<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 24, 2015, at 3:15 PM, Filipe Cabecinhas <<a href="mailto:filcab+llvm.phabricator@gmail.com" class="">filcab+llvm.phabricator@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Hi Chris,<br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 24, 2015 at 2:58 PM, Chris Bieneman<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:beanz@apple.com" target="_blank" class="">beanz@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I will update the patches shortly.<br class=""><span class=""><br class=""><br class="">================<br class="">Comment at: cmake/Modules/CompilerRTDarwinUtils.cmake:2<br class="">@@ +1,3 @@<br class="">+# On OS X SDKs can be installed anywhere on the base system and xcode-select<br class="">+# or SDKROOT can be used to set the default one to use. We want to find the SDKs<br class="">+# that are present in the current Xcode<br class="">----------------<br class=""></span><span class="">filcab wrote:<br class="">> This seems misleading. xcodebuild doesn't seem to honour SDKROOT.<br class="">><br class="">> If I have 10.10 and 10.9 installed, and set SDKROOT=/.../Xcode.app/.../MacOSX10.9.sdk, I get:<br class="">>   [~]% xcodebuild -version -sdk macosx Path<br class="">>   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk<br class="">><br class="">> (This is really handy when you have an SDK available for 10.(X+1), but are running on 10.X.<br class=""></span>I'll reword. Xcodebuild doesn't respect SDKROOT if you specify -sdk, which is why you would see that behavior.<br class=""></blockquote><div class="">Fair enough. Do you happen to know if there's a way (other than moving the 10.(X+1) sdk out of the way) to have my use-case work? (Just curious. It's not something that happens a lot (a few months per year, at most ;-) ).</div></div></div></div></div></blockquote><div><br class=""></div><div>Changing the value passed into the -sdk flag will allow you to specify a specific version. We should support that more formally eventually.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class="">================<br class="">Comment at: lib/asan/CMakeLists.txt:116<br class="">@@ -115,3 +115,3 @@<br class="">     add_compiler_rt_darwin_dynamic_runtime(clang_rt.asan_${os}_dynamic ${os}<br class="">-      ARCHS ${ASAN_SUPPORTED_ARCH}<br class="">+      ARCHS ${SANITIZER_COMMON_DARWIN_${os}_ARCHES}<br class="">       SOURCES $<TARGET_OBJECTS:RTAsan.${os}><br class="">----------------<br class=""></span><span class="">filcab wrote:<br class="">> 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)<br class="">><br class="">> 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?<br class=""></span>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.<br class=""><br class="">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.<br class=""></blockquote><div class="">Fair enough. Can you please double check AddCompilerRT.cmake:42, then?</div><div class="">It's setting the property OSX_ARCHITECTURES to ${LIB_ARCHS}. Please double-check if we care about it (It's used for CMake's Xcode generator, and "Local Generator", which I have no idea what it's for :-) ).</div></div></div></div></div></blockquote><div><br class=""></div><div>That’s in my patches:</div><div><br class=""></div><div><div>Index: cmake/Modules/AddCompilerRT.cmake</div><div>===================================================================</div><div>--- cmake/Modules/AddCompilerRT.cmake</div><div>+++ cmake/Modules/AddCompilerRT.cmake</div><div>@@ -19,6 +19,8 @@</div><div>       set(libname "${name}.${os}")</div><div>       set(libnames ${libnames} ${libname})</div><div>       set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS})</div><div>+      set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS})</div><div>+      set(LIB_ARCHS_${libname} ${SANITIZER_COMMON_DARWIN_${os}_ARCHES})</div><div>     endforeach()</div><div>   else()</div><div>     foreach(arch ${LIB_ARCHS})</div><div>@@ -39,7 +41,9 @@</div><div>     set_property(TARGET ${libname} APPEND PROPERTY</div><div>       COMPILE_DEFINITIONS ${LIB_DEFS})</div><div>     if(APPLE)</div><div>-      set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCHS}")</div><div>+      set_target_properties(${libname} PROPERTIES</div><div>+        OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}"</div><div>+        LINK_FLAGS "${extra_linkflags_${libname}}")</div><div>     endif()</div><div>   endforeach()</div><div> endfunction()</div><div><br class=""></div><div>Thanks,</div><div>-Chris</div></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class=""> Filipe</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class=""><br class="">================<br class="">Comment at: lib/ubsan/CMakeLists.txt:47<br class="">@@ -46,3 +46,3 @@<br class="">       add_compiler_rt_darwin_dynamic_runtime(clang_rt.ubsan_${os}_dynamic ${os}<br class="">-        ARCHS ${UBSAN_SUPPORTED_ARCH}<br class="">+        ARCHS ${SANITIZER_COMMON_DARWIN_${os}_ARCHES}<br class="">         SOURCES $<TARGET_OBJECTS:RTUbsan.${os}><br class="">----------------<br class=""></span><span class="">filcab wrote:<br class="">> Just to be sure, UBSan will be supported on all of the arch + OS that sanitizer_common will run on?<br class="">><br class="">> Same comment as ASan (check line 42 here).<br class=""></span>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.<br class=""><br class="">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.<br class=""><div class=""><div class="h5"><br class=""><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10710&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=SoBO0IiKP-43YWNvfXrAkustTcapeTzPe6pTMODYtGY&s=OuaA6nbHGD0hvk3SDfeMbLLmcJRxgCOjUtpgZ06p0sQ&e=" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D10710</a><br class=""><br class="">EMAIL PREFERENCES<br class=""> <span class="Apple-converted-space"> </span><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=SoBO0IiKP-43YWNvfXrAkustTcapeTzPe6pTMODYtGY&s=ekW6nwCwZip3KfNwyS7Lqg2UNu9p0gSajKt3pZH5r_k&e=" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/settings/panel/emailpreferences/</a></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></body></html>