Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

darwin.xnu: use unwrapped clang for MIGCC #324440

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) (
--replace " -o 0" "" \
--replace '$SRC/$mig' '-I$DSTROOT/include $SRC/$mig' \
--replace '$SRC/servers/netname.defs' '-I$DSTROOT/include $SRC/servers/netname.defs' \
--replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR' \
--replace 'MACHINE_ARCH=armv7' 'MACHINE_ARCH=arm64' # this might break the comments saying 32-bit is required
--replace '$BUILT_PRODUCTS_DIR/mig_hdr' '$BUILT_PRODUCTS_DIR'

patchShebangs .
'' + lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinSdkVersion "11") ''
Expand All @@ -72,11 +71,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) (
HOST_FLEX = "flex";
HOST_BISON = "bison";
HOST_GM4 = "m4";
# use unwrapped clang to generate headers because wrapper is not compatible with a 32 bit -arch.
# aarch64 should likely do this as well and remove the --replace MACHINE_ARCH above
MIGCC = if stdenv.isx86_64 && lib.versionAtLeast stdenv.hostPlatform.darwinSdkVersion "11"
then "${lib.getBin pkgsBuildBuild.stdenv.cc.cc}/bin/clang"
else "cc";
MIGCC = "${lib.getBin pkgsBuildBuild.stdenv.cc.cc}/bin/clang";
ARCHS = arch;
ARCH_CONFIGS = arch;

Expand Down