Building FreeRADIUS on Debian and the RTDL_GLOBAL issue.

Chris Moules chris at
Wed Sep 24 16:50:59 CEST 2008

Hi All,

I have been reading lots into this, and related libltdl issues on Debian, and trying to solve this myself. The problem is that I
am not a great developer / debugger, just a Sys Admin.

I know that there is 'issues' with FreeRADIUS (and other software) on Debian. However I need a working system with a number of
features (SQL, SQL IP Pool and Perl). I am willing to forgo some niceties to have a working system, but I want this to be contained.

I was reading through the thread "RTLD_GLOBAL and sql_ippool" from the list. I understand the issues at hand and that there is
no 'current' solution to this issue. There are some work-arounds however. I opted to try and build the FreeRADIUS package with
it's own libltdl library and install this as a package local library. This is, in my view, the cleanest current solution.

I have modified the debian/rules file:
+++ debian/rules        2008-09-24 14:21:49.000000000 +0200
@@ -68,7 +68,7 @@
                 --localstatedir=/var \
                 --with-raddbdir=$(raddbdir) \
                 --with-logdir=/var/log/$(package) \
-               --with-system-libtool --disable-ltdl-install \
+               --with-included-ltdl --enable-ltdl-install \
                 --with-large-files --with-udpfromto --with-edir \
                 --enable-developer \
                 --with-rlm-sql-postgresql-lib-dir=`pg_config --libdir` \

This makes the build system build and (try to) install a local libltdl. The local version has the RTDL_GLOBAL in the dlopen() call.

My problem is that the build system still links all the libraries to the system in /usr/lib/ and not to the 'new'
version in /usr/lib/freeradius

For testing, I modified the sym-link /usr/lib/ (the debian linked library) to point to the new version. Doing this,
FreeRADIUS would run. It is not, however, the contained solution that I wanted.

I am unsure how to tell the build system to use this new library. I have done some small experiments, with no success.

Here is a small extract from the build log, regarding the rlm_sql module:

gcc -Wall -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -Wall -D_GNU_SOURCE -g -Wshadow -Wpointer-arith -Wcast-qual
-Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W
-Wredundant-decls -Wundef -I/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/src
-I/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/libltdl -I/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/libltdl
-I/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/src/modules/rlm_sql -c rlm_sql.c  -fPIC -DPIC -o .libs/rlm_sql.o


libtool: install: warning: relinking `'
(cd /home/src/FreeRADIUS/testing/freeradius-server-2.1.0/src/modules/rlm_sql; /bin/sh
/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/libtool  --mode=relink gcc -release 2.1.0 -module -export-dynamic -o -rpath /usr/lib/freeradius rlm_sql.lo sql.lo rlm_sql.c sql.c
/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/libltdl/ -lnsl -lresolv -lpthread -inst-prefix-dir
gcc -shared  .libs/rlm_sql.o .libs/sql.o  -Wl,--rpath -Wl,/usr/lib/freeradius
-L/home/src/FreeRADIUS/testing/freeradius-server-2.1.0/debian/tmp/usr/lib/freeradius -L/usr/lib/freeradius -lfreeradius-radius
-lltdl -lnsl -lresolv -lpthread  -Wl,-soname -Wl, -o .libs/


Here I see that in the "libtool" line, "-L/usr/lib/freeradius" is set before the "-lltdl", as is "-Wl,--rpath

Still the outcome is:

ldd /usr/lib/freeradius/ =>  (0xffffe000) => /usr/lib/freeradius/ (0xb7fcf000) => /usr/lib/ (0xb7fbf000) => /lib/tls/i686/cmov/ (0xb7fa9000) => /lib/tls/i686/cmov/ (0xb7f95000) => /lib/tls/i686/cmov/ (0xb7f83000) => /lib/tls/i686/cmov/ (0xb7e52000)
         /lib/ (0x80000000) => /lib/tls/i686/cmov/ (0xb7e4e000)


Can anyone tell me how I can get this to build against the included libltdl?
If so, this could be worthy of a patch to the debian system for people who need this to work before the whole this is "fixed
properly" in the words of Alan DeKok ;)



More information about the Freeradius-Devel mailing list