Add support for blst modern builds on linux amd64 (#10567)

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Preston Van Loon 2022-04-28 05:02:02 -05:00 committed by GitHub
parent a428664eb5
commit 314ef8e1bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,17 @@
load("@prysm//tools/go:def.bzl", "go_library") load("@prysm//tools/go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_test") load("@io_bazel_rules_go//go:def.bzl", "go_test")
config_setting(
name = "blst_modern",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
],
values = {
"define": "blst_modern=true",
},
)
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
@ -12,7 +23,6 @@ go_library(
"-D__BLST_CGO__", "-D__BLST_CGO__",
"-Ibindings", "-Ibindings",
"-Isrc", "-Isrc",
"-D__BLST_PORTABLE__",
"-O", "-O",
] + select({ ] + select({
"@io_bazel_rules_go//go/platform:amd64": [ "@io_bazel_rules_go//go/platform:amd64": [
@ -20,6 +30,11 @@ go_library(
"-D__ADX__", "-D__ADX__",
], ],
"//conditions:default": [], "//conditions:default": [],
}) + select({
"//conditions:default": [
"-D__BLST_PORTABLE__",
],
":blst_modern": [],
}), }),
cdeps = [":blst"], cdeps = [":blst"],
importpath = "github.com/supranational/blst/bindings/go", importpath = "github.com/supranational/blst/bindings/go",
@ -71,7 +86,6 @@ cc_library(
"build/assembly.S", "build/assembly.S",
], ],
copts = [ copts = [
"-D__BLST_PORTABLE__",
"-O", "-O",
] + select({ ] + select({
"@io_bazel_rules_go//go/platform:amd64": [ "@io_bazel_rules_go//go/platform:amd64": [
@ -79,6 +93,11 @@ cc_library(
"-D__ADX__", "-D__ADX__",
], ],
"//conditions:default": [], "//conditions:default": [],
}) + select({
"//conditions:default": [
"-D__BLST_PORTABLE__",
],
":blst_modern": [],
}), }),
deps = [":asm_hdrs"], deps = [":asm_hdrs"],
linkstatic = True, linkstatic = True,