OpenWrt Forum Archive

Topic: Barrier Breaker trunk hostapd compile error

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

Trying to compile trunk with eglibc, but hostapd is not linking with the following error?

make[4]: Entering directory '/home/terence/openwrt/openwrt/build_dir/target-mips_34kc_eglibc-2.15/hostapd-wpad-mini/hostapd-20131120/hostapd'
../src/utils/os_unix.o: In function `os_get_reltime':
os_unix.c:(.text.os_get_reltime+0x3c): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

Any ideas?

fixed in r39741

Updated the trunk to latest, see that -lrt is added to the Makefile, but still having the same error.  Already tried make clean hostapd-wpad-min.

CFLAGS="-I/home/terence/openwrt/openwrt/staging_dir/target-mips_34kc_eglibc-2.15/usr/include/libnl-tiny -I/home/terence/openwrt/openwrt/build_dir/target-mips_34kc_eglibc-2.15/hostap
d-wpad-mini/hostapd-20131120/src/crypto -I/home/terence/openwrt/openwrt/staging_dir/target-mips_34kc_eglibc-2.15/usr/include -I/home/terence/openwrt/openwrt/staging_dir/target-mips_
34kc_eglibc-2.15/include -I/home/terence/openwrt/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/usr/include -I/home/terence/openwrt/openwrt/staging_dir/toolchain
-mips_34kc_gcc-4.6-linaro_eglibc-2.15/include -I/home/terence/openwrt/openwrt/package/network/services/hostapd/madwifi -DCONFIG_LIBNL20 -D_GNU_SOURCE -DCONFIG_MSG_MIN_PRIORITY=3 -Os
 -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -ffunction-sections -fdata-sections" make   -C /home
/terence/openwrt/openwrt/build_dir/target-mips_34kc_eglibc-2.15/hostapd-wpad-mini/hostapd-20131120/hostapd AR=mips-openwrt-linux-gnu-ar AS="mips-openwrt-linux-gnu-gcc -c -Os -pipe -
mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -ffunction-sections -fdata-sections" LD=mips-openwrt-linux-g
nu-ld NM=mips-openwrt-linux-gnu-nm CC="mips-openwrt-linux-gnu-gcc" GCC="mips-openwrt-linux-gnu-gcc" CXX="mips-openwrt-linux-gnu-g++" RANLIB=mips-openwrt-linux-gnu-ranlib STRIP=mips-
openwrt-linux-gnu-strip OBJCOPY=mips-openwrt-linux-gnu-objcopy OBJDUMP=mips-openwrt-linux-gnu-objdump SIZE=mips-openwrt-linux-gnu-size CONFIG_DRIVER_NL80211=y CONFIG_DRIVER_MADWIFI=
 CONFIG_DRIVER_HOSTAP= CONFIG_IEEE80211N=y CONFIG_IEEE80211W=y CONFIG_DRIVER_WEXT=  CONFIG_DRIVER_ROBOSWITCH= LIBS="-L/home/terence/openwrt/openwrt/staging_dir/target-mips_34kc_egli
bc-2.15/usr/lib -L/home/terence/openwrt/openwrt/staging_dir/target-mips_34kc_eglibc-2.15/lib -L/home/terence/openwrt/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.
15/usr/lib -L/home/terence/openwrt/openwrt/staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib -lrt -Wl,--gc-sections -lubox -lubus -lm -lnl-tiny" LIBS_c="" BCHECK=  CFLA
GS="$(cat /home/terence/openwrt/openwrt/build_dir/target-mips_34kc_eglibc-2.15/hostapd-wpad-mini/hostapd-20131120/.cflags)" MULTICALL=1 hostapd_cli hostapd_multi.a 
make[4]: Entering directory '/home/terence/openwrt/openwrt/build_dir/target-mips_34kc_eglibc-2.15/hostapd-wpad-mini/hostapd-20131120/hostapd'
  CC  hostapd_cli.c
  CC  ../src/common/wpa_ctrl.c
  CC  ../src/utils/os_unix.c
  CC  ../src/utils/eloop.c
  CC  ../src/utils/wpa_debug.c
  CC  ../src/utils/edit_simple.c
../src/utils/os_unix.o: In function `os_get_reltime':
os_unix.c:(.text.os_get_reltime+0x3c): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
Makefile:920: recipe for target 'hostapd_cli' failed

librt seems to be there.

./build_dir/target-mips_34kc_eglibc-2.15/toolchain/ipkg-ar71xx/librt
./build_dir/target-mips_34kc_eglibc-2.15/toolchain/ipkg-ar71xx/librt/lib/librt-2.15.so
./build_dir/target-mips_34kc_eglibc-2.15/toolchain/ipkg-ar71xx/librt/lib/librt.so.1
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-headers/librt.map
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909/libc/abilist/librt.abilist
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909/libc/nptl/sysdeps/pthread/librt-cancellation.c
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909/libc/nptl/sysdeps/unix/sysv/linux/x86_64/librt-cancellation.S
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt-cancellation.os.d
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt_pic.a
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt-cancellation.os
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt-cancellation.o.d
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt-cancellation.o
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt.a
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt.so
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/rt/librt.so.1
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/librt.map
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/elf/librtld.os.map
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/elf/librtld.mk
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/elf/librtld.map
./build_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/eglibc-2.15-r18909-final/elf/librtld.os
./staging_dir/target-mips_34kc_eglibc-2.15/pkginfo/librt.provides
./staging_dir/target-mips_34kc_eglibc-2.15/root-ar71xx/lib/librt_pic.a
./staging_dir/target-mips_34kc_eglibc-2.15/root-ar71xx/lib/librt-2.15.so
./staging_dir/target-mips_34kc_eglibc-2.15/root-ar71xx/lib/librt.a
./staging_dir/target-mips_34kc_eglibc-2.15/root-ar71xx/lib/librt.so.1
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib/librt_pic.a
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib/librt-2.15.so
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib/librt_pic.map
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib/librt.a
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib/librt.so
./staging_dir/toolchain-mips_34kc_gcc-4.6-linaro_eglibc-2.15/lib/librt.so.1

Have you run 'make package/hostapd/{clean,compile} V=ss'?

Just tried that, same error.

tried 'make clean' within ./build_dir/target-mips_34kc_eglibc-2.15/hostapd-wpad-mini/hostapd-20131120/hostapd/ before as well, same.

I was trying to see if the librt source still has the function?  But didn't know where the source was?

I removed the entire trunk and then clone again, then Make, finally got an image.  I guess 'make clean' didn't clean up the librt stuff?

Thanks.

The discussion might have continued from here.