Cannot find stubs-32.h

Hi, I’m trying to compile rust source code into a library (lib*.so) that can be used by android devices. However I got stuck when the cargo build command cannot find the stubs-32.h of a particular glibc-dev. I checked the other glibc-devs inside /nix/store and they have that header file. How can the glibc-dev that is used by my system get that header file? Thanks for the help :slight_smile:

1 Like

anyone has any ideas how to go around this?

To give some context on this

As you can see the glibc-dev that is used by my system doesn’t have that header file while the other glibc-dev that got installed before has one. Can somebody help me? Im stuck with this, thanks :slight_smile:

1 Like

looks like i’m in a similar situation:

$ find /nix/store/ -name stubs-32.h
find: ‘/nix/store/3b23rc9iqglir3kbq1rs3plagr0ffx05-vm-test-run-certmgr-systemd.drv.chroot’: Permission denied
/nix/store/qva24pnd66nyb0v5r7knshb6k3wlxv99-glibc-2.27-dev/include/gnu/stubs-32.h
/nix/store/zvkyj8lvm9xm5wgqj5n36495w4zzw0d5-source/lib/libc/include/generic-glibc/gnu/stubs-32.h
/nix/store/fky7wzbmz6pk477n79y8ac9ih55zvmq1-zig-0.5.0/lib/zig/libc/include/generic-glibc/gnu/stubs-32.h
/nix/store/x9jnwjzn0rh4ywvaxb1d5wxx65pbs1rl-glibc-2.27-dev/include/gnu/stubs-32.h
/nix/store/k57l3sjhqq6glvwmrgckhkp90zxif81z-glibc-multi-2.27-dev/include/gnu/stubs-32.h
/nix/store/jb68g1vdgvqplmc2k75fxz6phrjgwzkn-glibc-2.27-dev/include/gnu/stubs-32.h
$ nix-build -A glibc.dev
/nix/store/4v4ginzfvpsrnvafl1cxx1jn4wy6kc1r-glibc-2.27-dev
$ ls ./result-dev/include/gnu/
lib-names-64.h  lib-names.h  libc-version.h  stubs-64.h  stubs.h

however:

$ nix-build -A pkgsi686Linux.glibc.dev
/nix/store/qva24pnd66nyb0v5r7knshb6k3wlxv99-glibc-2.27-dev
$ ls ./result-dev/include/gnu/
lib-names-32.h  lib-names.h  libc-version.h  stubs-32.h  stubs.h

in short, glibc -> pkgsi686Linux.glibc

It’s probably safer to use glibc_multi for this (or gccMultiStdenv). I think there’s a few headers that are just available for arm32, and won’t be in i686-linux.

wasn’t aware of these, :slight_smile:

Based on what I have read said so far, I created a shell.nix that has pkgsi686Linux.glibc inside the buildInputs. I used that to enter into a nix shell and the cargo build command seems to be working now ( because I’m getting another error :smiley: ). Last question though… Is it possible that the 64bit glibc have those 32bit header files from pkgsi686Linux.glibc?

What’s the difference between those and multiStdenv?

And when I’m using multiStdenv, how do I get to the lib64 directory? Using stdenv.cc.cc.lib leads me to /lib, not /lib64. Neither does multiStdenv.cc.cc.lib.