Error with __gettimeofday: __time64: symbol not found

I struggled with getting my program to run on my device after cross compiling using the latest openwrt from github.

The latest download of openwrt stable from the repository seems to have the old version of libc
I searched everywhere for a more recent version but none found.
I finally looked in my cross complied packages are found the newer version libc_1.2.2-3_mipsel_24kc.ipk
and installed in on my device. No errors now and my program works as expected.

I don't know who is maintaining packages for github and the release presented on openwrt but they are out of sync for this package.

it is customary to state your device for such queries

as would be providing a direct link the whatever you are referring to above...

my device is onion omega2
sorry I dont have any direct links to offer here, I basically grabbed the latest version of openwrt for the omega2 device from the openwrt website and as for the cross compiliation - I grabbed that from github following the info on the openwrt wesbite.
sorry I cant be of more help but as I say compiling the latest version from github for cross compiling maybe the issue I have hit as it is not in sync with what is being offered as a stable release to put on the device.

time64 was introduced with musl 1.2.2 for all targets, including the 32bit ones.
Musl libc 1.2.2 is only found in the development master branch.
The "stable OpenWrt" is 21.02, and still uses musl libc 1.1.24

Sounds like you are mixing the packages / firmware / libc from master and the stable 21.02 branch, which are two different things.

If you have a 21.02 firmware, you should cross-compile with the 21.02 tools & SDK, not with the "the latest" in the master branch.

From 21.02.1:

From master:

But the libc is not meant to the upgraded, as it is a core library and all other apps are linked against it.

1 Like