| 10 Dec 2021 |
Mic92 | You could try to set CC, LD and so on manually in your derivation to make progress | 13:39:46 |
ErPepone | CC = "${pkgsCross32.buildPackages.gcc}/bin/cc";
this should be fine, no?
| 13:41:37 |
ErPepone | Actually I should put the target and not cc | 13:43:27 |
ErPepone | How can I get the target triple? | 13:43:42 |
Mic92 | ErPepone: that might not work. I think nix-shell is overwriting some variables again | 13:50:25 |
symphorien | are you looking for "cc=${stdenv.cc.targetPrefix}cc" ? | 13:50:27 |
Mic92 | You can use shellHook though | 13:50:33 |
ErPepone | yep I'm using shellHook now but CMake is complaining | 13:51:10 |
ErPepone | I have to setup also the CMake flags | 13:51:17 |
ErPepone | In reply to @symphorien:xlumurb.eu are you looking for "cc=${stdenv.cc.targetPrefix}cc" ? Thanks! | 13:51:22 |
ErPepone | CMake looks for cc and c++ | 13:51:47 |
ErPepone | Hmm, gccWithLldStdenv seems not to have any .cc.targetPrefix! | 13:53:48 |
ErPepone | So maybe is overrideCC that is not working properly? | 13:54:03 |
ErPepone | shellHook = ''
export CC=${gccWithLldStdenv.cc.targetPrefix}cc
export CXX=${gccWithLldStdenv.cc.targetPrefix}c++
'';
ends up in
$ echo $CC
cc
$ echo $CXX
c++
| 13:54:47 |
Mic92 | ErPepone: maybe gccWithLldStdenv.cc.targetPrefix is empty? | 13:57:33 |
ErPepone | I was just trying with what symphorien suggested me earlier | 13:58:04 |
ErPepone | It shouldn't be empty though, right? | 13:58:16 |
ErPepone | Because I'm overriding the stdenv of gnu32 | 13:58:28 |
Mic92 | Usually it's not empty, only if it is not a cross compiler | 13:58:37 |
ErPepone | Just to be sure, this is what I'm using now:
gccWithLld = pkgsCross32.wrapCCWith {
cc = pkgsCross32.buildPackages.gcc-unwrapped;
bintools = pkgsCross32.buildPackages.llvmPackages_13.bintools;
};
gccWithLldStdenv = pkgsCross32.overrideCC pkgsCross32.stdenv gccWithLld;
| 13:59:18 |
Mic92 | I mean maybe wrapCCWith does not apply the target prefix correctly | 13:59:56 |
ErPepone | Is there another way to force LLVM's bintools onto a stdenv? | 14:00:19 |
Mic92 | You could also hard code the correct prefix for now | 14:00:58 |
Mic92 | or use pkgsCross.gnu32.stdenv.cc.targetPrefix | 14:01:25 |
Mic92 | (targetPlatform.config + "-");
| 14:04:39 |
Mic92 | Somehow this condition does not set the prefix in your case: https://github.com/NixOS/nixpkgs/blob/d0d209fd591c40ac8a2be4a0379ee14ab5b556bb/pkgs/build-support/cc-wrapper/default.nix#L38 | 14:05:39 |
ErPepone | It's because I'm on x86-64 "cross-compiling" for x86 | 14:06:24 |
ErPepone | Probably | 14:06:28 |
ErPepone | I am compiling a fork of LLVM with the pkgsCross set but it seems that when linking one of the buildInputs, the file format is not correct | 14:18:45 |
ErPepone | /nix/store/g876mcfvkd6h80s28z5p1czvdcsxr3q3-i686-unknown-linux-gnu-binutils-2.35.2/bin/i686-unknown-linux-gnu-ld: /nix/store/2q3qzdrx1pka5gb93si9wca2a5b1qgx6-z3-4.8.12-lib/lib/libz3.so: error adding symbols: file in wrong format
| 14:20:37 |