[1/1] qt-mobility: remove /usr/lib from ld rpath-link option

Submitted by rongqing.li@windriver.com on June 24, 2013, 5:08 a.m. | Patch ID: 52253


Message ID 0931e07ae6c0734cb4300ee0bd94c45b511c3cbb.1372040014.git.rongqing.li@windriver.com
State Accepted
Commit f7409a9fe83ba2535a43f39ed57cd78242a88557
Headers show

Commit Message

rongqing.li@windriver.com June 24, 2013, 5:08 a.m.
From: "Roy.Li" <rongqing.li@windriver.com>

Remove /usr/lib from ld rpath-link option to fix the below build error:

        undefined reference to `inflateReset2@ZLIB_1.2.3.4'

since sysroot seems not work for rpath-link, and "rpath-link,/usr/lib" makes
ld to search host libraries for target libraries, once host has different
version zlib, the error will happen.

qmake uses QT_MOBILITY_LIB to generate "rpath-link,/usr/lib" when do_configure
but we can not add sysroot into QT_MOBILITY_LIB, since QT_MOBILITY_LIB is dir
which libraries will be installed to, so I remove this dir from rpath-link
before do_compile

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
 meta/recipes-qt/qt4/qt-mobility_1.2.0.inc |    6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc b/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc
index b0e4278..aba84ab 100644
--- a/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc
+++ b/meta/recipes-qt/qt4/qt-mobility_1.2.0.inc
@@ -59,6 +59,12 @@  do_configure_prepend() {
 	echo CONFIG += ${qtm_embedded} >>./config.pri
+do_compile_prepend() {
+	for NAME in `find ./ -name Makefile` ; do
+	    sed -e 's:-Wl,-rpath-link,${libdir}::g' -i $NAME 
+	done
 do_install() {
 	for NAME in */*.prf