Skip to content

Commit 3ef54fe

Browse files
Fix macOS build
- Remove unsupported options. - Disable executable heap for Linux.
1 parent e42ab84 commit 3ef54fe

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/OpenTelemetry.AutoInstrumentation.Native/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ add_compile_definitions(OTEL_AUTO_VERSION_PATCH=${OTEL_AUTO_VERSION_PATCH})
176176
# ASLR (Position Independent Executable) and additional security features
177177
if (ISMACOS)
178178
add_link_options(-Wl,-pie)
179-
# Mark heap as non-executable
180-
add_link_options(-Wl,-no_heap_execute)
181-
# Disable executable stack
182-
add_link_options(-Wl,-no_execute_stack)
183179
elseif(ISLINUX)
184180
add_link_options(-Wl,-pie)
185181
# Enable RELRO (Relocation Read-Only)
@@ -188,6 +184,8 @@ elseif(ISLINUX)
188184
add_link_options(-Wl,-z,now)
189185
# Mark stack as non-executable
190186
add_link_options(-Wl,-z,noexecstack)
187+
# Mark heap as non-executable
188+
add_link_options(-Wl,-z,noexecheap)
191189
endif()
192190

193191
# ******************************************************

0 commit comments

Comments
 (0)