* [Qemu-devel] v2.8.1 configure / build fails - just to let you know :
@ 2017-04-08 14:25 Jason Vas Dias
2017-04-08 14:45 ` Jason Vas Dias
0 siblings, 1 reply; 3+ messages in thread
From: Jason Vas Dias @ 2017-04-08 14:25 UTC (permalink / raw)
To: qemu-devel
Good day -
After checking the v2.8.1 GIT tag into $SRC/qemu and configuring in a
separate $BLD/qemu directory :
$ $SRC/qemu/configure --prefix=/usr --libdir=/usr/lib64 \
--sysconfdir=/etc --localstatedir=/var \
--target-list=x86_64-linux-user,x86_64-softmmu,i386-linux-user,\
i386-softmmu,aarch64-linux-user,aarch64-softmmu \
2>&1 | tee configure.log
& doing:
$ make -j4 V=1 2>&1 | tee make.log
The build fails for 2 reasons :
1. I had '-std=gnu11' in my $CFLAGS , while CXXFLAGS contained
'-std=gnu++11'
(CC was set to 'gcc', while CXX was set to 'g++' - these are both
from GCC 5.4.0
) ;
however, the qemu build scripts incorrectly used $CFLAGS instead of
$CXXFLAGS, so the build fails without '--disable-werror' because
'-std=gnu11' applies only to '--lang=c' compiles, not '--lang=c++' compiles -
there is no way to separately disable this warning (converted to an error).
Why is qemu's build scripts not using $CXXFLAGS instead of $CFLAGS here ?
2. With --disable-werror added to configure flags to overcome (1) , the build
fails because 'cpp' gets a '-c' flag .
No '-c' flag was in any $CFLAGS, $CXXFLAGS, or $CPPFLAGS setting -
here are the flags settings I used for configure -
( I actually ran 'c_env $SRC/qemu/configure ...') :
$ c_env "bash -c 'declare -p CFLAGS CPPFLAGS CXXFLAGS'"
declare -x CFLAGS="-std=gnu11 -march=x86-64 -mtune=native -O2 -g -fPIC -pipe"
declare -x CPPFLAGS=""
declare -x CXXFLAGS="-std=gnu++11 -march=x86-64 -mtune=native -O2 -g
-fPIC -pipe"
$ make -j4 V=1
...
cpp -m32 -I/usr/os_src/qemu/tcg -I/usr/os_src/qemu/tcg/i386
-I/usr/os_src/qemu/linux-headers
-I/usr/build/linux/qemu-v2.8.1/linux-headers -I. -I/usr/os_src/qemu
-I/usr/os_src/qemu/include -I/usr/os_src/qemu/pc-bios/optionrom -I.
-I/usr/os_src/qemu -MMD -MP -MT kvmvapic.o -MF ./kvmvapic.d -c -o -
/usr/os_src/qemu/pc-bios/optionrom/kvmvapic.S | as -32 -o kvmvapic.o
cpp: fatal error: '-c' is not a valid option to the preprocessor
compilation terminated.
Now I have to dig out in which Makefile variable that erroneous '-c' is - nice!
notes from the front ... just thought I should let you know!
I don't think these are unreasonable options to be passing to the build.
Maybe the build might succeed if I configured with no *FLAGS settings
at all - but that is not the way autoconf systems are meant to work -
they are meant to honor one's CFLAGS & CXXFLAGS settings, however
mistaken they may appear to be - that is the user's responsibility! - and use
CFLAGS for C programs, and CXXFLAGS for C++ programs, IMHO .
Thanks & Regards,
Jason
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] v2.8.1 configure / build fails - just to let you know :
2017-04-08 14:25 [Qemu-devel] v2.8.1 configure / build fails - just to let you know : Jason Vas Dias
@ 2017-04-08 14:45 ` Jason Vas Dias
2017-04-08 14:55 ` Jason Vas Dias
0 siblings, 1 reply; 3+ messages in thread
From: Jason Vas Dias @ 2017-04-08 14:45 UTC (permalink / raw)
To: qemu-devel
On 08/04/2017, Jason Vas Dias <jason.vas.dias@gmail.com> wrote:
> Good day -
>
> After checking the v2.8.1 GIT tag into $SRC/qemu and configuring in a
> separate $BLD/qemu directory :
>
> $ $SRC/qemu/configure --prefix=/usr --libdir=/usr/lib64 \
> --sysconfdir=/etc --localstatedir=/var \
> --target-list=x86_64-linux-user,x86_64-softmmu,i386-linux-user,\
> i386-softmmu,aarch64-linux-user,aarch64-softmmu \
> 2>&1 | tee configure.log
>
> & doing:
>
> $ make -j4 V=1 2>&1 | tee make.log
>
> The build fails for 2 reasons :
>
> 1. I had '-std=gnu11' in my $CFLAGS , while CXXFLAGS contained
> '-std=gnu++11'
> (CC was set to 'gcc', while CXX was set to 'g++' - these are both
> from GCC 5.4.0
> ) ;
> however, the qemu build scripts incorrectly used $CFLAGS instead of
> $CXXFLAGS, so the build fails without '--disable-werror' because
> '-std=gnu11' applies only to '--lang=c' compiles, not '--lang=c++'
> compiles -
> there is no way to separately disable this warning (converted to an
> error).
> Why is qemu's build scripts not using $CXXFLAGS instead of $CFLAGS here ?
>
> 2. With --disable-werror added to configure flags to overcome (1) , the
> build
> fails because 'cpp' gets a '-c' flag .
> No '-c' flag was in any $CFLAGS, $CXXFLAGS, or $CPPFLAGS setting -
> here are the flags settings I used for configure -
> ( I actually ran 'c_env $SRC/qemu/configure ...') :
> $ c_env "bash -c 'declare -p CFLAGS CPPFLAGS CXXFLAGS'"
> declare -x CFLAGS="-std=gnu11 -march=x86-64 -mtune=native -O2 -g -fPIC
> -pipe"
> declare -x CPPFLAGS=""
> declare -x CXXFLAGS="-std=gnu++11 -march=x86-64 -mtune=native -O2 -g
> -fPIC -pipe"
>
> $ make -j4 V=1
> ...
> cpp -m32 -I/usr/os_src/qemu/tcg -I/usr/os_src/qemu/tcg/i386
> -I/usr/os_src/qemu/linux-headers
> -I/usr/build/linux/qemu-v2.8.1/linux-headers -I. -I/usr/os_src/qemu
> -I/usr/os_src/qemu/include -I/usr/os_src/qemu/pc-bios/optionrom -I.
> -I/usr/os_src/qemu -MMD -MP -MT kvmvapic.o -MF ./kvmvapic.d -c -o -
> /usr/os_src/qemu/pc-bios/optionrom/kvmvapic.S | as -32 -o kvmvapic.o
> cpp: fatal error: '-c' is not a valid option to the preprocessor
> compilation terminated.
>
> Now I have to dig out in which Makefile variable that erroneous '-c' is -
> nice!
>
> notes from the front ... just thought I should let you know!
>
> I don't think these are unreasonable options to be passing to the build.
> Maybe the build might succeed if I configured with no *FLAGS settings
> at all - but that is not the way autoconf systems are meant to work -
> they are meant to honor one's CFLAGS & CXXFLAGS settings, however
> mistaken they may appear to be - that is the user's responsibility! - and
> use
> CFLAGS for C programs, and CXXFLAGS for C++ programs, IMHO .
>
> Thanks & Regards,
> Jason
>
This patch is necessary to enable build to complete :
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index fa53d9e..f894d5d 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -43,7 +43,7 @@ build-all: multiboot.bin linuxboot.bin
linuxboot_dma.bin kvmvapic.bin
%.o: %.S
- $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS)
-c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@")
+ $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS)
-o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@")
%.img: %.o
$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m
$(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o
$@ $<,"BUILD","$(TARGET_DIR)$@")
[
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] v2.8.1 configure / build fails - just to let you know :
2017-04-08 14:45 ` Jason Vas Dias
@ 2017-04-08 14:55 ` Jason Vas Dias
0 siblings, 0 replies; 3+ messages in thread
From: Jason Vas Dias @ 2017-04-08 14:55 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 218 bytes --]
Patch attached - removes '-c' from $CPP invocation in
pc-bios/optionrom/Makefile
- $CPP was 'cpp' in my environment.
Maybe you should use $CC or $CXX with '-e' flag ? -
then no warning (error) would occur for '-c' .
[-- Attachment #2: qemu-v2.8.1-cpp_no-c.patch --]
[-- Type: application/octet-stream, Size: 675 bytes --]
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index fa53d9e..f894d5d 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -43,7 +43,7 @@ build-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin
%.o: %.S
- $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@")
+ $(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$(TARGET_DIR)$@")
%.img: %.o
$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -m $(LD_I386_EMULATION) -T $(SRC_PATH)/pc-bios/optionrom/flat.lds -s -o $@ $<,"BUILD","$(TARGET_DIR)$@")
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-04-08 14:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-08 14:25 [Qemu-devel] v2.8.1 configure / build fails - just to let you know : Jason Vas Dias
2017-04-08 14:45 ` Jason Vas Dias
2017-04-08 14:55 ` Jason Vas Dias
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.