ports/80883: Freeradius port doesn't build if already installed

Andrey V. Semyonov wilfre at tcom.ru
Wed May 11 09:40:02 UTC 2005


>Number:         80883
>Category:       ports
>Synopsis:       Freeradius port doesn't build if already installed
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 11 09:40:02 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Andrey V. Semyonov
>Release:        5.3-RELEASE
>Organization:
Tower-Telecom
>Environment:
FreeBSD valhalla.starnet 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Wed Apr 20 15:26:00 MSD 2005     root at valhalla.starnet:/usr/obj/usr/src/sys/VALHALLA  i386

>Description:
/usr/ports/net/freeradius (port version 1.0.2_1) doesn't build if libradius is already installed on the system.

The linker exits with an error while compiling 'radwho' module:
Making all in main...
gmake[4]: Entering directory `/usr/ports/net/freeradius/work/freeradius-1.0.2/src/main'
/usr/ports/net/freeradius/work/freeradius-1.0.2/libtool --mode=link cc -export-dynamic -dlopen self \
	 -O -pipe  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DOPENSSL_NO_KRB5   -Wall -D_GNU_SOURCE -DNDEBUG -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I../include  -DHOSTINFO=\"\" -DRADIUSD_VERSION=\"1.0.2\"   -rpath=/usr/local/lib -L/usr/local/lib  -L../lib -o radiusd \
	radiusd.o files.o util.o acct.o nas.o log.o valuepair.o version.o proxy.o exec.o auth.o timestr.o conffile.o modules.o modcall.o session.o xlat.o threads.o smux.o radius_snmp.o client.o request_list.o mainconfig.o -lcrypt  -lpthread -lcrypto -lssl  -lradius  \
	 -lltdl -lcrypt
rm -f .libs/radiusd.nm .libs/radiusd.nmS .libs/radiusd.nmT
creating .libs/radiusdS.c
(cd .libs && cc -c -fno-builtin -fno-rtti -fno-exceptions "radiusdS.c")
cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
rm -f .libs/radiusdS.c .libs/radiusd.nm .libs/radiusd.nmS .libs/radiusd.nmT
cc .libs/radiusdS.o -O -pipe -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DOPENSSL_NO_KRB5 -Wall -D_GNU_SOURCE -DNDEBUG -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I../include -DHOSTINFO=\"\" -DRADIUSD_VERSION=\"1.0.2\" -rpath=/usr/local/lib -o radiusd radiusd.o files.o util.o acct.o nas.o log.o valuepair.o version.o proxy.o exec.o auth.o timestr.o conffile.o modules.o modcall.o session.o xlat.o threads.o smux.o radius_snmp.o client.o request_list.o mainconfig.o -Wl,--export-dynamic  -L/usr/local/lib -L/usr/ports/net/freeradius/work/freeradius-1.0.2/src/lib -lcrypt -lpthread -lcrypto -lssl /usr/local/lib/libradius.so /usr/local/lib/libltdl.so -lcrypt -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath -Wl,/usr/local/lib
rm -f .libs/radiusdS.o
cc -rpath=/usr/local/lib -L/usr/local/lib  -L../lib -o radwho radwho.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o -lpthread -lcrypto -lssl  -lradius 
/usr/local/lib/libradius.so: undefined reference to `crypt'
gmake[4]: *** [radwho] Error 1
gmake[4]: Leaving directory `/usr/ports/net/freeradius/work/freeradius-1.0.2/src/main'
gmake[3]: *** [common] Error 1
gmake[3]: Leaving directory `/usr/ports/net/freeradius/work/freeradius-1.0.2/src'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/usr/ports/net/freeradius/work/freeradius-1.0.2/src'
gmake[1]: *** [common] Error 1
gmake[1]: Leaving directory `/usr/ports/net/freeradius/work/freeradius-1.0.2'
gmake: *** [all] Error 2
*** Error code 2

Stop in /usr/ports/net/freeradius.

so it seems like freeradius-port conflicts with itself.

After '#make deinstall' the problem didn't appear.

And, for one-time build-and-install the port behaves well. For furter compiling (i.e. making a package for fast-installation of a second-third-... server while the main has already the port installed) the port doesn't compile.
>How-To-Repeat:
#cd /usr/ports/net/freeradius
#make install clean
#make build

This will repeat the problem.
>Fix:
As it seems to me, the linker-library path in
'cc -rpath=/usr/local/lib -L/usr/local/lib  -L../lib -o radwho radwho.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o -lpthread -lcrypto -lssl  -lradius'
should be corrected - instead of '-L/usr/local/lib -L../lib' it should be reversed to '-L../lib -L/usr/local/lib' so the linker first checks for 'libradius' in src/main/../lib (which compiles earlier) and so for all the objects, referenced by that library (which also compile into src/main/../lib).

A sample patch, which works fine for me:

--- src/main/Makefile.in.orig	Wed Jun  2 20:17:06 2004
+++ src/main/Makefile.in	Wed May 11 13:18:27 2005
@@ -14,7 +14,7 @@
 CFLAGS		+= -DHOSTINFO=\"${HOSTINFO}\"
 CFLAGS          += -DRADIUSD_VERSION=\"${RADIUSD_VERSION}\"
 CFLAGS          += $(SNMP_INCLUDE) 
-LDFLAGS		+= -L../lib
+LDFLAGS_MAIN	= -L../lib $(LDFLAGS)
 MODULE_LIBS	= $(STATIC_MODULES)
 MODULE_OBJS	=
 VFLAGS		= -DRADIUSD_MAJOR_VERSION=$(RADIUSD_MAJOR_VERSION)
@@ -52,7 +52,7 @@
 
 radiusd: $(SERVER_OBJS) ../lib/libradius.a $(MODULE_OBJS)
 	$(LIBTOOL) --mode=link $(CC) -export-dynamic -dlopen self \
-		$(CFLAGS) $(LDFLAGS) -o $@ \
+		$(CFLAGS) $(LDFLAGS_MAIN) -o $@ \
 		$(SERVER_OBJS) $(LCRYPT) $(MODULE_LIBS) $(LIBS) \
 		$(PTHREADLIB) $(LIBLTDL) $(LCRYPT)
 
@@ -123,13 +123,13 @@
 	$(CC) $(CFLAGS) -o radius_snmp.o -c radius_snmp.c
 
 radclient: radclient.o ../lib/libradius.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o radclient radclient.o $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS_MAIN) -o radclient radclient.o $(LIBS)
 
 radclient.o: radclient.c $(INCLUDES)
 	$(CC) $(CFLAGS) -c radclient.c
 
 radrelay: radrelay.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o ../lib/libradius.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o radrelay radrelay.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS_MAIN) -o radrelay radrelay.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o $(LIBS)
 
 radrelay.o: radrelay.c $(INCLUDES)
 	$(CC) $(CFLAGS) -c radrelay.c
@@ -138,13 +138,13 @@
 	$(CC) $(CFLAGS) -c radwho.c
 
 radwho: radwho.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o
-	$(CC) $(LDFLAGS) -o radwho radwho.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o $(LIBS)
+	$(CC) $(LDFLAGS_MAIN) -o radwho radwho.o mainconfig.o util.o nas.o client.o log.o conffile.o files.o xlat.o $(LIBS)
 
 radzap.o: radzap.c $(INCLUDES)
 	$(CC) $(CFLAGS) -c radzap.c
 
 radzap: radzap.o mainconfig.o util.o nas.o log.o client.o conffile.o files.o xlat.o
-	$(CC) $(CFLAGS) $(LDFLAGS) -o radzap radzap.o mainconfig.o util.o nas.o log.o client.o conffile.o files.o xlat.o $(LIBS)
+	$(CC) $(CFLAGS) $(LDFLAGS_MAIN) -o radzap radzap.o mainconfig.o util.o nas.o log.o client.o conffile.o files.o xlat.o $(LIBS)
 
 clean:
 	rm -rf *.o *.so *~ $(BINARIES) .libs

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list