!ayCRiZriCVtuCUpeLp:nixos.org

Nix Cross Compiling

561 Members
121 Servers

Load older messages


SenderMessageTime
3 Dec 2024
@kuruczgy:matrix.orgkuruczgyI think clang supports emitting just LLVM IR (.bc files), and only emitting the actual host platform machine code after linking the final binary (this is how LTO works AFAIK). So if the libs could just be compiled to .bc, you would not have to recompile it to each different fpu/mcu combo. (Of course this only works if the libs don't make assumptions about the host, e.g. they don't require you to already specify the exact mcu at compile time.)11:47:52
@reckenrode:matrix.orgRandy EckenrodeFrom what I understand, LLVM bitcode is not portable. It’s possible that may work, but it also may not work. This was a frequent source of speculation on Apple platforms before Apple Silicon was announced. If Apple were requiring bitcode submissions to the App Store, does that mean Apple could recompile everyone’s apps for ARM64? According to Chris Lattner, no.12:37:16
@reckenrode:matrix.orgRandy EckenrodeHowever, the pain seems to be with having to build a toolchain for every combination. There are some changes in staging that should allow one LLVM toolchain to be used to target different platforms12:38:08
@reckenrode:matrix.orgRandy Eckenrode * 12:38:12
@rsdy:rustch.at@rsdy:rustch.at changed their display name from rsdy to rsdy (old).18:05:48
@rsdy:rustch.at@rsdy:rustch.at left the room.18:56:54
4 Dec 2024
@alexfmpe:matrix.orgalexfmpe

nix-build -A pkgsCross.aarch64-android.llvmPackages.compiler-rt fails with

/build/compiler-rt-src-18.1.8/compiler-rt/lib/builtins/os_version_check.c:287:10: fatal error: 'pthread.h' file not found
  287 | #include <pthread.h>
      |          ^~~~~~~~~~~
1 error generated.
00:36:41
@alexfmpe:matrix.orgalexfmpeany clue where I can get it from? I found this pthreadstubs thing but trying to add it to inputs gives me an infinite recursion00:37:05
@alexfmpe:matrix.orgalexfmpeI might be holding it wrong00:37:08
@alexfmpe:matrix.orgalexfmpe ah the recursion happens when adding it to buildInputs
no such thing on nativeBuildInputs but doesn't fix it either
01:10:52
@alexfmpe:matrix.orgalexfmpe

hmm what I was actually trying to build is nix-build -A pkgsCross.aarch64-android.hello and now I notice that somehow tries to build compiler-rt and stdenv twice?

these 11 derivations will be built:
  /nix/store/jhn29m1681gxzps1sxfx8k2cn095ii63-compiler-rt-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/6xzb5f6kgdlvy8g6wff8qjfaapr2qb11-aarch64-unknown-linux-android-clang-wrapper-18.1.8.drv
  /nix/store/ckkly8cmq42d0hhd336jnr7qnvxcp154-stdenv-linux.drv
  /nix/store/g9mrv1h7wssdnbs94xqj3whn3nvly2wf-libunwind-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/bd8yrwvqxrkx8x13xgpf0wczv6rf2i9d-libcxx-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/jpk1xkn2zb72n6h8yk8wv4vi8abk704g-aarch64-unknown-linux-android-clang-wrapper-18.1.8.drv
  /nix/store/cxlyqni5w767a1wydi46jscj7841258i-stdenv-linux.drv
  /nix/store/86iixshw0gv2lpm948pdhrmq8dwmw8ww-compiler-rt-libc-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/9hz1mqp97knc52v7w070gzi2nqdlsnrp-aarch64-unknown-linux-android-clang-wrapper-18.1.8.drv
  /nix/store/lw1ky1s9xxlf41jgncd0bm2ss327n3sl-stdenv-linux.drv
  /nix/store/cc8328dz2ldwd2ff6d9i3q5n58jxdq1p-hello-aarch64-unknown-linux-android-2.12.1.drv
01:14:33
@alexfmpe:matrix.orgalexfmpe *

hmm what I was actually trying to build is nix-build -A pkgsCross.aarch64-android.hello and now I notice that somehow tries to build compiler-rt twice and stdenv thrice? wth?

these 11 derivations will be built:
  /nix/store/jhn29m1681gxzps1sxfx8k2cn095ii63-compiler-rt-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/6xzb5f6kgdlvy8g6wff8qjfaapr2qb11-aarch64-unknown-linux-android-clang-wrapper-18.1.8.drv
  /nix/store/ckkly8cmq42d0hhd336jnr7qnvxcp154-stdenv-linux.drv
  /nix/store/g9mrv1h7wssdnbs94xqj3whn3nvly2wf-libunwind-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/bd8yrwvqxrkx8x13xgpf0wczv6rf2i9d-libcxx-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/jpk1xkn2zb72n6h8yk8wv4vi8abk704g-aarch64-unknown-linux-android-clang-wrapper-18.1.8.drv
  /nix/store/cxlyqni5w767a1wydi46jscj7841258i-stdenv-linux.drv
  /nix/store/86iixshw0gv2lpm948pdhrmq8dwmw8ww-compiler-rt-libc-aarch64-unknown-linux-android-18.1.8.drv
  /nix/store/9hz1mqp97knc52v7w070gzi2nqdlsnrp-aarch64-unknown-linux-android-clang-wrapper-18.1.8.drv
  /nix/store/lw1ky1s9xxlf41jgncd0bm2ss327n3sl-stdenv-linux.drv
  /nix/store/cc8328dz2ldwd2ff6d9i3q5n58jxdq1p-hello-aarch64-unknown-linux-android-2.12.1.drv
01:14:50
@alexfmpe:matrix.orgalexfmpe this first compiler-rt is a dependency of everything else there, verified with --keep-going 01:16:32
@alexfmpe:matrix.orgalexfmpe FWIW aarch64-android-prebuild.hello works just fine 01:16:53
@alexfmpe:matrix.orgalexfmpe * FWIW aarch64-android-prebuilt.hello works just fine 01:17:07
@artturin:matrix.orgArtturinI don't think anyone uses non -prebuilt01:29:53
@artturin:matrix.orgArtturinMaybe need to separate headers from the ndk?01:41:46
@artturin:matrix.orgArtturinDunno where else would you get pthread for android if it's different from normal01:42:24
@artturin:matrix.orgArtturin
In reply to @alexfmpe:matrix.org
ah the recursion happens when adding it to buildInputs
no such thing on nativeBuildInputs but doesn't fix it either
Because of strictDeps, you can try to cheat it with buildPackages.pthreadstubs in buildInputs if there's no hostPlatform diff
01:43:45
@mmlb:matrix.org@mmlb:matrix.org left the room.02:44:03
@xin:xiny.lixin changed their display name from Xinyang Li to xin.15:45:05
5 Dec 2024
@aliarokapis:matrix.orgAlexandros Liarokapis this shoulds very interesting, can you point me to anything to take a look at the changes? 08:40:13
@aliarokapis:matrix.orgAlexandros Liarokapis * this shoulds very interesting, can you point me to the changes? 08:40:25
@k900:0upti.meK900Anyone want a fun adventure08:40:52
@k900:0upti.meK900Mesa 24.3 broke cross08:41:00
@k900:0upti.meK900When the asahi driver is enabled08:41:05
@k900:0upti.meK900It's very fixable08:42:33
@k900:0upti.meK900You just need to do some pretty invasive surgery08:42:45
@qualytllc:matrix.orgDanny Gerhardt joined the room.09:58:05
@reckenrode:matrix.orgRandy Eckenrode
In reply to @aliarokapis:matrix.org
this shoulds very interesting, can you point me to the changes?
https://github.com/NixOS/nixpkgs/pull/355532
https://github.com/NixOS/nixpkgs/pull/356162
https://github.com/NixOS/nixpkgs/pull/357633
12:03:00

Show newer messages


Back to Room ListRoom Version: 6