| 29 Oct 2021 |
sterni | why did I get a cache miss for cross ghc earlier today though | 17:57:41 |
John Ericson | Maybe it failed in CI? | 18:09:00 |
John Ericson | No idea | 18:09:03 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org easiest is probably to package it properly and then use overrideCC stdenv buildPackages.my-cross-compiler as stdenv. Thank for the tips. So first I add my-cross-compiler package to nixpkgs via overlay. Then I also override stdenv via overlay with overrideCC? my-cross-compiler gets available as buildPackages attribute? | 18:19:31 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org easiest is probably to package it properly and then use overrideCC stdenv buildPackages.my-cross-compiler as stdenv. * Thank you for the tips. So first I add my-cross-compiler package to nixpkgs via overlay. Then I also override stdenv via overlay with overrideCC? my-cross-compiler gets available as buildPackages attribute? | 18:19:56 |
sterni | John Ericson: seems like aarch64-gnu is not part of cross trunk? | 18:33:18 |
sterni | that was what I was trying, I think | 18:33:26 |
John Ericson | Ah | 18:34:00 |
John Ericson | Better than a CI failure! | 18:34:08 |
sterni | wondering if we maybe should tie cross trunk more to lib/systems/examples.nix | 18:34:52 |
sterni | but OTOH you still have to manually add the packages to test anyways | 18:35:04 |
sterni | @AleXoundOS:matrix.org: are you familiar with how cross compilation works for gcc in nixpkgs? | 19:00:24 |
sterni | also what exactly is your cross compiler? | 19:00:31 |
@AleXoundOS:matrix.org | @sterni, I have gcc 4.7.2 with glibc 2.16 mips32r2 in a single archive from embedded device manufacturer. Currently, I packaged it simply with autoPatchelfHook so that it compiles the firmware with mips-linux-gnu- prefix. | 19:03:45 |
@AleXoundOS:matrix.org | I'm not quite familiar with cross compilation for gcc in nixpkgs. Though, I actively read nixpkgs manual, wiki and sources. I couldn't find my case covered (when cross-compiler is "external"). | 19:07:13 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org if you are targeting mips, I'm not sure how will nixpkgs will cope with that seems only mipsel is explored territory Despite compiler does not mention mipsel anywhere, it produces little-endian executables which correctly run on embedded hardware the compiler is for. So this should be mipsel in terms of nixpkgs I guess. | 21:25:38 |
sterni | why can't you use regular nixpkgs with the glibc and gcc version it ships? targeting mispel should work | 21:34:43 |
sterni | also what are you trying to compile? arbitrary packages or something specific? | 21:34:56 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org why can't you use regular nixpkgs with the glibc and gcc version it ships? targeting mispel should work I'm not sure if the compiler I have can be substituted by regular nixpkgs (at least I have a compiler that works for simple apps and shipped with SDK). But I'm all for using regular nixpkgs compiler, however, the gcc compiler from the closest platform I tried (pkgsCross.fuloongminipc) fails to build. Specifically: nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/d4590d21006387dcb190c516724cb1e41c0f8fdf.tar.gz '<nixpkgs>' -A pkgsCross.fuloongminipc.hello. | 22:31:24 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org also what are you trying to compile? arbitrary packages or something specific? A console application that uses gstreamer with various media plugins and libwebsockets. | 22:33:50 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org also what are you trying to compile? arbitrary packages or something specific? * A console application that uses gstreamer with various media plugins and libwebsockets. It builds with nix-build (mkDerivation) and runs under x86_64. | 23:41:26 |
| 30 Oct 2021 |
sterni | In reply to @AleXoundOS:matrix.org I'm not sure if the compiler I have can be substituted by regular nixpkgs (at least I have a compiler that works for simple apps and shipped with SDK). But I'm all for using regular nixpkgs compiler, however, the gcc compiler from the closest platform I tried (pkgsCross.fuloongminipc) fails to build. Specifically: nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/d4590d21006387dcb190c516724cb1e41c0f8fdf.tar.gz '<nixpkgs>' -A pkgsCross.fuloongminipc.hello. what if you try building nix-build -E 'with import <nixpkgs> { crossSystem = "mipsel-linux"; }; hello? | 09:44:10 |
sterni | I think figuring out what's wrong with the default toolchain may be easier, because nixpkgs generally assumes that everything is bootstrapped properly and the c compiler and libc are built separately | 09:45:00 |
sterni | so I think it may require good knowledge of internals and the cc wrapper to make a stdenv from a bundled tarball | 09:45:42 |
sterni | using the normal toolchain is probably preferrable if you don't need any proprietary bits | 09:46:09 |
@AleXoundOS:matrix.org | In reply to @sternenseemann:systemli.org what if you try building nix-build -E 'with import <nixpkgs> { crossSystem = "mipsel-linux"; }; hello? Ok. Trying to build this. Surprisingly it requires more packages to build... | 10:14:18 |
sterni | I think that toolchain may be missing on hydra, so CI doesn't make it substitutable maybe? | 10:15:13 |
sterni | can add it if it's indeed working :) | 10:15:21 |
@AleXoundOS:matrix.org | Let's see :) It's building gcc in 2 passes at the moment. | 10:19:08 |
@AleXoundOS:matrix.org | Nah, error: build of '/nix/store/wdqk99kn2vs0zaxqk6724y420lmc7fxm-hello-2.10-mipsel-unknown-linux-gnu.drv' failed. | 10:20:13 |