blob: b7ac2ae3ba401cdb447a758df8abcb6f50efd7af [file] [log] [blame]
Austin Schuh0ca51f32020-12-25 21:51:45 -08001diff --git a/BUILD b/BUILD
James Kuszmaul9776b392023-01-14 14:08:08 -08002index cba9ccb1d..37fab16a7 100644
Austin Schuh0ca51f32020-12-25 21:51:45 -08003--- a/BUILD
4+++ b/BUILD
James Kuszmaul9776b392023-01-14 14:08:08 -08005@@ -16,6 +16,7 @@ licenses(["notice"])
6
7 exports_files(["LICENSE"])
8
9+load("@//tools/build_rules:select.bzl", "compiler_select")
10 load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
11
12 load(
13@@ -25,6 +26,8 @@ load(
Austin Schuh0ca51f32020-12-25 21:51:45 -080014 "crypto_sources",
15 "crypto_sources_linux_x86_64",
16 "crypto_sources_linux_ppc64le",
17+ "crypto_sources_linux_aarch64",
18+ "crypto_sources_linux_arm",
19 "crypto_sources_mac_x86_64",
20 "fips_fragments",
21 "ssl_headers",
James Kuszmaul9776b392023-01-14 14:08:08 -080022@@ -36,7 +39,17 @@ load(
Austin Schuh0ca51f32020-12-25 21:51:45 -080023
24 config_setting(
25 name = "linux_x86_64",
26- values = {"cpu": "k8"},
27+ constraint_values = ["@platforms//cpu:x86_64"],
28+)
29+
30+config_setting(
31+ name = "linux_aarch64",
32+ constraint_values = ["@platforms//cpu:aarch64"],
33+)
34+
35+config_setting(
36+ name = "linux_arm",
37+ constraint_values = ["@platforms//cpu:armv7"],
38 )
39
40 config_setting(
James Kuszmaul9776b392023-01-14 14:08:08 -080041@@ -76,6 +89,10 @@ posix_copts = [
Austin Schuh0ca51f32020-12-25 21:51:45 -080042 "-Wwrite-strings",
43 "-Wshadow",
44 "-fno-common",
45+ "-Wno-cast-qual",
46+ "-Wno-cast-align",
47+ "-Wno-unused-parameter",
James Kuszmaul9776b392023-01-14 14:08:08 -080048+ "-Wno-cast-function-type",
Austin Schuh0ca51f32020-12-25 21:51:45 -080049
50 # Modern build environments should be able to set this to use atomic
51 # operations for reference counting rather than locks. However, it's
Austin Schuh50e3dca2023-07-23 14:34:27 -070052@@ -86,17 +103,29 @@ posix_copts = [
Austin Schuh0ca51f32020-12-25 21:51:45 -080053 boringssl_copts = select({
54 ":linux_x86_64": posix_copts,
55 ":linux_ppc64le": posix_copts,
56+ ":linux_arm": posix_copts,
57+ ":linux_aarch64": posix_copts,
58 ":mac_x86_64": posix_copts,
59 ":windows_x86_64": [
60 "-DWIN32_LEAN_AND_MEAN",
James Kuszmaul9776b392023-01-14 14:08:08 -080061 "-DOPENSSL_NO_ASM",
62 ],
63 "//conditions:default": ["-DOPENSSL_NO_ASM"],
64+}) + compiler_select({
Austin Schuh50e3dca2023-07-23 14:34:27 -070065+ "clang": [
66+ "-Wno-unused-but-set-variable",
67+ "-Wno-array-parameter",
68+ ],
James Kuszmaul9776b392023-01-14 14:08:08 -080069+ "gcc": [
70+ "-Wno-array-parameter",
71+ ],
72 })
73
Austin Schuh0ca51f32020-12-25 21:51:45 -080074 crypto_sources_asm = select({
75 ":linux_x86_64": crypto_sources_linux_x86_64,
76 ":linux_ppc64le": crypto_sources_linux_ppc64le,
77+ ":linux_arm": crypto_sources_linux_arm,
78+ ":linux_aarch64": crypto_sources_linux_aarch64,
79 ":mac_x86_64": crypto_sources_mac_x86_64,
80 "//conditions:default": [],
81 })
James Kuszmaul9776b392023-01-14 14:08:08 -080082@@ -112,6 +138,8 @@ posix_copts_c11 = [
Austin Schuh0ca51f32020-12-25 21:51:45 -080083 boringssl_copts_c11 = boringssl_copts + select({
84 ":linux_x86_64": posix_copts_c11,
85 ":linux_ppc64le": posix_copts_c11,
86+ ":linux_arm": posix_copts_c11,
87+ ":linux_aarch64": posix_copts_c11,
88 ":mac_x86_64": posix_copts_c11,
89 "//conditions:default": [],
90 })
James Kuszmaul9776b392023-01-14 14:08:08 -080091@@ -125,6 +153,8 @@ posix_copts_cxx = [
Austin Schuh0ca51f32020-12-25 21:51:45 -080092 boringssl_copts_cxx = boringssl_copts + select({
93 ":linux_x86_64": posix_copts_cxx,
94 ":linux_ppc64le": posix_copts_cxx,
95+ ":linux_arm": posix_copts_cxx,
96+ ":linux_aarch64": posix_copts_cxx,
97 ":mac_x86_64": posix_copts_cxx,
98 "//conditions:default": [],
99 })