[llvm] [Support/BLAKE3] Make g_cpu_features thread safe (PR #147948)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 03:24:31 PDT 2025


nikic wrote:

This causes linker error when linking both libblake3 and LLVM statically.
```
  = note: /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libblake3-5c167293c56e5670.rlib(b8423798394d5395-blake3_avx512_x86-64_unix.o): in function `blake3_xof_many_avx512':
          (.text+0x3ac0): multiple definition of `blake3_xof_many_avx512'; /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-65facbdddbd830de.rlib(blake3_avx512_x86-64_unix.S.o):(.text+0x3ac0): first defined here
          /usr/bin/ld: /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libblake3-5c167293c56e5670.rlib(b8423798394d5395-blake3_avx512_x86-64_unix.o): in function `blake3_xof_many_avx512':
          (.text+0x3ac0): multiple definition of `_blake3_xof_many_avx512'; /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_llvm-65facbdddbd830de.rlib(blake3_avx512_x86-64_unix.S.o):(.text+0x3ac0): first defined here
          collect2: error: ld returned 1 exit status
```

https://github.com/llvm/llvm-project/pull/147948


More information about the llvm-commits mailing list