D98575
authorLLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
Fri, 22 Jul 2022 13:10:20 +0000 (14:10 +0100)
committerSylvestre Ledru <sylvestre@debian.org>
Fri, 22 Jul 2022 13:10:20 +0000 (14:10 +0100)
Gbp-Pq: Name D98575.patch

compiler-rt/cmake/base-config-ix.cmake

index 3ca9dc0f5515d3f145e964ae8cdee024f11b0fbf..f1edf5c7070962e961882fbef9965c5e2b0acb9c 100644 (file)
@@ -214,8 +214,12 @@ macro(test_targets)
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "s390x")
       test_target_arch(s390x "" "")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "sparc")
-      test_target_arch(sparc "" "-m32")
-      test_target_arch(sparcv9 "" "-m64")
+      if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+        test_target_arch(sparc "" "-mcpu=v9" "-m32")
+        append("-latomic" CMAKE_LD_FLAGS)
+      else()
+        test_target_arch(sparcv9 "" "-m64")
+      endif()
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el")
       # Gcc doesn't accept -m32/-m64 so we do the next best thing and use
       # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match