All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bitbake.conf: add --enable-new-dtags to linker
@ 2018-12-21 14:23 Alexander Kanavin
  2018-12-21 14:52 ` Khem Raj
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2018-12-21 14:23 UTC (permalink / raw)
  To: openembedded-core

Various versions of ld have different defaults for this
(even between e.g. Ubuntu 16.04 and 18.04). This has the
consequence of putting either RPATH or RUNPATH into the binary,
depending on the linker, which have different priorities
vs LD_LIBRARY_PATH env var. Also, I think, the original
executable binary is looked up for the tags when resolving
a dependency of a shared library when using RPATH, but not
RUNPATH.

Let's make this deterministic.

Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
 meta/conf/bitbake.conf | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 64800623545..732e4f93328 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -573,6 +573,7 @@ export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
 
 export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
                         -L${STAGING_BASE_LIBDIR_NATIVE} \
+                        -Wl,--enable-new-dtags \
                         -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
                         -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
                         -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bitbake.conf: add --enable-new-dtags to linker
  2018-12-21 14:23 [PATCH] bitbake.conf: add --enable-new-dtags to linker Alexander Kanavin
@ 2018-12-21 14:52 ` Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2018-12-21 14:52 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: Patches and discussions about the oe-core layer

On Fri, Dec 21, 2018 at 6:24 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> Various versions of ld have different defaults for this
> (even between e.g. Ubuntu 16.04 and 18.04). This has the
> consequence of putting either RPATH or RUNPATH into the binary,
> depending on the linker, which have different priorities
> vs LD_LIBRARY_PATH env var. Also, I think, the original
> executable binary is looked up for the tags when resolving
> a dependency of a shared library when using RPATH, but not
> RUNPATH.
>
> Let's make this deterministic.
>

this change is fine in general. What we have to understand is that
--enable-new-dtags actually sets DT_RUNPATH instead of DT_RPATH.
DT_RPATH has higher precedence than LD_LIBRARY_PATH; DT_RUNPATH has
lower precedence.

with this change we will let LD_LIBRARY_PATH override our
settings. So look for case where we might have assumed that
we are setting DT_RPATH so no environment can affect us

> Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
> ---
>  meta/conf/bitbake.conf | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 64800623545..732e4f93328 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -573,6 +573,7 @@ export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
>
>  export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
>                          -L${STAGING_BASE_LIBDIR_NATIVE} \
> +                        -Wl,--enable-new-dtags \
>                          -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
>                          -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
>                          -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
> --
> 2.17.1
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-21 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 14:23 [PATCH] bitbake.conf: add --enable-new-dtags to linker Alexander Kanavin
2018-12-21 14:52 ` Khem Raj

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.