about summary refs log tree commit diff
path: root/Makeconfig
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-01-14 16:09:20 +0100
committerFlorian Weimer <fweimer@redhat.com>2022-01-14 16:09:20 +0100
commitef7c6d42fe163a5e49a478c43e655ce4633fa5ba (patch)
tree6b81ceacb154c6386d4f4d4bb04490fb89ad3e8f /Makeconfig
parent5732a881aad24fac876f5505a212395048a7a483 (diff)
downloadglibc-ef7c6d42fe163a5e49a478c43e655ce4633fa5ba.tar.gz
glibc-ef7c6d42fe163a5e49a478c43e655ce4633fa5ba.tar.xz
glibc-ef7c6d42fe163a5e49a478c43e655ce4633fa5ba.zip
Generate gcc-macros.h
The file can be used to check the effect of the default compiler
flags on code generation even in areas of the build that uses
non-default compiler flags.

Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig9
1 files changed, 9 insertions, 0 deletions
diff --git a/Makeconfig b/Makeconfig
index 9b6fc6b08f..2e79077343 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1202,6 +1202,15 @@ $(common-objpfx)dl-tunable-list.stmp: \
 	touch $@
 endif
 
+# Dump the GCC macros used by the default compiler flags to a header
+# file, so that they can be inspected when using different compiler
+# flags.  Add the GCCMACRO prefix to make these macro names unique.
+$(common-objpfx)gcc-macros.h.in: $(common-objpfx)config.status
+	$(CC) $(CFLAGS) $(CPPFLAGS) -E -dM -x c -o $@ /dev/null
+$(common-objpfx)gcc-macros.h: $(common-objpfx)gcc-macros.h.in
+	sed 's/^#define /#define GCCMACRO/' < $< > $@
+before-compile += $(common-objpfx)gcc-macros.h
+
 # Generate version maps, but wait until sysdep-subdirs is known
 ifeq ($(sysd-sorted-done),t)
 ifeq ($(build-shared),yes)