Skip to content

Commit 02e3f2d

Browse files
committed
Fix for V8 build on s390x. (proxy-wasm#197)
Signed-off-by: Konstantin Maksimov <konstantin.maksimov@ibm.com>
1 parent 0df1224 commit 02e3f2d

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

bazel/external/v8.patch

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ index 2d5d241ebf..72aae9e270 100644
784784
if cpu_type in allowed_values:
785785
return V8CpuTypeInfo(value = cpu_type)
786786
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
787-
index 53fccf92e7..14fff6f049 100644
787+
index 53fccf92e7..8efd27f129 100644
788788
--- a/bazel/defs.bzl
789789
+++ b/bazel/defs.bzl
790790
@@ -89,7 +89,7 @@ def _default_args():
@@ -796,7 +796,7 @@ index 53fccf92e7..14fff6f049 100644
796796
"UNICODE",
797797
"_UNICODE",
798798
"_CRT_RAND_S",
799-
@@ -98,29 +98,59 @@ def _default_args():
799+
@@ -98,29 +98,63 @@ def _default_args():
800800
"//conditions:default": [],
801801
}),
802802
copts = select({
@@ -818,6 +818,10 @@ index 53fccf92e7..14fff6f049 100644
818818
],
819819
"//conditions:default": [],
820820
+ }) + select({
821+
+ "@v8//bazel/config:is_s390x": [
822+
+ "-fno-integrated-as",
823+
+ ],
824+
+ }) + select({
821825
+ "@v8//bazel/config:is_clang": [
822826
+ "-Wno-invalid-offsetof",
823827
+ "-std=c++17",
@@ -860,28 +864,28 @@ index 53fccf92e7..14fff6f049 100644
860864
"//conditions:default": ["-Wl,--no-as-needed -ldl -pthread"],
861865
}) + select({
862866
":should_add_rdynamic": ["-rdynamic"],
863-
@@ -248,8 +278,10 @@ def v8_library(
867+
@@ -248,8 +282,10 @@ def v8_library(
864868
)
865-
869+
866870
def _torque_impl(ctx):
867871
- v8root = "."
868872
- prefix = ctx.attr.prefix
869873
+ if ctx.workspace_name == "v8":
870874
+ v8root = "."
871875
+ else:
872876
+ v8root = "external/v8"
873-
877+
874878
# Arguments
875879
args = []
876-
@@ -301,7 +333,6 @@ _v8_torque = rule(
880+
@@ -301,7 +337,6 @@ _v8_torque = rule(
877881
cfg = "exec",
878882
),
879883
"args": attr.string_list(),
880884
- "v8root": attr.label(default = ":v8_root"),
881885
},
882886
)
883-
884-
@@ -313,7 +344,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
887+
888+
@@ -313,7 +348,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
885889
args = args,
886890
extras = extras,
887891
tool = select({
@@ -890,7 +894,7 @@ index 53fccf92e7..14fff6f049 100644
890894
"//conditions:default": ":torque",
891895
}),
892896
)
893-
@@ -324,7 +355,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
897+
@@ -324,7 +359,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
894898
args = args,
895899
extras = extras,
896900
tool = select({
@@ -899,21 +903,23 @@ index 53fccf92e7..14fff6f049 100644
899903
"//conditions:default": ":torque",
900904
}),
901905
)
902-
@@ -334,6 +365,7 @@ def _v8_target_cpu_transition_impl(settings, attr):
906+
@@ -334,22 +369,24 @@ def _v8_target_cpu_transition_impl(settings, attr):
903907
"haswell": "x64",
904908
"k8": "x64",
905909
"x86_64": "x64",
906910
+ "darwin": "x64",
907911
"darwin_x86_64": "x64",
908912
"x86": "ia32",
909913
"ppc": "ppc64",
910-
@@ -342,14 +374,14 @@ def _v8_target_cpu_transition_impl(settings, attr):
914+
"arm64-v8a": "arm64",
915+
"arm": "arm64",
911916
"armeabi-v7a": "arm32",
917+
+ "s390x": "s390x",
912918
}
913919
v8_target_cpu = mapping[settings["//command_line_option:cpu"]]
914920
- return {"@config//:v8_target_cpu": v8_target_cpu}
915921
+ return {"@v8//bazel/config:v8_target_cpu": v8_target_cpu}
916-
922+
917923
# Set the v8_target_cpu to be the correct architecture given the cpu specified
918924
# on the command line.
919925
v8_target_cpu_transition = transition(

0 commit comments

Comments
 (0)