darwin/xcode: remove -arch flags

These are now provided by the standard bintools and cc wrappers.
This commit is contained in:
Andrew Childs 2020-12-12 15:49:48 +09:00
parent b26e0bac8d
commit 8feb949ab5

View file

@ -14,12 +14,6 @@ let
minSdkVersion = targetPlatform.minSdkVersion or "9.0";
iosPlatformArch = { parsed, ... }: {
armv7a = "armv7";
aarch64 = "arm64";
x86_64 = "x86_64";
}.${parsed.cpu.name};
in
rec {
@ -35,9 +29,7 @@ rec {
binutils = wrapBintoolsWith {
libc = targetIosSdkPkgs.libraries;
bintools = binutils-unwrapped;
extraBuildCommands = ''
echo "-arch ${iosPlatformArch targetPlatform}" >> $out/nix-support/libc-ldflags
'' + lib.optionalString (sdk.platform == "iPhoneSimulator") ''
extraBuildCommands = lib.optionalString (sdk.platform == "iPhoneSimulator") ''
echo "-platform_version ios-sim ${minSdkVersion} ${sdk.version}" >> $out/nix-support/libc-ldflags
'' + lib.optionalString (sdk.platform == "iPhoneOS") ''
echo "-platform_version ios ${minSdkVersion} ${sdk.version}" >> $out/nix-support/libc-ldflags
@ -52,7 +44,7 @@ rec {
extraBuildCommands = ''
tr '\n' ' ' < $out/nix-support/cc-cflags > cc-cflags.tmp
mv cc-cflags.tmp $out/nix-support/cc-cflags
echo "-target ${targetPlatform.config} -arch ${iosPlatformArch targetPlatform}" >> $out/nix-support/cc-cflags
echo "-target ${targetPlatform.config}" >> $out/nix-support/cc-cflags
echo "-isystem ${sdk}/usr/include${lib.optionalString (lib.versionAtLeast "10" sdk.version) " -isystem ${sdk}/usr/include/c++/4.2.1/ -stdlib=libstdc++"}" >> $out/nix-support/cc-cflags
'' + lib.optionalString (sdk.platform == "iPhoneSimulator") ''
echo "-mios-simulator-version-min=${minSdkVersion}" >> $out/nix-support/cc-cflags