Skip to content

Fix for V8 build on s390x. (#197) #214

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
30 changes: 18 additions & 12 deletions bazel/external/v8.patch
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ index 2d5d241ebf..72aae9e270 100644
if cpu_type in allowed_values:
return V8CpuTypeInfo(value = cpu_type)
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 53fccf92e7..14fff6f049 100644
index 53fccf92e7..8efd27f129 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -89,7 +89,7 @@ def _default_args():
Expand All @@ -796,7 +796,7 @@ index 53fccf92e7..14fff6f049 100644
"UNICODE",
"_UNICODE",
"_CRT_RAND_S",
@@ -98,29 +98,59 @@ def _default_args():
@@ -98,29 +98,63 @@ def _default_args():
"//conditions:default": [],
}),
copts = select({
Expand All @@ -818,6 +818,10 @@ index 53fccf92e7..14fff6f049 100644
],
"//conditions:default": [],
+ }) + select({
+ "@v8//bazel/config:is_s390x": [
+ "-fno-integrated-as",
+ ],
+ }) + select({
+ "@v8//bazel/config:is_clang": [
+ "-Wno-invalid-offsetof",
+ "-std=c++17",
Expand Down Expand Up @@ -860,28 +864,28 @@ index 53fccf92e7..14fff6f049 100644
"//conditions:default": ["-Wl,--no-as-needed -ldl -pthread"],
}) + select({
":should_add_rdynamic": ["-rdynamic"],
@@ -248,8 +278,10 @@ def v8_library(
@@ -248,8 +282,10 @@ def v8_library(
)

def _torque_impl(ctx):
- v8root = "."
- prefix = ctx.attr.prefix
+ if ctx.workspace_name == "v8":
+ v8root = "."
+ else:
+ v8root = "external/v8"

# Arguments
args = []
@@ -301,7 +333,6 @@ _v8_torque = rule(
@@ -301,7 +337,6 @@ _v8_torque = rule(
cfg = "exec",
),
"args": attr.string_list(),
- "v8root": attr.label(default = ":v8_root"),
},
)
@@ -313,7 +344,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):

@@ -313,7 +348,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
args = args,
extras = extras,
tool = select({
Expand All @@ -890,7 +894,7 @@ index 53fccf92e7..14fff6f049 100644
"//conditions:default": ":torque",
}),
)
@@ -324,7 +355,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
@@ -324,7 +359,7 @@ def v8_torque(name, noicu_srcs, icu_srcs, args, extras):
args = args,
extras = extras,
tool = select({
Expand All @@ -899,21 +903,23 @@ index 53fccf92e7..14fff6f049 100644
"//conditions:default": ":torque",
}),
)
@@ -334,6 +365,7 @@ def _v8_target_cpu_transition_impl(settings, attr):
@@ -334,22 +369,24 @@ def _v8_target_cpu_transition_impl(settings, attr):
"haswell": "x64",
"k8": "x64",
"x86_64": "x64",
+ "darwin": "x64",
"darwin_x86_64": "x64",
"x86": "ia32",
"ppc": "ppc64",
@@ -342,14 +374,14 @@ def _v8_target_cpu_transition_impl(settings, attr):
"arm64-v8a": "arm64",
"arm": "arm64",
"armeabi-v7a": "arm32",
+ "s390x": "s390x",
}
v8_target_cpu = mapping[settings["//command_line_option:cpu"]]
- return {"@config//:v8_target_cpu": v8_target_cpu}
+ return {"@v8//bazel/config:v8_target_cpu": v8_target_cpu}

# Set the v8_target_cpu to be the correct architecture given the cpu specified
# on the command line.
v8_target_cpu_transition = transition(
Expand Down