mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Swift: build x86_64 on arm64 macOS
This is a temporary workaround. At a later stage we will add * a Swift/LLVM prebuilt package for arm64 * universal binary for the extractor
This commit is contained in:
@@ -5,7 +5,11 @@ def _wrap_cc(rule, kwargs):
|
|||||||
_add_args(kwargs, "copts", [
|
_add_args(kwargs, "copts", [
|
||||||
# Required by LLVM/Swift
|
# Required by LLVM/Swift
|
||||||
"-fno-rtti",
|
"-fno-rtti",
|
||||||
])
|
] + select({
|
||||||
|
# temporary, before we do universal merging and have an arm prebuilt package, we make arm build x86
|
||||||
|
"@platforms//os:macos": ["-arch=x86_64"],
|
||||||
|
"//conditions:default": [],
|
||||||
|
}))
|
||||||
_add_args(kwargs, "features", [
|
_add_args(kwargs, "features", [
|
||||||
# temporary, before we do universal merging
|
# temporary, before we do universal merging
|
||||||
"-universal_binaries",
|
"-universal_binaries",
|
||||||
|
|||||||
@@ -1,11 +1,21 @@
|
|||||||
package(default_visibility = ["//swift:__subpackages__"])
|
package(default_visibility = ["//swift:__subpackages__"])
|
||||||
|
|
||||||
|
#TODO we will be introducing universal binaries at a later stage, when we have both architectures prebuilt for macOS
|
||||||
|
# for the moment, we make arm build an x86_64 binary
|
||||||
|
_arch_override = {
|
||||||
|
"darwin_arm64": "darwin_x86_64",
|
||||||
|
}
|
||||||
|
|
||||||
[
|
[
|
||||||
alias(
|
alias(
|
||||||
name = name,
|
name = name,
|
||||||
actual = select({
|
actual = select({
|
||||||
"@bazel_tools//src/conditions:%s" % arch: "@swift_prebuilt_%s//:%s" % (arch, name)
|
"@bazel_tools//src/conditions:%s" % arch: "@swift_prebuilt_%s//:%s" % (
|
||||||
|
_arch_override.get(arch, arch),
|
||||||
|
name,
|
||||||
|
)
|
||||||
for arch in ("linux", "darwin_x86_64", "darwin_arm64")
|
for arch in ("linux", "darwin_x86_64", "darwin_arm64")
|
||||||
}),
|
}),
|
||||||
) for name in ("swift-llvm-support", "swift-test-sdk")
|
)
|
||||||
|
for name in ("swift-llvm-support", "swift-test-sdk")
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user