Skip to content

Commit a17e346

Browse files
authored
add back linker flags "-z noexecstack" that were lost by accident (microsoft#25200)
### Description <!-- Describe your changes. --> Add back the linker option to make stack non-executable, which was accidentally lost here: microsoft#22646 This just adds back the option in the same place where it was. ### Motivation and Context After upgrading to 1.22.0 we saw this warning: OpenJDK 64-Bit Server VM warning: You have loaded library /opt/vespa-deps/lib64/libonnxruntime.so.1.22.0 which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
1 parent a135796 commit a17e346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/onnxruntime.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ if(onnxruntime_BUILD_SHARED_LIB)
148148
if (APPLE)
149149
target_link_options(onnxruntime PRIVATE "LINKER:-dead_strip")
150150
elseif(NOT CMAKE_SYSTEM_NAME MATCHES "AIX")
151-
target_link_options(onnxruntime PRIVATE "LINKER:--version-script=${SYMBOL_FILE}" "LINKER:--no-undefined" "LINKER:--gc-sections")
151+
target_link_options(onnxruntime PRIVATE "LINKER:--version-script=${SYMBOL_FILE}" "LINKER:--no-undefined" "LINKER:--gc-sections" "LINKER:-z,noexecstack")
152152
endif()
153153
else()
154154
target_link_options(onnxruntime PRIVATE "-DEF:${SYMBOL_FILE}")

0 commit comments

Comments
 (0)