qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 1/5] configure: introduce --extra-libs


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v1 1/5] configure: introduce --extra-libs
Date: Thu, 28 Jan 2016 12:14:17 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0


On 28/01/2016 11:15, 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"
> 
> This is more explicit than just specifying --extra-ldflags which does
> not get applied at the end of the linker string.
> 
> Signed-off-by: Alex Bennée <address@hidden>

Did you find out why you need -ltsan?

Paolo

> ---
> v1
>   - rebase
>   - also ensure it is applied to test builds
> ---
>  configure | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 44ac9ab..bd29ba7 100755
> --- a/configure
> +++ b/configure
> @@ -113,7 +113,7 @@ compile_object() {
>  compile_prog() {
>    local_cflags="$1"
>    local_ldflags="$2"
> -  do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
> +  do_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags 
> $EXTRA_LIBS
>  }
>  
>  do_libtool() {
> @@ -366,6 +366,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"
> @@ -786,6 +788,8 @@ for opt do
>    ;;
>    --extra-ldflags=*)
>    ;;
> +  --extra-libs=*)
> +  ;;
>    --enable-debug-info)
>    ;;
>    --disable-debug-info)
> @@ -1282,6 +1286,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]
> @@ -4715,6 +4720,11 @@ fi
>  QEMU_CFLAGS="$pixman_cflags $fdt_cflags $QEMU_CFLAGS"
>  libs_softmmu="$pixman_libs $libs_softmmu"
>  
> +# 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`"
> @@ -4885,6 +4895,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
>  
> 



reply via email to

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