[libc-commits] [libc] [libc] [riscv] support build with `scudo` on `riscv64` (PR #74951)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Mon Dec 11 10:26:28 PST 2023


================
@@ -268,18 +268,27 @@ if(LLVM_LIBC_INCLUDE_SCUDO)
   set(SCUDO_DEPS "")
 
   include(${LIBC_SOURCE_DIR}/../compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake)
-  if(NOT (LIBC_TARGET_ARCHITECTURE IN_LIST ALL_SCUDO_STANDALONE_SUPPORTED_ARCH))
-    message(FATAL_ERROR "Architecture ${LIBC_TARGET_ARCHITECTURE} is not supported by SCUDO. 
+  
+  # scudo distinguishes riscv32 and riscv64, so we need to translate the architecture
+  set(LIBC_TARGET_ARCHITECTURE_FOR_SCUDO ${LIBC_TARGET_ARCHITECTURE})
----------------
SchrodingerZhu wrote:

According to https://github.com/llvm/llvm-project/blob/40e2bb5330840b56d452244f96e491b6530ce4bf/libc/cmake/modules/LLVMLibCArchitectures.cmake#L144

`LIBC_TARGET_ARCHITECTURE` actively reset `riscv64` to `riscv` soon upon definition, with a purpose of simplying the build system.

https://github.com/llvm/llvm-project/pull/74951


More information about the libc-commits mailing list