[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.

llvm-svn: 228650
This commit is contained in:
Alexey Samsonov 2015-02-10 01:42:44 +00:00
parent e4725beba7
commit 54a0e40442
1 changed files with 7 additions and 2 deletions

View File

@ -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_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