Skip to content

Commit 6d766ec

Browse files
committed
Update static linking build step after GCM changes
1 parent 563f65e commit 6d766ec

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

build.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ fn static_link() {
200200
"certdb",
201201
"certhi",
202202
"cryptohi",
203+
"gcm",
203204
"freebl_static",
204205
if env::consts::OS == "windows" {
205206
"libnspr4"
@@ -235,32 +236,27 @@ fn static_link() {
235236
// Hardware specific libs.
236237
// See https://github.com/mozilla/application-services/blob/0a2dac76f979b8bcfb6bacb5424b50f58520b8fe/components/support/rc_crypto/nss/nss_build_common/src/lib.rs#L127-L157
237238
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap();
238-
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap();
239239
// https://searchfox.org/nss/rev/0d5696b3edce5124353f03159d2aa15549db8306/lib/freebl/freebl.gyp#508-542
240240
if target_arch == "arm" || target_arch == "aarch64" {
241241
static_libs.push("armv8_c_lib");
242242
}
243243
if target_arch == "x86_64" || target_arch == "x86" {
244-
static_libs.push("gcm-aes-x86_c_lib");
244+
static_libs.push("ghash-aes-x86_c_lib");
245245
static_libs.push("sha-x86_c_lib");
246246
}
247247
if target_arch == "arm" {
248-
static_libs.push("gcm-aes-arm32-neon_c_lib");
248+
static_libs.push("ghash-aes-arm32-neon_c_lib");
249249
}
250250
if target_arch == "aarch64" {
251-
static_libs.push("gcm-aes-aarch64_c_lib");
251+
static_libs.push("ghash-aes-aarch64_c_lib");
252252
}
253253
if target_arch == "x86_64" {
254254
static_libs.push("hw-acc-crypto-avx");
255255
static_libs.push("hw-acc-crypto-avx2");
256256
}
257257
// https://searchfox.org/nss/rev/08c4d05078d00089f8d7540651b0717a9d66f87e/lib/freebl/freebl.gyp#315-324
258-
if (target_os == "android" || target_os == "linux") && target_arch == "x86_64" {
258+
if target_arch == "x86_64" {
259259
static_libs.push("intel-gcm-wrap_c_lib");
260-
// https://searchfox.org/nss/rev/08c4d05078d00089f8d7540651b0717a9d66f87e/lib/freebl/freebl.gyp#43-47
261-
if (target_os == "android" || target_os == "linux") && target_arch == "x86_64" {
262-
static_libs.push("intel-gcm-s_lib");
263-
}
264260
}
265261
for lib in static_libs {
266262
println!("cargo:rustc-link-lib=static={lib}");

0 commit comments

Comments
 (0)