[Qemu-devel] qemu Makefile configure
CVSROOT:/sources/qemu Module name:qemu Changes by: Thiemo Seufer 07/12/09 05:10:03 Modified files: . : Makefile configure Log message: SH4 big endian configuration, by Tomoyoshi Asano. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/Makefile?cvsroot=qemu&r1=1.136&r2=1.137 http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.176&r2=1.177
[Qemu-devel] qemu Makefile configure
CVSROOT:/sources/qemu Module name:qemu Changes by: Paul Brook 07/09/22 16:49:15 Modified files: . : Makefile configure Log message: Only build qemu-img with softmmu targets. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/Makefile?cvsroot=qemu&r1=1.122&r2=1.123 http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.155&r2=1.156
Re: [Qemu-devel] qemu Makefile configure
On 3 janv. 07, at 15:23, Bernhard Fischer wrote: On Wed, Jan 03, 2007 at 01:59:50PM +, Thiemo Seufer wrote: ifeq ($(ARCH),ppc) -> CFLAGS+= -D__powerpc__ + CPPFLAGS += -D__powerpc__ (doesn't cpp already define that on ppc?) That's for the Darwin/Mac OS X PowerPC platforms where __powerpc__ is not defined by gcc. Pierre ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Thiemo Seufer wrote: > Thiemo Seufer wrote: > > Fabrice Bellard wrote: > > > IMHO, CFLAGS and LDFLAGS overriding should not be allowed for QEMU as it > > > is almost sure to break the dyngen stuff. If ever it is allowed, it > > > should be done so that the CFLAGS for the files used by dyngen are not > > > modified. > > > > That's why I made OP_CFLAGS a separate set of flags. > > > > I append the next version of the patch, which incorporates the > > suggestions made by Daniel and Bernhard, and fixes a gcc3 detection > > bug I introduced earlier. > > Next iteration, this uses BASE_CFLAGS and BASE_LDFLAGS instead of > gmake's override feature. Comitted, since it held up well for several people. Thiemo ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Thiemo Seufer wrote: > Fabrice Bellard wrote: > > IMHO, CFLAGS and LDFLAGS overriding should not be allowed for QEMU as it > > is almost sure to break the dyngen stuff. If ever it is allowed, it > > should be done so that the CFLAGS for the files used by dyngen are not > > modified. > > That's why I made OP_CFLAGS a separate set of flags. > > I append the next version of the patch, which incorporates the > suggestions made by Daniel and Bernhard, and fixes a gcc3 detection > bug I introduced earlier. Next iteration, this uses BASE_CFLAGS and BASE_LDFLAGS instead of gmake's override feature. Thiemo Index: Makefile === RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.107 diff -u -p -r1.107 Makefile --- Makefile1 Jan 2007 21:31:01 - 1.107 +++ Makefile4 Jan 2007 11:47:40 - @@ -5,19 +5,18 @@ include config-host.mak .PHONY: all clean distclean dvi info install install-doc tar tarbin \ speed test test2 html dvi info -CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I. -ifdef CONFIG_DARWIN -CFLAGS+= -mdynamic-no-pic -endif +BASE_CFLAGS= +BASE_LDFLAGS= + +BASE_CFLAGS += $(OS_CFLAGS) ifeq ($(ARCH),sparc) -CFLAGS+=-mcpu=ultrasparc +BASE_CFLAGS += -mcpu=ultrasparc endif -LDFLAGS+=-g +CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS= -DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE TOOLS=qemu-img$(EXESUF) ifdef CONFIG_STATIC -LDFLAGS+=-static +BASE_LDFLAGS += -static endif ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 @@ -41,10 +40,10 @@ subdir-%: dyngen$(EXESUF) recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS) dyngen$(EXESUF): dyngen.c - $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ + $(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^ clean: # avoid old build problems by removing potentially incorrect old files Index: Makefile.target === RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.134 diff -u -p -r1.134 Makefile.target --- Makefile.target 7 Dec 2006 18:15:35 - 1.134 +++ Makefile.target 4 Jan 2007 11:47:40 - @@ -12,14 +12,14 @@ TARGET_BASE_ARCH:=sparc endif TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio -DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) +CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) ifdef CONFIG_USER_ONLY VPATH+=:$(SRC_PATH)/linux-user -DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) +CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing +BASE_CFLAGS= +BASE_LDFLAGS= #CFLAGS+=-Werror -LDFLAGS=-g LIBS= HELPER_CFLAGS=$(CFLAGS) DYNGEN=../dyngen$(EXESUF) @@ -62,18 +62,20 @@ endif endif # !CONFIG_USER_ONLY ifdef CONFIG_STATIC -LDFLAGS+=-static +BASE_LDFLAGS+=-static endif +# We require -O2 to avoid the stack setup prologue in EXIT_TB +OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing + ifeq ($(ARCH),i386) -HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer -OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +HELPER_CFLAGS+=-fomit-frame-pointer +OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer ifeq ($(HAVE_GCC3_OPTIONS),yes) OP_CFLAGS+= -falign-functions=0 -fno-gcse else OP_CFLAGS+= -malign-functions=0 endif - ifdef TARGET_GPROF USE_I386_LD=y endif @@ -81,76 +83,76 @@ ifdef CONFIG_STATIC USE_I386_LD=y endif ifdef USE_I386_LD -LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld +BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld else # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this # is the simplest way to make it self virtualizable! -LDFLAGS+=-Wl,-shared +BASE_LDFLAGS+=-Wl,-shared endif endif ifeq ($(ARCH),x86_64) -OP_CFLAGS=$(CFLAGS) -falign-functions=0 -LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld +BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),ppc) -CFLAGS+= -D__powerpc__ -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld +CPPFLAGS+= -D__powerpc__ +BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),s390) -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld +BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),sparc) ifeq ($(CONFIG_SOLARIS),yes) -CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 -LDFLAGS+=-m32 -OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -fno-omit-frame-pointer
Re: [Qemu-devel] qemu Makefile configure
On Wed, Jan 03, 2007 at 04:16:53PM +, Thiemo Seufer wrote: >Fabrice Bellard wrote: >> IMHO, CFLAGS and LDFLAGS overriding should not be allowed for QEMU as it >> is almost sure to break the dyngen stuff. If ever it is allowed, it >> should be done so that the CFLAGS for the files used by dyngen are not >> modified. > >That's why I made OP_CFLAGS a separate set of flags. > >I append the next version of the patch, which incorporates the >suggestions made by Daniel and Bernhard, and fixes a gcc3 detection >bug I introduced earlier. Is the override directive a common extension? http://www.opengroup.org/onlinepubs/009695399/utilities/make.html I'd avoid override if possible and use a different variable instead (CC_CFLAGS, or the like) to be passed to the .c.o rules ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Fabrice Bellard wrote: > IMHO, CFLAGS and LDFLAGS overriding should not be allowed for QEMU as it > is almost sure to break the dyngen stuff. If ever it is allowed, it > should be done so that the CFLAGS for the files used by dyngen are not > modified. That's why I made OP_CFLAGS a separate set of flags. I append the next version of the patch, which incorporates the suggestions made by Daniel and Bernhard, and fixes a gcc3 detection bug I introduced earlier. Thiemo Index: Makefile === RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.107 diff -u -p -r1.107 Makefile --- Makefile1 Jan 2007 21:31:01 - 1.107 +++ Makefile3 Jan 2007 16:10:06 - @@ -5,19 +5,15 @@ include config-host.mak .PHONY: all clean distclean dvi info install install-doc tar tarbin \ speed test test2 html dvi info -CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I. -ifdef CONFIG_DARWIN -CFLAGS+= -mdynamic-no-pic -endif +override CFLAGS += $(OS_CFLAGS) ifeq ($(ARCH),sparc) -CFLAGS+=-mcpu=ultrasparc +override CFLAGS += -mcpu=ultrasparc endif -LDFLAGS+=-g +CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS= -DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE TOOLS=qemu-img$(EXESUF) ifdef CONFIG_STATIC -LDFLAGS+=-static +override LDFLAGS += -static endif ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 @@ -41,10 +37,10 @@ subdir-%: dyngen$(EXESUF) recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lz $(LIBS) dyngen$(EXESUF): dyngen.c - $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ + $(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ clean: # avoid old build problems by removing potentially incorrect old files Index: Makefile.target === RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.134 diff -u -p -r1.134 Makefile.target --- Makefile.target 7 Dec 2006 18:15:35 - 1.134 +++ Makefile.target 3 Jan 2007 16:10:07 - @@ -12,14 +12,12 @@ TARGET_BASE_ARCH:=sparc endif TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio -DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) +CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) ifdef CONFIG_USER_ONLY VPATH+=:$(SRC_PATH)/linux-user -DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) +CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing #CFLAGS+=-Werror -LDFLAGS=-g LIBS= HELPER_CFLAGS=$(CFLAGS) DYNGEN=../dyngen$(EXESUF) @@ -62,18 +60,20 @@ endif endif # !CONFIG_USER_ONLY ifdef CONFIG_STATIC -LDFLAGS+=-static +override LDFLAGS+=-static endif +# We require -O2 to avoid the stack setup prologue in EXIT_TB +OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing + ifeq ($(ARCH),i386) -HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer -OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +HELPER_CFLAGS+=-fomit-frame-pointer +override OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer ifeq ($(HAVE_GCC3_OPTIONS),yes) -OP_CFLAGS+= -falign-functions=0 -fno-gcse +override OP_CFLAGS+= -falign-functions=0 -fno-gcse else -OP_CFLAGS+= -malign-functions=0 +override OP_CFLAGS+= -malign-functions=0 endif - ifdef TARGET_GPROF USE_I386_LD=y endif @@ -81,91 +81,92 @@ ifdef CONFIG_STATIC USE_I386_LD=y endif ifdef USE_I386_LD -LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld +override LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld else # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this # is the simplest way to make it self virtualizable! -LDFLAGS+=-Wl,-shared +override LDFLAGS+=-Wl,-shared endif endif ifeq ($(ARCH),x86_64) -OP_CFLAGS=$(CFLAGS) -falign-functions=0 -LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld +override LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),ppc) -CFLAGS+= -D__powerpc__ -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld +CPPFLAGS+= -D__powerpc__ +override LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),s390) -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld +override LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),sparc) ifeq ($(CONFIG_SOLARIS),yes) -CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 -LDFLAGS+=-m32 -OP_CFLAGS=$(CFLAGS) -fno-delayed-branch -fno-omit-frame-pointer -ffixed-i0 +override CFLAGS+=-mcpu=ultrasparc -m32 -ffixed-g2 -ffixed-g3 +override LDFLAGS+=-m32 +over
Re: [Qemu-devel] qemu Makefile configure
IMHO, CFLAGS and LDFLAGS overriding should not be allowed for QEMU as it is almost sure to break the dyngen stuff. If ever it is allowed, it should be done so that the CFLAGS for the files used by dyngen are not modified. Fabrice. Thiemo Seufer wrote: Thiemo Seufer wrote: CVSROOT:/sources/qemu Module name:qemu Changes by: Thiemo Seufer07/01/01 21:31:01 Modified files: . : Makefile configure Log message: Fix Makefile weirdness. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/Makefile?cvsroot=qemu&r1=1.106&r2=1.107 http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.114&r2=1.115 As mentioned on IRC, this patch makes configure's --extra-cflags and --extra-ldflags functional, but at the same time it breaks overriding CFLAGS/LDFLAGS at make time. The appended patch is an attempt to allow both, and to untangle the various flags settings. It collects and records the overridable defaults at configure time, adds OS_CFLAGS for mandatory OS specific flags, prefers the more standard CPPFLAGS over other preprocessor flag names, and OP_CFLAGS a separate set of flags which has also an overridable portion. All of this works fine for me, but patches of this sort are likely to break things, so please test and comment. Thiemo Index: Makefile === RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.107 diff -u -p -r1.107 Makefile --- Makefile1 Jan 2007 21:31:01 - 1.107 +++ Makefile3 Jan 2007 13:47:50 - @@ -5,19 +5,15 @@ include config-host.mak .PHONY: all clean distclean dvi info install install-doc tar tarbin \ speed test test2 html dvi info -CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I. -ifdef CONFIG_DARWIN -CFLAGS+= -mdynamic-no-pic -endif +CFLAGS += $(OS_CFLAGS) ifeq ($(ARCH),sparc) -CFLAGS+=-mcpu=ultrasparc +CFLAGS += -mcpu=ultrasparc endif -LDFLAGS+=-g +CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS= -DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE TOOLS=qemu-img$(EXESUF) ifdef CONFIG_STATIC -LDFLAGS+=-static +LDFLAGS += -static endif ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 @@ -41,10 +37,10 @@ subdir-%: dyngen$(EXESUF) recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lz $(LIBS) dyngen$(EXESUF): dyngen.c - $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ + $(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ clean: # avoid old build problems by removing potentially incorrect old files Index: Makefile.target === RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.134 diff -u -p -r1.134 Makefile.target --- Makefile.target 7 Dec 2006 18:15:35 - 1.134 +++ Makefile.target 3 Jan 2007 13:47:50 - @@ -12,14 +12,12 @@ TARGET_BASE_ARCH:=sparc endif TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio -DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) +CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) ifdef CONFIG_USER_ONLY VPATH+=:$(SRC_PATH)/linux-user -DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) +CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing #CFLAGS+=-Werror -LDFLAGS=-g LIBS= HELPER_CFLAGS=$(CFLAGS) DYNGEN=../dyngen$(EXESUF) @@ -65,15 +63,17 @@ ifdef CONFIG_STATIC LDFLAGS+=-static endif +# We require -O2 to avoid the stack setup prologue in EXIT_TB +OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing + ifeq ($(ARCH),i386) -HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer -OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +HELPER_CFLAGS+=-fomit-frame-pointer +OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer ifeq ($(HAVE_GCC3_OPTIONS),yes) OP_CFLAGS+= -falign-functions=0 -fno-gcse else OP_CFLAGS+= -malign-functions=0 endif - ifdef TARGET_GPROF USE_I386_LD=y endif @@ -81,7 +81,7 @@ ifdef CONFIG_STATIC USE_I386_LD=y endif ifdef USE_I386_LD -LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld else # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this @@ -91,66 +91,66 @@ endif endif ifeq ($(ARCH),x86_64) -OP_CFLAGS=$(CFLAGS) -falign-functions=0 -LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),ppc) CFLAGS+= -D__powerpc__ -OP_CFLAGS=$(CFLAGS) -
Re: [Qemu-devel] qemu Makefile configure
Daniel Jacobowitz wrote: > On Wed, Jan 03, 2007 at 02:42:20PM +, Thiemo Seufer wrote: > > +CFLAGS += $(OS_CFLAGS) > > Did you try this on any target that triggers one of the += cases? > > It's not the most intuitive thing in the world, but I believe make > ignores Makefile += operators if the variable was overridden on the > command line (i.e. the override effectively happens after the +=). You are right. > You'd need to leave CFLAGS for the overrideable bits unless you > wanted to override all the += deliberately. I think I have to use "override CFLAGS += -ffoo". Thiemo ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Bernhard Fischer wrote: > On Wed, Jan 03, 2007 at 01:59:50PM +, Thiemo Seufer wrote: > > >All of this works fine for me, but patches of this sort are likely to > >break things, so please test and comment. > > > > > >Thiemo > > > > >Index: Makefile.target > >=== > >RCS file: /sources/qemu/qemu/Makefile.target,v > >retrieving revision 1.134 > >diff -u -p -r1.134 Makefile.target > >--- Makefile.target 7 Dec 2006 18:15:35 - 1.134 > >+++ Makefile.target 3 Jan 2007 13:47:50 - > >@@ -91,66 +91,66 @@ endif > > endif > > > > ifeq ($(ARCH),x86_64) > >-OP_CFLAGS=$(CFLAGS) -falign-functions=0 > >-LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld > >+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld > > endif > > > > ifeq ($(ARCH),ppc) > -> CFLAGS+= -D__powerpc__ > + CPPFLAGS += -D__powerpc__ > > (doesn't cpp already define that on ppc?) Apparently it's sometimes __ppc__. Thiemo ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
On Wed, Jan 03, 2007 at 02:42:20PM +, Thiemo Seufer wrote: > +CFLAGS += $(OS_CFLAGS) Did you try this on any target that triggers one of the += cases? It's not the most intuitive thing in the world, but I believe make ignores Makefile += operators if the variable was overridden on the command line (i.e. the override effectively happens after the +=). You'd need to leave CFLAGS for the overrideable bits unless you wanted to override all the += deliberately. -- Daniel Jacobowitz CodeSourcery ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Thiemo Seufer wrote: > Thiemo Seufer wrote: > > CVSROOT:/sources/qemu > > Module name:qemu > > Changes by: Thiemo Seufer 07/01/01 21:31:01 > > > > Modified files: > > . : Makefile configure > > > > Log message: > > Fix Makefile weirdness. > > > > CVSWeb URLs: > > http://cvs.savannah.gnu.org/viewcvs/qemu/Makefile?cvsroot=qemu&r1=1.106&r2=1.107 > > http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.114&r2=1.115 > > As mentioned on IRC, this patch makes configure's --extra-cflags and > --extra-ldflags functional, but at the same time it breaks overriding > CFLAGS/LDFLAGS at make time. > > The appended patch is an attempt to allow both, and to untangle the > various flags settings. It collects and records the overridable defaults > at configure time, adds OS_CFLAGS for mandatory OS specific flags, > prefers the more standard CPPFLAGS over other preprocessor flag names, > and OP_CFLAGS a separate set of flags which has also an overridable > portion. > > All of this works fine for me, but patches of this sort are likely to > break things, so please test and comment. With that prelude I just had to introduce an obvious bug. :-) Next try. Thiemo Index: Makefile === RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.107 diff -u -p -r1.107 Makefile --- Makefile1 Jan 2007 21:31:01 - 1.107 +++ Makefile3 Jan 2007 14:40:11 - @@ -5,19 +5,15 @@ include config-host.mak .PHONY: all clean distclean dvi info install install-doc tar tarbin \ speed test test2 html dvi info -CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I. -ifdef CONFIG_DARWIN -CFLAGS+= -mdynamic-no-pic -endif +CFLAGS += $(OS_CFLAGS) ifeq ($(ARCH),sparc) -CFLAGS+=-mcpu=ultrasparc +CFLAGS += -mcpu=ultrasparc endif -LDFLAGS+=-g +CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS= -DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE TOOLS=qemu-img$(EXESUF) ifdef CONFIG_STATIC -LDFLAGS+=-static +LDFLAGS += -static endif ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 @@ -41,10 +37,10 @@ subdir-%: dyngen$(EXESUF) recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lz $(LIBS) dyngen$(EXESUF): dyngen.c - $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ + $(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ clean: # avoid old build problems by removing potentially incorrect old files Index: Makefile.target === RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.134 diff -u -p -r1.134 Makefile.target --- Makefile.target 7 Dec 2006 18:15:35 - 1.134 +++ Makefile.target 3 Jan 2007 14:40:11 - @@ -12,14 +12,12 @@ TARGET_BASE_ARCH:=sparc endif TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio -DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) +CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) ifdef CONFIG_USER_ONLY VPATH+=:$(SRC_PATH)/linux-user -DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) +CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing #CFLAGS+=-Werror -LDFLAGS=-g LIBS= HELPER_CFLAGS=$(CFLAGS) DYNGEN=../dyngen$(EXESUF) @@ -65,15 +63,17 @@ ifdef CONFIG_STATIC LDFLAGS+=-static endif +# We require -O2 to avoid the stack setup prologue in EXIT_TB +OP_CFLAGS := -Wall -O2 -g -fno-strict-aliasing + ifeq ($(ARCH),i386) -HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer -OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +HELPER_CFLAGS+=-fomit-frame-pointer +OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer ifeq ($(HAVE_GCC3_OPTIONS),yes) OP_CFLAGS+= -falign-functions=0 -fno-gcse else OP_CFLAGS+= -malign-functions=0 endif - ifdef TARGET_GPROF USE_I386_LD=y endif @@ -81,7 +81,7 @@ ifdef CONFIG_STATIC USE_I386_LD=y endif ifdef USE_I386_LD -LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld else # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this @@ -91,66 +91,66 @@ endif endif ifeq ($(ARCH),x86_64) -OP_CFLAGS=$(CFLAGS) -falign-functions=0 -LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),ppc) CFLAGS+= -D__powerpc__ -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),s3
Re: [Qemu-devel] qemu Makefile configure
On Wed, Jan 03, 2007 at 01:59:50PM +, Thiemo Seufer wrote: >All of this works fine for me, but patches of this sort are likely to >break things, so please test and comment. > > >Thiemo > >Index: Makefile.target >=== >RCS file: /sources/qemu/qemu/Makefile.target,v >retrieving revision 1.134 >diff -u -p -r1.134 Makefile.target >--- Makefile.target7 Dec 2006 18:15:35 - 1.134 >+++ Makefile.target3 Jan 2007 13:47:50 - >@@ -91,66 +91,66 @@ endif > endif > > ifeq ($(ARCH),x86_64) >-OP_CFLAGS=$(CFLAGS) -falign-functions=0 >-LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld >+LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld > endif > > ifeq ($(ARCH),ppc) -> CFLAGS+= -D__powerpc__ + CPPFLAGS += -D__powerpc__ (doesn't cpp already define that on ppc?) >Index: configure >=== >RCS file: /sources/qemu/qemu/configure,v >retrieving revision 1.115 >diff -u -p -r1.115 configure >--- configure 1 Jan 2007 21:31:01 - 1.115 >+++ configure 3 Jan 2007 13:47:50 - >@@ -243,6 +244,10 @@ for opt do > esac > done > >+# default flags for all hosts >+CFLAGS=$CFLAGS "-Wall -O2 -g -fno-strict-aliasing" >+LDFLAGS=$LDFLAGS "-g" Does that really work for you? I'd rather say LDFLAGS="$LDFLAGS -g" cheers, ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Thiemo Seufer wrote: > CVSROOT: /sources/qemu > Module name: qemu > Changes by: Thiemo Seufer 07/01/01 21:31:01 > > Modified files: > . : Makefile configure > > Log message: > Fix Makefile weirdness. > > CVSWeb URLs: > http://cvs.savannah.gnu.org/viewcvs/qemu/Makefile?cvsroot=qemu&r1=1.106&r2=1.107 > http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.114&r2=1.115 As mentioned on IRC, this patch makes configure's --extra-cflags and --extra-ldflags functional, but at the same time it breaks overriding CFLAGS/LDFLAGS at make time. The appended patch is an attempt to allow both, and to untangle the various flags settings. It collects and records the overridable defaults at configure time, adds OS_CFLAGS for mandatory OS specific flags, prefers the more standard CPPFLAGS over other preprocessor flag names, and OP_CFLAGS a separate set of flags which has also an overridable portion. All of this works fine for me, but patches of this sort are likely to break things, so please test and comment. Thiemo Index: Makefile === RCS file: /sources/qemu/qemu/Makefile,v retrieving revision 1.107 diff -u -p -r1.107 Makefile --- Makefile1 Jan 2007 21:31:01 - 1.107 +++ Makefile3 Jan 2007 13:47:50 - @@ -5,19 +5,15 @@ include config-host.mak .PHONY: all clean distclean dvi info install install-doc tar tarbin \ speed test test2 html dvi info -CFLAGS+=-Wall -O2 -g -fno-strict-aliasing -I. -ifdef CONFIG_DARWIN -CFLAGS+= -mdynamic-no-pic -endif +CFLAGS += $(OS_CFLAGS) ifeq ($(ARCH),sparc) -CFLAGS+=-mcpu=ultrasparc +CFLAGS += -mcpu=ultrasparc endif -LDFLAGS+=-g +CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE LIBS= -DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE TOOLS=qemu-img$(EXESUF) ifdef CONFIG_STATIC -LDFLAGS+=-static +LDFLAGS += -static endif ifdef BUILD_DOCS DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 @@ -41,10 +37,10 @@ subdir-%: dyngen$(EXESUF) recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS)) qemu-img$(EXESUF): qemu-img.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lz $(LIBS) dyngen$(EXESUF): dyngen.c - $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ + $(HOST_CC) $(CFLAGS) $(CPPFLAGS) -o $@ $^ clean: # avoid old build problems by removing potentially incorrect old files Index: Makefile.target === RCS file: /sources/qemu/qemu/Makefile.target,v retrieving revision 1.134 diff -u -p -r1.134 Makefile.target --- Makefile.target 7 Dec 2006 18:15:35 - 1.134 +++ Makefile.target 3 Jan 2007 13:47:50 - @@ -12,14 +12,12 @@ TARGET_BASE_ARCH:=sparc endif TARGET_PATH=$(SRC_PATH)/target-$(TARGET_BASE_ARCH) VPATH=$(SRC_PATH):$(TARGET_PATH):$(SRC_PATH)/hw:$(SRC_PATH)/audio -DEFINES=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) +CPPFLAGS=-I. -I.. -I$(TARGET_PATH) -I$(SRC_PATH) ifdef CONFIG_USER_ONLY VPATH+=:$(SRC_PATH)/linux-user -DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) +CPPFLAGS+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH) endif -CFLAGS=-Wall -O2 -g -fno-strict-aliasing #CFLAGS+=-Werror -LDFLAGS=-g LIBS= HELPER_CFLAGS=$(CFLAGS) DYNGEN=../dyngen$(EXESUF) @@ -65,15 +63,17 @@ ifdef CONFIG_STATIC LDFLAGS+=-static endif +# We require -O2 to avoid the stack setup prologue in EXIT_TB +OP_CFLAGS = -Wall -O2 -g -fno-strict-aliasing + ifeq ($(ARCH),i386) -HELPER_CFLAGS:=$(CFLAGS) -fomit-frame-pointer -OP_CFLAGS:=$(CFLAGS) -mpreferred-stack-boundary=2 -fomit-frame-pointer +HELPER_CFLAGS+=-fomit-frame-pointer +OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer ifeq ($(HAVE_GCC3_OPTIONS),yes) OP_CFLAGS+= -falign-functions=0 -fno-gcse else OP_CFLAGS+= -malign-functions=0 endif - ifdef TARGET_GPROF USE_I386_LD=y endif @@ -81,7 +81,7 @@ ifdef CONFIG_STATIC USE_I386_LD=y endif ifdef USE_I386_LD -LDFLAGS+=-Wl,-T,$(SRC_PATH)/i386.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld else # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object # that the kernel ELF loader considers as an executable. I think this @@ -91,66 +91,66 @@ endif endif ifeq ($(ARCH),x86_64) -OP_CFLAGS=$(CFLAGS) -falign-functions=0 -LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),ppc) CFLAGS+= -D__powerpc__ -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/ppc.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),s390) -OP_CFLAGS=$(CFLAGS) -LDFLAGS+=-Wl,-T,$(SRC_PATH)/s390.ld +LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld endif ifeq ($(ARCH),sparc) ifeq ($(CONFI
[Qemu-devel] qemu Makefile configure
CVSROOT:/sources/qemu Module name:qemu Changes by: Thiemo Seufer 07/01/01 21:31:01 Modified files: . : Makefile configure Log message: Fix Makefile weirdness. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/Makefile?cvsroot=qemu&r1=1.106&r2=1.107 http://cvs.savannah.gnu.org/viewcvs/qemu/configure?cvsroot=qemu&r1=1.114&r2=1.115 ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] qemu Makefile configure
Attached is a patch to fix 'make install' when the docs are not built (it currently fails). - Leo Reiter Paul Brook wrote: > CVSROOT: /sources/qemu > Module name: qemu > Branch: > Changes by: Paul Brook <[EMAIL PROTECTED]> 06/04/23 17:57:59 > > Modified files: > . : Makefile configure > > Log message: > Autodetect tools neccessary for building documentation. > Make distclean remove generated documentation files. > > CVSWeb URLs: > http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/Makefile.diff?tr1=1.96&tr2=1.97&r1=text&r2=text > http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/configure.diff?tr1=1.93&tr2=1.94&r1=text&r2=text -- Leonardo E. Reiter Vice President of Product Development, CTO Win4Lin, Inc. Virtual Computing that means Business Main: +1 512 339 7979 Fax: +1 512 532 6501 http://www.win4lin.com Index: Makefile === RCS file: /cvsroot/qemu/qemu/Makefile,v retrieving revision 1.97 diff -a -u -r1.97 Makefile --- Makefile 23 Apr 2006 17:57:59 - 1.97 +++ Makefile 30 Apr 2006 15:03:51 - @@ -55,11 +55,15 @@ video.x proll.elf linux_boot.bin; do \ $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ done +ifdef BUILD_DOCS mkdir -p "$(DESTDIR)$(docdir)" $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" +endif ifndef CONFIG_WIN32 +ifdef BUILD_DOCS mkdir -p "$(DESTDIR)$(mandir)/man1" $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" +endif mkdir -p "$(DESTDIR)$(datadir)/keymaps" for x in $(KEYMAPS); do \ $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] qemu Makefile configure
CVSROOT:/sources/qemu Module name:qemu Branch: Changes by: Paul Brook <[EMAIL PROTECTED]> 06/04/23 17:57:59 Modified files: . : Makefile configure Log message: Autodetect tools neccessary for building documentation. Make distclean remove generated documentation files. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/Makefile.diff?tr1=1.96&tr2=1.97&r1=text&r2=text http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/configure.diff?tr1=1.93&tr2=1.94&r1=text&r2=text ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] qemu Makefile configure kqemu.h
CVSROOT:/sources/qemu Module name:qemu Branch: Changes by: Fabrice Bellard <[EMAIL PROTECTED]> 06/02/08 22:39:17 Modified files: . : Makefile configure Added files: . : kqemu.h Log message: kqemu/qvm86 must now be compiled outside QEMU CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/Makefile.diff?tr1=1.91&tr2=1.92&r1=text&r2=text http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/configure.diff?tr1=1.80&tr2=1.81&r1=text&r2=text http://cvs.savannah.gnu.org/viewcvs/qemu/qemu/kqemu.h?rev=1.1 ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel