Crosscompilation to musl32 problems

Hi,

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?

Thanks

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:

https://github.com/NixOS/nixpkgs/commit/78bd45b92d06dd4e1b0a4a2a7c57b94b988312c3

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

https://github.com/sabotage-linux/sabotage/commit/193770784b7fdafa3d6447b2a4d55ef27894bbd2

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