Crosscompilation to musl32 problems


I need to maintain for my day job some code that must work on an old 32bit platform running a kernel not supported anymore by glibc.

I’m trying to cross compile to musl32 and check if it works with the following command:

nix-build channel:nixos-unstable -A pkgsCross.musl32.zlib

however it seems some problem exists with the __stack_chk_fail_local since the following error:

hidden symbol `__stack_chk_fail_local' isn't defined

can be found in the build logs of some notable package: nix (via aws-checksums), zlib and probably others.

Can someone point me in the right direction to solve this problem?


I’m still finding a solution and the nixpkgs documentation suggests the use of the hardeningDisable flag, however I’m not sure how to use it from nix-build.

I noticed this a while back too! You can try this commit on Nixpkgs:

but it is very weird that stackprotector isn’t working! Some searching comes up with:

Thanks, your comment has been really useful.
I’ll open a pull request to discuss the small changes required to build nix.

I’ve created PR#61817