This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC][PATCH] fix math cflags overrides
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Cc: nd at arm dot com
- Date: Thu, 24 Aug 2017 10:27:16 +0100
- Subject: [RFC][PATCH] fix math cflags overrides
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- Nodisclaimer: True
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
The problem i see is that in the makefile logic the sysdirs var has
sysdeps/aarch64/fpu before sysdeps/ieee754/dbl-64.
this means source files and rules in the former override files in
the later (which is good), but it also means variable definitions
in makefile fragments of the later overrides the ones of the former
(i.e. reverse order wrt the source override, which is not what i'd
expect).
as a workaround i'd just use += instead of = in the dbl-64 makefile
cflags definitions so at least it does not drop earlier cflags,
the cflag definition ordering is not ideal: if i have a target
specific sqrt, i don't want to compile it with nofma flags.
2017-08-23 Szabolcs Nagy <szabolcs.nagy@arm.com>
* sysdeps/ieee754/dbl-64/Makefile: Don't override cflags.
diff --git a/sysdeps/ieee754/dbl-64/Makefile b/sysdeps/ieee754/dbl-64/Makefile
index 5557c75b45..c965982fa5 100644
--- a/sysdeps/ieee754/dbl-64/Makefile
+++ b/sysdeps/ieee754/dbl-64/Makefile
@@ -1,6 +1,6 @@
ifeq ($(subdir),math)
# branred depends on precise IEEE double rounding
-CFLAGS-branred.c = $(config-cflags-nofma)
-CFLAGS-e_sqrt.c = $(config-cflags-nofma)
-CFLAGS-e_pow.c = $(config-cflags-nofma)
+CFLAGS-branred.c += $(config-cflags-nofma)
+CFLAGS-e_sqrt.c += $(config-cflags-nofma)
+CFLAGS-e_pow.c += $(config-cflags-nofma)
endif