cross compilation of freeradius-server-3.0.10 fails at link of radeapclient, undefined references
Alan DeKok
aland at deployingradius.com
Fri Apr 22 17:42:27 CEST 2016
On Apr 22, 2016, at 9:53 AM, Aaron Wegner <aaron at cs.wisc.edu> wrote:
>
> When I start the build of FreeRADIUS it fails with an error because it can't execute jlibtool. If I use the native compiler rather than the cross compiler to build jlibtool the build proceeds.
The build system isn't really set up to do cross-compilation.
> $ gcc scripts/jlibtool.c -o build/make/jlibtool
That helps.
> However it breaks again when it tries to link build/bin/local/radeapclient (sorry my mail client is adding newlines to long single lines).
>
> LTIB> build/make/jlibtool --silent --mode=link gcc -o build/bin/local/radeapclient -rpath /spare1/aaron/0339/ltib/rpm/BUILD/freeradius-server-3.0.10/build/lib/local//.libs --shared -L/spare1/aaron/0339/ltib/rootfs/usr/lib -Wl,-rpath,/spare1/aaron/0339/ltib/rootfs/usr/lib build/objs/src/modules/rlm_eap/radeapclient.lo build/objs/src/main/files.lo build/objs/src/main/threads.lo build/objs/src/main/version.lo build/objs/src/main/cb.lo build/objs/src/main/tls.lo build/lib/local/libfreeradius-radius.la build/lib/local/libfreeradius-server.la build/lib/local/libfreeradius-eap.la -lcrypto -lssl -ltalloc -lpcre -lcap -lnsl -lresolv -ldl -lpthread -lcrypto -lssl
>
> However, if I change the command to the following it works.
>
> LTIB> gcc -o build/bin/local/radeapclient -Wl,-rpath /spare1/aaron/0339/ltib/rpm/BUILD/freeradius-server-3.0.10/build/lib/local//.libs --shared -L/spare1/aaron/0339/ltib/rootfs/usr/lib -Wl,-rpath,/spare1/aaron/0339/ltib/rootfs/usr/lib -L/spare1/aaron/0339/ltib/rpm/BUILD/freeradius-server-3.0.10/build/lib/local//.libs build/objs/src/modules/rlm_eap/radeapclient.o build/objs/src/main/files.o build/objs/src/main/threads.o build/objs/src/main/version.o build/objs/src/main/cb.o build/objs/src/main/tls.o -lfreeradius-radius -lfreeradius-server -lfreeradius-eap -lcrypto -lssl -ltalloc -lpcre -lcap -lnsl -lresolv -ldl -lpthread -lcrypto -lssl
You're running the local "gcc", and not the cross-compiler.
You should do:
$ CC=/path/to/cross/cc ./configure ... args ...
$ gcc scripts/jlibtool.c -o build/make/jlibtool
$ make
That lets you build jlibtool with the native C compiler, and the rest of the build system will then use the cross compiler.
Alan DeKok.
More information about the Freeradius-Users
mailing list