[CMake] [macho_embedded] We need to set some extra flags when building the macho_embedded builtins.
If we don't specify the arm target the float ABI compiler flags get ignored.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248853 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake
index 474c9fd..12c1747 100644
--- a/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -338,6 +338,11 @@
set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR
${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded)
+
+ set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi")
+ set(CFLAGS_armv7em "-target thumbv7-apple-darwin-eabi")
+ set(CFLAGS_armv7m "-target thumbv7-apple-darwin-eabi")
+ set(CFLAGS_i386 "-march=pentium")
set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7)
set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7 i386 x86_64)
@@ -378,7 +383,7 @@
OS macho_embedded
ARCH ${arch}
SOURCES ${${arch}_filtered_sources}
- CFLAGS -arch ${arch} ${${type}_FLAG} ${${float_type}_FLOAT_FLAG}
+ CFLAGS -arch ${arch} ${${type}_FLAG} ${${float_type}_FLOAT_FLAG} ${CFLAGS_${arch}}
PARENT_TARGET builtins)
endforeach()
foreach(lib ${macho_embedded_${lib_suffix}_libs})