diff --git a/lib/libc/tests/gen/Makefile b/lib/libc/tests/gen/Makefile index 74a245779d1b..2096f2066e52 100644 --- a/lib/libc/tests/gen/Makefile +++ b/lib/libc/tests/gen/Makefile @@ -35,11 +35,12 @@ posix_spawn_test_FILESPACKAGE= ${PACKAGE} CFLAGS+= -DTEST_LONG_DOUBLE -# Not sure why this isn't defined for all architectures, since most -# have long double. +# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater +# precision than their double. .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" + ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif diff --git a/lib/libc/tests/stdlib/Makefile b/lib/libc/tests/stdlib/Makefile index f305ca579e11..da152159f8a8 100644 --- a/lib/libc/tests/stdlib/Makefile +++ b/lib/libc/tests/stdlib/Makefile @@ -19,11 +19,12 @@ ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test # All architectures on FreeBSD have fenv.h CFLAGS+= -D__HAVE_FENV -# Not sure why this isn't defined for all architectures, since most -# have long double. +# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater +# precision than their double. .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" + ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile index 6c8cee976173..d1c8ba34398c 100644 --- a/lib/msun/tests/Makefile +++ b/lib/msun/tests/Makefile @@ -10,11 +10,12 @@ CFLAGS+= -DHAVE_FENV_H # For isqemu.h CFLAGS+= -I${TESTSRC:H}/libc/gen -# Not sure why this isn't defined for all architectures, since most -# have long double. +# Define __HAVE_LONG_DOUBLE for architectures whose long double has greater +# precision than their double. .if ${MACHINE_CPUARCH} == "aarch64" || \ ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" + ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "riscv" CFLAGS+= -D__HAVE_LONG_DOUBLE .endif