[PATCH] [COMPILER-RT] Fix CMake build for Apple/Darwin without Xcode and for universal build

Jonathan Buschmann jonathan+llvm at pinacea.com
Tue Apr 21 13:50:43 PDT 2015


It's on OSX 10.7 (but I also thought that a redirection to /dev/null would have done the trick).

Information of the system :

  $ sw_vers
  ProductName:    Mac OS X
  ProductVersion: 10.7.5
  BuildVersion:   11G63
  
  
  $ pkgutil --pkg-info=com.apple.pkg.DeveloperToolsCLI
  package-id: com.apple.pkg.DeveloperToolsCLI
  version: 4.6.0.0.1.1365549073

An example of the error I get

  [ 15%] Built target compiler-rt-headers
  Scanning dependencies of target lsan
  [ 15%] Built target lsan
  Scanning dependencies of target RTUbsan_standalone.iossim
  [ 15%] Building CXX object projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_standalone.iossim.dir/ubsan_init_standalone.cc.o
  clang-3.4: error: no such file or directory: 'returned'
  clang-3.4: error: no such file or directory: 'unexpected'
  clang-3.4: error: no such file or directory: 'error.'
  clang-3.4: warning: /usr/bin/xcode-select: 'linker' input unused
  clang-3.4: warning: no such sysroot directory: 'Error:'
  make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_standalone.iossim.dir/ubsan_init_standalone.cc.o] Error 1
  make[1]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/RTUbsan_standalone.iossim.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....

The command that fails during CMake :

  $ xcodebuild -version -sdk iphonesimulator.internal Path 2>/dev/null
  Error: /usr/bin/xcode-select returned unexpected error.

which gives in the final Makefile :

  ./lib/asan/CMakeFiles/clang_rt.asan_iossim_dynamic.dir/flags.make:CXX_FLAGS = -I/Users/user/A/llvm/build/../projects/libcxx/include/ -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -Wall -std=c++11 -O3 -DNDEBUG -arch x86_64 -fPIC -I/Users/user/A/llvm/build/projects/compiler-rt/lib/asan -I/Users/user/A/llvm/projects/compiler-rt/lib/asan -I/Users/user/A/llvm/build/include -I/Users/user/A/llvm/include -I/Users/user/A/llvm/projects/compiler-rt/lib/asan/..     -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -ftls-model=initial-exec -stdlib=libc++ -mios-simulator-version-min=7.0 -isysroot Error: /usr/bin/xcode-select returned unexpected error.

Finally the CMake command I use :

  cmake -DCMAKE_INSTALL_PREFIX=/tmp/A -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_LIBCXX=ON -DCMAKE_C_COMPILER=${CC} -DCMAKE_CXX_COMPILER=${CXX} -DCMAKE_CXX_FLAGS=-I$(pwd)/../projects/libcxx/include/ -DCMAKE_SHARED_LINKER_FLAGS=-L$(pwd)/lib/ -DCMAKE_OSX_ARCHITECTURES="x86_64;i386"


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8936

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






More information about the llvm-commits mailing list