From 65877a9c1260c1c37d1c3355703b1951b6754cdf Mon Sep 17 00:00:00 2001
From: Adeel <3840695+am11@users.noreply.github.com>
Date: Mon, 20 Mar 2023 19:36:14 +0200
Subject: [PATCH] Specify -z notext on linux-musl-x86

---
 src/coreclr/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/runtime/src/coreclr/CMakeLists.txt b/src/runtime/src/coreclr/CMakeLists.txt
index 67b773bf78787..87d862a541ae6 100644
--- a/src/runtime/src/coreclr/CMakeLists.txt
+++ b/src/runtime/src/coreclr/CMakeLists.txt
@@ -109,6 +109,10 @@ if(CLR_CMAKE_HOST_UNIX)
         endif()
     endif()
 
+    if(CLR_CMAKE_TARGET_ALPINE_LINUX AND CLR_CMAKE_TARGET_ARCH_I386)
+      add_linker_flag(-Wl,-z,notext)
+    endif()
+
     if(NOT CLR_CMAKE_HOST_MACCATALYST AND NOT CLR_CMAKE_HOST_IOS AND NOT CLR_CMAKE_HOST_TVOS)
       add_subdirectory(pal)
       add_subdirectory(hosts)
