From 26096a3306970686df8f69edc789b6d87e4de833 Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Fri, 14 May 2021 14:16:34 +0200 Subject: [PATCH 1/3] A small step toward building a toolchain on M1 Mac --- Utilities/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index 8a10f221a06..6d722584df6 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -805,7 +805,7 @@ def get_swiftpm_flags(args): build_target = get_build_target(args) cross_compile_hosts = args.cross_compile_hosts - if build_target == 'x86_64-apple-macosx' and "macosx-arm64" in cross_compile_hosts: + if (build_target == 'x86_64-apple-macosx' or build_target == 'arm64-apple-macosx') and "macosx-arm64" in cross_compile_hosts: build_flags += ["--arch", "x86_64", "--arch", "arm64"] elif cross_compile_hosts: error("cannot cross-compile for %s" % cross_compile_hosts) From 99f712209011301ef2938b786bd4475c64982bd6 Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Wed, 19 May 2021 11:47:58 +0200 Subject: [PATCH 2/3] Remove filtering by "build_target" --- Utilities/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index 6d722584df6..19ca1b9d0c5 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -805,7 +805,7 @@ def get_swiftpm_flags(args): build_target = get_build_target(args) cross_compile_hosts = args.cross_compile_hosts - if (build_target == 'x86_64-apple-macosx' or build_target == 'arm64-apple-macosx') and "macosx-arm64" in cross_compile_hosts: + if "macosx-arm64" in cross_compile_hosts: build_flags += ["--arch", "x86_64", "--arch", "arm64"] elif cross_compile_hosts: error("cannot cross-compile for %s" % cross_compile_hosts) From 925f892b311523e1c8b86983eaebc493f9b743bc Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Tue, 25 May 2021 10:12:09 +0200 Subject: [PATCH 3/3] check only for presence of cross_compile_hosts preset --- Utilities/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/bootstrap b/Utilities/bootstrap index 19ca1b9d0c5..3ac4da0aeb7 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -805,7 +805,7 @@ def get_swiftpm_flags(args): build_target = get_build_target(args) cross_compile_hosts = args.cross_compile_hosts - if "macosx-arm64" in cross_compile_hosts: + if cross_compile_hosts is not None: build_flags += ["--arch", "x86_64", "--arch", "arm64"] elif cross_compile_hosts: error("cannot cross-compile for %s" % cross_compile_hosts)