[PATCH] D61242: [CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #2.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 19:14:27 PDT 2019


delcypher added a comment.

In D61242#1549797 <https://reviews.llvm.org/D61242#1549797>, @hans wrote:

> In D61242#1547365 <https://reviews.llvm.org/D61242#1547365>, @delcypher wrote:
>
> > @juliehockett Sorry I completely dropped the ball here and forgot to land this. I've rebased and committed the change. @thakis I noticed I had a merge conflict with your change. Hopefully this hasn't broken anything for you.
>
>
> I don't have context here, but this change caused Chromium's clang package to stop building, failing with:
>
> [...]
>  CMake Error at /work/llvm.monorepo/compiler-rt/cmake/config-ix.cmake:179 (message):
>
>   Unsupported architecture: i386
>
> Call Stack (most recent call first):
>
>   /work/llvm.monorepo/compiler-rt/cmake/config-ix.cmake:218 (get_target_flags_for_arch)
>   /work/llvm.monorepo/compiler-rt/test/ubsan/CMakeLists.txt:116 (get_test_cflags_for_apple_platform)
>   
>
> See https://bugs.chromium.org/p/chromium/issues/detail?id=976593#c3 for the full cmake invocation and output.
>
> I've reverted this in r363779 until it's more clear what's happening.


@hans 
Thanks for the link to reproducer. Unfortunately I've not been able to reproduce this issue. I reverted your revert of my patch and then tried running the cmake configure and it succeeds for me. I used AppleClang (LLVM version 9.1.0 (clang-902.0.39.1)) from Xcode 9 as the toolchain.

  cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="clang;compiler-rt;lld;libcxx" -DLLVM_TARGETS_TO_BUILD="AArch64;ARM;Mips;PowerPC;SystemZ;WebAssembly;X86" -DLLVM_ENABLE_PIC=OFF -DLLVM_ENABLE_UNWIND_TABLES=OFF -DLLVM_ENABLE_TERMINFO=OFF -DCLANG_PLUGIN_SUPPORT=OFF -DCLANG_ENABLE_STATIC_ANALYZER=OFF -DCLANG_ENABLE_ARCMT=OFF -DCOMPILER_RT_USE_LIBCXX=NO -DLIBCXX_CXX_ABI=libcxxabi -DLIBCXX_CXX_ABI_SYSTEM=1 -DLLVM_ENABLE_LIBXML2=FORCE_ON -DCOMPILER_RT_BUILD_CRT=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=ON -DCOMPILER_RT_BUILD_PROFILE=ON -DCOMPILER_RT_BUILD_SANITIZERS=ON -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_BUILD_BUILTINS=ON -DCOMPILER_RT_ENABLE_IOS=ON -DCOMPILER_RT_ENABLE_WATCHOS=OFF -DCOMPILER_RT_ENABLE_TVOS=OFF -DDARWIN_ios_ARCHS="armv7;armv7s;arm64" -DDARWIN_iossim_ARCHS="i386;x86_64" -DDARWIN_osx_ARCHS=x86_64 -DLLVM_ENABLE_THREADS=OFF -DCOMPILER_RT_ENABLE_IOS=ON -DSANITIZER_MIN_OSX_VERSION=10.7 ../../llvm/llvm/

Looking at the output I can see when I run this there are some suspicious differences between my output and yours.

In my output there's

  -- ios Simulator supported arches: i386;x86_64

Your output doesn't have that line at all.

My output also shows...

  -- Compiler-RT supported architectures: x86_64;i386;armv7;armv7s;arm64

whereas yours shows

  -- Compiler-RT supported architectures: x86_64;armv7;armv7s;arm64

I had a quick look around and the missing "-- ios Simulator supported arches: " line could be caused if ` DARWIN_iossim_SYSROOT` was not set. In turn this would mean that `COMPILER_RT_SUPPORTED_ARCH` wouldn't get i386 added to it. This would explain some of the the symptoms we're seeing.

This is weird though because it suggests that the `find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator)` call isn't finding the iOS simulator SDK in your toolchain. Is your toolchain a modified Apple toolchain? For the normal (included with Xcode) Apple toolchain our CMake code doesn't have a problem finding the simulator SDK.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61242/new/

https://reviews.llvm.org/D61242





More information about the llvm-commits mailing list