2009/2/17 Frederik Himpe <[email protected]>:
> On Tue, Feb 17, 2009 at 09:53:21AM +0100, Ludovic Rousseau wrote:
>> 2009/2/15 Frederik Himpe <[email protected]>:
>> > Mandriva uses the LDFLAGS --no-undefined --as-needed by default. Because
>> > of these flags, undefined references are reported when building ccid:
>> [...]
>> > /home/fhimpe/ccid/BUILD/ccid-1.3.9/src/commands.c:1637: undefined
>> > reference to `log_msg'
>> > [...]
>> >
>> > I need this patch to make these errors go away::
>> >
>> > http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/ccid/current/SOURCES/ccid-libtool_fixes.diff?revision=340650
>> >
>> > Could you review this patch and include if it's correct?
>>
>> The patch looks a good idea.
>> Do you have a documentation (URL) for the -module argument?
>> I could not find it in gcc(1) or ld(1) manpages.
>
> I think it's related to libtool and dlopened modules. There's an
> explanation here:
> http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html#Link-mode
I can reproduce the problem using --no-undefined
But I your solution does not solve the problem for me :-(
The "-module" argument is passed to libtool but then not passed to the
gcc for the link. I am not sure using "-module" is the correct
solution to the problem.
/bin/sh ../libtool --tag=CC --mode=link gcc -I/usr/include/PCSC
-pthread -fvisibility=hidden -DCCID_VERSION=`./convert_version.pl
1.3.9` -Wall -g -O2 -Wextra -pipe -funsigned-char -fstrict-aliasing
-Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings
-Wunused -Wno-unused-value -Wuninitialized -Wpointer-arith
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
-Wold-style-definition -Wmissing-declarations -Wbad-function-cast
-Winline -Wnested-externs -Wformat-security -Wswitch-enum -Winit-self
-Wmissing-include-dirs -Wno-unused-parameter -Wno-sign-compare
-D_REENTRANT -module -Wl,--no-undefined -Wl,--as-needed -o libccid.la
-rpath /usr/lib libccid_la-ccid.lo libccid_la-commands.lo
libccid_la-ifdhandler.lo libccid_la-utils.lo libccid_la-ccid_usb.lo
libccid_la-tokenparser.lo libccid_la-strlcpy.lo libccid_la-atr.lo
libccid_la-pps.lo libccid_la-buffer.lo libccid_la-checksum.lo
libccid_la-proto-t1.lo -lfl -lusb
libtool: link: gcc -shared .libs/libccid_la-ccid.o
.libs/libccid_la-commands.o .libs/libccid_la-ifdhandler.o
.libs/libccid_la-utils.o .libs/libccid_la-ccid_usb.o
.libs/libccid_la-tokenparser.o .libs/libccid_la-strlcpy.o
.libs/libccid_la-atr.o .libs/libccid_la-pps.o
.libs/libccid_la-buffer.o .libs/libccid_la-checksum.o
.libs/libccid_la-proto-t1.o -lfl /usr/lib/libusb.so -L/usr/lib
/usr/lib/libusb-1.0.so -lrt -pthread -Wl,--no-undefined
-Wl,--as-needed -pthread -Wl,-soname -Wl,libccid.so.0 -o
.libs/libccid.so.0.0.0
.libs/libccid_la-ccid.o: In function `ccid_error':
/home/lroussea/sc/costa/pcsclite/trunk/Drivers/ccid/src/ccid.c:453:
undefined reference to `log_msg'
.libs/libccid_la-ccid.o: In function `ccid_open_hack':
/home/lroussea/sc/costa/pcsclite/trunk/Drivers/ccid/src/ccid.c:228:
undefined reference to `log_msg'
And your patch makes the compilation/link fail on Mac OS X:
/bin/sh ../libtool --tag=CC --mode=link gcc -I/tmp/ccid-1.3.9/MacOSX
-I/usr/local/include -Wall -g -O2 -Wextra -pipe -funsigned-char
-fstrict-aliasing -Wchar-subscripts -Wundef -Wshadow -Wcast-align
-Wwrite-strings -Wunused -Wno-unused-value -Wuninitialized
-Wpointer-arith -Wredundant-decls -Wmissing-prototypes
-Wstrict-prototypes -Wold-style-definition -Wmissing-declarations
-Wbad-function-cast -Winline -Wnested-externs -Wformat-security
-Wswitch-enum -Winit-self -Wmissing-include-dirs -Wno-unused-parameter
-Wno-sign-compare -DRESPONSECODE_DEFINED_IN_WINTYPES_H -isysroot
/Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc -arch i386 -arch
ppc -o parse parse-parse.o parse-debug.o libccid.la -L/usr/local/lib
-lusb
*** Warning: Linking the executable parse against the loadable module
*** libccid.so is not portable!
libtool: link: gcc -I/tmp/ccid-1.3.9/MacOSX -I/usr/local/include -Wall
-g -O2 -Wextra -pipe -funsigned-char -fstrict-aliasing
-Wchar-subscripts -Wundef -Wshadow -Wcast-align -Wwrite-strings
-Wunused -Wno-unused-value -Wuninitialized -Wpointer-arith
-Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes
-Wold-style-definition -Wmissing-declarations -Wbad-function-cast
-Winline -Wnested-externs -Wformat-security -Wswitch-enum -Winit-self
-Wmissing-include-dirs -Wno-unused-parameter -Wno-sign-compare
-DRESPONSECODE_DEFINED_IN_WINTYPES_H -isysroot
/Developer/SDKs/MacOSX10.5.sdk -arch i386 -arch ppc -arch i386 -arch
ppc -o .libs/parse parse-parse.o parse-debug.o ./.libs/libccid.so
-L/usr/local/lib -lfl /usr/local/lib/libusb-0.1.4.4.5.dylib
ld: warning in ./.libs/libccid.so, file is not of required architecture
Undefined symbols for architecture i386:
"_get_ccid_usb_interface", referenced from:
_main in parse-parse.o
_main in parse-parse.o
_main in parse-parse.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
ld: warning in ./.libs/libccid.so, file is not of required architecture
Undefined symbols for architecture ppc:
"_get_ccid_usb_interface", referenced from:
_main in parse-parse.o
_main in parse-parse.o
ld: symbol(s) not found for architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file:
/var/folders/Pb/PbgY+BJ9Foiqz4urTUb1+E+++TI/-Tmp-//ccXYBqlp.out (No
such file or directory)
make[2]: *** [parse] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
So I can't just apply your patch.
I am afraid Mandriva will have to provide its own patch to build
libccid. At least until I find a solution that works under Linux and
Mac OS X.
Bye
--
Dr. Ludovic Rousseau
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle