* ulogd compile problems @ 2009-09-06 3:31 Jason Frisvold 2009-09-08 16:08 ` Jason Frisvold 0 siblings, 1 reply; 5+ messages in thread From: Jason Frisvold @ 2009-09-06 3:31 UTC (permalink / raw) To: netfilter I'm having a problem compiling ulogd 1.24. I believe I have all of the appropriate development libraries installed, but I'm receiving the error below. This is a CentOS 5.3 system with MySQL 5.0.67 installed. Can someone please shed some light on how to resolve this? make[1]: Entering directory `/home/friz/ulogd-1.24/mysql' gcc -I-I/usr/include/mysql -DOLD_MYSQL=1 -g -O2 -Wall - DULOGD_CONFIGFILE=\"/usr/local/etc/ulogd.conf\" -I/lib/modules/`uname - r`/build/include -I.. -I../libipulog/include -I../include -fPIC -o ulogd_MYSQL_sh.o -c ulogd_MYSQL.c ld -shared -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl - lm -o ulogd_MYSQL.so ulogd_MYSQL_sh.o -lc ld: bad -rpath option make[1]: *** [ulogd_MYSQL.so] Error 1 make[1]: Leaving directory `/home/friz/ulogd-1.24/mysql' make: *** [recurse] Error 1 Thanks, -- Jason 'XenoPhage' Frisvold XenoPhage0@gmail.com http://blog.godshell.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ulogd compile problems 2009-09-06 3:31 ulogd compile problems Jason Frisvold @ 2009-09-08 16:08 ` Jason Frisvold 2009-09-08 16:25 ` Michele Petrazzo - Unipex 0 siblings, 1 reply; 5+ messages in thread From: Jason Frisvold @ 2009-09-08 16:08 UTC (permalink / raw) To: netfilter On Sep 5, 2009, at 11:31 PM, Jason Frisvold wrote: > I'm having a problem compiling ulogd 1.24. I believe I have all of > the appropriate development libraries installed, but I'm receiving > the error below. This is a CentOS 5.3 system with MySQL 5.0.67 > installed. Can someone please shed some light on how to resolve this? Is this not the proper list to ask such questions? If so, can someone please direct me to a more appropriate place? -- Jason 'XenoPhage' Frisvold XenoPhage0@gmail.com http://blog.godshell.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ulogd compile problems 2009-09-08 16:08 ` Jason Frisvold @ 2009-09-08 16:25 ` Michele Petrazzo - Unipex 2009-09-08 21:13 ` Jason Frisvold 0 siblings, 1 reply; 5+ messages in thread From: Michele Petrazzo - Unipex @ 2009-09-08 16:25 UTC (permalink / raw) To: Jason Frisvold; +Cc: netfilter Jason Frisvold wrote: > On Sep 5, 2009, at 11:31 PM, Jason Frisvold wrote: >> I'm having a problem compiling ulogd 1.24. I believe I have all of >> the appropriate development libraries installed, but I'm receiving >> the error below. This is a CentOS 5.3 system with MySQL 5.0.67 >> installed. Can someone please shed some light on how to resolve >> this? > > Is this not the proper list to ask such questions? If so, can > someone please direct me to a more appropriate place? > I think that it's the right one, but the developers can be busy sometime... However, "ld: bad -rpath option " can be only a linker option so trying to googleing a bit, I found this: http://tinyurl.com/nqewau Modify the Makefile with that options and, if it work, try to submit a patch to the devels. Michele ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ulogd compile problems 2009-09-08 16:25 ` Michele Petrazzo - Unipex @ 2009-09-08 21:13 ` Jason Frisvold 2009-09-11 2:57 ` Jason Frisvold 0 siblings, 1 reply; 5+ messages in thread From: Jason Frisvold @ 2009-09-08 21:13 UTC (permalink / raw) To: Michele Petrazzo - Unipex; +Cc: netfilter On 09/08/2009 12:25 PM, Michele Petrazzo - Unipex wrote: > I think that it's the right one, but the developers can be busy sometime... Understood. I didn't see any comments on it, so I figured I'd ask. > However, "ld: bad -rpath option " can be only a linker option so trying > to googleing a bit, I found this: http://tinyurl.com/nqewau > Modify the Makefile with that options and, if it work, try to submit a > patch to the devels. I did modify the makefile and change the -rdynamic flag to -rpath. I compiled and it seems to run now, though I need to test more. I'm a bit confused, though, because mysql_config defined -rdynamic, which I'm inclined to believe. Also, configure seems to be "broken" when it comes to mysql anyway because of this : checking for mysql_real_escape_string support... strings: invalid option -- r Usage: strings [option(s)] [file(s)] Display printable strings in [file(s)] (stdin by default) The options are: -a - --all Scan the entire file, not just the data section -f --print-file-name Print the name of the file before each string -n --bytes=[number] Locate & print any NUL-terminated sequence of at -<number> least [number] characters (default 4). -t --radix={o,d,x} Print the location of the string in base 8, 10 or 16 -o An alias for --radix=o -T --target=<BFDNAME> Specify the binary file format -e --encoding={s,S,b,l,B,L} Select character size and endianness: s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit @<file> Read options from <file> -h --help Display this information -v --version Print the program's version number strings: supported targets: elf32-i386 a.out-i386-linux efi-app-ia32 elf32-little elf32-big srec symbolsrec tekhex binary ihex trad-core The source of this problem is line 1750 of configure : MYSQL_FUNCTION_TEST=`strings ${MYSQLLIBS}/libmysqlclient.so | grep mysql_real_escape_string` This would work, if MYSQLLIBS wasn't defined above as : MYSQLLIBS=`$d/mysql_config --libs` I'm not sure why they would try to use MYSQLLIBS as a path in the function test as mysql_config --libs returns something similar to this: [user@example ulogd-1.24]$ /usr/bin/mysql_config --libs -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm And there's that pesky -rdynamic, too. I wonder, perhaps, if it should be -Bdynamic instead.. that would make more sense to me.. Actually, the -rdynamic is ok for GCC, but not LD ... So perhaps the Makefile is wrong? Or outdated? > Michele -- --------------------------- Jason Frisvold xenophage0@gmail.com --------------------------- "I love deadlines. I like the whooshing sound they make as they fly by." - Douglas Adams ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ulogd compile problems 2009-09-08 21:13 ` Jason Frisvold @ 2009-09-11 2:57 ` Jason Frisvold 0 siblings, 0 replies; 5+ messages in thread From: Jason Frisvold @ 2009-09-11 2:57 UTC (permalink / raw) To: Jason Frisvold; +Cc: Michele Petrazzo - Unipex, netfilter On Sep 8, 2009, at 5:13 PM, Jason Frisvold wrote: > I did modify the makefile and change the -rdynamic flag to -rpath. I > compiled and it seems to run now, though I need to test more. Ok, so a final update to explain what I did to get this to work. If the developers can come up with a patch, then awesome. If not, then I've included the patch to configure that I used to make this work. To start, I'm running this on a CentOS 5.3 system with MySQL 5.0.67 installed via RPMs. I'm using the rhel5 RPMS. If we run mysql_config --libs, we get the following output : [user@example SPECS]$ /usr/bin/mysql_config --libs -rdynamic -L/usr/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm There are two problems with this. First, -rdynamic is not a linker flag and just ends with an error. I believe this can be changed to - Bdynamic, which is a linker flag, or it can be deleted. I chose the latter. The second problem won't show itself until you try to start ulogd with the MySQL extension configured. When you try to start ulogd, you get this : Starting ulogd: Thu Sep 10 22:35:20 2009 <7> ulogd.c:462 load_plugins: '/usr/lib/ulogd/ulogd_MYSQL.so': /usr/lib/ulogd/ulogd_MYSQL.so: undefined symbol: mysql_fetch_field The problem here is that libmysqlclient exists in /usr/lib, not /usr/ lib/mysql. So, we need to add -L/usr/lib to the linker options. Adding this allows the extension to properly build, linking it with the proper libraries. Also included in the patch below is a fix for the mysql_real_escape_string check. I'm not sure what the exact aim is here, but I do know that the original method for checking failed miserably. My fix uses "locate," though, which I don't believe is portable. If someone has a better patch, please let me know. I'd love to fix this the correct way, but I'm not that familiar with linker and compiler flags. --- ./configure 2006-01-25 06:15:22.000000000 -0500 +++ ./configure 2009-09-10 22:37:24.000000000 -0400 @@ -1728,11 +1728,11 @@ EOF MYSQLINCLUDES=`$d/mysql_config --include` - MYSQLLIBS=`$d/mysql_config --libs` + MYSQLLIBS=`$d/mysql_config --libs | sed s/-rdynamic//` DATABASE_DIR="${DATABASE_DIR} mysql" - MYSQL_LIB="${DATABASE_LIB} ${MYSQLLIBS} " + MYSQL_LIB="${DATABASE_LIB} -L/usr/lib ${MYSQLLIBS}" # no change to DATABASE_LIB_DIR, since --libs already includes -L DATABASE_DRIVERS="${DATABASE_DRIVERS} ../mysql/mysql_driver.o " @@ -1747,7 +1747,8 @@ echo $ac_n "checking for mysql_real_escape_string support""... $ac_c" 1>&6 echo "configure:1749: checking for mysql_real_escape_string support" >&5 - MYSQL_FUNCTION_TEST=`strings ${MYSQLLIBS}/libmysqlclient.so | grep mysql_real_escape_string` + LIBMYSQLCLIENT=`locate libmysqlclient.so | grep libmysqlclient.so$` + MYSQL_FUNCTION_TEST=`strings $LIBMYSQLCLIENT | grep mysql_real_escape_string` if test "x$MYSQL_FUNCTION_TEST" = x then Thanks! -- Jason 'XenoPhage' Frisvold XenoPhage0@gmail.com http://blog.godshell.com ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-09-11 2:57 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-09-06 3:31 ulogd compile problems Jason Frisvold 2009-09-08 16:08 ` Jason Frisvold 2009-09-08 16:25 ` Michele Petrazzo - Unipex 2009-09-08 21:13 ` Jason Frisvold 2009-09-11 2:57 ` Jason Frisvold
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.