Conversation
lzcunt
left a comment
There was a problem hiding this comment.
freestanding-toolchain assumes LLVM toolchains are in PATH so it should be patched to support LLVM toolchains not in path. As a workaround you can try passing all of AR_FOR_TARGET, CC_FOR_TARGET, LD_FOR_TARGET, OBJCOPY_FOR_TARGET, OBJDUMP_FOR_TARGET, READELF_FOR_TARGET.
|
unwrapped clang shouldn't do stuff like adding architecture related args like wrapped one does, right? I wonder if this could also fix building on Darwin |
By architecture related args if you mean --target no that's staying, that's added by limine's build system but stuff like hardening flags would not be added. I haven't tested but this could also remove the need for disabling zerocallusedregs (I think cc-wrapper adds that in?) but we might consider adding supported hardening flags manually since likely all of them will stop functioning with the unwrapped clang. |
I mean I had access to a macbook for few hours in October so I tried to get it to build and as far as I remember it was because wrapper was adding march or something which was conflicting with --target. I might be wrong tho and I can't really verify this anymore |
lzcunt
left a comment
There was a problem hiding this comment.
Changes are good but freestanding-toolchain's checks fail when cross compiling (aka enableAll is broken)
|
Ok, so looking at Limine's build process, either Except the unwrapped clang can't find the C runtime libraries, so configure aborts before any of that can get checked. At this point, I'm tempted to just put up with the warning and cut the first line from each toolchain file. Or I suppose we can patch the script to accept a different clang. I'm not sure if |
|
I'm ashamed of what I had to do to work around this: if [ -z "$FREESTANDING_CC" ] && [ "x$WANT_FREESTANDING_CC" = "xyes" ]; then
_FREESTANDING_CC="clang -target $TRIPLET"
validate_cc "$_FREESTANDING_CC" || break
fi |
Not for NixOS itself when it wants to use Limine as bootloader for itself. But it is important for OS developers that want to create bootable images for various systems for their custom kernels/custom OS. Thanks for putting time and effort into this! |
lzcunt
left a comment
There was a problem hiding this comment.
The patch looks good, maybe consider squashing the second commit because it's a fixup.
Thanks for the patch! Hopefully we can update to 9.0 after this is merged
surfaceflinger
left a comment
There was a problem hiding this comment.
Everything works exactly as it did before it broke, thanks!
Resolves NixOS#377469 by compiling the freestanding part with an unwrapped compiler. This compiler is required to be the default directly in the `PATH`. However a *wrapped* compiler is *also* required, but can be passed by a `CC` environment variable. Includes change to clang path from lzcnt.
|
Resolves #377469 by compiling the freestanding part with an unwrapped compiler.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.