[compiler-rt] [compiler-rt] Add hexagon architecture to cmake (PR #98650)

Brian Cain via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 08:19:27 PDT 2024


https://github.com/androm3da created https://github.com/llvm/llvm-project/pull/98650

Add hexagon to detect_target_arch, test_target macros.

>From e4c21ade54120303ec54f78e36206c8a550f36c4 Mon Sep 17 00:00:00 2001
From: Brian Cain <bcain at quicinc.com>
Date: Fri, 12 Jul 2024 07:22:10 -0700
Subject: [PATCH] [compiler-rt] Add hexagon architecture to cmake

Add hexagon to detect_target_arch, test_target macros.
---
 compiler-rt/cmake/Modules/CompilerRTUtils.cmake | 3 +++
 compiler-rt/cmake/base-config-ix.cmake          | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
index 58b02fe48cd8f..379e2c25949cb 100644
--- a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTUtils.cmake
@@ -152,6 +152,7 @@ macro(detect_target_arch)
   check_symbol_exists(__aarch64__ "" __AARCH64)
   check_symbol_exists(__x86_64__ "" __X86_64)
   check_symbol_exists(__i386__ "" __I386)
+  check_symbol_exists(__hexagon__ "" __HEXAGON)
   check_symbol_exists(__loongarch__ "" __LOONGARCH)
   check_symbol_exists(__mips__ "" __MIPS)
   check_symbol_exists(__mips64__ "" __MIPS64)
@@ -182,6 +183,8 @@ macro(detect_target_arch)
     else()
       message(FATAL_ERROR "Unsupported pointer size for X86_64")
     endif()
+  elseif(__HEXAGON)
+    add_default_target_arch(hexagon)
   elseif(__I386)
     add_default_target_arch(i386)
   elseif(__LOONGARCH)
diff --git a/compiler-rt/cmake/base-config-ix.cmake b/compiler-rt/cmake/base-config-ix.cmake
index 2d6342b28ea31..80bbca1cbfceb 100644
--- a/compiler-rt/cmake/base-config-ix.cmake
+++ b/compiler-rt/cmake/base-config-ix.cmake
@@ -218,6 +218,8 @@ macro(test_targets)
       test_target_arch(amdgcn "" "--target=amdgcn-amd-amdhsa" "-nogpulib"
                        "-flto" "-fconvergent-functions"
                        "-Xclang -mcode-object-version=none")
+    elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "hexagon")
+      test_target_arch(hexagon "" "")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "loongarch64")
       test_target_arch(loongarch64 "" "")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc64le|ppc64le")



More information about the llvm-commits mailing list