|
| 1 | +From 6b86fb03c7d1396db7972a09acbb94319e7e5824 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Neil Mayhew <neil@mayhew.name> |
| 3 | +Date: Wed, 26 Nov 2025 12:33:37 -0700 |
| 4 | +Subject: [PATCH] Fix inconsistency in how __blst_platform_cap is defined |
| 5 | +Content-Type: text/plain; charset=utf-8 |
| 6 | + |
| 7 | +In C it's a BSS symbol, and in assembly it's a common symbol: |
| 8 | + |
| 9 | +$ nm -og libblst.a | grep __blst_platform_cap |
| 10 | +libblst.a:assembly.o:0000000000000004 C __blst_platform_cap |
| 11 | +libblst.a:server.o:0000000000000000 B __blst_platform_cap |
| 12 | + |
| 13 | +This causes problems for some toolchains. |
| 14 | + |
| 15 | +With this change, it becomes: |
| 16 | + |
| 17 | +$ nm -og libblst.a | grep __blst_platform_cap |
| 18 | +libblst.a:assembly.o:0000000000000004 C __blst_platform_cap |
| 19 | +libblst.a:server.o:0000000000000004 C __blst_platform_cap |
| 20 | +--- |
| 21 | + src/cpuid.c | 4 ++-- |
| 22 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
| 23 | + |
| 24 | +diff --git a/src/cpuid.c b/src/cpuid.c |
| 25 | +index a1a01d4..bbba87e 100644 |
| 26 | +--- a/src/cpuid.c |
| 27 | ++++ b/src/cpuid.c |
| 28 | +@@ -5,9 +5,9 @@ |
| 29 | + */ |
| 30 | + |
| 31 | + #if (defined(__GNUC__) || defined(__clang__) || defined(__SUNPRO_C)) && !defined(_WIN32) |
| 32 | +-__attribute__((visibility("hidden"))) |
| 33 | ++__attribute__((visibility("hidden"), common)) |
| 34 | + #endif |
| 35 | +-int __blst_platform_cap = 0; |
| 36 | ++int __blst_platform_cap; |
| 37 | + |
| 38 | + #if defined(__x86_64__) || defined(__x86_64) || (defined(_M_X64) && !defined(_M_ARM64EC)) |
| 39 | + |
| 40 | +-- |
| 41 | +2.51.0 |
| 42 | + |
0 commit comments