Skip to content
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

Multi arch patches #16

Merged
merged 2 commits into from
Jun 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changes for multi-arch build
yselkowitz authored and jwendell committed May 18, 2020
commit 2d1a0fe0c42df68fe02ad56aab928e7d9093be4d
6 changes: 6 additions & 0 deletions bazel/BUILD
Original file line number Diff line number Diff line change
@@ -273,6 +273,11 @@ config_setting(
values = {"cpu": "mips64"},
)

config_setting(
name = "linux_s390x",
values = {"cpu": "s390x"},
)

config_setting(
name = "windows_x86_64",
values = {"cpu": "x64_windows"},
@@ -351,6 +356,7 @@ alias(
":linux_x86_64": ":linux_x86_64",
":linux_aarch64": ":linux_aarch64",
":linux_ppc": ":linux_ppc",
":linux_s390x": "linux_s390x",
":linux_mips64": ":linux_mips64",
# If we're not on an linux platform return a value that will never match in the select() statement calling this
# since it would have already been matched above.
13 changes: 8 additions & 5 deletions bazel/external/wee8.genrule_cmd
Original file line number Diff line number Diff line change
@@ -2,11 +2,14 @@

set -e

# This works only on Linux-x86_64 and macOS-x86_64.
if [[ ( `uname` != "Linux" && `uname` != "Darwin" ) || `uname -m` != "x86_64" ]]; then
echo "ERROR: wee8 is currently supported only on Linux-x86_64 and macOS-x86_64."
# This works only on Linux-{x86_64,ppc64le,s390x,aarch64} and macOS-x86_64.
case "$$(uname -s)-$$(uname -m)" in
Linux-x86_64|Linux-ppc64le|Linux-s390x|Linux-aarch64|Darwin-x86_64)
;;
*)
echo "ERROR: wee8 is currently supported only on Linux-{x86_64,ppc64le,s390x,aarch64} and macOS-x86_64." >&2
exit 1
fi
esac

# Bazel magic.
ROOT=$$(dirname $(rootpath wee8/BUILD.gn))/..
@@ -68,7 +71,7 @@ WEE8_BUILD_ARGS+=" v8_enable_shared_ro_heap=false"

# Build wee8.
third_party/depot_tools/gn gen out/wee8 --args="$$WEE8_BUILD_ARGS"
third_party/depot_tools/ninja -C out/wee8 wee8
ninja -C out/wee8 wee8

# Move compiled library to the expected destinations.
popd
3 changes: 3 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -812,5 +812,8 @@ def _is_arch(ctxt, arch):
def _is_linux_ppc(ctxt):
return _is_linux(ctxt) and _is_arch(ctxt, "ppc")

def _is_linux_s390x(ctxt):
return _is_linux(ctxt) and _is_arch(ctxt, "s390x")

def _is_linux_x86_64(ctxt):
return _is_linux(ctxt) and _is_arch(ctxt, "x86_64")
2 changes: 2 additions & 0 deletions source/common/api/BUILD
Original file line number Diff line number Diff line change
@@ -27,13 +27,15 @@ envoy_cc_library(
"//bazel:linux_aarch64": ["os_sys_calls_impl_linux.cc"],
"//bazel:linux_ppc": ["os_sys_calls_impl_linux.cc"],
"//bazel:linux_mips64": ["os_sys_calls_impl_linux.cc"],
"//bazel:linux_s390x": ["os_sys_calls_impl_linux.cc"],
"//conditions:default": [],
}) + envoy_select_hot_restart(["os_sys_calls_impl_hot_restart.cc"]),
hdrs = ["os_sys_calls_impl.h"] + select({
"//bazel:linux_x86_64": ["os_sys_calls_impl_linux.h"],
"//bazel:linux_aarch64": ["os_sys_calls_impl_linux.h"],
"//bazel:linux_ppc": ["os_sys_calls_impl_linux.h"],
"//bazel:linux_mips64": ["os_sys_calls_impl_linux.h"],
"//bazel:linux_s390x": ["os_sys_calls_impl_linux.h"],
"//conditions:default": [],
}) + envoy_select_hot_restart(["os_sys_calls_impl_hot_restart.h"]),
deps = [
2 changes: 2 additions & 0 deletions source/server/BUILD
Original file line number Diff line number Diff line change
@@ -195,6 +195,7 @@ envoy_cc_library(
"//bazel:linux_aarch64": ["options_impl_platform_linux.cc"],
"//bazel:linux_ppc": ["options_impl_platform_linux.cc"],
"//bazel:linux_mips64": ["options_impl_platform_linux.cc"],
"//bazel:linux_s390x": ["options_impl_platform_linux.cc"],
"//conditions:default": ["options_impl_platform_default.cc"],
}),
hdrs = [
@@ -205,6 +206,7 @@ envoy_cc_library(
"//bazel:linux_aarch64": ["options_impl_platform_linux.h"],
"//bazel:linux_ppc": ["options_impl_platform_linux.h"],
"//bazel:linux_mips64": ["options_impl_platform_linux.h"],
"//bazel:linux_s390x": ["options_impl_platform_linux.h"],
"//conditions:default": [],
}),
# TCLAP command line parser needs this to support int64_t/uint64_t in several build environments.