cross compilation of freeradius-server-3.0.10 fails at link of radeapclient, undefined references
Aaron Wegner
aaron at cs.wisc.edu
Fri Apr 22 19:04:12 CEST 2016
On 2016-04-22 11:42, Alan DeKok wrote:
> 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.
In the LTIB environment "gcc" is the cross compiler. It's spoofed, not
the native compiler.
[aaron at geiswbuild1 /spare1/aaron/0339/ltib Fri Apr 22 12:59:44]
$ ./ltib -m shell
LTIB> gcc --version
powerpc-linux-gnu-gcc (Sourcery CodeBench 2014.11-97) 4.9.1
LTIB> exit
exit
[aaron at geiswbuild1 /spare1/aaron/0339/ltib Fri Apr 22 13:00:54]
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
Both 3.0.10 and 3.0.11 are working for me now. I tried to duplicate the
errors from yesterday and I no longer can, sorry for what seems to be an
unnecessary request for help. Moving forward, thanks.
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list