[llvm] [Support] Adjust .note.GNU-stack guard in Support/BLAKE3/blake3_*_x86… (PR #76229)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 22 02:45:05 PST 2023
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-support
Author: Rainer Orth (rorth)
<details>
<summary>Changes</summary>
…-64_unix.S
When using GNU ld 2.41 on FreeBSD 14.0/amd64, there are linker warnings like
```
/vol/gcc/bin/gld-2.41: warning: blake3_avx512_x86-64_unix.S.o: missing .note.GNU-stack section implies executable stack
/vol/gcc/bin/gld-2.41: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
```
This can be fixed by adjusting the guard of the `.note.GNU-stack` sections in `blake3_*_x86-64_unix.S` to match other instances.
Tested on `amd64-pc-freebsd14.0`.
---
Full diff: https://github.com/llvm/llvm-project/pull/76229.diff
4 Files Affected:
- (modified) llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S (+1-1)
- (modified) llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S (+1-1)
- (modified) llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S (+1-1)
- (modified) llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S (+1-1)
``````````diff
diff --git a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S
index 69fc0936d73c56..a1210f98d5fa99 100644
--- a/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S
+++ b/llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S
@@ -2,7 +2,7 @@
#include "llvm_blake3_prefix.h"
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__) || defined(__Fuchsia__))
.section .note.GNU-stack,"",%progbits
#endif
diff --git a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
index f04a135dd1bc48..877359de93c085 100644
--- a/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
+++ b/llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
@@ -2,7 +2,7 @@
#include "llvm_blake3_prefix.h"
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__) || defined(__Fuchsia__))
.section .note.GNU-stack,"",%progbits
#endif
diff --git a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S
index 9a4f5eb7318bf9..bd8cb8e888e6fe 100644
--- a/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S
+++ b/llvm/lib/Support/BLAKE3/blake3_sse2_x86-64_unix.S
@@ -2,7 +2,7 @@
#include "llvm_blake3_prefix.h"
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__) || defined(__Fuchsia__))
.section .note.GNU-stack,"",%progbits
#endif
diff --git a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S
index 1be4ed744426b0..b273047630883a 100644
--- a/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S
+++ b/llvm/lib/Support/BLAKE3/blake3_sse41_x86-64_unix.S
@@ -2,7 +2,7 @@
#include "llvm_blake3_prefix.h"
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__linux__) || defined(__FreeBSD__) || defined(__Fuchsia__))
.section .note.GNU-stack,"",%progbits
#endif
``````````
</details>
https://github.com/llvm/llvm-project/pull/76229
More information about the llvm-commits
mailing list