Wrong ELF Type?

I’m trying to use a build expression in the nix repo, via invoking it with nix-build -E.

The build goes (apparently) OK, but I’m getting "Wrong ELF Type over and over again.

I have flags set to try to turn it off, I think.
doCheck = false;
dontFixip = true;
dontStrip = true;
dontPatchELF = true;

But it keeps going. Is there a debug mode for all of this?

I found the debug flag. It doesn’t seem to help. Just a string of thousands of “Wrong ELF Type”.
It looks like its executing the fixup phase in spite of being told not.

what package is it, you can do a nix-shell to maybe trace the build?

branch acc-test.

Whatever script is messing with the binaries need to be stopped. Half the binaries in the built image are for enclaves and are different from host binaries. They have expected symbols and data structures or don’t load.

FWIW, when I build very much the same thing outside of the repo, I have no issue.

BTW, Thank you in advance for any help.

are you sure it’s coming from patch elf? Try the build in the nix-shell , run each step of build process from there as a debug?

you seem to be using stdenvNoCC.mkDerivation rather than stdenv.mkDerivation

why is that? could it be that stdenvNoCC.mkDerivation doesn’t honour dontPatchELF = true;

just an idea?

What I can’t figure out is how to control “post-installation fixup”.
It seems to be doing very much the wrong things.

make[1]: Leaving directory ‘/nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk’
/nix/store/acw9iism5wr6mxaq54h306bbxnl27n63-cmake-3.16.3/bin/cmake -E cmake_progress_start /nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk/CMakeFiles 0
post-installation fixup
patching script interpreter paths in /nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk
/nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk/3rdparty/musl/musl/configure: interpreter directive changed from “/bin/sh” to “/nix/store/hrpvwkjz04s9i4nmli843hyw9z4pwhww-bash-4.4-p23/bin/sh”
/nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk/3rdparty/musl/musl/tools/install.sh: interpreter directive changed from “/bin/sh” to “/nix/store/hrpvwkjz04s9i4nmli843hyw9z4pwhww-bash-4.4-p23/bin/sh”
/nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk/tests/mbed/data_files/dir-maxpath/long.sh: interpreter directive changed from “/bin/sh” to “/nix/store/hrpvwkjz04s9i4nmli843hyw9z4pwhww-bash-4.4-p23/bin/sh”
/nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk/output/bin/oegdb: interpreter directive changed from “/usr/bin/env bash” to “/nix/store/hrpvwkjz04s9i4nmli843hyw9z4pwhww-bash-4.4-p23/bin/bash”
checking for references to /tmp/nix-build-openenclave-sdk.drv-0/ in /nix/store/jpyhjgn0ykv2ck8q48ihz78x02pn8j98-openenclave-sdk…
wrong ELF type
wrong ELF type

Looks like its spelled “dontFixup” not dontFixip…

whoops… i wasn’t expecting that… :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: :eyes: