!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

518 Members
108 Servers

Load older messages


SenderMessageTime
15 Sep 2025
@rosscomputerguy:matrix.orgTristan RossWhich seems to somewhat be possible but isn't exactly tested19:31:27
@rosscomputerguy:matrix.orgTristan RossI've been wanting to do an LLVM bootstrap but there's been blockers, like cleaning up the versions.19:32:34
@rosscomputerguy:matrix.orgTristan RossAnd redoing the default.nix to not split tools and libraries is something that's better as well.19:33:16
@matthewcroughan:defenestrate.itmatthewcroughan

Tristan Ross: Is this misconfigured? Because it's still producing errors

  nixpkgs.buildPlatform = "aarch64-unknown-linux-gnu";
  nixpkgs.hostPlatform = lib.recursiveUpdate (lib.systems.elaborate "aarch64-linux") {
    useLLVM = true;
    linker = "lld";
    linux-kernel.target = "vmlinuz.efi";
    linux-kernel.installTarget = "zinstall";
    config = "aarch64-unknown-linux-musl";
  };

19:39:49
@matthewcroughan:defenestrate.itmatthewcroughanI will get you the diff shortly19:40:13
@rosscomputerguy:matrix.orgTristan RossThat should be fine19:40:18
@rosscomputerguy:matrix.orgTristan RossThe diff would help19:40:23
@rosscomputerguy:matrix.orgTristan RossAnd whatever errors you get19:40:31
@matthewcroughan:defenestrate.itmatthewcroughanAh okay, no sorry, different build failure now19:41:16
@matthewcroughan:defenestrate.itmatthewcroughan
error: builder for '/nix/store/hgl5bcxdmp4qlma4b48njyxa02qyj8kz-glibc-nolibgcc-aarch64-unknown-linux-musl-2.40-66.drv' failed with exit code 2;
       last 25 log lines:
       > ../sysdeps/unix/sysv/linux/gettimeofday.c:56:1: note: in expansion of macro 'weak_alias'
       >    56 | weak_alias (__gettimeofday, gettimeofday)
       >       | ^~~~~~~~~~
       > ../sysdeps/unix/sysv/linux/gettimeofday.c:42:13: note: aliased declaration here
       >    42 | libc_ifunc (__gettimeofday,
       >       |             ^~~~~~~~~~~~~~
       > ./../include/libc-symbols.h:672:25: note: in definition of macro '__ifunc_resolver'
       >   672 |   __typeof (type_name) *name##_ifunc (__VA_ARGS__)                      \
       >       |                         ^~~~
       > ./../include/libc-symbols.h:710:3: note: in expansion of macro '__ifunc_args'
       >   710 |   __ifunc_args (type_name, name, expr, init, arg)
       >       |   ^~~~~~~~~~~~
       > ./../include/libc-symbols.h:794:32: note: in expansion of macro '__ifunc'
       >   794 | #define libc_ifunc(name, expr) __ifunc (name, name, expr, void, INIT_ARCH)
       >       |                                ^~~~~~~
       > ../sysdeps/unix/sysv/linux/gettimeofday.c:42:1: note: in expansion of macro 'libc_ifunc'
       >    42 | libc_ifunc (__gettimeofday,
       >       | ^~~~~~~~~~
       > cc1: all warnings being treated as errors
       > make[2]: *** [/build/build/sysd-rules:25: /build/build/time/gettimeofday.os] Error 1
       > make[2]: *** Waiting for unfinished jobs....
       > make[2]: Leaving directory '/build/glibc-2.40/time'
       > make[1]: *** [Makefile:484: time/subdir_lib] Error 2
       > make[1]: Leaving directory '/build/glibc-2.40'
       > make: *** [Makefile:9: all] Error 2
       For full logs, run 'nix log /nix/store/hgl5bcxdmp4qlma4b48njyxa02qyj8kz-glibc-nolibgcc-aarch64-unknown-linux-musl-2.40-66.drv'
19:41:26
@matthewcroughan:defenestrate.itmatthewcroughan

ah the actual error is here:

glibc-nolibgcc-aarch64-unknown-linux-musl> ../sysdeps/unix/sysv/linux/gettimeofday.c:56:29: error: 'gettimeofday' alias between functions of incompatible types 'int(struct timeval *, void *)' and 'int (*(void))(struct timeval *, void *)' [8;;https://gcc.gnu.org/onlinedocs/gcc-14.3.0/gcc/Warning-Options.html#index-Wattribute-alias-Werror=attribute-alias=8;;]
glibc-nolibgcc-aarch64-unknown-linux-musl>    56 | weak_alias (__gettimeofday, gettimeofday)
19:43:01
@matthewcroughan:defenestrate.itmatthewcroughanTrying staging19:43:33
@matthewcroughan:defenestrate.itmatthewcroughan Same there, is it another wno-error that needs to go atop pkgs/development/libraries/glibc/default.nix ? 19:46:33
@matthewcroughan:defenestrate.itmatthewcroughan
pkgs/development/libraries/glibc/default.nix
79:            (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
19:55:12
@matthewcroughan:defenestrate.itmatthewcroughanactually looks like it already should be19:55:17
@matthewcroughan:defenestrate.itmatthewcroughan so is something wrong with my hostPlatform Tristan Ross ? 19:55:24
@rosscomputerguy:matrix.orgTristan RossI'm not sure19:56:43
@matthewcroughan:defenestrate.itmatthewcroughan I guess (lib.systems.elaborate "aarch64-linux") is somehow making the isMusl set to false 19:57:25
@matthewcroughan:defenestrate.itmatthewcroughanIn which case, reverting to the legacy method seems better19:57:56
@matthewcroughan:defenestrate.itmatthewcroughan
19:57:57
@matthewcroughan:defenestrate.itmatthewcroughan *
  nixpkgs.localSystem = {
    system = "aarch64-unknown-linux-gnu";
  };
  nixpkgs.crossSystem = {
    config = "aarch64-unknown-linux-musl";
    useLLVM = true;
    linker = "lld";
  };

``
19:58:00
@matthewcroughan:defenestrate.itmatthewcroughan *
  nixpkgs.localSystem = {
    system = "aarch64-unknown-linux-gnu";
  };
  nixpkgs.crossSystem = {
    config = "aarch64-unknown-linux-musl";
    useLLVM = true;
    linker = "lld";
  };
19:58:05
@matthewcroughan:defenestrate.itmatthewcroughanAnd in that setup, I get the relocation issue19:58:21
@matthewcroughan:defenestrate.itmatthewcroughan Tristan Ross: in pkgsLLVM.pkgsMusl.buildPlatform the linker is linker = "bfd"; 20:07:15
@matthewcroughan:defenestrate.itmatthewcroughan pkgsLLVM.buildPlatform's linker is also bfd 20:07:36
@rosscomputerguy:matrix.orgTristan RossYes, that's right20:07:43
@rosscomputerguy:matrix.orgTristan RossThat's the default on GNU20:07:50
@matthewcroughan:defenestrate.itmatthewcroughan
nix-repl> pkgsLLVM.pkgsMusl.hostPlatform.linker 
"bfd"
20:07:58
@rosscomputerguy:matrix.orgTristan Ross
nix-repl> legacyPackages.aarch64-linux.hostPlatform.linker
"bfd"
20:08:02
@matthewcroughan:defenestrate.itmatthewcroughanand is that also correct?20:08:02

Show newer messages


Back to Room ListRoom Version: 6