clang-3.6 build failure

René J.V. Bertin rjvbertin at gmail.com
Mon Dec 22 06:29:10 PST 2014


On Sunday December 21 2014 21:03:14 Lawrence Velázquez wrote:


> > In the meantime, with these changes, xcodebuild and xcrun behave exactly the way they would if Xcode where the selected tool chain.

> The bootstrapped compiler is not functioning correctly with the detected OS X SDK. Perhaps it was not built properly. What does this output?
> 
>     % CLANG_SRC=$(port work clang-3.6)/trunk
>     % $(CLANG_SRC)/Release+Debug+Asserts/bin/clang \
>         -arch x86_64 -c -integrated-as \
>         $(CLANG_SRC)/projects/compiler-rt/make/platform/clang_darwin_test_input.c \
>         -isysroot $(xcrun --sdk macosx --show-sdk-path) -o /dev/null

#> ${CLANG_SRC}/Release+Debug+Asserts/bin/clang         -arch x86_64 -c -integrated-as         ${CLANG_SRC}/projects/compiler-rt/make/platform/clang_darwin_test_input.c         -isysroot $(xcrun --sdk macosx --show-sdk-path) -o /dev/null
0  libLLVM-3.6svn.dylib     0x00000001078476f4 llvm::sys::PrintStackTrace(__sFILE*) + 57
1  libLLVM-3.6svn.dylib     0x0000000107847be1 SignalHandler(int) + 220
2  libsystem_platform.dylib 0x00007fff886f35aa _sigtramp + 26
3  libsystem_c.dylib        0x00007fff7a0de420 __stack_chk_guard + 0
4  libLLVM-3.6svn.dylib     0x0000000107848246 llvm::SmallPtrSetImplBase::insert_imp(void const*) + 164
5  clang                    0x00000001051c7e77 RemoveDuplicates(std::__1::vector<clang::DirectoryLookup, std::__1::allocator<clang::DirectoryLookup> >&, unsigned int, bool) + 711
6  clang                    0x00000001051c5e48 clang::ApplyHeaderSearchOptions(clang::HeaderSearch&, clang::HeaderSearchOptions const&, clang::LangOptions const&, llvm::Triple const&) + 4024
7  clang                    0x0000000105181f49 clang::CompilerInstance::createPreprocessor(clang::TranslationUnitKind) + 2121
8  clang                    0x00000001051b427a clang::FrontendAction::BeginSourceFile(clang::CompilerInstance&, clang::FrontendInputFile const&) + 2634
9  clang                    0x0000000105185410 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 896
10 clang                    0x0000000105141e51 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3361
11 clang                    0x0000000105138f41 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 929
12 clang                    0x000000010514021d main + 10957
13 libdyld.dylib            0x00007fff888d25fd start + 1
14 libdyld.dylib            0x0000000000000031 start + 2004015669
Stack dump:
0.      Program arguments: /Volumes/Debian/MP9/var/macports/build/_Volumes_Debian_MP9_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-3.6/clang-3.6/work/trunk/Release+Debug+Asserts/bin/clang -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free -main-file-name clang_darwin_test_input.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 236.3 -dwarf-column-info -coverage-file /dev/null -resource-dir /Volumes/Debian/MP9/var/macports/build/_Volumes_Debian_MP9_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-3.6/clang-3.6/work/trunk/Release+Debug+Asserts/bin/../lib/clang/3.6.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fdebug-compilation-dir /Users/bertin -ferror-limit 19 -fmessage-length 132 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /dev/null -x c /Volumes/Debian/MP9/var/macports/build/_Volumes_Debian_MP9_var_macports_sources_rsync.macports.org_release_ports_lang_llvm-3.6/clang-3.6/work/trunk/projects/compiler-rt/make/platform/clang_darwin_test_input.c 
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.6.0 (trunk 223943)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: error: unable to execute command: Segmentation fault: 11
clang: note: diagnostic msg: Error generating preprocessed source(s).

>     % echo $?
254

> 
> > The IDE version appears to run its internal tools no matter what CLT you have installed; I'm assuming the batch version does the same.

What I meant here is that I assume that using xcodebuild/xcrun to build an Xcode project uses the same tools as doing the build in the IDE.

> What "batch version"? Do you mean the /usr/bin shims? Those point to whatever `xcode-select` says to point to. You can see what's going on for yourself:
> 
>     % echo 'int main(void) {}' | /usr/bin/clang -v -x c -o /dev/null -

Well, invoking /usr/bin/clang directly will of course use the CLT version. That was actually my intention: have the newer compiler version for building most of (FOSS) MacPorts (notably Qt and KDE), but a stabler Xcode version.

I actually never checked my assumption, as I always build Xcode projects in the IDE, not using xcodebuild/xcrun/whatever. Guess I should...

And maybe I should update my 10.9 SDK.

R.


More information about the macports-dev mailing list