!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

577 Members
127 Servers

Load older messages


SenderMessageTime
22 Aug 2025
@emilazy:matrix.orgemilybut... is it wrong? :)10:57:33
@emilazy:matrix.orgemilyit seems like it's accessing earlier bootstrap stages in some cases, maybe.10:57:50
@dramforever:matrix.orgdramforever targetPackages.stdenv is okay i think 10:59:21
@dramforever:matrix.orgdramforeverit's like the one package that's okay to get from targetPackages10:59:40
@dramforever:matrix.orgdramforeveras of whether the mapping to ccFor* tbh idfk10:59:58
@dramforever:matrix.orgdramforever * as of whether the mapping to ccFor* is correct tbh idfk 11:00:06
@emilazy:matrix.orgemily

honestly I guess it's more likely one of these things

    ++
      optional
        (stdenv.hostPlatform.isLinux && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD && useLLVM)
        "--push-state --as-needed -L${llvmPackages.libcxx}/lib -lc++ -lc++abi -lLLVM-${lib.versions.major llvmPackages.llvm.version} --pop-state"
    ++ optional (stdenv.hostPlatform.isDarwin && !withBundledLLVM) "-lc++ -lc++abi"
    ++ optional stdenv.hostPlatform.isFreeBSD "-rpath ${llvmPackages.libunwind}/lib"
  ++ optional (useLLVM && !withBundledLLVM && !stdenv.targetPlatform.isFreeBSD) [
    llvmPackages.libunwind
    # Hack which is used upstream https://github.com/gentoo/gentoo/blob/master/dev-lang/rust/rust-1.78.0.ebuild#L284
    (runCommandLocal "libunwind-libgcc" { } ''
      mkdir -p $out/lib
      ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so
      ln -s ${llvmPackages.libunwind}/lib/libunwind.so $out/lib/libgcc_s.so.1
    '')
  ];
11:08:51
@emilazy:matrix.orgemily since the hack that "fixes" it just involves overriding llvmPackages 11:09:00
@emilazy:matrix.orgemily so leaning more towards "llvmPackages wire-up is busted", as I've observed that myself 11:09:14
@limwa:matrix.orgAndré Lima joined the room.15:07:26
@elikoga:matrix.orgelikoga changed their profile picture.17:27:46
23 Aug 2025
@limwa:matrix.orgAndré Lima Any tips on cross-compiling a package out-of-tree with a compiler that's also built out-of-tree? I was looking into mkScopeWithSplicing', but I'm not sure how to use it outside of the Nixpkgs repository.
The concrete goal I'm trying to achieve is 1. compile a specific revision of LLVM that's used by Polygeist and 2. be able to use the clang compiler with the libc provided by that revision to cross-compile programs to another architecture. Any help is appreciated 🙏
22:37:19
24 Aug 2025
@corridor4572:matrix.orgRichInOverdraft changed their display name from Richman to rich.04:10:44
@artturin:matrix.orgArtturinWith overlays12:22:57
@artturin:matrix.orgArtturin* With a overlay12:23:14
@artturin:matrix.orgArtturinThen you can use mkScopeWithSplicing because the set will be available top-level12:24:03
@artturin:matrix.orgArtturin* Then you can use makeScopeWithSplicing' because the set will be available top-level12:24:50
@artturin:matrix.orgArtturinYou don't necessarily need a scope12:28:13
@artturin:matrix.orgArtturinUse overlays and callPackage to get deps, then you don't have to do anything non-cross specific unless the package itself needs something12:28:39
@artturin:matrix.orgArtturin* Use overlays and callPackage to get deps, then you don't have to do anything cross specific unless the package itself needs something12:28:55
@limwa:matrix.orgAndré LimaThat's very helpful, thanks12:33:44
@artturin:matrix.orgArtturin* Define your packages in an overlay and use callPackage in the overlay to get deps, then you don't have to do anything cross specific unless the package itself needs something12:34:05
@emilazy:matrix.orgemily I think you can use it without an overlay if you use splice.nix right? 12:56:45
@artturin:matrix.orgArtturinsplice.nix doesn't help with that12:59:48
@artturin:matrix.orgArtturin You can get otherSplices without an overlay if you use all the different callPackages yourself 13:00:15
@emilazy:matrix.orgemily it provides a generateSplicesForMkScope you can use with makeScopeWithSplicing' right? but I guess the problem is mixing in stuff from the main package set… 13:00:19
@artturin:matrix.orgArtturin generateSplicesForMkScope gets from pkgsBuildBuild and so on 13:00:39
@artturin:matrix.orgArtturin
selfBuildBuild = lib.attrByPath (split "pkgsBuildBuild") bad pkgs;
selfBuildHost = lib.attrByPath (split "pkgsBuildHost") bad pkgs;
selfBuildTarget = lib.attrByPath (split "pkgsBuildTarget") bad pkgs;
selfHostHost = lib.attrByPath (split "pkgsHostHost") bad pkgs;
selfHostTarget = lib.attrByPath (split "pkgsHostTarget") bad pkgs;
selfTargetTarget = lib.attrByPath (split "pkgsTargetTarget") { } pkgs;
13:00:48
@emilazy:matrix.orgemilyI really wish we could have generic builder functions for compiler scopes that can be used out-of-tree to produce correct cross results without an overlay13:00:50
@artturin:matrix.orgArtturin Used like this otherSplices = generateSplicesForMkScope "xfce"; 13:01:58

Show newer messages


Back to Room ListRoom Version: 6