“missing .note.GNU-stack section implies executable stack” when building OpenBLAS #5313
-
When building OpenBLAS (version 0.3.29) in an environment (Buildroot) without proper
The root cause is missing or incorrect Environment:
Steps to Reproduce:
Observed Behavior:
Is the problem on my end, or is there really a problem? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Build Configuration (ARMv7, 32-bit)
|
Beta Was this translation helpful? Give feedback.
-
This came up recently for IBM Z, but I could not reproduce it on Arm at the time, probably depends on having a very new version of the binutils. |
Beta Was this translation helpful? Give feedback.
-
@martin-frbg diff --git a/common_arm.h b/common_arm.h
index d6291018b..6efb20c58 100644
--- a/common_arm.h
+++ b/common_arm.h
@@ -114,7 +114,15 @@ static inline int blas_quickdivide(blasint x, blasint y){
OPENBLAS_ARM_TYPE_FUNCTION \
REALNAME:
-#define EPILOGUE
+#if defined(__ELF__) && defined(__linux__)
+# define GNUSTACK .section .note.GNU-stack,"",%progbits
+#else
+# define GNUSTACK
+#endif
+
+#define EPILOGUE \
+ .size REALNAME, .-REALNAME; \
+ GNUSTACK
#define PROFCODE
diff --git a/common_arm64.h b/common_arm64.h
index 5856898a2..7fd81acc4 100644
--- a/common_arm64.h
+++ b/common_arm64.h
@@ -159,8 +159,15 @@ static inline int blas_quickdivide(blasint x, blasint y){
REALNAME:
.endm
+#if defined(__ELF__) && defined(__linux__)
+# define GNUSTACK .section .note.GNU-stack,"",%progbits
+#else
+# define GNUSTACK
+#endif
-#define EPILOGUE
+#define EPILOGUE \
+ .size REALNAME, .-REALNAME; \
+ GNUSTACK
#define PROFCODE
Can I create PR? |
Beta Was this translation helpful? Give feedback.
-
That's unfortunate - I thought it might work. Perhaps it is only the |
Beta Was this translation helpful? Give feedback.
@martin-frbg
As was said this helps: