From 0e30076d8342aa2d509f1dc5cd024be4afb627f4 Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Mon, 10 Apr 2023 11:44:54 +0900 Subject: [PATCH] util/blake3: Patch with hidden visibility for asm symbols. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For Unix platforms, the symbol visibility needs to be hidden to avoid exposing them in driver shared objects. Acked-by: Marek Olšák Part-of: --- src/util/blake3/README | 4 +++- src/util/blake3/blake3_avx2_x86-64_unix.S | 5 +++++ src/util/blake3/blake3_avx512_x86-64_unix.S | 8 ++++++++ src/util/blake3/blake3_sse2_x86-64_unix.S | 8 ++++++++ src/util/blake3/blake3_sse41_x86-64_unix.S | 8 ++++++++ src/util/blake3/mesa_blake3_visibility.h | 5 +++++ 6 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/util/blake3/mesa_blake3_visibility.h diff --git a/src/util/blake3/README b/src/util/blake3/README index 24fe84d..02922dc 100644 --- a/src/util/blake3/README +++ b/src/util/blake3/README @@ -11,4 +11,6 @@ Changes: - Add non-typedef struct name to blake3_hasher. -- Add "static" to blake3_hash4_neon, to comply with -Werror=missing-prototypes. \ No newline at end of file +- Add "static" to blake3_hash4_neon, to comply with -Werror=missing-prototypes. + +- Add mesa_blake3_visibility.h and set symbol visibility to hidden for assembly sources. \ No newline at end of file diff --git a/src/util/blake3/blake3_avx2_x86-64_unix.S b/src/util/blake3/blake3_avx2_x86-64_unix.S index 812bb85..89b2310 100644 --- a/src/util/blake3/blake3_avx2_x86-64_unix.S +++ b/src/util/blake3/blake3_avx2_x86-64_unix.S @@ -1,3 +1,5 @@ +#include "mesa_blake3_visibility.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif @@ -13,6 +15,9 @@ #endif .intel_syntax noprefix + +HIDDEN _blake3_hash_many_avx2 +HIDDEN blake3_hash_many_avx2 .global _blake3_hash_many_avx2 .global blake3_hash_many_avx2 #ifdef __APPLE__ diff --git a/src/util/blake3/blake3_avx512_x86-64_unix.S b/src/util/blake3/blake3_avx512_x86-64_unix.S index a06aede..c948483 100644 --- a/src/util/blake3/blake3_avx512_x86-64_unix.S +++ b/src/util/blake3/blake3_avx512_x86-64_unix.S @@ -1,3 +1,5 @@ +#include "mesa_blake3_visibility.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif @@ -13,6 +15,12 @@ #endif .intel_syntax noprefix +HIDDEN _blake3_hash_many_avx512 +HIDDEN blake3_hash_many_avx512 +HIDDEN blake3_compress_in_place_avx512 +HIDDEN _blake3_compress_in_place_avx512 +HIDDEN blake3_compress_xof_avx512 +HIDDEN _blake3_compress_xof_avx512 .global _blake3_hash_many_avx512 .global blake3_hash_many_avx512 .global blake3_compress_in_place_avx512 diff --git a/src/util/blake3/blake3_sse2_x86-64_unix.S b/src/util/blake3/blake3_sse2_x86-64_unix.S index 99f033f..078eb23 100644 --- a/src/util/blake3/blake3_sse2_x86-64_unix.S +++ b/src/util/blake3/blake3_sse2_x86-64_unix.S @@ -1,3 +1,5 @@ +#include "mesa_blake3_visibility.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif @@ -13,6 +15,12 @@ #endif .intel_syntax noprefix +HIDDEN blake3_hash_many_sse2 +HIDDEN _blake3_hash_many_sse2 +HIDDEN blake3_compress_in_place_sse2 +HIDDEN _blake3_compress_in_place_sse2 +HIDDEN blake3_compress_xof_sse2 +HIDDEN _blake3_compress_xof_sse2 .global blake3_hash_many_sse2 .global _blake3_hash_many_sse2 .global blake3_compress_in_place_sse2 diff --git a/src/util/blake3/blake3_sse41_x86-64_unix.S b/src/util/blake3/blake3_sse41_x86-64_unix.S index a3ff642..7644ebf 100644 --- a/src/util/blake3/blake3_sse41_x86-64_unix.S +++ b/src/util/blake3/blake3_sse41_x86-64_unix.S @@ -1,3 +1,5 @@ +#include "mesa_blake3_visibility.h" + #if defined(__ELF__) && defined(__linux__) .section .note.GNU-stack,"",%progbits #endif @@ -13,6 +15,12 @@ #endif .intel_syntax noprefix +HIDDEN blake3_hash_many_sse41 +HIDDEN _blake3_hash_many_sse41 +HIDDEN blake3_compress_in_place_sse41 +HIDDEN _blake3_compress_in_place_sse41 +HIDDEN blake3_compress_xof_sse41 +HIDDEN _blake3_compress_xof_sse41 .global blake3_hash_many_sse41 .global _blake3_hash_many_sse41 .global blake3_compress_in_place_sse41 diff --git a/src/util/blake3/mesa_blake3_visibility.h b/src/util/blake3/mesa_blake3_visibility.h new file mode 100644 index 0000000..a759691 --- /dev/null +++ b/src/util/blake3/mesa_blake3_visibility.h @@ -0,0 +1,5 @@ +#ifdef __APPLE__ +#define HIDDEN .private_extern +#else +#define HIDDEN .hidden +#endif \ No newline at end of file -- 2.7.4