From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLByb-0002ev-7m for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:16:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLByW-0003GF-16 for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:16:32 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:38869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLByV-0003GB-NW for qemu-devel@nongnu.org; Thu, 07 Jul 2016 12:16:27 -0400 Received: by mail-wm0-x230.google.com with SMTP id n127so22605927wme.1 for ; Thu, 07 Jul 2016 09:16:27 -0700 (PDT) References: <1467821896-32616-1-git-send-email-rth@twiddle.net> <1467821896-32616-2-git-send-email-rth@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1467821896-32616-2-git-send-email-rth@twiddle.net> Date: Thu, 07 Jul 2016 17:16:30 +0100 Message-ID: <87a8htmnj5.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PULL v2 1/4] build: Use $(CCAS) for compiling .S files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org Richard Henderson writes: > We fail to pass to $(AS) all of the different flags that may be required > for a given set of CFLAGS. Rather than figuring out the host-specific > mapping, it's better to allow the compiler driver to do that. > > However, simply using $(CC) runs afoul of clang trying to build the > option roms. C.f. 3dd46c78525a30e98c68, wherein we changed from > using $(CC) to using $(AS) in the first place. > > Work around this by passing -fno-integrated-as to clang, so that we use > the external assembler, and the clang driver still passes along all of > the options that the assembler might require. > > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > Message-Id: <1466703558-7723-1-git-send-email-rth@twiddle.net> > --- > configure | 13 ++++++++++--- > rules.mak | 7 ++----- > 2 files changed, 12 insertions(+), 8 deletions(-) > > diff --git a/configure b/configure > index 67beb47..e9090a0 100755 > --- a/configure > +++ b/configure > @@ -368,7 +368,7 @@ else > fi > > ar="${AR-${cross_prefix}ar}" > -as="${AS-${cross_prefix}as}" > +ccas="${CCAS-$cc}" > cpp="${CPP-$cc -E}" > objcopy="${OBJCOPY-${cross_prefix}objcopy}" > ld="${LD-${cross_prefix}ld}" > @@ -4490,6 +4490,13 @@ if test "$fortify_source" != "no"; then > fi > fi > > +################################################# > +# clang does not support the 16-bit assembly for roms > + > +if echo | $ccas -dM -E - | grep __clang__ > /dev/null 2>&1 ; then > + ccas="$ccas -fno-integrated-as" > +fi Hi Richard, This looks like it breaks the Travis clang: https://travis-ci.org/qemu/qemu/builds/142825178 We get the error: AS optionrom/multiboot.o clang: error: unknown argument: '-fno-integrated-as' make[1]: *** [multiboot.o] Error 1 make: *** [romsubdir-optionrom] Error 2 make: *** Waiting for unfinished jobs.... Clang in Travis is: clang version 3.4 (tags/RELEASE_34/final) > + > ########################################## > # check if struct fsxattr is available via linux/fs.h > > @@ -5508,7 +5515,7 @@ echo "CXX=$cxx" >> $config_host_mak > echo "OBJCC=$objcc" >> $config_host_mak > echo "AR=$ar" >> $config_host_mak > echo "ARFLAGS=$ARFLAGS" >> $config_host_mak > -echo "AS=$as" >> $config_host_mak > +echo "CCAS=$ccas" >> $config_host_mak > echo "CPP=$cpp" >> $config_host_mak > echo "OBJCOPY=$objcopy" >> $config_host_mak > echo "LD=$ld" >> $config_host_mak > @@ -5981,7 +5988,7 @@ for rom in seabios vgabios ; do > config_mak=roms/$rom/config.mak > echo "# Automatically generated by configure - do not modify" > $config_mak > echo "SRC_PATH=$source_path/roms/$rom" >> $config_mak > - echo "AS=$as" >> $config_mak > + echo "CCAS=$ccas" >> $config_mak > echo "CC=$cc" >> $config_mak > echo "BCC=bcc" >> $config_mak > echo "CPP=$cpp" >> $config_mak > diff --git a/rules.mak b/rules.mak > index 72c5955..7d7d83b 100644 > --- a/rules.mak > +++ b/rules.mak > @@ -68,11 +68,8 @@ LINK = $(call quiet-command, $(LINKPROG) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o > $(call process-archive-undefs, $1) \ > $(version-obj-y) $(call extract-libs,$1) $(LIBS)," LINK $(TARGET_DIR)$@") > > -%.asm: %.S > - $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -o $@ $<," CPP $(TARGET_DIR)$@") > - > -%.o: %.asm > - $(call quiet-command,$(AS) $(ASFLAGS) -o $@ $<," AS $(TARGET_DIR)$@") > +%.o: %.S > + $(call quiet-command,$(CCAS) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@") > > %.o: %.cc > $(call quiet-command,$(CXX) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<," CXX $(TARGET_DIR)$@") -- Alex Bennée