Sender | Message | Time |
---|---|---|
3 Nov 2021 | ||
Also, "Cross-compilation infrastructure" section of nixpkgs gives no clear insight on how to handle this. | 19:57:39 | |
* Also, "Cross-compilation infrastructure" section of nixpkgs manual gives no clear insight on how to handle this. | 19:57:49 | |
it might be a case of trading build time for sanity. | 20:01:11 | |
but if you PR to nixpkgs --disable-libsanitizer on mips, the native gcc will be provided by hydra ;) | 20:02:43 | |
Yeah. Just I thought having a robust theoretical background with depsXY system it's possible to tune this without patching nixpkgs directly. It's not only build time but incompatibilities between build options for different platforms. Also disk space. | 20:07:23 | |
* Yeah. Just I thought having a robust theoretical background with depsXY system it's possible to tune this without patching nixpkgs directly. It's not only build time but incompatibilities between build options for different platforms. It wouldn't work if disabling libsanitizer broke native compiler. Also disk space. | 20:08:27 | |
* Yeah. Just I thought having a robust theoretical background with depsXY system it's possible to tune this without patching nixpkgs directly. It's not only build time but incompatibilities between build options for different platforms. It wouldn't work if disabling libsanitizer broke native compiler. Also disk space... | 20:08:49 | |
again, I believe patching nixpkgs is the right way to tune it. Doing it by overlays is hard, not always possible, and will likely break in a backward incompatible manner as often as a patch | 20:09:16 | |
here you need to inspect targetPlatform I think | 20:09:58 | |
hostPlatform is the platform that runs the compiler you are building | 20:10:26 | |
so it's likely to be x86 64 | 20:11:03 | |
In reply to @symphorien:xlumurb.euHmm. When I patched boost for mips32r2, the code after optionals (stdenv.hostPlatform != stdenv.buildPlatform) was significant and responsible to setting the architecture . | 20:14:22 | |
In reply to @symphorien:xlumurb.eu* Hmm. When I patched boost for mips32r2, the code after optionals (stdenv.hostPlatform != stdenv.buildPlatform) was significant and responsible fpr setting the architecture . | 20:14:38 | |
boost is not a compiler | 20:14:48 | |
* Hmm. When I patched boost for mips32r2, the code after optionals (stdenv.hostPlatform != stdenv.buildPlatform) was significant and responsible for setting the architecture . | 20:15:00 | |
host platform is the platform the code you compile runs on -> for a lib, it's where you put the .so so mips | 20:15:21 | |
In my mind these two statements about what is host platform come into conflict :) | 20:17:22 | |
when you compile a compiler for mips but that runs on x86, hostplatform = x86 and target = mips | 20:18:59 | |
when you compile boost for mips, hostplatform = mips, target = whatever | 20:19:15 | |
because $out/bin/gcc is x86 and $out/lib/boost is mips | 20:19:31 | |
phrased differently, hostplatform is the platform of executables that go in $out | 20:20:28 | |
modulo the fact that gcc contains some libs for the target platforms but let's keep it simple and approximate | 20:21:14 | |
Btw, if somebody interested getting ldd for host platform when cross-compiling I managed to get this with (pkgs.glibcCross.overrideAttrs (_: { preFixup = null; })).bin . Full command:nix-build --dry-run -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/d4590d21006387dcb190c516724cb1e41c0f8fdf.tar.gz -E 'with import <nixpkgs> { overlays = [ (self: super: { wrapCC = cc: super.wrapCC (cc.overrideAttrs (def: { configureFlags = def.configureFlags ++ [ "--disable-libsanitizer" ]; })); }) ]; crossSystem = { config = "mipsel-linux"; gcc.arch = "mips32r2"; gcc.abi = "32"; }; }; (glibcCross.overrideAttrs (_: { preFixup = null; })).bin' .And it runs fine on the hardware. | 21:45:00 | |
The trick is to use glibcCross instead of glibc . | 21:45:59 | |
* Btw, if somebody interested getting ldd for host platform when cross-compiling I managed to get this with (pkgs.glibcCross.overrideAttrs (_: { preFixup = null; })).bin . Full command:nix-build -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/d4590d21006387dcb190c516724cb1e41c0f8fdf.tar.gz -E 'with import <nixpkgs> { overlays = [ (self: super: { wrapCC = cc: super.wrapCC (cc.overrideAttrs (def: { configureFlags = def.configureFlags ++ [ "--disable-libsanitizer" ]; })); }) ]; crossSystem = { config = "mipsel-linux"; gcc.arch = "mips32r2"; gcc.abi = "32"; }; }; (glibcCross.overrideAttrs (_: { preFixup = null; })).bin' .And it runs fine on the hardware. | 21:55:38 | |
22:01:14 | ||
@AleXoundOS:matrix.org: yeah, I think you should be able to apply --disable-libsanitizer only for cross-compiler (or set more specific constraints). def is a set of known attributes being evaluated. Probably something like if (def.stdenv.buildPlatform != def.stdenv.hostPlatform) then [ "--disable-libsanitizer" ] else [] . Totally untested. | 22:31:23 | |
lib.optional is shorter for this usecase | 22:38:32 | |
4 Nov 2021 | ||
@AleXoundOS:matrix.org: btw I looked into it and it seems fine to install ldd etc in the cross case as well: https://github.com/NixOS/nixpkgs/pull/144417 | 01:10:13 | |
* @AleXoundOS:matrix.org: btw I looked into it and it seems fine to install ldd etc in the cross case for the normal derivation as well: https://github.com/NixOS/nixpkgs/pull/144417 | 01:10:24 |