package/expect: don't tells the linker to search for libraries in /usr/lib
PATCH 1/1 package/expect: don't tells the linker to search for libraries in /usr/lib
Even by using --disable-rpath option, the TCL_CC_SEARCH_FLAGS and EXP_CC_SEARCH_FLAGS wich contains respectively "-Wl,-rpath,/usr/lib" and "-Wl,-rpath,/usr/lib/expect5.45.3" are added to the command line:
[...]/x86_64-linux-gcc \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
-Os -pipe -O2 -fomit-frame-pointer -Wall -fPIC -D_LARGEFILE_SOURCE \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
-Wl,--export-dynamic \
-o expect exp_main_exp.o \
-L[...]/output/build/expect-2014-05-02 -lexpect5.45.3 \
-L[...]/output/build/tcl-8.6.6/unix -ltcl8.6 \
-ldl \
-Wl,-rpath,/usr/lib \
-Wl,-rpath,/usr/lib/expect5.45.3Remove them to avoid using host libz.so with cross-compiling.
Fixes:
http://autobuild.buildroot.net/results/714/71457ed23bb149ed2253b01be90711e422faa6aa
--- ...n-t-tells-the-linker-to-search-for-librar.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 package/expect/0003-Makefile-don-t-tells-the-linker-to-search-for-librar.patch
package/expect/0003-Makefile-don-t-tells-the-linker-to-search-for-librar.patch new file +50 -0
@@ -0,0 +1,50 @@ +From 6c4f09ee7d8d757cea276cc1e988d00401ab543b Mon Sep 17 00:00:00 2001 +From: Romain Naour <[email protected]> +Date: Sun, 28 May 2017 22:26:32 +0200 +Subject: [PATCH] Makefile: don't tells the linker to search for libraries in + /usr/lib + +Even by using --disable-rpath option, the TCL_CC_SEARCH_FLAGS and +EXP_CC_SEARCH_FLAGS wich contains respectively "-Wl,-rpath,/usr/lib" +and "-Wl,-rpath,/usr/lib/expect5.45.3" are added to the command line: + +[...]/x86_64-linux-gcc \ + -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ + -Os -pipe -O2 -fomit-frame-pointer -Wall -fPIC -D_LARGEFILE_SOURCE \ + -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \ + -Wl,--export-dynamic \ + -o expect exp_main_exp.o \ + -L[...]/output/build/expect-2014-05-02 -lexpect5.45.3 \ + -L[...]/output/build/tcl-8.6.6/unix -ltcl8.6 \ + -ldl \ + -Wl,-rpath,/usr/lib \ + -Wl,-rpath,/usr/lib/expect5.45.3 + +Remove them to avoid using host libz.so with cross-compiling. + +Fixes: +http://autobuild.buildroot.net/results/714/71457ed23bb149ed2253b01be90711e422faa6aa + +Signed-off-by: Romain Naour <[email protected]> +--- + Makefile.in | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 05d3e2b..d4edd10 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -394,9 +394,7 @@ expect: exp_main_exp.o $(PKG_LIB_FILE) + -o expect exp_main_exp.o \ + @EXP_BUILD_LIB_SPEC@ \ + @TCL_BUILD_LIB_SPEC@ \ +- @TCL_DL_LIBS@ @PKG_LIBS@ @MATH_LIBS@ \ +- @TCL_CC_SEARCH_FLAGS@ \ +- @EXP_CC_SEARCH_FLAGS@ ++ @TCL_DL_LIBS@ @PKG_LIBS@ @MATH_LIBS@ + $(SETUID) expect + + expectk: +-- +2.9.4 +
Signature · 1 line
2.9.4
PATCH 1/1 package/expect: don't tells the linker to search for libraries in /usr/lib
Hello,
Quoted 11 lines · Romain Naour
[...]/x86_64-linux-gcc \
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
-Os -pipe -O2 -fomit-frame-pointer -Wall -fPIC -D_LARGEFILE_SOURCE \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 \
-Wl,--export-dynamic \
-o expect exp_main_exp.o \
-L[...]/output/build/expect-2014-05-02 -lexpect5.45.3 \
-L[...]/output/build/tcl-8.6.6/unix -ltcl8.6 \
-ldl \
-Wl,-rpath,/usr/lib \
-Wl,-rpath,/usr/lib/expect5.45.3Problem is that /usr/lib/expect5.45.3 is a non-standard library path. So if the expect binary does not have a RPATH to this location, it won't find the shared libraries in /usr/lib/expect5.45.3, unless they are explicitly dlopen()ed.
Have you verified that?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com