nixpkgs/pkgs/servers/http/envoy/fix-aarch64-wamr.patch
Luke Granger-Brown defb2298de envoy: fix builds for x86_64-linux and aarch64-linux
* Bumps brotli version to incorporate a fix for some GCC warnings which
  get promoted to errors.
* Switches from wee8 to WAMR because it's easier to make it build
  sensibly on a range of GCC versions that aren't just "whatever ships
  with Ubuntu LTS".
* Adds a patch for WAMR's build in Envoy because it won't build properly
  under Linux aarch64, since WAMR doesn't detect aarch64 unless it's on
  macOS.
2022-05-09 00:51:26 +00:00

39 lines
1.4 KiB
Diff

diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl
index f48ebe7056..1e5cc5d663 100644
--- a/bazel/envoy_build_system.bzl
+++ b/bazel/envoy_build_system.bzl
@@ -102,6 +102,7 @@ def envoy_cmake(
pdb_name = "",
cmake_files_dir = "$BUILD_TMPDIR/CMakeFiles",
generate_crosstool_file = False,
+ generate_args = [],
**kwargs):
cache_entries.update({"CMAKE_BUILD_TYPE": "Bazel"})
cache_entries_debug = dict(cache_entries)
@@ -131,7 +132,7 @@ def envoy_cmake(
"@envoy//bazel:dbg_build": cache_entries_debug,
"//conditions:default": cache_entries,
}),
- generate_args = ["-GNinja"],
+ generate_args = ["-GNinja"] + generate_args,
targets = ["", "install"],
# TODO: Remove install target and make this work
install = False,
diff --git a/bazel/foreign_cc/BUILD b/bazel/foreign_cc/BUILD
index 4d3a281669..b4716dfe2e 100644
--- a/bazel/foreign_cc/BUILD
+++ b/bazel/foreign_cc/BUILD
@@ -394,6 +394,12 @@ envoy_cmake(
"WAMR_BUILD_LIBC_WASI": "0",
"WAMR_BUILD_TAIL_CALL": "1",
},
+ generate_args = select({
+ "//conditions:default": [],
+ "@platforms//cpu:aarch64": [
+ "-DWAMR_BUILD_TARGET=AARCH64",
+ ],
+ }),
lib_source = "@com_github_wamr//:all",
out_static_libs = ["libvmlib.a"],
tags = ["skip_on_windows"],