Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Debian Squeeze 64-bit, dlopen() missing?

112 views
Skip to first unread message

Johan Karlsson

unread,
Feb 10, 2011, 11:30:03 AM2/10/11
to
Hi!

I'm trying to compile pmacct from source under Debian Squeeze 64-bit, but it can't seem to find dlopen(). The very same thing works without problems on Debian Squeeze 32-bit.

If I run "nm /usr/lib/libdl.a", I get this output (looks fine to me):

dlopen.o:
U __dlopen
0000000000000000 n __evoke_link_warning_dlopen
0000000000000000 T dlopen

I don't want to disable shared objects (ie don't suggest the -disable-so flag ;))

This also happens with the debian-patched source (apt-get source pmacct) by the way.

---
/usr/local/src/pmacct-0.12.5# ./configure --enable-mysql --with-mysql-libs=/usr/lib --enable-64bit

loading cache ./config.cache
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... (cached) yes
checking for working aclocal-1.4... missing
checking for working autoconf... missing
checking for working automake-1.4... missing
checking for working autoheader... missing
checking for working makeinfo... found
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking OS... Linux
checking hardware... x86_64
checking for ranlib... (cached) ranlib
checking whether to enable debugging compiler options... no
checking whether to relax compiler optimizations... no
checking for gmake... (cached) make
checking whether make sets ${MAKE}... (cached) yes
checking for __progname... yes
checking for extra flags needed to export symbols... --export-dynamic
checking for static inline... yes
checking endianess... little
checking unaligned accesses... ok
checking whether to disable L2 features... no
checking whether to enable IPv6 code... no
checking default locations for pcap.h... found in /usr/local/include
checking default locations for libpcap... found in /usr/local/lib
checking for PF_RING library... yes
checking packet capture type... linux
checking whether to enable MySQL support... checking how to run the C preprocessor... (cached) gcc -E
yes
checking your own MySQL client library... ok
checking default locations for mysql.h... found in /usr/include/mysql
checking whether to enable PostgreSQL support... no
checking whether to enable SQLite3 support... no
checking whether to disable shared objects... no
checking for dlopen... no
checking for dlopen in -ldl... no
configure: error: Unable to find dlopen(). Try with --disable-so
---

Any suggestions?

Regards,

Johan


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/B08F3F3D67451844A7A8A...@WIN01.ad.deltamanagement.se

Johan Karlsson

unread,
Feb 16, 2011, 5:30:03 AM2/16/11
to
C'mon, anyone? :)

Maybe this is the wrong list for these kinds of problems?

Regards,

Johan

Roger Leigh

unread,
Feb 16, 2011, 6:00:02 AM2/16/11
to
On Wed, Feb 16, 2011 at 11:23:51AM +0100, Johan Karlsson wrote:
> I'm trying to compile pmacct from source under Debian Squeeze 64-bit, but it can't seem to find dlopen(). The very same thing works without problems on Debian Squeeze 32-bit.
> /usr/local/src/pmacct-0.12.5# ./configure --enable-mysql --with-mysql-libs=/usr/lib --enable-64bit

Check exactly what it did in config.log.

Note that the --enable-64bit might be what's causing you problems;
if you're on a 64 bit system already, it might be making it look
for libraries in odd locations or with 64 suffixes or something odd.
The log will show you what it tried to do and failed.


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.

signature.asc

Johan Karlsson

unread,
Feb 16, 2011, 7:50:02 AM2/16/11
to
Hi!

The --enable-64bit flag is just to enable 64bit counters in pmacct, and I get the same error without it.

I've also tried using LDFLAGS to point out every single lib-directory on the server when running configure ;)

Here's the the info from config.log when things start to go bad (the undefined reference to "pfring_enable_hw_timestamp" I guess is because it failed to find dlopen and load shared libs):

---
configure:2701: checking whether to disable shared objects
configure:2806: checking for dlopen
configure:2834: gcc -o conftest -O2 -Wl,--export-dynamic conftest.c -L/usr/local/lib -lpcap -lpfring -L/usr/lib -lmysqlclient 1>&5
/tmp/ccmfOILI.o: In function `main':
conftest.c:(.text+0x7): undefined reference to `dlopen'
/usr/local/lib/libpfring.so: undefined reference to `pfring_enable_hw_timestamp'
collect2: ld returned 1 exit status
configure: failed program was:
#line 2811 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dlopen();

int main() {

/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_dlopen) || defined (__stub___dlopen)
choke me
#else
dlopen();
#endif

; return 0; }
configure:2855: checking for dlopen in -ldl
configure:2874: gcc -o conftest -O2 -Wl,--export-dynamic conftest.c -ldl -L/usr/local/lib -lpcap -lpfring -L/usr/lib -lmysqlclient 1>&5
/usr/local/lib/libpfring.so: undefined reference to `pfring_enable_hw_timestamp'
collect2: ld returned 1 exit status
configure: failed program was:
#line 2863 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char dlopen();

int main() {
dlopen()
; return 0; }
---

Regards,

Johan


Regards,
Roger

Roger Leigh

unread,
Feb 16, 2011, 9:00:01 AM2/16/11
to
On Wed, Feb 16, 2011 at 12:43:19PM +0100, Johan Karlsson wrote:
> Hi!
>
> The --enable-64bit flag is just to enable 64bit counters in pmacct, and I get the same error without it.
>
> I've also tried using LDFLAGS to point out every single lib-directory on the server when running configure ;)
>
> Here's the the info from config.log when things start to go bad (the undefined reference to "pfring_enable_hw_timestamp" I guess is because it failed to find dlopen and load shared libs):
>
> ---
> configure:2701: checking whether to disable shared objects
> configure:2806: checking for dlopen
> configure:2834: gcc -o conftest -O2 -Wl,--export-dynamic conftest.c -L/usr/local/lib -lpcap -lpfring -L/usr/lib -lmysqlclient 1>&5
> /tmp/ccmfOILI.o: In function `main':
> conftest.c:(.text+0x7): undefined reference to `dlopen'

I think the answer is fairly straightforward: the above link line
does not include "-ldl" so libdl is not linked in, and the
reference is indeed undefined.

This may have worked previously with indirect linkage (i.e.
one of the other libraries linked to libdl either directly
or indirectly). Either way, it's the configure test that's
broken, not your system!

This is how I check for dlopen:
AC_CHECK_LIB(dl, dlopen, [DLOPEN_LIBS="-ldl"])

signature.asc

Johan Karlsson

unread,
Feb 16, 2011, 10:00:02 AM2/16/11
to
Hi!

First it checks for dlopen (indirectly), but check later down in my config.log paste:

configure:2855: checking for dlopen in -ldl

configure:2874: gcc -o conftest -O2 -Wl,--export-dynamic conftest.c -ldl -L/usr/local/lib -lpcap -lpfring -L/usr/lib -lmysqlclient 1>&5

So the configure script indeed tries with "-ldl"

The output regarding dlopen of the configure on Debian Squeeze 64-bit is:

checking for dlopen... no
checking for dlopen in -ldl... no
configure: error: Unable to find dlopen(). Try with --disable-so

While on Debian Squeeze 32-bit, it finds it in -ldl:

checking for dlopen... no
checking for dlopen in -ldl... yes

So something else must be the cause

Regards,

Johan

-----Original Message-----
From: Roger Leigh [mailto:rle...@codelibre.net]
Sent: den 16 februari 2011 14:51
To: Johan Karlsson
Cc: debia...@lists.debian.org
Subject: Re: Debian Squeeze 64-bit, dlopen() missing?


Regards,
Roger

Roger Leigh

unread,
Feb 16, 2011, 10:30:02 AM2/16/11
to
On Wed, Feb 16, 2011 at 03:51:10PM +0100, Johan Karlsson wrote:

[Please don't top post, it really makes it hard to read.]

> First it checks for dlopen (indirectly), but check later down in my config.log paste:
>
> configure:2855: checking for dlopen in -ldl
> configure:2874: gcc -o conftest -O2 -Wl,--export-dynamic conftest.c -ldl -L/usr/local/lib -lpcap -lpfring -L/usr/lib -lmysqlclient 1>&5
>
> So the configure script indeed tries with "-ldl"

OK, but it does fail. What does config.log tell you at this point about
the failure reason? Note that the configure test is still broken; it's
linking with many unnecessary libraries, and it should only link with
libdl to check for the presence of dlopen. A problem with one of the
other libs could result in a test failure.

signature.asc

Johan Karlsson

unread,
Feb 17, 2011, 8:10:01 AM2/17/11
to
> OK, but it does fail. What does config.log tell you at this point about the
> failure reason? Note that the configure test is still broken; it's linking with
> many unnecessary libraries, and it should only link with libdl to check for the
> presence of dlopen. A problem with one of the other libs could result in a
> test failure.

Hi,

I've sorted this out now. The configure test of pmacct is obviously a bit.. odd. It seems the problem was never that it couldn't find dlopen(). Look at this part of the full config.log I pasted earlier:

configure:2874: gcc -o conftest -O2 -Wl,--export-dynamic conftest.c -ldl -L/usr/local/lib -lpcap -lpfring -L/usr/lib -lmysqlclient 1>&5

/usr/local/lib/libpfring.so: undefined reference to `pfring_enable_hw_timestamp'
collect2: ld returned 1 exit status

The problem lies with the libpfring.so library. I "cheated" the configure script by installing the normal libpcap & libpcap-dev packages (without pfring support) an ran a configure.. which worked fine. I then switched back to the pfring libpcap and ran a configure, which then "found" dlopen in -ldl (but cached from the previous configure). However the make failed on "undefined reference to `pfring_enable_hw_timestamp'" anyway.

I went back to my 32-bit test server (where everything works), and noticed that I had checked out a later SVN of PF_RING on the 64-bit box. So there had been an update during the hour between my tests on the 32-bit and the 64-bit squeeze. A bit embarrassing, heh. Needless to say, the newer SVN version doesn't work on 32-bit either.

PF_RING isn't stable and the source is only available via SVN (afaik).

I'll take this up with the PF_RING devs instead :)

Thanks for your time though!

Regards,

Johan

0 new messages