Skip to contentSkip to conversation

compile with -funit-at-a-time option of gcc

PATCH In review aq 2 participants 2 messages Jun 30, 2005

lore
Share & tools
lore

aq

author
#0 lore raw

PATCH 1/1 compile with -funit-at-a-time option of gcc

This patch makes xen compiled with gcc option -funit-at-a-time if supported. This option is available for gcc 3.4 and upward, which reduces the .text binary size considerably.

$ diffstat configmk.patch 
 Config.mk |    6 ++++++
 1 files changed, 6 insertions(+)

===== Config.mk 1.6 vs edited =====

Config.mk +6 -0
@@ -29,8 +29,14 @@
 EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBDIR)
 endif
 
+cc-option := $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+             > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
+
+check_gcc := $(call cc-option, $(1),$(2))
+
 LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) 
 CFLAGS += $(foreach i, $(EXTRA_INCLUDES), -I$(i))
+CFLAGS += $(call check_gcc,-funit-at-a-time,)
 
 # Choose the best mirror to download linux kernel
 KERNEL_REPO = http://www.kernel.org

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 3 lines · aq

This patch makes xen compiled with gcc option -funit-at-a-time if supported. This option is available for gcc 3.4 and upward, which reduces the .text binary size considerably.

This option is the default for -O2 and above in gcc4 anyway. It might explain why I end up with a buggy Xen when I build with gcc4 (Linux has had a number of problems with -funit-at-a-time, because odf extra stack usage and code reordering).

-- Keir