Skip to content

Commit

Permalink
Add a Makefile.float to centralize soft vs hard float logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdjhb committed Jan 20, 2019
1 parent ed5dcc4 commit eb836f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
6 changes: 2 additions & 4 deletions lib/libc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,8 @@ NOASM=
.include "${LIBC_SRCTOP}/rpc/Makefile.inc"
.include "${LIBC_SRCTOP}/uuid/Makefile.inc"
.include "${LIBC_SRCTOP}/xdr/Makefile.inc"
.if (${LIBC_ARCH} == "arm" && \
(${MACHINE_ARCH:Marmv[67]*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
(${LIBC_ARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \
(${LIBC_ARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != "")
.include "${LIBC_SRCTOP}/Makefile.float"
.if ${SOFTFLOAT} == "yes"
.include "${LIBC_SRCTOP}/softfloat/Makefile.inc"
.endif
.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64"
Expand Down
16 changes: 16 additions & 0 deletions lib/libc/Makefile.float
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# $FreeBSD$

# Architectures which use soft-float:
# - armv4/5
# - armv6/7 with "soft" in CPUTYPE.
# - mips without "hf" in MACHINE_ARCH.
# - riscv without "sf" in MACHINE_ARCH.
.if ((${MACHINE_CPUARCH} == "arm" && \
(${MACHINE_ARCH:Marmv[67]*} == "" || \
(defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
(${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \
(${MACHINE_CPUARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != ""))
SOFTFLOAT=yes
.else
SOFTFLOAT=no
.endif
6 changes: 2 additions & 4 deletions lib/libcompiler_rt/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ SRCF+= trunctfsf2

# These are provided via the softfloat support in libc.a on some
# architectures.
.if !((${MACHINE_CPUARCH} == "arm" && \
(${MACHINE_ARCH:Marmv[67]*} == "" || (defined(CPUTYPE) && ${CPUTYPE:M*soft*}))) || \
(${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips*hf} == "") || \
(${MACHINE_CPUARCH} == "riscv" && ${MACHINE_ARCH:Mriscv*sf} != ""))
.include "${SRCTOP}/lib/libc/Makefile.float"
.if ${SOFTFLOAT} == "no"
SRCF+= adddf3
SRCF+= addsf3
SRCF+= divdf3
Expand Down

0 comments on commit eb836f7

Please sign in to comment.