pkgsCross.aarch64-multiplatform.ubootQemuAarch64
fails to build on aarch64-darwin
#203775
Labels
0.kind: build failure
6.topic: cross-compilation
Building packages on a different sort platform than than they will be run on
6.topic: darwin
Running or building packages on Darwin
Build failure
This may be a tall order, but ultimately, I'd like
to succeed on
aarch64-darwin
, to make it easy to do linux kernel development on M1/... chips under QEMU.Situation
Today, this command fails initially due to #137877, which is now fixed in staging-next, in commit e9f52e8.
Continuing with nixpkgs from that commit:
reveals new errors that look like:
I think due to u-boot's Makefile calling
sw_vers
to decide what compiler/linker flags to pass to different versions of Apple's C toolchain: https://source.denx.de/u-boot/u-boot/-/blob/master/Makefile#L308-338.The fix for this issue, I think, is to add
darwin.DarwinTools
tonativeBuildInputs
or similar.Continuing with that change:
we get a new error about
gcc
not being found:This is actually due to the need to build Kconfig itself as part of
configurePhase
and can, in principle, be solved either by makinggcc
available or by usingclang
to build Kconfig, with something like eitheror
Unhappily, neither of these attempted fixes works in the end, for different reasons but in similar ways across many variations of
HOSTCC=clang
/HOSTCC=gcc
:buildPhase
with errors that look likeFinally, digging one step deeper on the
HOSTCC=gcc
family of errors: I think that part of the problem on this branch of the tree of attempted fixes is that nixpkgs on Darwin secretly wraps Apple's Mach-Old
, which AIUI can no longer be configured to tolerate multiply-defined symbols in the same way that GNU ld can?(Specifically: Darwin
ld
does not accept the--accept-multiple-definition
/-z multdef
flags that GNUld
does and further, recent versions of Darwinld
have obsoleted the previous workaround that U-Boot natively uses, which is to pass-multiply_defined suppress
when it detects that Darwin'sld
is in use, which I think it does not do successfully in this setup?)Notify maintainers
@bartsch @dezgeg @samueldr @lopsided98
Thanks
Finally, regards + thanks in advance for any thoughts / suggestions; I know this is a rather finicky thing to try to get to work!
The text was updated successfully, but these errors were encountered: