Bug #2784 libmysqld 4.1.1-alpha doesn't work on MacOS X because of linker error
Description:
Trying to link a program with libmysqld on MacOS 10.3, I get this error:
ld: warning multiple definitions of symbol _qsort
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libmysys_mf_qsort.o) definition of _qsort
in section (__TEXT\
,__text)
/usr/lib/libSystem.dylib(qsort.So) definition of _qsort
ld: warning multiple definitions of symbol _regcomp
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regcomp.o) definition of
_regcomp in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regexec.o) definition of _regexec
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regfree.o) definition of _regfree
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
So it looks like the library is being called out of libmysqld.a and is conflicting with what's in the system
libSystem.dylib. This is probably a MacOS-related bug, and I'll be filing a linker error with Apple's
bugreporter, too. Next I'll specifically remove these modules from the MacOS libmysqld.a and see if the
errors go away.
How to repeat:
"dm" is any test program.
make -k dm
g++-3.3 -o dm dm.o ../lib/libstream.a /Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a
-L../lib -lstream -lss\
l -lcrypto
ld: warning multiple definitions of symbol _qsort
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libmysys_mf_qsort.o) definition of _qsort
in section (__TEXT\
,__text)
/usr/lib/libSystem.dylib(qsort.So) definition of _qsort
ld: warning multiple definitions of symbol _regcomp
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regcomp.o) definition of
_regcomp in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regcomp.So) definition of _regcomp
ld: warning multiple definitions of symbol _regexec
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regexec.o) definition of _regexec
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regexec.So) definition of _regexec
ld: warning multiple definitions of symbol _regfree
/Users/simsong/mysql-4.1.1-alpha//libmysqld/libmysqld.a(libregex_regfree.o) definition of _regfree
in section (__TEX\
T,__text)
/usr/lib/libSystem.dylib(regfree.So) definition of _regfree
ld: Undefined symbols:
_compress
_uncompress
_crc32
make: *** [dm] Error 1
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.061 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.