[PATCH] Adding experimental build support for building compiler-rt for iOS.

Chris Bieneman beanz at apple.com
Wed Jun 24 14:58:43 PDT 2015


I will update the patches shortly.


================
Comment at: cmake/Modules/CompilerRTDarwinUtils.cmake:2
@@ +1,3 @@
+# On OS X SDKs can be installed anywhere on the base system and xcode-select
+# or SDKROOT can be used to set the default one to use. We want to find the SDKs
+# that are present in the current Xcode
----------------
filcab wrote:
> This seems misleading. xcodebuild doesn't seem to honour SDKROOT.
> 
> If I have 10.10 and 10.9 installed, and set SDKROOT=/.../Xcode.app/.../MacOSX10.9.sdk, I get:
>   [~]% xcodebuild -version -sdk macosx Path
>   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
> 
> (This is really handy when you have an SDK available for 10.(X+1), but are running on 10.X.
I'll reword. Xcodebuild doesn't respect SDKROOT if you specify -sdk, which is why you would see that behavior.

================
Comment at: lib/asan/CMakeLists.txt:116
@@ -115,3 +115,3 @@
     add_compiler_rt_darwin_dynamic_runtime(clang_rt.asan_${os}_dynamic ${os}
-      ARCHS ${ASAN_SUPPORTED_ARCH}
+      ARCHS ${SANITIZER_COMMON_DARWIN_${os}_ARCHES}
       SOURCES $<TARGET_OBJECTS:RTAsan.${os}>
----------------
filcab wrote:
> Just to be sure, ASan will be supported on all of the arch + OS that sanitizer_common will run on? (at first sight, it almost looks like a copy-paste bug)
> 
> You're adding object_libraries (line 80) for ASAN_SUPPORTED_ARCH, but then generate dynamic_runtimes for SANITIZER_COMMON_..._ARCHES. Shouldn't these be the same, at least?
Anna would have to comment as to what ASan will or won't be supported on. I'm just trying to make it build, and ASAN_SUPPORTED_ARCH is set to i386;x86_64, which just doesn't work on iOS. For Darwin we always need platform-specific arch settings.

The line 80 thing is just an oddity of the moment. If you look at add_compiler_rt_object_libraries, it actually ignores the ARCH setting that comes in because it needs platform-specific archs.

================
Comment at: lib/ubsan/CMakeLists.txt:47
@@ -46,3 +46,3 @@
       add_compiler_rt_darwin_dynamic_runtime(clang_rt.ubsan_${os}_dynamic ${os}
-        ARCHS ${UBSAN_SUPPORTED_ARCH}
+        ARCHS ${SANITIZER_COMMON_DARWIN_${os}_ARCHES}
         SOURCES $<TARGET_OBJECTS:RTUbsan.${os}>
----------------
filcab wrote:
> Just to be sure, UBSan will be supported on all of the arch + OS that sanitizer_common will run on?
> 
> Same comment as ASan (check line 42 here).
Again, I can't really comment about official support. I'm just trying to make it build and you can't build UBSan for iOS targeting x86.

My goal in these patches was to identify up front the architectures that your host toolchain is capable of targeting for each target OS, and build everything for all of them.

http://reviews.llvm.org/D10710

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list