27 Sep 2024 |
Artturin | postInstall is already used so you have to append to it | 20:37:06 |
Artturin | You're also overriding the wrapped gcc | 20:37:36 |
Artturin | you have to override gcc.cc | 20:37:43 |
Artturin | and then wrap it again | 20:37:47 |
yehowshua | you may have lost me | 20:41:38 |
yehowshua | How does one wrap gcc.cc? Also, does gcc.cc give me gcc and g++? | 20:41:56 |
Artturin | Check the links I sent | 20:42:56 |
yehowshua | Just now seeing those!! | 20:43:44 |
yehowshua | My bad | 20:43:48 |
Artturin | nix-repl> gcc.cc.langC
true
nix-repl> gcc.cc.langCC
true
| 20:43:53 |
yehowshua | Thanks!! I think I've got what I need! | 20:45:50 |
yehowshua | Actually - one more question - I'll need to use a special for of binutils as well. Is there any wrapping of binutils required or anything I ought to look out for? | 20:53:09 |
Artturin | It's wrapped too | 20:54:00 |
Artturin | bintools.bintools wrapBintoolsWith | 20:54:09 |
Artturin | https://github.com/NixOS/nixpkgs/blob/3913c72204235cebbc151a875250b96df485ea60/pkgs/top-level/all-packages.nix#L17238 | 20:54:47 |
yehowshua | Perfect! I imagine I can then pass my modified binutils as an argument to the gcc derivation? | 20:55:55 |
yehowshua | or rather, override it as it seems to inherit it? | 20:56:31 |
yehowshua | https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/gcc/default.nix#L18 | 20:56:59 |
yehowshua | NVM - argument it is | 20:57:05 |
Artturin | I suppose you pass it to the wrapCC and then additionally to the gcc if needed | 20:58:51 |
yehowshua | Seems I have trouble with static linking when cross compiling?
/nix/store/nmwfk6kfxn1kwryaind9jz3q5l00y307-riscv32-unknown-linux-gnu-binutils-2.41/bin/riscv32-unknown-linux-gnu-ld: cannot find -lm: No such file or directory
| 23:40:45 |
yehowshua | For a bit more context: https://paste.debian.net/1330644 | 23:42:25 |
yehowshua | I'm not actually using a custom toolchain there:
$ cat pkgs.nix
{ }:
let
pkgs = import (fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/24.05.tar.gz";
}) {};
in
pkgs
| 23:43:35 |
yehowshua | I'm not seeing a libmath or anything on nixpkgs, so I would assume it would be included with libgcc in stdenv of riscv32? | 23:44:48 |
yehowshua | Some more of the error if it helps: https://paste.debian.net/1330645/ | 23:46:46 |
Artturin | Dunno if it'll fix that but build time tools go in nativeBuildInputs and usually we import nixpkgs with the wanted wanted crossSystem and then use mkDerivation from it
Also do pkgs = (import ./pkgs.nix {}).__splicedPackages for the dependency attributes to work correctly | 23:49:55 |
Artturin | * Dunno if it'll fix that but build time tools go in nativeBuildInputs and usually we import nixpkgs with the wanted wanted crossSystem(or use pkgsCross) and then use mkDerivation from it
Also do pkgs = (import ./pkgs.nix {}).__splicedPackages for the dependency attributes to work correctly
| 23:51:52 |
Artturin | * Dunno if it'll fix that but build time tools go in nativeBuildInputs and usually we import nixpkgs with the wanted wanted crossSystem(or use pkgsCross) and then use mkDerivation from it
Also do pkgs = (import ./pkgs.nix {}).__splicedPackages for the dependency attributes to work correctly when cross | 23:54:48 |
Artturin | * Dunno if it'll fix that but build time tools go in nativeBuildInputs and usually we import nixpkgs with the wanted wanted crossSystem(or use pkgsCross) and then use mkDerivation from it
Also do pkgs = (import ./pkgs.nix {}).__splicedPackages for the dependency attributes to work correctly when cross.
pkgsCross.x.__splicedPackages
| 23:55:45 |
Artturin | * Dunno if it'll fix that but build time tools go in nativeBuildInputs and usually we import nixpkgs with the wanted wanted crossSystem(or use pkgsCross) and then use mkDerivation from it
Also do pkgs = (import ./pkgs.nix {}).__splicedPackages for the dependency attributes to work correctly when cross.
Or pkgsCross.x.__splicedPackages
On native splicing isn't used | 23:56:44 |