[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shlibpath.at may need -no-undefined

From: Roumen Petrov
Subject: Re: shlibpath.at may need -no-undefined
Date: Tue, 04 Aug 2009 22:45:58 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20090624 SeaMonkey/1.1.17

Roumen Petrov wrote:
Ralf Wildenhues wrote:
Hello Roumen,

* Roumen Petrov wrote on Fri, Jul 24, 2009 at 03:26:47PM CEST:
It seems to me that test shlibpath.at require -no-undefined flag to
generated shared libraries on windows platforms, i.e. something as
"LDFLAGS="$LDFLAGS -no-undefined" at begining.

As the currently test don't work in cross-environment ( related to
PATH variable) I could not propose a patch.

I really appreciate you reporting bugs and sending patches (along with
all other people who do so, and who constantly receive less attention on
this list than they deserve  :-/ ), but can you please get into the
habit of never writing "it doesn't work" without any proof?  I mean, if
you've already tried it out, then it should be easy for you to copy and
paste the failing command and the error message, no?  That would save me
quite a bit of time; even if you don't analyze the error at all.  In
fact, copy-n-paste of the message is often more important than the error
analysis done.  Thanks.
I'm thinking about a work-around Please see attached file test-shlibpath.patch. Updated test "static.at" is not in patch as I would like to get some feedbacks first.

Now command ".../testsuite.dir/29$ ./m.exe --lt-debug" output:
(main) argv[0]      : <TESTDIR>\29\m.exe
(main) program_name : m.exe
(find_executable)   : <TESTDIR>\29\m.exe
(check_executable)  : <TESTDIR>\29\m.exe
(main) found exe (before symlink chase) at : <TESTDIR>\29\m.exe
(main) found exe (after symlink chase) at : <TESTDIR>\29\m.exe
(main) libtool target name: m.exe
(lt_setenv) setting 'BIN_SH' to 'xpg4'
(lt_setenv) setting 'DUALCASE' to '1'
(lt_update_lib_path) modifying 'PATH' by prepending ''
(lt_update_exe_path) modifying 'PATH' by prepending '<TESTDIR>\29\moved\bin;Z:\opt\mingw\lib;Z:\opt\mingw\bin;<TESTDIR>\29\sub\lib;<TESTDIR>\29\sub\bin;' (lt_setenv) setting 'PATH' to '<TESTDIR>\29\moved\bin;Z:\opt\mingw\lib;Z:\opt\mingw\bin;<TESTDIR>\29\sub\lib;<TESTDIR>\29\sub\bin;C:\windows\system32;C:\windows;...'
(main) lt_argv_zero : <TESTDIR>/29/.libs/m.exe
(main) newargz[0]   : <TESTDIR>/29/.libs/m.exe


P.S.: I think Z:\opt\mingw\{lib|bin} is fine to be before <TESTDIR>\29\sub\{lib|bin} as libtool is configured with LDFLAGS="-L/opt/mingw/lib" to find libz in one of tests(sys_lib_search_path).

Note it is my issue with GCC 3.4.5(cross) as libz is installed in PREFIX and if I install in PREFIX/TARGET the test sys_lib_search_path will work without LDFLAGS.
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index d8c5749..abbca17 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -2893,6 +2893,9 @@ EOF
            if test -n "$dllsearchpath"; then
+             if test -n "$LTTEST_DLLPATH"; then
+               dllsearchpath="$LTTEST_DLLPATH:$dllsearchpath"
+             fi
               func_to_host_pathlist "$dllsearchpath:"
              cat <<EOF
 const char * EXE_PATH_VARNAME = "PATH";
diff --git a/tests/shlibpath.at b/tests/shlibpath.at
index eea059b..9800f03 100644
--- a/tests/shlibpath.at
+++ b/tests/shlibpath.at
@@ -25,6 +25,14 @@
+LDFLAGS="$LDFLAGS -no-undefined"
+eval `$LIBTOOL --config | $EGREP 
+if test "$shlibpath_var" = PATH; then
+  LTTEST_DLLPATH=moved/bin
 mkdir sub sub/lib sub/bin
 echo 'int a () { return 0; }' > a.c
 echo 'extern int a (); int main () { return a(); }' > m.c
@@ -48,20 +56,18 @@ $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o liba.la a.lo 
-rpath `pwd`/sub/lib
 $LIBTOOL --mode=install cp liba.la `pwd`/sub/lib/liba.la
 $LIBTOOL --mode=clean rm -f liba.la
-eval `$LIBTOOL --config | $EGREP 
 # No point checking a system with static libraries:
+if test "$shlibpath_var" != PATH; then
 LT_AT_EXEC_CHECK([./m], [1], [ignore], [ignore], [|| exit 1 && exit 77])
-if test "$shlibpath_var" = PATH; then
-  addpath=`pwd`/moved/bin
+if test "$shlibpath_var" != PATH; then
+  sep=
+  eval test -n \"\$$shlibpath_var\" && sep=:
+  eval $shlibpath_var='$addpath$sep$'$shlibpath_var
+  export $shlibpath_var
-eval test -n \"\$$shlibpath_var\" && sep=:
-eval $shlibpath_var='$addpath$sep$'$shlibpath_var
-export $shlibpath_var
 if test "$shlibpath_overrides_runpath" != no; then
   LT_AT_EXEC_CHECK([./m], [0], [ignore], [ignore])

reply via email to

[Prev in Thread] Current Thread [Next in Thread]