mirror of
https://github.com/urbit/vere.git
synced 2024-09-11 03:45:31 +03:00
Replace arm64
with aarch64
as canonical identifier for 64-bit ARM architecture (#52)
This commit is contained in:
parent
16df0cd516
commit
1203b900bb
16
.github/workflows/shared.yml
vendored
16
.github/workflows/shared.yml
vendored
@ -34,11 +34,11 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- { target: linux-arm64, runner: ubuntu-22.04 }
|
||||
- { target: linux-aarch64, runner: ubuntu-22.04 }
|
||||
- { target: linux-x86_64, runner: ubuntu-22.04 }
|
||||
# GitHub doesn't provide M1 macOS machines, so we self-host a runner
|
||||
# instead.
|
||||
- { target: macos-arm64, runner: [self-hosted, macos, ARM64] }
|
||||
- { target: macos-aarch64, runner: [self-hosted, macos, ARM64] }
|
||||
- { target: macos-x86_64, runner: macos-12 }
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@ -51,7 +51,7 @@ jobs:
|
||||
|
||||
- name: chown /usr/local
|
||||
run: |
|
||||
if [[ "${{ matrix.target }}" == "linux-arm64" || "${{ matrix.target }}" == "linux-x86_64" ]]; then
|
||||
if [[ "${{ matrix.target }}" == "linux-aarch64" || "${{ matrix.target }}" == "linux-x86_64" ]]; then
|
||||
# See https://github.com/actions/cache/issues/845.
|
||||
sudo chown -R $(whoami) /usr/local
|
||||
fi
|
||||
@ -78,16 +78,16 @@ jobs:
|
||||
echo "${{ inputs.pace }}" > ./pkg/vere/PACE
|
||||
params=()
|
||||
case "${{ matrix.target }}" in
|
||||
"linux-arm64")
|
||||
"linux-aarch64")
|
||||
bazel run //bazel/toolchain:aarch64-linux-musl-gcc
|
||||
params+=(
|
||||
--platforms=//:linux-arm64
|
||||
--platforms=//:linux-aarch64
|
||||
)
|
||||
;;
|
||||
"linux-x86_64")
|
||||
bazel run //bazel/toolchain:x86_64-linux-musl-gcc
|
||||
;;
|
||||
"macos-arm64")
|
||||
"macos-aarch64")
|
||||
;;
|
||||
"macos-x86_64")
|
||||
# Switch Xcode path to match the path specified in our bazel toolchain.
|
||||
@ -111,9 +111,9 @@ jobs:
|
||||
echo "$GITHUB_WORKSPACE/bazel-bin/pkg/vere/urbit"
|
||||
echo "urbit_static=$GITHUB_WORKSPACE/bazel-bin/pkg/vere/urbit" >> $GITHUB_ENV
|
||||
|
||||
# We have no way of running the linux-arm64 tests on a linux-x86_64
|
||||
# We have no way of running the linux-aarch64 tests on a linux-x86_64
|
||||
# machine.
|
||||
if [[ "${{ matrix.target }}" != "linux-arm64" ]]; then
|
||||
if [[ "${{ matrix.target }}" != "linux-aarch64" ]]; then
|
||||
params+=(
|
||||
--build_tests_only
|
||||
)
|
||||
|
22
BUILD.bazel
22
BUILD.bazel
@ -7,10 +7,10 @@ load("@io_bazel_rules_docker//container:container.bzl", "container_push")
|
||||
#
|
||||
|
||||
config_setting(
|
||||
name = "linux_arm64",
|
||||
name = "linux_aarch64",
|
||||
constraint_values = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
)
|
||||
|
||||
@ -23,10 +23,10 @@ config_setting(
|
||||
)
|
||||
|
||||
config_setting(
|
||||
name = "macos_arm64",
|
||||
name = "macos_aarch64",
|
||||
constraint_values = [
|
||||
"@platforms//os:macos",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
)
|
||||
|
||||
@ -71,12 +71,12 @@ string_flag(
|
||||
# A platform takes one of two formats: `<compiler>-<os>-<cpu>` or `<os>-<cpu>`
|
||||
# if the compiler is unspecified.
|
||||
|
||||
# Linux arm64 platform with unspecified compiler.
|
||||
# Linux aarch64 platform with unspecified compiler.
|
||||
platform(
|
||||
name = "linux-arm64",
|
||||
name = "linux-aarch64",
|
||||
constraint_values = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
)
|
||||
|
||||
@ -100,19 +100,19 @@ platform(
|
||||
)
|
||||
|
||||
platform(
|
||||
name = "macos-arm64",
|
||||
name = "macos-aarch64",
|
||||
constraint_values = [
|
||||
"@platforms//os:macos",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
)
|
||||
|
||||
platform(
|
||||
name = "clang-macos-arm64",
|
||||
name = "clang-macos-aarch64",
|
||||
constraint_values = [
|
||||
":clang",
|
||||
"@platforms//os:macos",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
)
|
||||
|
||||
|
@ -8,9 +8,9 @@ run:
|
||||
----------------------------------
|
||||
Host Platform | Target Platform
|
||||
----------------------------------
|
||||
`linux-x86_64` | `linux-arm64`
|
||||
`linux-x86_64` | `linux-aarch64`
|
||||
`linux-x86_64` | `linux-x86_64`
|
||||
`macos-arm64` | `macos-arm64`
|
||||
`macos-aarch64` | `macos-aarch64`
|
||||
`macos-x86_64` | `macos-x86_64`
|
||||
|
||||
## Prerequisites
|
||||
|
@ -80,14 +80,14 @@ va.b.c pill.
|
||||
|
||||
Release binaries:
|
||||
|
||||
(linux-arm64)
|
||||
https://bootstrap.urbit.org/urbit-vx.y-linux-arm64.tgz
|
||||
(linux-aarch64)
|
||||
https://bootstrap.urbit.org/urbit-vx.y-linux-aarch64.tgz
|
||||
|
||||
(linux-x86_64)
|
||||
https://bootstrap.urbit.org/urbit-vx.y-linux-x86_64.tgz
|
||||
|
||||
(macos-arm64)
|
||||
https://bootstrap.urbit.org/urbit-vx.y-macos-arm64.tgz
|
||||
(macos-aarch64)
|
||||
https://bootstrap.urbit.org/urbit-vx.y-macos-aarch64.tgz
|
||||
|
||||
(macos-x86_64)
|
||||
https://bootstrap.urbit.org/urbit-vx.y-macos-x86_64.tgz
|
||||
|
@ -47,7 +47,7 @@
|
||||
# platform-specific, wrap it in the appropriate URBIT_RUNTIME_* macro.
|
||||
# We "gate" source patches with these macros so that we only ever need
|
||||
# at most one patch per dependency.
|
||||
# (a) CPU architecture macros: `URBIT_RUNTIME_CPU_{X86_64,ARM64}`.
|
||||
# (a) CPU architecture macros: `URBIT_RUNTIME_CPU_{X86_64,AARCH64}`.
|
||||
# (b) OS macros: `URBIT_RUNTIME_OS_{LINUX,DARWIN,BSD,MINGW}`.
|
||||
# (2) Generate a patch file named <dependency_version>.patch and save it in
|
||||
# `bazel/third_party/<dependency>`.
|
||||
@ -93,8 +93,8 @@ versioned_http_archive(
|
||||
|
||||
# Use the toolchains we've configured.
|
||||
register_toolchains(
|
||||
"//bazel/toolchain:gcc-linux-arm64-toolchain",
|
||||
"//bazel/toolchain:clang-macos-arm64-toolchain",
|
||||
"//bazel/toolchain:gcc-linux-aarch64-toolchain",
|
||||
"//bazel/toolchain:clang-macos-aarch64-toolchain",
|
||||
"//bazel/toolchain:clang-macos-x86_64-toolchain",
|
||||
"//bazel/toolchain:gcc-linux-x86_64-toolchain",
|
||||
)
|
||||
|
2
bazel/third_party/curl/curl.BUILD
vendored
2
bazel/third_party/curl/curl.BUILD
vendored
@ -53,7 +53,7 @@ configure_make(
|
||||
"--without-zlib",
|
||||
"--without-zstd",
|
||||
] + select({
|
||||
"@//:linux_arm64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_aarch64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_x86_64": ["--host=x86_64-linux-musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
2
bazel/third_party/gmp/gmp.BUILD
vendored
2
bazel/third_party/gmp/gmp.BUILD
vendored
@ -18,7 +18,7 @@ configure_make(
|
||||
# but we leave it in for all builds as a precaution.
|
||||
"--with-pic",
|
||||
] + select({
|
||||
"@//:linux_arm64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_aarch64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_x86_64": ["--host=x86_64-linux-musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
6
bazel/third_party/h2o/2.2.6.patch
vendored
6
bazel/third_party/h2o/2.2.6.patch
vendored
@ -6,7 +6,7 @@ index 742fec90b..9a11a21bd 100644
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
+#if defined(URBIT_RUNTIME_CPU_ARM64)
|
||||
+#if defined(URBIT_RUNTIME_CPU_AARCH64)
|
||||
+#include "sse2neon.h"
|
||||
+#else
|
||||
#include <emmintrin.h>
|
||||
@ -22,7 +22,7 @@ index 3ae3bd309..7db05a186 100644
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
+#if defined(URBIT_RUNTIME_CPU_ARM64)
|
||||
+#if defined(URBIT_RUNTIME_CPU_AARCH64)
|
||||
+#include "sse2neon.h"
|
||||
+#else
|
||||
#include <emmintrin.h>
|
||||
@ -39,7 +39,7 @@ index a707070d1..714850f64 100644
|
||||
#include <string.h>
|
||||
#ifdef __SSE4_2__
|
||||
-#ifdef _MSC_VER
|
||||
+#if defined(URBIT_RUNTIME_CPU_ARM64)
|
||||
+#if defined(URBIT_RUNTIME_CPU_AARCH64)
|
||||
+#include "sse2neon.h"
|
||||
+#elif defined(_MSC_VER)
|
||||
#include <nmmintrin.h>
|
||||
|
12
bazel/third_party/h2o/h2o.BUILD
vendored
12
bazel/third_party/h2o/h2o.BUILD
vendored
@ -43,7 +43,7 @@ cc_library(
|
||||
includes = ["deps/klib"],
|
||||
linkstatic = True,
|
||||
local_defines = select({
|
||||
"@platforms//cpu:arm64": ["URBIT_RUNTIME_CPU_ARM64"],
|
||||
"@platforms//cpu:aarch64": ["URBIT_RUNTIME_CPU_AARCH64"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:private"],
|
||||
@ -51,7 +51,7 @@ cc_library(
|
||||
"@curl",
|
||||
"@zlib",
|
||||
] + select({
|
||||
"@platforms//cpu:arm64": ["@sse2neon"],
|
||||
"@platforms//cpu:aarch64": ["@sse2neon"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
@ -99,12 +99,12 @@ cc_library(
|
||||
includes = ["deps/picohttpparser"],
|
||||
linkstatic = True,
|
||||
local_defines = select({
|
||||
"@platforms//cpu:arm64": ["URBIT_RUNTIME_CPU_ARM64"],
|
||||
"@platforms//cpu:aarch64": ["URBIT_RUNTIME_CPU_AARCH64"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:private"],
|
||||
deps = select({
|
||||
"@platforms//cpu:arm64": ["@sse2neon"],
|
||||
"@platforms//cpu:aarch64": ["@sse2neon"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
@ -130,7 +130,7 @@ cc_library(
|
||||
],
|
||||
linkstatic = True,
|
||||
local_defines = select({
|
||||
"@platforms//cpu:arm64": ["URBIT_RUNTIME_CPU_ARM64"],
|
||||
"@platforms//cpu:aarch64": ["URBIT_RUNTIME_CPU_AARCH64"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:private"],
|
||||
@ -139,7 +139,7 @@ cc_library(
|
||||
":micro_ecc",
|
||||
"@openssl",
|
||||
] + select({
|
||||
"@platforms//cpu:arm64": ["@sse2neon"],
|
||||
"@platforms//cpu:aarch64": ["@sse2neon"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
6
bazel/third_party/openssl/openssl.BUILD
vendored
6
bazel/third_party/openssl/openssl.BUILD
vendored
@ -13,15 +13,15 @@ configure_make(
|
||||
"//conditions:default": ["--jobs=`nproc`"],
|
||||
}),
|
||||
configure_command = select({
|
||||
"@//:linux_arm64": "Configure",
|
||||
"@//:linux_aarch64": "Configure",
|
||||
"//conditions:default": "config",
|
||||
}),
|
||||
configure_options = [
|
||||
"no-shared",
|
||||
] + select({
|
||||
"@//:linux_arm64": [
|
||||
"@//:linux_aarch64": [
|
||||
"linux-aarch64",
|
||||
# Native compilation on linux-arm64 isn't supported. The prefix is
|
||||
# Native compilation on linux-aarch64 isn't supported. The prefix is
|
||||
# empty because the configure script detects an absolute path to the
|
||||
# aarch64-linux-gnu-gcc instead of just the binary name. This is
|
||||
# presumably because of the Bazel toolchain configuration but is not
|
||||
|
2
bazel/third_party/secp256k1/secp256k1.BUILD
vendored
2
bazel/third_party/secp256k1/secp256k1.BUILD
vendored
@ -19,7 +19,7 @@ configure_make(
|
||||
"--enable-module-schnorrsig",
|
||||
"--enable-static",
|
||||
] + select({
|
||||
"@//:linux_arm64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_aarch64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_x86_64": ["--host=x86_64-linux-musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
2
bazel/third_party/sigsegv/sigsegv.BUILD
vendored
2
bazel/third_party/sigsegv/sigsegv.BUILD
vendored
@ -20,7 +20,7 @@ configure_make(
|
||||
"@platforms//os:linux": ["--disable-stackvma"],
|
||||
"//conditions:default": [],
|
||||
}) + select({
|
||||
"@//:linux_arm64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_aarch64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_x86_64": ["--host=x86_64-linux-musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
4
bazel/third_party/softfloat/softfloat.BUILD
vendored
4
bazel/third_party/softfloat/softfloat.BUILD
vendored
@ -9,14 +9,14 @@ cc_library(
|
||||
name = "softfloat",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = select({
|
||||
"@platforms//cpu:arm64": [":softfloat_arm64"],
|
||||
"@platforms//cpu:aarch64": [":softfloat_aarch64"],
|
||||
"@platforms//cpu:x86_64": [":softfloat_x86_64"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "softfloat_arm64",
|
||||
name = "softfloat_aarch64",
|
||||
srcs = [
|
||||
# See `OBJS_PRIMITIVES` in `build/Linux-ARM-VFPv2-GCC/Makefile` in the
|
||||
# `softfloat` repo.
|
||||
|
2
bazel/third_party/uv/uv.BUILD
vendored
2
bazel/third_party/uv/uv.BUILD
vendored
@ -17,7 +17,7 @@ configure_make(
|
||||
configure_options = [
|
||||
"--disable-shared",
|
||||
] + select({
|
||||
"@//:linux_arm64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_aarch64": ["--host=aarch64-linux-musl"],
|
||||
"@//:linux_x86_64": ["--host=x86_64-linux-musl"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
|
@ -46,10 +46,10 @@ alias(
|
||||
#
|
||||
|
||||
# Toolchain identifier.
|
||||
_arm64_gcc = "toolchain-gcc-linux-arm64"
|
||||
_aarch64_gcc = "toolchain-gcc-linux-aarch64"
|
||||
|
||||
cc_toolchain_config(
|
||||
name = "gcc-linux-arm64-config",
|
||||
name = "gcc-linux-aarch64-config",
|
||||
ar = "{}/aarch64-linux-musl/bin/aarch64-linux-musl-ar".format(_install_prefix),
|
||||
cc = "{}/aarch64-linux-musl/bin/aarch64-linux-musl-gcc".format(_install_prefix),
|
||||
cc_flags = [
|
||||
@ -64,12 +64,12 @@ cc_toolchain_config(
|
||||
"{}/aarch64-linux-musl/aarch64-linux-musl/include".format(_install_prefix),
|
||||
"{}/aarch64-linux-musl/lib/gcc/aarch64-linux-musl/{{compiler_version}}/include".format(_install_prefix),
|
||||
],
|
||||
target_cpu = "arm64",
|
||||
toolchain_identifier = _arm64_gcc,
|
||||
target_cpu = "aarch64",
|
||||
toolchain_identifier = _aarch64_gcc,
|
||||
)
|
||||
|
||||
cc_toolchain(
|
||||
name = "gcc-linux-arm64",
|
||||
name = "gcc-linux-aarch64",
|
||||
all_files = ":empty",
|
||||
compiler_files = ":empty",
|
||||
dwp_files = ":empty",
|
||||
@ -77,21 +77,21 @@ cc_toolchain(
|
||||
objcopy_files = ":empty",
|
||||
strip_files = ":empty",
|
||||
supports_param_files = 0,
|
||||
toolchain_config = ":gcc-linux-arm64-config",
|
||||
toolchain_identifier = _arm64_gcc,
|
||||
toolchain_config = ":gcc-linux-aarch64-config",
|
||||
toolchain_identifier = _aarch64_gcc,
|
||||
)
|
||||
|
||||
toolchain(
|
||||
name = "gcc-linux-arm64-toolchain",
|
||||
name = "gcc-linux-aarch64-toolchain",
|
||||
exec_compatible_with = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:x86_64",
|
||||
],
|
||||
target_compatible_with = [
|
||||
"@platforms//os:linux",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
toolchain = ":gcc-linux-arm64",
|
||||
toolchain = ":gcc-linux-aarch64",
|
||||
toolchain_type = ":toolchain_type",
|
||||
)
|
||||
|
||||
@ -150,14 +150,14 @@ toolchain(
|
||||
)
|
||||
|
||||
#
|
||||
# clang-macos-arm64
|
||||
# clang-macos-aarch64
|
||||
#
|
||||
|
||||
# Toolchain identifier.
|
||||
_macos_arm64_clang = "toolchain-clang-macos-arm64"
|
||||
_macos_aarch64_clang = "toolchain-clang-macos-aarch64"
|
||||
|
||||
cc_toolchain_config(
|
||||
name = "clang-macos-arm64-config",
|
||||
name = "clang-macos-aarch64-config",
|
||||
# NOTE: building with `libtool` does not work on macOS due to lack of
|
||||
# support in the `configure_make` rule provided by `rules_foreign_cc`.
|
||||
# Therefore, we require setting `ar` as the archiver tool on macOS.
|
||||
@ -177,12 +177,12 @@ cc_toolchain_config(
|
||||
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include",
|
||||
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/{compiler_version}/include",
|
||||
],
|
||||
target_cpu = "arm64",
|
||||
toolchain_identifier = _macos_arm64_clang,
|
||||
target_cpu = "aarch64",
|
||||
toolchain_identifier = _macos_aarch64_clang,
|
||||
)
|
||||
|
||||
cc_toolchain(
|
||||
name = "clang-macos-arm64",
|
||||
name = "clang-macos-aarch64",
|
||||
all_files = ":empty",
|
||||
compiler_files = ":empty",
|
||||
dwp_files = ":empty",
|
||||
@ -190,21 +190,21 @@ cc_toolchain(
|
||||
objcopy_files = ":empty",
|
||||
strip_files = ":empty",
|
||||
supports_param_files = 0,
|
||||
toolchain_config = ":clang-macos-arm64-config",
|
||||
toolchain_identifier = _macos_arm64_clang,
|
||||
toolchain_config = ":clang-macos-aarch64-config",
|
||||
toolchain_identifier = _macos_aarch64_clang,
|
||||
)
|
||||
|
||||
toolchain(
|
||||
name = "clang-macos-arm64-toolchain",
|
||||
name = "clang-macos-aarch64-toolchain",
|
||||
exec_compatible_with = [
|
||||
"@platforms//os:macos",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
target_compatible_with = [
|
||||
"@platforms//os:macos",
|
||||
"@platforms//cpu:arm64",
|
||||
"@platforms//cpu:aarch64",
|
||||
],
|
||||
toolchain = ":clang-macos-arm64",
|
||||
toolchain = ":clang-macos-aarch64",
|
||||
toolchain_type = ":toolchain_type",
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user