From: Yuanjie Huang <yuanjie.hu...@windriver.com>

Since libtool sysroot is not set when compiling sanitizers, the libtool
does no prefix the dependency path correctly. Fix it, so that programs
can link to sanitizer libraries without error.

This patch changes the depenedency_libs line in libasan.la and
libusan.la from
        dependency_libs=' -lpthread -ldl '/usr/lib'/libstdc++.la 
'/usr/lib'/libstdc++.la'
to
        dependency_libs=' -lpthread -ldl =/usr/lib/libstdc++.la 
=/usr/lib/libstdc++.la'

Upstream-Status: Inappropriate [embedded specific]
(LOCAL REV; NOT UPSTREAM) -- sent to oe-core on 2016-09-20

Signed-off-by: Yuanjie Huang <yuanjie.hu...@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-sanitizers.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc 
b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
index c987ccb..5fe5eaf 100644
--- a/meta/recipes-devtools/gcc/gcc-sanitizers.inc
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -50,6 +50,8 @@ do_install () {
         rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
     fi
     chown -R root:root ${D}
+    # Fix broken libtool with stdc++, as sysroot is not set.
+    find ${D} -name \*.la -exec sed -i 
"/^dependency_libs=/s@'/usr/lib'@=/usr/lib@g" {} \;
 }
 
 INHIBIT_DEFAULT_DEPS = "1"
-- 
1.9.1

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to