Rik van Riel
2006-Mar-02 21:36 UTC
[Xen-devel] [PATCH] fix x86_64 build with specified CFLAGS
When building Xen, RPM passes in a bunch of CFLAGS. Make sure to remove the -m64 from the CFLAGS before compiling vmxloader and hvmloader. Note that this is not a question of building from RPM, even when passing in empty CFLAGS this problem occurs. Signed-off-by: Rik van Riel <riel@redhat.com> --- xen-3.0.1/tools/firmware/vmxassist/Makefile.m64 2006-02-28 10:14:19.000000000 -0500 +++ xen-3.0.1/tools/firmware/vmxassist/Makefile 2006-03-02 10:49:53.000000000 -0500 @@ -27,6 +27,9 @@ DEFINES=-DDEBUG -DTEXTADDR=$(TEXTADDR) XENINC=-I$(XEN_ROOT)/tools/libxc +# vmxloader is a 32 bit program +CFLAGS=$(echo "$CFLAGS" | sed -e ''s/ -m64//g'') + # Disable PIE/SSP if GCC supports them. They can break us. CFLAGS += $(call test-gcc-flag,$(CC),-nopie) CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector) --- xen-3.0.1/tools/firmware/hvmloader/Makefile.m64 2006-03-02 10:52:21.000000000 -0500 +++ xen-3.0.1/tools/firmware/hvmloader/Makefile 2006-03-02 10:52:54.000000000 -0500 @@ -29,6 +29,9 @@ OBJECTS = hvmloader.o acpi_madt.o +# hvmloader is a 32 bit program +CFLAGS=$(echo "$CFLAGS" | sed -e ''s/ -m64//g'') + # Disable PIE/SSP if GCC supports them. They can break us. CFLAGS += $(call test-gcc-flag,$(CC),-nopie) CFLAGS += $(call test-gcc-flag,$(CC),-fno-stack-protector) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Mar-03 09:42 UTC
Re: [Xen-devel] [PATCH] fix x86_64 build with specified CFLAGS
On 2 Mar 2006, at 21:36, Rik van Riel wrote:> Note that this is not a question of building from RPM, even when > passing in empty CFLAGS this problem occurs.Where would the -m64 come from in that case? Not from Config.mk... -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Rik van Riel
2006-Mar-03 14:17 UTC
Re: [Xen-devel] [PATCH] fix x86_64 build with specified CFLAGS
On Fri, 3 Mar 2006, Keir Fraser wrote:> On 2 Mar 2006, at 21:36, Rik van Riel wrote: > > > Note that this is not a question of building from RPM, even when > > passing in empty CFLAGS this problem occurs. > > Where would the -m64 come from in that case? Not from Config.mk...tools/Rules.mk: ifeq ($(XEN_TARGET_ARCH),x86_64) CFLAGS += -m64 LDFLAGS += -m64 endif -- All Rights Reversed _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-Mar-03 14:27 UTC
Re: [Xen-devel] [PATCH] fix x86_64 build with specified CFLAGS
On 3 Mar 2006, at 14:17, Rik van Riel wrote:>> Where would the -m64 come from in that case? Not from Config.mk... > > tools/Rules.mk: > > ifeq ($(XEN_TARGET_ARCH),x86_64) > CFLAGS += -m64 > LDFLAGS += -m64 > endifThose directories don''t include tools/Rules.mk, instead they include the root Config.mk file directly. Anyway, I made a different fix for you, which is to completely ignore externally-supplied CFLAGS when building in those directories (the assumption being that the build target is special and the local Makefile knows best). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel