Bug #58477 Compilation problem on CentOS 5.5
Submitted: 25 Nov 2010 3:48 Modified: 20 Dec 2010 19:06
Reporter: Robert Gebis Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:5.5.7-rc OS:Linux (CentOS 5.5 x32)
Assigned to: CPU Architecture:Any
Tags: HAVE_DLOPEN dlopen comile error

[25 Nov 2010 3:48] Robert Gebis
Description:
After unpacking mysql-5.5.7-rc.tar.gz i executed configure script.

While compilation I got error in libmysql:

client_plugin.c:354: error: âRTLD_NOWâ undeclared (first use in this function)

I fixed it by defining HAVE_DLOPEN 1 in my_config.h

But then I am getting linking errors

client_plugin.c:(.text+0x361): undefined reference to `dlopen'
client_plugin.c:(.text+0x37d): undefined reference to `dlsym'
client_plugin.c:(.text+0x46f): undefined reference to `dlclose'

How to repeat:
build with 

" ./configure --prefix=/usr/local/mysql-5.5.7-rc CFLAGS="-O3 -m32 -march=core2 -mtune=core2 -fomit-frame-pointer -pipe -fno-exceptions" CXXFLAGS="-O3 -m32 -march=core2 -mtune=core2 -fomit-frame-pointer -pipe -fno-exceptions" --enable-assembler --disable-shared --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-plugins=innobase --without-debug CXX=gcc --with-comment="Build 5.6.7-rc x32"  --enable-thread-safe-client
[25 Nov 2010 4:11] Robert Gebis
Changing client/Makefile 
From
   LIBS = -lcrypt -lnsl -lm -lz
To
   LIBS = -lcrypt -lnsl -lm -lz -ldl

Fixed this problem
[25 Nov 2010 18:56] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior. Which version of gcc do you use?
[29 Nov 2010 17:54] Shailesh Tyagi
I got the same error on Debian 6.0 (squeeze) gcc (Debian 4.4.5-8) 4.4.5

client_plugin.c: In function âmysql_load_plugin_vâ:
client_plugin.c:354: error: âRTLD_NOWâ undeclared (first use in this function)
client_plugin.c:354: error: (Each undeclared identifier is reported only once
client_plugin.c:354: error: for each function it appears in.)
client_plugin.c:382: warning: assignment makes pointer from integer without a cast
make[2]: *** [client_plugin.lo] Error 1
make[2]: Leaving directory `/usr/local/src/mysql-5.5.7-rc/libmysql'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/mysql-5.5.7-rc/libmysql'
make: *** [all-recursive] Error 1
[29 Nov 2010 18:18] Robert Gebis
$uname -a
   2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:40 EST 2010 i686 i686 i386 GNU/Linux
$gcc --version
   gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
[16 Dec 2010 21:46] Sveta Smirnova
Thank you for the feedback.

Please try with current version 5.5.8 and inform us if problem still exists.
[20 Dec 2010 14:44] Robert Gebis
It builds fine now with cmake. Thank you
[20 Dec 2010 19:06] Sveta Smirnova
Thank you for the feedback.

Closed as "Can't repeat"