Skip to content

[libc] add loongarch32 and loongarch64 config #136380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RossComputerGuy
Copy link
Member

Enables configuring for loongarch64. #136247 allows for loongarch64-unknown-uefi-llvm so these two PR's could be paired together.

@llvmbot llvmbot added the libc label Apr 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 18, 2025

@llvm/pr-subscribers-libc

Author: Tristan Ross (RossComputerGuy)

Changes

Enables configuring for loongarch64. #136247 allows for loongarch64-unknown-uefi-llvm so these two PR's could be paired together.


Full diff: https://github.com/llvm/llvm-project/pull/136380.diff

1 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCArchitectures.cmake (+8)
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index 62f3a2e3bdb59..083291c0e1f73 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -45,6 +45,10 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
     set(target_arch "i386")
   elseif(target_arch MATCHES "^(powerpc|ppc)")
     set(target_arch "power")
+  elseif(target_arch MATCHES "^loongarch32")
+    set(target_arch "loongarch32")
+  elseif(target_arch MATCHES "^loongarch64")
+    set(target_arch "loongarch64")
   elseif(target_arch MATCHES "^riscv32")
     set(target_arch "riscv32")
   elseif(target_arch MATCHES "^riscv64")
@@ -154,6 +158,10 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "x86_64")
   set(LIBC_TARGET_ARCHITECTURE_IS_X86_64 TRUE)
 elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "i386")
   set(LIBC_TARGET_ARCHITECTURE_IS_X86 TRUE)
+elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "loongarch32")
+  set(LIBC_TARGET_ARCHITECTURE_IS_LOONGARCH32 TRUE)
+elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "loongarch64")
+  set(LIBC_TARGET_ARCHITECTURE_IS_LOONGARCH64 TRUE)
 elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "riscv64")
   set(LIBC_TARGET_ARCHITECTURE_IS_RISCV64 TRUE)
   set(LIBC_TARGET_ARCHITECTURE "riscv")

@RossComputerGuy RossComputerGuy changed the title [libc] add loongarch32 and loongarch32 config [libc] add loongarch32 and loongarch64 config Apr 18, 2025
@michaelrj-google
Copy link
Contributor

Before we add a new target we need CI, as described here: https://libc.llvm.org/porting.html. This ensures that we can actually support what we claim to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants