diff options
author | Michael Brown <mcb30@etherboot.org> | 2009-05-27 02:21:45 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2009-05-27 02:30:46 +0100 |
commit | 8afafb65322a3fec01206720a1d8be4083e9c0d6 (patch) | |
tree | 8eacb27e8d4e9aa5a46fd2638fcabea9f5ddfb2d /src/Makefile.housekeeping | |
parent | e47869995f67bd2547bf416e53c480ca51235ed8 (diff) | |
download | ipxe-8afafb65322a3fec01206720a1d8be4083e9c0d6.zip ipxe-8afafb65322a3fec01206720a1d8be4083e9c0d6.tar.gz ipxe-8afafb65322a3fec01206720a1d8be4083e9c0d6.tar.bz2 |
[build] Add -fno-dwarf2-cfi-asm to CFLAGS if supported by the gcc in use
gcc 4.4 defaults to using .cfi assembler directives for debugging
information, which causes unneeded .eh_frame sections to be generated.
These sections are already stripped out by our linker script, so don't
affect the final build, but do distort the output of "size" when run
on individual .o files; the .eh_frame size is included within the size
reported for .text. This makes it difficult to accurately judge the
effects of source code changes upon object code size.
Fix by adding -fno-dwarf2-cfi-asm to CFLAGS if we detect that this
option is supported by the gcc that we are compiling with.
Tested-by: Daniel Verkamp <daniel@drv.nu>
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r-- | src/Makefile.housekeeping | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index e886c4b..cf7a9c7 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -134,6 +134,16 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector') CFLAGS += $(SP_FLAGS) endif +# gcc 4.4 generates .eh_frame sections by default, which distort the +# output of "size". Inhibit this. +# +ifeq ($(CCTYPE),gcc) +CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \ + -o /dev/null >/dev/null 2>&1 +CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm') +CFLAGS += $(CFI_FLAGS) +endif + # Some versions of gas choke on division operators, treating them as # comment markers. Specifying --divide will work around this problem, # but isn't available on older gas versions. |