!lheuhImcToQZYTQTuI:nixos.org

Nix on macOS

1181 Members
“There are still many issues with the Darwin platform but most of it is quite usable.” — http://yves.gnu-darwin.org194 Servers

Load older messages


SenderMessageTime
17 Jan 2026
@alexfmpe:matrix.orgalexfmpeat any rate, the libiconv error seems odd16:43:06
@alexfmpe:matrix.orgalexfmpeis the expression even right? should I be overriding stdenv for hello only?16:44:12
@reckenrode:matrix.orgRandy EckenrodeThe expression seems right.16:47:04
@reckenrode:matrix.orgRandy Eckenrode Can you nix develop (or whatever the equivalent is for the old CLI) the failing drv to check that the path to libiconv is there and that ld is wrapped? 16:48:00
@alexfmpe:matrix.orgalexfmpe
$ nix-shell -E "with import ./. {}; pkgs.hello.override { stdenv = pkgs.gccStdenv; }"
Using versionCheckHook

# echo $NIX_LDFLAGS
-liconv

# which ld
/nix/store/cjkf5fm587xv34pz9zfs3q2qpvij61fz-gcc-wrapper-15.2.0/bin/ld
16:54:10
@alexfmpe:matrix.orgalexfmpe fwiw, with gnuStdenv I get /usr/bin/ld 16:56:43
@alexfmpe:matrix.orgalexfmpe *
$ nix-shell -E "with import ./. {}; pkgs.hello.override { stdenv = pkgs.gccStdenv; }"
Using versionCheckHook

# echo $NIX_LDFLAGS
-liconv

# which ld
/nix/store/cjkf5fm587xv34pz9zfs3q2qpvij61fz-gcc-wrapper-15.2.0/bin/ld

# ld
ld: library not found for -liconv
16:57:25
@alexfmpe:matrix.orgalexfmpe *
$ nix-shell -E "with import ./. {}; pkgs.hello.override { stdenv = pkgs.gccStdenv; }"
Using versionCheckHook

# env | grep iconv
NIX_LDFLAGS=-liconv

# which ld
/nix/store/cjkf5fm587xv34pz9zfs3q2qpvij61fz-gcc-wrapper-15.2.0/bin/ld

# ld
ld: library not found for -liconv
16:59:57
@alexfmpe:matrix.orgalexfmpe * fwiw, with gnuStdenv I get /usr/bin/ld (or rather, it's unchanged) 17:01:19
@reckenrode:matrix.orgRandy EckenrodeThat’s definitely not right.17:13:04
@alexfmpe:matrix.orgalexfmpeno clue how to debug/fix this, but up for legwork if that helps17:22:37
@alexfmpe:matrix.orgalexfmpeI'm waiting for builds anyway on the next best thing to work on17:23:38
@reckenrode:matrix.orgRandy Eckenrode SDKROOT is missing, which means there is no SDK. Hmm. 17:45:22
@reckenrode:matrix.orgRandy Eckenrode

gccStdenv =
  if stdenv.cc.isGNU then
    stdenv
  else
    stdenv.override {
      cc = buildPackages.gcc;
      allowedRequisites = null;
      # Remove libcxx/libcxxabi, and add clang for AS if on darwin (it uses
      # clang's internal assembler).
      extraBuildInputs = lib.optional stdenv.hostPlatform.isDarwin clang.cc;
    };
17:46:16
@reckenrode:matrix.orgRandy EckenrodeThat’s probably not right. I guess this has been broken since the SDK rework.17:46:28
@reckenrode:matrix.orgRandy Eckenrode Should be extraBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ clang.cc apple-sdk ]. 17:47:13
@alexfmpe:matrix.orgalexfmpetesting17:47:50
@reckenrode:matrix.orgRandy Eckenrode Though I don’t think the clang.cc is needed anymore for as. That’s done as a script with an absolute path to clang. 17:48:50
@reckenrode:matrix.orgRandy Eckenrode (Not unless something expects to invoke clang explicitly as the assembler, so it may not be worth dropping it.) 17:50:13
@alexfmpe:matrix.orgalexfmpe

adding apple-sdk there causes -L to be passed with libiconv

echo $NIX_LDFLAGS
-liconv -L/nix/store/6nmmi317rg2bnybndbgc944dpg5cnl5a-libiconv-109.100.2/lib -L/nix/store/lgcr7kswpb1hap1vsjwrzzcqjks0xal6-libresolv-91/lib -L/nix/store/0x1fcnqb9lf6x3vcn53rxn7ijv7skg7y-libsbuf-14.1.0/lib -L/nix/store/fq0jizzyjkilz0rj3kvc1hskc7ry84ds-libutil-72/lib -L/nix/store/6nmmi317rg2bnybndbgc944dpg5cnl5a-libiconv-109.100.2/lib -L/nix/store/lgcr7kswpb1hap1vsjwrzzcqjks0xal6-libresolv-91/lib -L/nix/store/0x1fcnqb9lf6x3vcn53rxn7ijv7skg7y-libsbuf-14.1.0/lib -L/nix/store/fq0jizzyjkilz0rj3kvc1hskc7ry84ds-libutil-72/lib
17:51:57
@alexfmpe:matrix.orgalexfmpe

building hello now gets through configure but fails with several errors on string.h

lib/string.h:754:20: error: expected declaration specifiers or '...' before '__builtin_object_size'
  754 | _GL_EXTERN_C void *memcpy (void *__dest, const void *__src, size_t __n)
17:52:48
@emilazy:matrix.orgemily note that GCC does not even support aarch64-darwin upstream 17:56:47
@emilazy:matrix.orgemilywe basically only use it at all because nobody's gotten around to integrating Flang for Fortran yet17:57:17
@alexfmpe:matrix.orgalexfmpeouch17:57:27
@alexfmpe:matrix.orgalexfmpe *

adding apple-sdk there causes -L to be passed with libiconv

$ echo $NIX_LDFLAGS
-liconv -L/nix/store/6nmmi317rg2bnybndbgc944dpg5cnl5a-libiconv-109.100.2/lib -L/nix/store/lgcr7kswpb1hap1vsjwrzzcqjks0xal6-libresolv-91/lib -L/nix/store/0x1fcnqb9lf6x3vcn53rxn7ijv7skg7y-libsbuf-14.1.0/lib -L/nix/store/fq0jizzyjkilz0rj3kvc1hskc7ry84ds-libutil-72/lib -L/nix/store/6nmmi317rg2bnybndbgc944dpg5cnl5a-libiconv-109.100.2/lib -L/nix/store/lgcr7kswpb1hap1vsjwrzzcqjks0xal6-libresolv-91/lib -L/nix/store/0x1fcnqb9lf6x3vcn53rxn7ijv7skg7y-libsbuf-14.1.0/lib -L/nix/store/fq0jizzyjkilz0rj3kvc1hskc7ry84ds-libutil-72/lib
17:57:32
@alexfmpe:matrix.orgalexfmpeso I guess...PR the apple-sdk addition and call it a day?17:57:45
@reckenrode:matrix.orgRandy EckenrodeI think there is work (slowly) being done to add support upstream, but it’s slow going.17:57:56
@alexfmpe:matrix.orgalexfmpemakes it less broken afterall17:58:01
@reckenrode:matrix.orgRandy Eckenrode * 17:58:06
@reckenrode:matrix.orgRandy EckenrodeI wouldn’t be surprised if whatever GNU is doing to generate their own headers is not compatible with recent SDKs and GCC.17:58:40

Show newer messages


Back to Room ListRoom Version: 6