xcp-1.6-updates/xen-4.1.hg
changeset 23206:14dbd6be46c8
ipxe: fix compilation issues with some gcc versions
Backported some changes from current ipxe, to fix a issue with some
new versions of gcc that add -fPIC by default, and compilation fails
with the following error:
arch/i386/core/cpu.c: In function 'get_cpuinfo':
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
Two patches from ipxe git have been added. The problem is reproducible
with at least this version of gcc:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-uclibc/4.6.2/lto-wrapper
Target: x86_64-alpine-linux-uclibc
Configured with:
/home/buildozer/aports/main/gcc/src/gcc-4.6.2/configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--build=x86_64-alpine-linux-uclibc --host=x86_64-alpine-linux-uclibc
--target=x86_64-alpine-linux-uclibc --with-pkgversion='Alpine
4.6.2-r1' --disable-altivec --disable-checking --disable-fixed-point
--disable-libssp --disable-libstdcxx-pch --disable-multilib
--disable-nls --disable-werror --enable-__cxa_atexit --enable-cld
--enable-esp --enable-cloog-backend
--enable-languages=c,c++,objc,java,go --enable-shared
--enable-target-optspace --enable-tls --enable-threads
--with-dynamic-linker=ld64-uClibc.so.0.9.32
--with-dynamic-linker-prefix=/lib --with-system-zlib
--without-system-libunwind
Thread model: posix
gcc version 4.6.2 (Alpine 4.6.2-r1)
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Keir Fraser <keir@xen.org>
Backported some changes from current ipxe, to fix a issue with some
new versions of gcc that add -fPIC by default, and compilation fails
with the following error:
arch/i386/core/cpu.c: In function 'get_cpuinfo':
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
Two patches from ipxe git have been added. The problem is reproducible
with at least this version of gcc:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-uclibc/4.6.2/lto-wrapper
Target: x86_64-alpine-linux-uclibc
Configured with:
/home/buildozer/aports/main/gcc/src/gcc-4.6.2/configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--build=x86_64-alpine-linux-uclibc --host=x86_64-alpine-linux-uclibc
--target=x86_64-alpine-linux-uclibc --with-pkgversion='Alpine
4.6.2-r1' --disable-altivec --disable-checking --disable-fixed-point
--disable-libssp --disable-libstdcxx-pch --disable-multilib
--disable-nls --disable-werror --enable-__cxa_atexit --enable-cld
--enable-esp --enable-cloog-backend
--enable-languages=c,c++,objc,java,go --enable-shared
--enable-target-optspace --enable-tls --enable-threads
--with-dynamic-linker=ld64-uClibc.so.0.9.32
--with-dynamic-linker-prefix=/lib --with-system-zlib
--without-system-libunwind
Thread model: posix
gcc version 4.6.2 (Alpine 4.6.2-r1)
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Keir Fraser <keir@xen.org>
author | Roger Pau Monne <roger.pau@entel.upc.edu> |
---|---|
date | Sun Dec 18 14:52:52 2011 +0000 (2011-12-18) |
parents | e2af3c4e4c1d |
children | 95a0e0b47e95 |
files | tools/firmware/etherboot/patches/gpxe-git-b8924c1aed51 tools/firmware/etherboot/patches/gpxe-git-fe61f6de0dd5 tools/firmware/etherboot/patches/series |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/tools/firmware/etherboot/patches/gpxe-git-b8924c1aed51 Sun Dec 18 14:52:52 2011 +0000 1.3 @@ -0,0 +1,72 @@ 1.4 +commit b8924c1aed512aa40cf28a43635df383880f771d 1.5 +Author: Michael Brown <mcb30@ipxe.org> 1.6 +Date: Wed Mar 16 19:30:42 2011 +0000 1.7 + 1.8 + [build] Allow workaround-specific flags to override default flags 1.9 + 1.10 + Signed-off-by: Michael Brown <mcb30@ipxe.org> 1.11 + 1.12 +diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping 1.13 +index 709f8de..78e78c9 100644 1.14 +--- a/src/Makefile.housekeeping 1.15 ++++ b/src/Makefile.housekeeping 1.16 +@@ -109,6 +109,10 @@ VERYCLEANUP += .toolcheck 1.17 + # Check for various tool workarounds 1.18 + # 1.19 + 1.20 ++WORKAROUND_CFLAGS := 1.21 ++WORKAROUND_ASFLAGS := 1.22 ++WORKAROUND_LDFLAGS := 1.23 ++ 1.24 + # Make syntax does not allow use of comma or space in certain places. 1.25 + # This ugly workaround is suggested in the manual. 1.26 + # 1.27 +@@ -119,7 +123,7 @@ SPACE := $(EMPTY) $(EMPTY) 1.28 + # Check for an old version of gas (binutils 2.9.1) 1.29 + # 1.30 + OLDGAS := $(shell $(AS) --version | grep -q '2\.9\.1' && $(ECHO) -DGAS291) 1.31 +-CFLAGS += $(OLDGAS) 1.32 ++WORKAROUND_CFLAGS += $(OLDGAS) 1.33 + oldgas : 1.34 + @$(ECHO) $(oldgas) 1.35 + 1.36 +@@ -131,7 +135,7 @@ ifeq ($(CCTYPE),gcc) 1.37 + SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \ 1.38 + -o /dev/null >/dev/null 2>&1 1.39 + SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector') 1.40 +-CFLAGS += $(SP_FLAGS) 1.41 ++WORKAROUND_CFLAGS += $(SP_FLAGS) 1.42 + endif 1.43 + 1.44 + # gcc 4.4 generates .eh_frame sections by default, which distort the 1.45 +@@ -141,7 +145,7 @@ ifeq ($(CCTYPE),gcc) 1.46 + CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \ 1.47 + -o /dev/null >/dev/null 2>&1 1.48 + CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm') 1.49 +-CFLAGS += $(CFI_FLAGS) 1.50 ++WORKAROUND_CFLAGS += $(CFI_FLAGS) 1.51 + endif 1.52 + 1.53 + # Some versions of gas choke on division operators, treating them as 1.54 +@@ -150,7 +154,7 @@ endif 1.55 + # 1.56 + DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null 1.57 + DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide') 1.58 +-ASFLAGS += $(DIVIDE_FLAGS) 1.59 ++WORKAROUND_ASFLAGS += $(DIVIDE_FLAGS) 1.60 + 1.61 + ############################################################################### 1.62 + # 1.63 +@@ -375,9 +379,9 @@ CFLAGS += -diag-disable 1419 # Missing prototypes 1.64 + CFLAGS += -diag-disable 1599 # Hidden variables 1.65 + CFLAGS += -Wall -Wmissing-declarations 1.66 + endif 1.67 +-CFLAGS += $(EXTRA_CFLAGS) 1.68 +-ASFLAGS += $(EXTRA_ASFLAGS) 1.69 +-LDFLAGS += $(EXTRA_LDFLAGS) 1.70 ++CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS) 1.71 ++ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS) 1.72 ++LDFLAGS += $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS) 1.73 + 1.74 + # Inhibit -Werror if NO_WERROR is specified on make command line 1.75 + #
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/tools/firmware/etherboot/patches/gpxe-git-fe61f6de0dd5 Sun Dec 18 14:52:52 2011 +0000 2.3 @@ -0,0 +1,32 @@ 2.4 +commit fe61f6de0dd5d39ac3de5e8e18742f9bd0aafad7 2.5 +Author: Gilles Espinasse <g.esp@free.fr> 2.6 +Date: Tue Mar 29 15:30:11 2011 +0100 2.7 + 2.8 + [build] Fix compilation when gcc is patched to default to -fPIE -Wl,-pie 2.9 + 2.10 + Signed-off-by: Gilles Espinasse <g.esp@free.fr> 2.11 + Modified-by: Michael Brown <mcb30@ipxe.org> 2.12 + Signed-off-by: Michael Brown <mcb30@ipxe.org> 2.13 + 2.14 +diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping 2.15 +index 57e52c0..c184351 100644 2.16 +--- a/src/Makefile.housekeeping 2.17 ++++ b/src/Makefile.housekeeping 2.18 +@@ -138,6 +138,17 @@ SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector') 2.19 + WORKAROUND_CFLAGS += $(SP_FLAGS) 2.20 + endif 2.21 + 2.22 ++# Some widespread patched versions of gcc include -fPIE -Wl,-pie by 2.23 ++# default. Note that gcc will exit *successfully* if it fails to 2.24 ++# recognise an option that starts with "no", so we have to test for 2.25 ++# output on stderr instead of checking the exit status. 2.26 ++# 2.27 ++ifeq ($(CCTYPE),gcc) 2.28 ++PIE_TEST = [ -z "`$(CC) -fno-PIE -nopie -x c -c /dev/null -o /dev/null 2>&1`" ] 2.29 ++PIE_FLAGS := $(shell $(PIE_TEST) && $(ECHO) '-fno-PIE -nopie') 2.30 ++WORKAROUND_CFLAGS += $(PIE_FLAGS) 2.31 ++endif 2.32 ++ 2.33 + # gcc 4.4 generates .eh_frame sections by default, which distort the 2.34 + # output of "size". Inhibit this. 2.35 + #
3.1 --- a/tools/firmware/etherboot/patches/series Sun Dec 18 14:48:28 2011 +0000 3.2 +++ b/tools/firmware/etherboot/patches/series Sun Dec 18 14:52:52 2011 +0000 3.3 @@ -1,3 +1,5 @@ 3.4 boot_prompt_option.patch 3.5 gpxe-git-0edf2405b457 3.6 gpxe-git-a803ef3dfeac 3.7 +gpxe-git-b8924c1aed51 3.8 +gpxe-git-fe61f6de0dd5