qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs


From: Alex Bennée
Subject: Re: [Qemu-devel] [RFC PATCH 2/4] configure: introduce --extra-libs
Date: Mon, 25 Jan 2016 18:15:21 +0000
User-agent: mu4e 0.9.17; emacs 25.0.50.6

Paolo Bonzini <address@hidden> writes:

> On 25/01/2016 17:49, Alex Bennée wrote:
>> If for example you want to use the thread sanitizer you want to ensure all
>> binaries are linked with the library:
>>
>>   ./configure ${TARGETS} --cc=gcc-5 --cxx=g++-5 \
>>     --extra-cflags="-fsanitize=thread" --extra-libs="-ltsan"
>
> Shouldn't -fsanitize=thread work as a linker command line flag too?

No, the sanitizers are compile time options as they instrument the
generated code. It's just in the case of the ThreadSanitizer you also
need the support library.

> Perhaps if that works there's a better place to put -fsanitizer flags.
>
> Paolo
>
>> This is more explicit than just specifying --extra-ldflags which might
>> not get applied in the right place all the time.
>>
>> Signed-off-by: Alex Bennée <address@hidden>
>> ---
>>  configure | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/configure b/configure
>> index 7d23c6c..194bae9 100755
>> --- a/configure
>> +++ b/configure
>> @@ -365,6 +365,8 @@ for opt do
>>    --extra-ldflags=*) LDFLAGS="$LDFLAGS $optarg"
>>                       EXTRA_LDFLAGS="$optarg"
>>    ;;
>> +  --extra-libs=*)    EXTRA_LIBS="$optarg"
>> +  ;;
>>    --enable-debug-info) debug_info="yes"
>>    ;;
>>    --disable-debug-info) debug_info="no"
>> @@ -785,6 +787,8 @@ for opt do
>>    ;;
>>    --extra-ldflags=*)
>>    ;;
>> +  --extra-libs=*)
>> +  ;;
>>    --enable-debug-info)
>>    ;;
>>    --disable-debug-info)
>> @@ -1281,6 +1285,7 @@ Advanced options (experts only):
>>    --objcc=OBJCC            use Objective-C compiler OBJCC [$objcc]
>>    --extra-cflags=CFLAGS    append extra C compiler flags QEMU_CFLAGS
>>    --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS
>> +  --extra-libs=LIBS        append extra libraries when linking
>>    --make=MAKE              use specified make [$make]
>>    --install=INSTALL        use specified install [$install]
>>    --python=PYTHON          use specified python [$python]
>> @@ -4718,6 +4723,11 @@ libs_softmmu="$pixman_libs $libs_softmmu"
>>  CFLAGS="$CFLAGS $EXTRA_CFLAGS"
>>  QEMU_CFLAGS="$QEMU_CFLAGS $EXTRA_CFLAGS"
>>
>> +# extra-libs
>> +LIBS="$LIBS $EXTRA_LIBS"
>> +libs_softmmu="$libs_softmmu $EXTRA_LIBS"
>> +libs_qga="$libs_qga $EXTRA_LIBS"
>> +
>>  echo "Install prefix    $prefix"
>>  echo "BIOS directory    `eval echo $qemu_datadir`"
>>  echo "binary directory  `eval echo $bindir`"
>> @@ -4888,6 +4898,7 @@ fi
>>  echo "qemu_helperdir=$libexecdir" >> $config_host_mak
>>  echo "extra_cflags=$EXTRA_CFLAGS" >> $config_host_mak
>>  echo "extra_ldflags=$EXTRA_LDFLAGS" >> $config_host_mak
>> +echo "extra_libs=$EXTRA_LIBS" >> $config_host_mak
>>  echo "qemu_localedir=$qemu_localedir" >> $config_host_mak
>>  echo "libs_softmmu=$libs_softmmu" >> $config_host_mak
>>
>>


--
Alex Bennée



reply via email to

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