!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

580 Members
128 Servers

Load older messages


SenderMessageTime
3 Jan 2025
@artturin:matrix.orgArtturin *
nix-repl> pkgsCross.x86_64-linux-mlibc.stdenv.cc.cc.langCC
true

Should be but

--enable-languages=c

17:04:42
@artturin:matrix.orgArtturin --enable-languages=c\,c++ nix log ".#stdenv.cc.cc" 17:05:03
@artturin:matrix.orgArtturin * --enable-languages=c\,c++ in nix log ".#stdenv.cc.cc" 17:05:08
@artturin:matrix.orgArtturinhttps://github.com/NixOS/nixpkgs/blob/8adbfd92518a59f18a8216c4b13a11cedc16abf0/pkgs/development/compilers/gcc/common/configure-flags.nix#L16717:05:48
@artturin:matrix.orgArtturin The configure flags: in the log is printed by configurePhase and not gcc's buildSystem 17:06:29
@artturin:matrix.orgArtturin * The configure flags: in the log is printed by configurePhase and not gcc's build system 17:06:34
@artturin:matrix.orgArtturin * The configure flags: in the log is printed by our configurePhase and not gcc's build system 17:06:40
@sananatheskenana:matrix.orglzcuntI just ran this and it didn't have c++17:07:05
@sananatheskenana:matrix.orglzcunthmm just maybe, the stdenvNoLibc gcc does not have c++ (I haven't looked into this yet because my internet is slow lol)17:07:27
@sananatheskenana:matrix.orglzcuntno it would have c++ because mlibc does compile when not cross compiling17:07:52
@sananatheskenana:matrix.orglzcunt
nix-repl> pkgs.pkgsCross.x86_64-linux-mlibc.mlibc.stdenv.cc.cc.langCC
false
17:11:14
@sananatheskenana:matrix.orglzcunthuh17:11:15
@sananatheskenana:matrix.orglzcuntyep stdenvNoLibc has c++ when not cross compiling and doesn't have c++ when cross compiling17:12:01
@sananatheskenana:matrix.orglzcuntI have a theory17:12:04
@artturin:matrix.orgArtturin
In reply to @sananatheskenana:matrix.org
nix-repl> pkgs.pkgsCross.x86_64-linux-mlibc.mlibc.stdenv.cc.cc.langCC
false
Ah I was looking in the wrong attr
17:12:32
@sananatheskenana:matrix.orglzcunt

in all-packages

stdenvNoLibc =
    if stdenvNoCC.hostPlatform != stdenvNoCC.buildPlatform
    then
      (if stdenvNoCC.hostPlatform.isDarwin || stdenvNoCC.hostPlatform.useLLVM or false
       then overrideCC stdenvNoCC buildPackages.llvmPackages.clangNoLibc
       else gccCrossLibcStdenv)
    else mkStdenvNoLibs stdenv;
17:14:08
@sananatheskenana:matrix.orglzcuntmy theory is that the else branch does have c++ but the other branch does not17:14:29
@sananatheskenana:matrix.orglzcuntso gccCrossLibcStdenv does not enable C++17:14:54
@artturin:matrix.orgArtturin Yep gccWithoutTargetLibc 17:15:06
@artturin:matrix.orgArtturin You can do / then ^ gccWithoutTargetLibc in vim 17:15:28
@sananatheskenana:matrix.orglzcuntah so nobody expected someone build a libc in C++17:16:29
@emilazy:matrix.orgemilyoh, it's C++?17:17:43
@emilazy:matrix.orgemilyI would have warned you it might be rough if you said so 😆17:17:58
@emilazy:matrix.orgemilythough I think the LLVM libc is C++ too?17:18:08
@sananatheskenana:matrix.orglzcuntI think LLVM libc doesn't use stdenvNoLibc?17:18:30
@sananatheskenana:matrix.orglzcunt because of the stdenvNoCC.hostPlatform.useLLVM check 17:18:44
@sananatheskenana:matrix.orglzcunt* I think LLVM libc doesn't use gccCrossLibcStdenv?17:19:17
@sananatheskenana:matrix.orglzcuntso basically if the LLVM libc PR decided to not default to using LLVM for everything they would have hit this issue too17:19:59
@sananatheskenana:matrix.orglzcuntwhat would be the correct way to handle this? this means clangNoLibc has C++ while gccWithoutTargetLibc does not17:22:00
@emilazy:matrix.orgemilyright17:22:01

Show newer messages


Back to Room ListRoom Version: 6