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 1/4] Specify -z notext on linux-musl-x86 --- src/coreclr/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreclr/CMakeLists.txt b/src/coreclr/CMakeLists.txt index 67b773bf78787..87d862a541ae6 100644 --- a/src/coreclr/CMakeLists.txt +++ b/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) From 465f01eb13ba83d2b19d21973edbbd604dd5539f Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Mon, 24 Apr 2023 11:39:10 +0300 Subject: [PATCH 2/4] Fix riscv64 build with clang/lld v15+ --- src/coreclr/jit/instr.cpp | 1 + src/coreclr/vm/exceptionhandling.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/instr.cpp b/src/coreclr/jit/instr.cpp index 97d0d94754a41..42580242c408a 100644 --- a/src/coreclr/jit/instr.cpp +++ b/src/coreclr/jit/instr.cpp @@ -1487,6 +1487,7 @@ instruction CodeGen::ins_Move_Extend(var_types srcType, bool srcInReg) return INS_vmov; #else NYI("ins_Move_Extend"); + return INS_invalid; #endif } diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index 02c7398a9c994..730234c763d87 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -5857,7 +5857,7 @@ struct _Unwind_Exception; // This is a personality routine for TheUMEntryPrestub and UMThunkStub Unix asm stubs. // An exception propagating through these stubs is an unhandled exception. // This function dumps managed stack trace and terminates the current process. -EXTERN_C _Unwind_Reason_Code +DLLEXPORT EXTERN_C _Unwind_Reason_Code UnhandledExceptionHandlerUnix( IN int version, IN _Unwind_Action action, From cde6b8f73069b45886762189653ce18ea113b09b Mon Sep 17 00:00:00 2001 From: Adeel Mujahid <3840695+am11@users.noreply.github.com> Date: Tue, 25 Apr 2023 00:39:22 +0300 Subject: [PATCH 3/4] Inline visibility attribute --- src/coreclr/vm/exceptionhandling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index 730234c763d87..8410310d54a1f 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -5857,7 +5857,7 @@ struct _Unwind_Exception; // This is a personality routine for TheUMEntryPrestub and UMThunkStub Unix asm stubs. // An exception propagating through these stubs is an unhandled exception. // This function dumps managed stack trace and terminates the current process. -DLLEXPORT EXTERN_C _Unwind_Reason_Code +__attribute__((visibility("default"))) EXTERN_C _Unwind_Reason_Code UnhandledExceptionHandlerUnix( IN int version, IN _Unwind_Action action, From e71b1f51d447119e39e5094f6d34955fa69e51be Mon Sep 17 00:00:00 2001 From: Adeel <3840695+am11@users.noreply.github.com> Date: Tue, 25 Apr 2023 02:31:32 +0300 Subject: [PATCH 4/4] Fix gcc build --- src/coreclr/vm/exceptionhandling.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp index 8410310d54a1f..0a4ca9cfa7883 100644 --- a/src/coreclr/vm/exceptionhandling.cpp +++ b/src/coreclr/vm/exceptionhandling.cpp @@ -5857,7 +5857,7 @@ struct _Unwind_Exception; // This is a personality routine for TheUMEntryPrestub and UMThunkStub Unix asm stubs. // An exception propagating through these stubs is an unhandled exception. // This function dumps managed stack trace and terminates the current process. -__attribute__((visibility("default"))) EXTERN_C _Unwind_Reason_Code +EXTERN_C __attribute__((visibility("default"))) _Unwind_Reason_Code UnhandledExceptionHandlerUnix( IN int version, IN _Unwind_Action action,