Reputation: 1221
I recently upgraded my OSX from El Capitan to Sierra. The upgrade starts generating compiler errors when using clang++ for one of my projects. I tried it on other projects which do not generate the same errors. Here's the error message.
clang++ -v -O3 -std=c++11 -stdlib=libc++ -g -Wall -I/Users/kevincha/projects/git_hub/DRAMPower/src -I/usr/local/include -I/usr/local/Cellar/boost/1.63.0/include -DRAMULATOR -o ramulator src/Main.cpp obj/ALDRAM.o obj/Cache.o obj/Config.o obj/Controller.o obj/DDR3.o obj/DDR4.o obj/DSARP.o obj/GDDR5.o obj/HBM.o obj/LPDDR4.o obj/Packet.o obj/Processor.o obj/Refresh.o obj/SALP.o obj/StatType.o obj/TLDRAM.o obj/WideIO.o obj/WideIO2.o
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name Main.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn -target-linker-version 274.2 -v -dwarf-column-info -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -I /Users/kevincha/projects/git_hub/DRAMPower/src -I /usr/local/include -I /usr/local/Cellar/boost/1.63.0/include -D RAMULATOR -stdlib=libc++ -O3 -Wall -std=c++11 -fdeprecated-macro -fdebug-compilation-dir /Users/kevincha/projects/git_hub/ramulator_power -ferror-limit 19 -fmessage-length 270 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /var/folders/cn/jclpg1w53fd_gbsnwtjzsc7w0000gn/T/Main-4d31a3.o -x c++ src/Main.cpp
clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin16.4.0
ignoring nonexistent directory "/usr/include/c++/v1"
ignoring duplicate directory "/usr/local/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/Users/kevincha/projects/git_hub/DRAMPower/src
/usr/local/Cellar/boost/1.63.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/cn/jclpg1w53fd_gbsnwtjzsc7w0000gn/T/Main-ae92f3.cpp
clang: note: diagnostic msg: /var/folders/cn/jclpg1w53fd_gbsnwtjzsc7w0000gn/T/Main-ae92f3.sh
clang: note: diagnostic msg:
********************
make: *** [ramulator] Error 254
Upvotes: 1
Views: 756
Reputation: 47219
This was a clang compiler bug, now fixed in the latest (beta) Xcode:
Xcode 8.3 beta 3 (8W132p)
Posted Date: Feb 20th, 2017
↳ https://developer.apple.com/download/
Upvotes: 2