]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Generate gcc-macros.h
authorFlorian Weimer <fweimer@redhat.com>
Fri, 14 Jan 2022 15:09:20 +0000 (16:09 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 14 Jan 2022 15:09:20 +0000 (16:09 +0100)
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>
Makeconfig

index 9b6fc6b08f9d2cab9fc9df09e1cc5a2b6c91aae2..2e7907734379174eaf163d04f88da93807130dd0 100644 (file)
@@ -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)