qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.0] configure: use do_cc when checking for


From: Alexey Kardashevskiy
Subject: Re: [Qemu-devel] [PATCH for-2.0] configure: use do_cc when checking for -fstack-protector support
Date: Sat, 12 Apr 2014 00:33:31 +1000
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/12/2014 12:24 AM, Alexey Kardashevskiy wrote:
> On 04/11/2014 10:34 PM, Alexey Kardashevskiy wrote:
>> On 04/09/2014 09:04 PM, Peter Maydell wrote:
>>> MacOSX clang silently swallows unrecognized -f options when doing a link
>>> with '-framework' also on the command line, so to detect support for
>>> the various -fstack-protector options we must do a plain .c to .o compile,
>>> not a complete compile-and-link.
>>>
>>> Signed-off-by: Peter Maydell <address@hidden>
>>> ---
>>> This should be a pretty safe change and it prevents clang/MacOSX
>>> builds from spewing a warning on every C file compilation, so I'd
>>> like to get it into 2.0.
>>>
>>>  configure | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/configure b/configure
>>> index eb0e7bb..c85475f 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -1448,7 +1448,7 @@ done
>>>  if test "$stack_protector" != "no" ; then
>>>    gcc_flags="-fstack-protector-strong -fstack-protector-all"
>>>    for flag in $gcc_flags; do
>>> -    if compile_prog "-Werror $flag" "" ; then
>>> +    if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC ; then
>>>        QEMU_CFLAGS="$QEMU_CFLAGS $flag"
>>>        LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
>>>        break
>>>
>>
>> My cross environment fails after this patch on "-fstack-protector-all".
>> Without the patch, gcc for test program gets additional "-m64 -g
>> -L/home/alexey/crosslib/qemu-build-lib-fc19/usr/lib64" (the last one is
>> mine, passed via --extra-ldflags=), fails with an error (below). With the
>> patch, the configure script thinks everything is fine and fails on "ERROR:
>> zlib check failed".
>>
>> Why is this happening? Thanks.
> 
> 
> This helps. No idea why. Any ideas? :)
> 
> @@ -1448,7 +1452,7 @@ done
>  if test "$stack_protector" != "no" ; then
>    gcc_flags="-fstack-protector-strong -fstack-protector-all"
>    for flag in $gcc_flags; do
> -    if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC ; then
> +    if do_cc $QEMU_CFLAGS -Werror $flag -c -o $TMPO $TMPC "" ; then
>        QEMU_CFLAGS="$QEMU_CFLAGS $flag"
>        LIBTOOLFLAGS="$LIBTOOLFLAGS -Wc,$flag"
>        break



Ok. Here are 2 logs - "good" with the patch above, "bad" - without.


> 
> 
> 
> 
>>
>>
>>
>> powerpc64-linux-gcc -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
>> -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef
>> -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common
>> --sysroot=/home/alexey/crosslib/qemu-build-lib-fc19/ -isystem
>> /home/alexey/crosslib/qemu-build-lib-fc19/usr/include -D__EXCEPTIONS
>> -D__LONG_DOUBLE_128__ -D__NO_INLINE__ -Wno-redundant-decls
>> -Wno-missing-prototypes -Wmissing-include-dirs -Wno-system-headers
>> -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs
>> -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
>> -Wold-style-declaration -Wold-style-definition -Wtype-limits -Werror
>> -fstack-protector-strong -o /tmp/qemu-conf-24556-2284-15038.exe
>> /tmp/qemu-conf-31026-2284-18135.c -m64 -g
>> -L/home/alexey/crosslib/qemu-build-lib-fc19/usr/lib64
>> powerpc64-linux-gcc: error: unrecognized command line option
>> '-fstack-protector-strong'
>> powerpc64-linux-gcc -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
>> -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef
>> -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common
>> --sysroot=/home/alexey/crosslib/qemu-build-lib-fc19/ -isystem
>> /home/alexey/crosslib/qemu-build-lib-fc19/usr/include -D__EXCEPTIONS
>> -D__LONG_DOUBLE_128__ -D__NO_INLINE__ -Wno-redundant-decls
>> -Wno-missing-prototypes -Wmissing-include-dirs -Wno-system-headers
>> -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs
>> -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers
>> -Wold-style-declaration -Wold-style-definition -Wtype-limits -Werror
>> -fstack-protector-all -o /tmp/qemu-conf-24556-2284-15038.exe
>> /tmp/qemu-conf-31026-2284-18135.c -m64 -g
>> -L/home/alexey/crosslib/qemu-build-lib-fc19/usr/lib64
>> /home/system/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/4.8.0/../../../../powerpc64-linux/bin/ld:
>> cannot find -lssp_nonshared
>> /home/system/opt/cross/gcc-4.8.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/4.8.0/../../../../powerpc64-linux/bin/ld:
>> cannot find -lssp
>> collect2: error: ld returned 1 exit status
>>
>>
>>
>>
> 
> 


-- 
Alexey

Attachment: cfg.bad
Description: Text document

Attachment: cfg.good
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]