Repository: lucy-charmonizer
Updated Branches:
  refs/heads/master 0539a8ce8 -> 7c09817b4


Add --disable-new-dtags option when setting rpath

Some newer Linux systems enable the "new dtags" linker option by
default. With this option --rpath sets DT_RUNPATH instead of DT_RPATH.
Unfortunately, DT_RUNPATH is not applied transitively when searching
for indirect dependencies, breaking the Lucy test executable. See

    https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638
    https://sourceware.org/bugzilla/show_bug.cgi?id=13945


Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/7c09817b
Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/7c09817b
Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/7c09817b

Branch: refs/heads/master
Commit: 7c09817b4fdcaa9dc1714bb5ed3101c8a2c931c8
Parents: 0539a8c
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Sat May 20 14:55:08 2017 +0200
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Sat May 20 14:55:08 2017 +0200

----------------------------------------------------------------------
 src/Charmonizer/Core/CFlags.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/7c09817b/src/Charmonizer/Core/CFlags.c
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/CFlags.c b/src/Charmonizer/Core/CFlags.c
index ab57fcc..c42b6bf 100644
--- a/src/Charmonizer/Core/CFlags.c
+++ b/src/Charmonizer/Core/CFlags.c
@@ -363,7 +363,15 @@ chaz_CFlags_add_rpath(chaz_CFlags *flags, const char 
*path) {
     if (chaz_CC_binary_format() != CHAZ_CC_BINFMT_ELF) { return; }
 
     if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        string = chaz_Util_join("", "-Wl,-rpath,", path, NULL);
+        /* If "new dtags" are enabled by default, DT_RUNPATH is set instead of
+         * DT_RPATH. Unfortunately, DT_RUNPATH is not applied transitively
+         * when searching for indirect dependencies. See
+         *
+         * https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638
+         * https://sourceware.org/bugzilla/show_bug.cgi?id=13945
+         */
+        string = chaz_Util_join("", "-Wl,--disable-new-dtags -Wl,-rpath,",
+                                path, NULL);
     }
     else if (flags->style == CHAZ_CFLAGS_STYLE_SUN_C) {
         string = chaz_Util_join(" ", "-R", path, NULL);

Reply via email to