!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

579 Members
129 Servers

Load older messages


SenderMessageTime
29 Oct 2021
@sternenseemann:systemli.orgsterniwhy did I get a cache miss for cross ghc earlier today though17:57:41
@Ericson2314:matrix.orgJohn EricsonMaybe it failed in CI?18:09:00
@Ericson2314:matrix.orgJohn EricsonNo idea18:09:03
@AleXoundOS:matrix.org@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@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
@sternenseemann:systemli.orgsterni John Ericson: seems like aarch64-gnu is not part of cross trunk? 18:33:18
@sternenseemann:systemli.orgsternithat was what I was trying, I think18:33:26
@Ericson2314:matrix.orgJohn EricsonAh18:34:00
@Ericson2314:matrix.orgJohn EricsonBetter than a CI failure!18:34:08
@sternenseemann:systemli.orgsterni wondering if we maybe should tie cross trunk more to lib/systems/examples.nix 18:34:52
@sternenseemann:systemli.orgsternibut OTOH you still have to manually add the packages to test anyways18:35:04
@sternenseemann:systemli.orgsterni @AleXoundOS:matrix.org: are you familiar with how cross compilation works for gcc in nixpkgs? 19:00:24
@sternenseemann:systemli.orgsternialso what exactly is your cross compiler?19:00:31
@AleXoundOS:matrix.org@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@AleXoundOS:matrix.orgI'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@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
@sternenseemann:systemli.orgsterniwhy can't you use regular nixpkgs with the glibc and gcc version it ships? targeting mispel should work21:34:43
@sternenseemann:systemli.orgsternialso what are you trying to compile? arbitrary packages or something specific?21:34:56
@AleXoundOS:matrix.org@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@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@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
@sternenseemann:systemli.orgsterni
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
@sternenseemann:systemli.orgsterniI 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 separately09:45:00
@sternenseemann:systemli.orgsterniso I think it may require good knowledge of internals and the cc wrapper to make a stdenv from a bundled tarball09:45:42
@sternenseemann:systemli.orgsterniusing the normal toolchain is probably preferrable if you don't need any proprietary bits09:46:09
@AleXoundOS:matrix.org@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
@sternenseemann:systemli.orgsterniI think that toolchain may be missing on hydra, so CI doesn't make it substitutable maybe?10:15:13
@sternenseemann:systemli.orgsternican add it if it's indeed working :)10:15:21
@AleXoundOS:matrix.org@AleXoundOS:matrix.orgLet's see :) It's building gcc in 2 passes at the moment.10:19:08
@AleXoundOS:matrix.org@AleXoundOS:matrix.org Nah, error: build of '/nix/store/wdqk99kn2vs0zaxqk6724y420lmc7fxm-hello-2.10-mipsel-unknown-linux-gnu.drv' failed. 10:20:13

Show newer messages


Back to Room ListRoom Version: 6