I'm trying to cross-compile part of the perfSONAR tools for OpenWrt (18.06.1), running on an x86_64 embedded board (PC Engines APU1D).
I'm trying to cross-compile from Ubuntu 19.04.
I then copied all the content of the I2util library repository into the "I2util" directory (which I had to manually create), inside the main "owamp" folder.
After that, I built, with cross-compilation, the I2util library.
I was able to run autoconf with:
cd owamp cd I2util autoreconf -vif autoconf
Then, I configured and built the source following the instructions on the OpenWrt documentation (I already have a proper toolchain installed, which I was able to successfully use to cross-compile other programs too):
./configure --build=x86_64-unknown-linux-gnu --host=x86_64-openwrt-linux-musl make
The build process went fine.
The issue came when I tried building the main "owamp" binaries.
autoreconf -vif autoconf ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ./configure --build=x86_64-unknown-linux-gnu --host=x86_64-openwrt-linux-musl
Everything went fine (I had to add the "ac_cv_func" part following this post, otherwise I was getting an error about "malloc" not being found, probably due to an autoconf error).
But as I try to compile:
I'm constantly getting this error:
../owamp/libowamp.a(time.o): In function `_OWPInitNTP': /home/francesco/owamp/owamp/time.c:107: undefined reference to `ntp_adjtime' ../owamp/libowamp.a(time.o): In function `_OWPGetTimespec': /home/francesco/owamp/owamp/time.c:213: undefined reference to `ntp_adjtime' collect2: error: ld returned 1 exit status make: *** [Makefile:385: owampd] Error 1 make: Leaving directory '/home/francesco/owamp/owampd' make: *** [Makefile:387: all-recursive] Error 1
ntp_adjtime should be defined in
sys/timex.h, which is correctly defined and included in the source code.
Do you know if I am doing something wrong when cross-compiling with the OpenWrt toolchain?
Should I specify other options when running
ntp_adjtime undefined in the
timex.h version included in 18.06.1?
Thank you very much in advance!