!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

398 Members
92 Servers

Load older messages


SenderMessageTime
27 Sep 2024
@artturin:matrix.orgArtturin postInstall is already used so you have to append to it 20:37:06
@artturin:matrix.orgArtturinYou're also overriding the wrapped gcc20:37:36
@artturin:matrix.orgArtturin you have to override gcc.cc 20:37:43
@artturin:matrix.orgArtturinand then wrap it again20:37:47
@yehowshua:matrix.orgyehowshuayou may have lost me20:41:38
@yehowshua:matrix.orgyehowshuaHow does one wrap gcc.cc? Also, does gcc.cc give me gcc and g++?20:41:56
@artturin:matrix.orgArtturinCheck the links I sent20:42:56
@yehowshua:matrix.orgyehowshuaJust now seeing those!!20:43:44
@yehowshua:matrix.orgyehowshuaMy bad20:43:48
@artturin:matrix.orgArtturin
nix-repl> gcc.cc.langC
true

nix-repl> gcc.cc.langCC
true
20:43:53
@yehowshua:matrix.orgyehowshuaThanks!! I think I've got what I need!20:45:50
@yehowshua:matrix.orgyehowshuaActually - 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:matrix.orgArtturinIt's wrapped too20:54:00
@artturin:matrix.orgArtturin bintools.bintools wrapBintoolsWith 20:54:09
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/blob/3913c72204235cebbc151a875250b96df485ea60/pkgs/top-level/all-packages.nix#L1723820:54:47
@yehowshua:matrix.orgyehowshuaPerfect! I imagine I can then pass my modified binutils as an argument to the gcc derivation?20:55:55
@yehowshua:matrix.orgyehowshuaor rather, override it as it seems to inherit it?20:56:31
@yehowshua:matrix.orgyehowshuahttps://github.com/NixOS/nixpkgs/blob/master/pkgs/development/compilers/gcc/default.nix#L1820:56:59
@yehowshua:matrix.orgyehowshuaNVM - argument it is20:57:05
@artturin:matrix.orgArtturin I suppose you pass it to the wrapCC and then additionally to the gcc if needed 20:58:51
@yehowshua:matrix.orgyehowshua

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:matrix.orgyehowshuaFor a bit more context: https://paste.debian.net/133064423:42:25
@yehowshua:matrix.orgyehowshua

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:matrix.orgyehowshua 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:matrix.orgyehowshuaSome more of the error if it helps: https://paste.debian.net/1330645/23:46:46
@artturin:matrix.orgArtturin

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:matrix.orgArtturin* 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:matrix.orgArtturin* 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 cross23:54:48
@artturin:matrix.orgArtturin* 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:matrix.orgArtturin* 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 used23:56:44

Show newer messages


Back to Room ListRoom Version: 6