From 5f93c6eed251586c6b80b39fd8ec0db9023e5e52 Mon Sep 17 00:00:00 2001 From: springmin Date: Thu, 15 Oct 2026 13:25:41 +0800 Subject: [PATCH] coreclr: default EnableWriteXorExecute to 0 on OpenHarmony Ported from the OpenHarmony runtime integration branch. --- src/coreclr/inc/clrconfigvalues.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coreclr/inc/clrconfigvalues.h b/src/coreclr/inc/clrconfigvalues.h index 08ff844f9f6f38..816cf930c64005 100644 --- a/src/coreclr/inc/clrconfigvalues.h +++ b/src/coreclr/inc/clrconfigvalues.h @@ -640,11 +640,13 @@ RETAIL_CONFIG_STRING_INFO(INTERNAL_LTTngConfig, W("LTTngConfig"), "Configuration // Executable code // // TODO: https://github.com/dotnet/runtime/issues/103465 -#ifdef TARGET_RISCV64 +#if defined(TARGET_RISCV64) || defined(TARGET_OPENHARMONY) +// TARGET_OPENHARMONY: the sandbox denies PROT_EXEC on the file-backed mappings the W^X +// allocator uses; anonymous executable memory is allowed, so default to the RWX allocator. RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableWriteXorExecute, W("EnableWriteXorExecute"), 0, "Enable W^X for executable memory."); #else RETAIL_CONFIG_DWORD_INFO(EXTERNAL_EnableWriteXorExecute, W("EnableWriteXorExecute"), 1, "Enable W^X for executable memory."); -#endif // TARGET_RISCV64 +#endif // TARGET_RISCV64 || TARGET_OPENHARMONY #ifdef FEATURE_GDBJIT ///