git: cf97d2a1dab8 - main - Build lib/msun tests with compiler builtins disabled
Mateusz Guzik
mjguzik at gmail.com
Mon Mar 1 07:34:54 UTC 2021
This breaks riscv:
ld: error: undefined symbol: fabs
>>> referenced by t_acos.c:93 (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:93) >>> t_acos.o:(atfu_acos_is_plus_zero_body)
>>> referenced by t_acos.c:94 (/usr/src/contrib/netbsd-tests/lib/libm/t_acos.c:94) >>> t_acos.o:(atfu_acos_is_plus_zero_body)
>>> did you mean: cabs >>> defined in: /usr/obj/usr/src/riscv.riscv64sf/tmp/usr/lib/libm.so
On 2/23/21, Dimitry Andric <dim at freebsd.org> wrote:
> The branch main has been updated by dim:
>
> URL:
> https://cgit.FreeBSD.org/src/commit/?id=cf97d2a1dab8f2cddc4466fe64d37818339c73be
>
> commit cf97d2a1dab8f2cddc4466fe64d37818339c73be
> Author: Dimitry Andric <dim at FreeBSD.org>
> AuthorDate: 2021-02-23 20:03:32 +0000
> Commit: Dimitry Andric <dim at FreeBSD.org>
> CommitDate: 2021-02-23 20:10:01 +0000
>
> Build lib/msun tests with compiler builtins disabled
>
> This forces the compiler to emit calls to libm functions, instead of
> possibly substituting pre-calculated results at compile time, which
> should help to actually test those functions.
>
> Reviewed by: emaste, arichardson, ngie
> Differential Revision: https://reviews.freebsd.org/D28577
> MFC after: 3 days
> ---
> lib/msun/tests/Makefile | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/lib/msun/tests/Makefile b/lib/msun/tests/Makefile
> index d58333271e9b..85a558bb0733 100644
> --- a/lib/msun/tests/Makefile
> +++ b/lib/msun/tests/Makefile
> @@ -19,6 +19,10 @@ CFLAGS+= -I${TESTSRC:H}/libc/gen
> CFLAGS+= -D__HAVE_LONG_DOUBLE
> .endif
>
> +# Avoid builtins, to force the compiler to emit calls to the libm
> +# functions, and not calculate any results in advance.
> +CFLAGS+= -fno-builtin
> +
> NETBSD_ATF_TESTS_C= acos_test
> NETBSD_ATF_TESTS_C+= asin_test
> NETBSD_ATF_TESTS_C+= atan_test
>
--
Mateusz Guzik <mjguzik gmail.com>
More information about the dev-commits-src-all
mailing list