OpenWrt Forum Archive

Topic: Problems with compiling freeradius on mips

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hey,

I tried to compile from source freeradius for my WRT160NL, but when i'm starting "radiusd", I get multiple errors that say: "rlm_* is not an ELF file".

This are the commands I issued on my desktop with ubuntu 11.10(64-bit):

export $STAGING_DIR=/root/test/backfire/staging_dir
export $RANLIB=mips-openwrt-linux-uclibc-ranlib

./configure --host=mips-openwrt-linux-uclibc --prefix=/root/freeradius
make LD=mips-openwrt-linux-uclibc-ld CC=mips-openwrt-linux-uclibc-gcc
make install
ldconfig

now i'm archive all the generated files in a tar file, for safely transport the whole program:

tar -cvzf freeradius /root/freeradius

on my router I unpack it:

tar -xvzf freeradius

And I'm make it executable

export PATH=$PATH:/root/freeradius/bin:/root/freeradius/sbin
export LD_LIBRARY_PATH=/root/freeradius

radiusd command gives:

./radiusd: '/root/freeradius/lib/rlm_exec.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_expr.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_expiration.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_logintime.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_pap.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_chap.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_mschap.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_unix.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_eap.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_eap_md5.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_eap_leap.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_eap_gtc.a' is not an ELF file
./radiusd: '/root/freeradius/lib/rlm_eap_mschapv2.a' is not an ELF file

I'm searching for hours now, but the problem still remains.

You copied static library archives into a directory where only dynamic ELF shared objects are expected, that makes the messages above entirely normal.

Ok, thanks for the quick answer!

So I deleted all the *.a files with the command:

rm /root/freeradius/*.a

(i hope i did not wrong!)

Now those errors are gone, but there's still an other error:

rlm_eap: Ignoring EAP-Type/tls because we do not have OpenSSL support.
rlm_eap: Ignoring EAP-Type/ttls because we do not have OpenSSL support.
rlm_eap: Ignoring EAP-Type/peap because we do not have OpenSSL support.
Module: Linked to sub-module rlm_eap_mschapv2
Module: Instantiating eap-mschapv2
   mschapv2 {
        with_ntdomain_hack = no
   }
rlm_eap: No such sub-type for default EAP type peap
/root/freeradius/etc/raddb/eap.conf[1]: Instantiation failed for module "eap"
/root/freeradius/etc/raddb/sites-enabled/default[252]: Failed to find module "eap".
/root/freeradius/etc/raddb/sites-enabled/default[199]: Errors parsing authenticate section.
}
}
Errors initializing modules

So I compiled en installed Openssl in /root/openssl and make sure it's executable on my desktop pc.
And then I reconfigure and reïnstall freeradius with the following commands:

./configure --host=mips-openwrt-linux-uclibc --prefix=/root/freeradius --with-openssl-includes=/root/openssl/include --with-openssl-libraries=/root/openssl/lib
make LD=mips-openwrt-linux-uclibc-ld CC=mips-openwrt-linux-uclibc-gcc
make install
ldconfig

But the error still remains, any ideas?

Why don't you simply use the OpenWrt package of freeradius? It has all this stuff sorted out already.

Because I want to add a patch to the source code, so It's necessary that I can compile my own version of it.
For now I compile it without altering the code.

Thanks, but even my build without a patch don't succeed because there is no openssl support.

The OpenWrt package has openssl support.

The discussion might have continued from here.