[libvirt] [PATCH 2/2 v3] Check for --no-copy-dt-needed linker flag

Eric Blake eblake at redhat.com
Tue Aug 20 19:30:14 UTC 2013


On 08/20/2013 08:40 AM, Guido Günther wrote:
> and use it when available
> ---

> +AC_DEFUN([LIBVIRT_LINKER_NO_INDIRECT],[
> +    AC_MSG_CHECKING([for how to avoid indirect lib deps])
> +
> +    NO_INDIRECT_LDFLAGS=
> +    `$LD --help 2>&1 | grep -- "--no-copy-dt-needed-entries" >/dev/null` && \
> +        NO_INDIRECT_LDFLAGS="-Wl,--no-copy-dt-needed-entries"
> +    AC_SUBST([NO_INDIRECT_LDFLAGS])

You fixed the relro detection to use case instead of ``&&..., but forgot
to fix this one.

> +
> +    AC_MSG_RESULT([$NO_INDIRECT_LDFLAGS])
> +])
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 7c3d8a1..faa2cd6 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -35,6 +35,7 @@ AM_CFLAGS =	$(LIBXML_CFLAGS)				\
>  AM_LDFLAGS =	$(DRIVER_MODULE_LDFLAGS)			\
>  		$(COVERAGE_LDFLAGS)				\
>  		$(RELRO_LDFLAGS)				\
> +		$(NO_INDIRECT_LDFLAGS)				\

Of course, depending on the verdict on 1/2 will determine whether this
patch applies or must be split into a per-binary usage.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130820/968ce555/attachment-0001.sig>


More information about the libvir-list mailing list