Skip to content

Conversation

@jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Feb 24, 2025

Summary:
Some day we'd like to support this, add some initial support for parsing
the triple so it will at least attempt to build.

Summary:
Some day we'd like to support this, add some initial support for parsing
the triple so it will at least attempt to build.
@llvmbot
Copy link
Member

llvmbot commented Feb 24, 2025

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

Changes

Summary:
Some day we'd like to support this, add some initial support for parsing
the triple so it will at least attempt to build.


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

1 Files Affected:

  • (modified) libc/cmake/modules/LLVMLibCArchitectures.cmake (+4)
diff --git a/libc/cmake/modules/LLVMLibCArchitectures.cmake b/libc/cmake/modules/LLVMLibCArchitectures.cmake
index fbb1091ddabab..b94534bb00980 100644
--- a/libc/cmake/modules/LLVMLibCArchitectures.cmake
+++ b/libc/cmake/modules/LLVMLibCArchitectures.cmake
@@ -53,6 +53,8 @@ function(get_arch_and_system_from_triple triple arch_var sys_var)
     set(target_arch "amdgpu")
   elseif(target_arch MATCHES "^nvptx64")
     set(target_arch "nvptx")
+  elseif(target_arch MATCHES "^spirv64")
+    set(target_arch "spirv64")
   else()
     return()
   endif()
@@ -162,6 +164,8 @@ elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "amdgpu")
   set(LIBC_TARGET_ARCHITECTURE_IS_AMDGPU TRUE)
 elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "nvptx")
   set(LIBC_TARGET_ARCHITECTURE_IS_NVPTX TRUE)
+elseif(LIBC_TARGET_ARCHITECTURE STREQUAL "spirv64")
+  set(LIBC_TARGET_ARCHITECTURE_IS_SPIRV TRUE)
 else()
   message(FATAL_ERROR
           "Unsupported libc target architecture ${LIBC_TARGET_ARCHITECTURE}")

Copy link
Collaborator

@JonChesterfield JonChesterfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciated, removes some local cmake patches I'm carrying while trying to get it to build as spirv

@jhuber6 jhuber6 merged commit 9bfe486 into llvm:main Feb 24, 2025
18 checks passed
@jhuber6 jhuber6 deleted the SPIRVlibc branch February 24, 2025 21:18
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