[compiler-rt] r228650 - [CMake] PowerPC: detect host endianness to build corresponding version of runtimes.

Alexey Samsonov vonosmas at gmail.com
Mon Feb 9 17:42:44 PST 2015


Author: samsonov
Date: Mon Feb  9 19:42:44 2015
New Revision: 228650

URL: http://llvm.org/viewvc/llvm-project?rev=228650&view=rev
Log:
[CMake] PowerPC: detect host endianness to build corresponding version of runtimes.

Prior to this change we built two identical runtimes, named "powerpc64"
and "powerpc64le", while their actual endianness matched the host
endianness.

Modified:
    compiler-rt/trunk/cmake/config-ix.cmake

Modified: compiler-rt/trunk/cmake/config-ix.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=228650&r1=228649&r2=228650&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/config-ix.cmake (original)
+++ compiler-rt/trunk/cmake/config-ix.cmake Mon Feb  9 19:42:44 2015
@@ -1,6 +1,7 @@
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
 include(CheckSymbolExists)
+include(TestBigEndian)
 
 # CodeGen options.
 check_cxx_compiler_flag(-fPIC                COMPILER_RT_HAS_FPIC_FLAG)
@@ -144,8 +145,12 @@ else()
       test_target_arch(i386 "")
     endif()
   elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC")
-    test_target_arch(powerpc64 "-m64")
-    test_target_arch(powerpc64le "-m64")
+    TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN)
+    if(HOST_IS_BIG_ENDIAN)
+      test_target_arch(powerpc64 "-m64")
+    else()
+      test_target_arch(powerpc64le "-m64")
+    endif()
   elseif("${LLVM_NATIVE_ARCH}" STREQUAL "Mips")
     if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "mipsel|mips64el")
       # regex for mipsel, mips64el





More information about the llvm-commits mailing list