* [RFC][PATCH] fix math cflags overrides
@ 2017-08-24 9:27 Szabolcs Nagy
2017-08-24 14:33 ` Joseph Myers
0 siblings, 1 reply; 2+ messages in thread
From: Szabolcs Nagy @ 2017-08-24 9:27 UTC (permalink / raw)
To: GNU C Library; +Cc: nd
[-- Attachment #1: Type: text/plain, Size: 764 bytes --]
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.
[-- Attachment #2: foo.diff --]
[-- Type: text/x-patch, Size: 543 bytes --]
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC][PATCH] fix math cflags overrides
2017-08-24 9:27 [RFC][PATCH] fix math cflags overrides Szabolcs Nagy
@ 2017-08-24 14:33 ` Joseph Myers
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2017-08-24 14:33 UTC (permalink / raw)
To: Szabolcs Nagy; +Cc: GNU C Library, nd
On Thu, 24 Aug 2017, Szabolcs Nagy wrote:
> 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.
This patch is OK on the general principle of using += in Makefiles when
overriding is not specifically intended.
For a target-specific file, the nofma flags could be worked around by just
having a dummy e_sqrt.c and the main implementation in a separate
e_sqrt_<arch>.c. Or make all the cases where contraction is appropriate
explicit (e.g. sysdeps/powerpc/fpu/e_sqrt.c makes explicit use of
__builtin_fma to fix bug 17964).
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-24 14:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24 9:27 [RFC][PATCH] fix math cflags overrides Szabolcs Nagy
2017-08-24 14:33 ` Joseph Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).