Den 2009-01-24 14:06, skrev Ralf Wildenhues:
Hi Peter,
* Peter Rosin wrote on Sat, Jan 24, 2009 at 11:55:50AM CET:
When you open libfoo.la, the preloader assumes that the preloaded
library is named libfoo.$libext. I.e. it doesn't care about the
libname_spec variable. This patch fixes that and makes
lt_dladvise.at pass on MSYS/MSVC (and maybe on OS/2).
What if the system allows several kinds of prefixes?
Isn't that the case on some of the w32 setups (Cygwin?)?
Can you post the verbose failure you're getting without this?
I descided to only include the last bit, from the linking of the
libpreload.la module and forward, hope that's enough?
*snip*
../../tests/lt_dladvise.at:351: $LIBTOOL --mode=link $CC -module $CFLAGS
$LDFLAGS -o lib$name.la mod$name.lo $st -rpath /foo -avoid-version
stderr:
stdout:
libtool: link: lib -NOLOGO -OUT:.libs/preload.lib modpreload.obj
libtool: link: : .libs/preload.lib
libtool: link: ( cd ".libs" && rm -f "libpreload.la" && cp -p "../libpreload.la"
"libpreload.la" )
../../tests/lt_dladvise.at:365: $LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS -o
main$EXEEXT main.$OBJEXT $preloaded $modules $LIBLTDL
stderr:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9035 : option 'o' has been deprecated and will be
removed in a future release
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
cl : Command line warning D9035 : option 'o' has been deprecated and will be
removed in a future release
stdout:
libtool: link: rm -f .libs/main.exe.nm .libs/main.exe.nmS .libs/main.exe.nmT
libtool: link: (cd .libs &&
/c/cygwin/home/peda/libtool/git/libtool-msvc/libltdl/config/compile cl -MD -Zi -c
"main.exeS.c")
main.exeS.c
libtool: link: LINK="" /c/cygwin/home/peda/libtool/git/libtool-msvc/libltdl/config/compile cl -MD -Zi -o .libs/main.exe main.obj .libs/main.exeS.obj ./.libs/preload.lib
/c/cygwin/home/peda/libtool/git/libtool-msvc/msvc/libltdl/.libs/loadlibrary.lib /c/cygwin/home/peda/libtool/git/libtool-msvc/msvc/tests/../libltdl/.libs/ltdlc.lib
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
/debug
/out:.libs/main.exe
main.obj
.libs/main.exeS.obj
./.libs/preload.lib
c:/cygwin/home/peda/libtool/git/libtool-msvc/msvc/libltdl/.libs/loadlibrary.lib
c:/cygwin/home/peda/libtool/git/libtool-msvc/msvc/tests/../libltdl/.libs/ltdlc.lib
Creating library .libs/main.lib and object .libs/main.exp
libtool: link: lt_outputfile=".libs/main.exe"
libtool: link: case ".libs/main.exe" in *.[eE][xX][eE]) ;; *)
lt_outputfile=".libs/main.exe.exe" ;; esac
libtool: link: if test -e ".libs/main.exe.manifest"; then mt -manifest ".libs/main.exe.manifest"
-outputresource:".libs/main.exe" || exit 1; rm -f ".libs/main.exe.manifest"; fi
Microsoft (R) Manifest Tool version 5.2.3790.2075
Copyright (c) Microsoft Corporation 2005.
All rights reserved.
lt-main.c
Microsoft (R) Incremental Linker Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
/out:lt-main.exe
/debug
/out:./main.exe
lt-main.obj
../../tests/lt_dladvise.at:370: $LIBTOOL --mode=clean rm -f libpreload.la
stderr:
stdout:
libtool: clean: rm -f libpreload.la .libs/preload.lib .libs/libpreload.la
.libs/libpreload.lai
libtool: clean: rmdir .libs >/dev/null 2>&1
../../tests/lt_dladvise.at:372: if $LIBTOOL --mode=execute $modules "$lt_exe" ; then :; else lt_status=$?; test $lt_status != $modules && test "X$host" != "X$build" && test -x "$lt_exe" &&
exit 77; exit $lt_status; fi
--- /dev/null Sat Jan 24 20:04:07 2009
+++
/c/cygwin/home/peda/libtool/git/libtool-msvc/msvc/tests/testsuite.dir/at-groups/54/stderr
Sat Jan 24 20:04:07 2009
@@ -0,0 +1,3 @@
+can't open the module libpreload.la!
+error was: file not found
+/c/cygwin/home/peda/libtool/git/libtool-msvc/tests/testsuite: test: too many
arguments
--- expout Sat Jan 24 20:03:28 2009
+++
/c/cygwin/home/peda/libtool/git/libtool-msvc/msvc/tests/testsuite.dir/at-groups/54/stdout
Sat Jan 24 20:04:07 2009
@@ -2,4 +2,3 @@
local: 3
global: 4
depend: 5
-preload: 6
../../tests/lt_dladvise.at:372: exit code was 1, expected 0
54. lt_dladvise.at:28: 54. lt_dlopenadvise library loading (lt_dladvise.at:28):
FAILED (lt_dladvise.at:372)
(note, the line in stderr ending with "test: too many arguments" is from
the $2 vs $3 bug in LT_AT_NOINST_EXEC_CHECK, I haven't merged that bugfix
into this branch yet)
The thing I'm trying to fix is the problem causing the line
"+can't open the module libpreload.la!".
The best hint at what goes wrong is to look at the generated main.exeS.c
file, which has:
lt__PROGRAM__LTX_preloaded_symbols[] =
{ { "@PROGRAM@", (void *) 0 },
{"preload.lib", (void *) 0},
{"k", (void *) &k},
{"h", (void *) &h},
{0, (void *) 0}
};
Without the patch, ltdl - when asked for libpreload.la - looks for
the module named libpreload.$libext instead of the (IMHO) more
correct ${libprefix}preload.$libext. I suppose an alternative
solution could be to put something else in the ...S.c file (i.e.
"libpreload.lib" instead of "preload.lib").
I hope that explains what I'm trying to fix?
(BTW, to my knowledge, there is no testsuite option that prevents
the very interesting ...S.c file from being deleted, I have to hack
the libtool script to get at it...)
Cheers,
Peter