From 54ea3ec5d6f53c177655c4b3d6e7fde92dba30ec Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 15 Oct 2023 22:57:46 +0000 Subject: [PATCH] build: workaround OpenSSL crate expecting libatomic to be available --- scripts/zig-cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/zig-cc b/scripts/zig-cc index 4b1293dde..b6d9ebc68 100755 --- a/scripts/zig-cc +++ b/scripts/zig-cc @@ -5,6 +5,10 @@ import os def flag_filter(flag: str) -> bool: + # Workaround for . + if flag == "-latomic": + return False + if flag == "-lc": return False if flag == "-Wl,-melf_i386": @@ -24,6 +28,11 @@ def main(): else: zig_cpu_args = [] + # Disable atomics and use locks instead in OpenSSL. + # Zig toolchains do not provide atomics. + # This is a workaround for + args += ["-DBROKEN_CLANG_ATOMICS"] + subprocess.run( ["zig", "cc", "-target", zig_target, *zig_cpu_args, *args], check=True )