-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
treewide: change various flags to allow x64 darwin to default to sdk 11.0 when ready #324155
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ appleDerivation', lib, stdenv, stdenvNoCC, buildPackages | ||
{ appleDerivation', lib, stdenv, stdenvNoCC, buildPackages, pkgsBuildBuild | ||
, bootstrap_cmds, bison, flex | ||
, gnum4, unifdef, perl, python3 | ||
, headersOnly ? true | ||
|
@@ -12,7 +12,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ( | |
|
||
nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ]; | ||
|
||
patches = lib.optionals stdenv.isx86_64 [ ./python3.patch ]; | ||
patches = lib.optionals (lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11") [ ./python3.patch ]; | ||
|
||
postPatch = '' | ||
substituteInPlace Makefile \ | ||
|
@@ -48,7 +48,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ( | |
--replace 'MACHINE_ARCH=armv7' 'MACHINE_ARCH=arm64' # this might break the comments saying 32-bit is required | ||
|
||
patchShebangs . | ||
'' + lib.optionalString stdenv.isAarch64 '' | ||
'' + lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinSdkVersion "11") '' | ||
# iig is closed-sourced, we don't have it | ||
# create an empty file to the header instead | ||
# this line becomes: echo "" > $@; echo --header ... | ||
|
@@ -72,15 +72,19 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ( | |
HOST_FLEX = "flex"; | ||
HOST_BISON = "bison"; | ||
HOST_GM4 = "m4"; | ||
MIGCC = "cc"; | ||
# 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"; | ||
ARCHS = arch; | ||
ARCH_CONFIGS = arch; | ||
|
||
env.NIX_CFLAGS_COMPILE = "-Wno-error"; | ||
|
||
preBuild = let macosVersion = | ||
"10.0 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8 10.9 10.10 10.11" + | ||
lib.optionalString stdenv.isAarch64 " 10.12 10.13 10.14 10.15 11.0"; | ||
lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinSdkVersion "11") " 10.12 10.13 10.14 10.15 11.0"; | ||
in '' | ||
# This is a bit of a hack... | ||
mkdir -p sdk/usr/local/libexec | ||
|
@@ -150,7 +154,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ( | |
mv $out/Library/Frameworks/IOKit.framework $out/Library/PrivateFrameworks | ||
''; | ||
|
||
appleHeaders = builtins.readFile (./. + "/headers-${arch}.txt"); | ||
appleHeaders = builtins.readFile (./. + "/headers-${stdenv.hostPlatform.darwinSdkVersion}-${arch}.txt"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will we ever want to split on more than the architecture? I'd say the goal is to unsplit these header checks eventually. If they're even still useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way to do these in the future probably requires us to inventory the upstream SDKs and compare our headers to those in the SDK. Otherwise, using headers + stubs with more than a few SDKs is going to get painful quickly. (Or I wouldn’t worry too much about the current situation because it’s going to need to change.) |
||
} // lib.optionalAttrs headersOnly { | ||
HOST_CODESIGN = "echo"; | ||
HOST_CODESIGN_ALLOCATE = "echo"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this shouldn't be conditional? Even the 10.12 script relies on the 32-bit arch compiler. Or does the wrapper only force a 64-bit architecture when using the 11 SDK?