Assertion failed: (!isCommon()), function getOffset, file /usr/src/lib/clang/libllvmmc/../../../contrib/llvm/include/llvm/MC/MCAssembler.h, line 736. Stack dump: 0. Program arguments: /usr/obj/usr/src/tmp/usr/bin/cc -cc1 -triple x86_64-unknown-freebsd11.0 -emit-obj -disable-free -main-file-name sched_ule.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -mdisable-tail-calls -masm-verbose -mconstructor-aliases -mcode-model kernel -target-cpu amdfam10 -target-feature -mmx -target-feature -sse -target-feature -aes -target-feature -avx -disable-red-zone -no-implicit-float -gdwarf-2 -dwarf-column-info -coverage-file /usr/obj/usr/src/sys/TRANT/sched_ule.c -nostdsysteminc -nobuiltininc -resource-dir /usr/obj/usr/src/tmp/usr/bin/../lib/clang/3.6.0 -include opt_global.h -D _KERNEL -D HAVE_KERNEL_OPTION_HEADERS -D __printf__=__freebsd_kprintf__ -I . -I /usr/src/sys -I /usr/src/sys/contrib/libfdt -isysroot /usr/obj/usr/src/tmp -O2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -Wmissing-include-dirs -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Werror -std=iso9899:1999 -fdebug-compilation-dir /usr/obj/usr/src/sys/TRANT -ferror-limit 19 -fmessage-length 230 -ffreestanding -fwrapv -stack-protector 1 -mstackrealign -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o sched_ule.o -x c /usr/src/sys/kern/sched_ule.c 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/usr/src/sys/kern/sched_ule.c'. 4. Running pass 'X86 Assembly / Object Emitter' on function '@sched_switch' cc: error: unable to execute command: Abort trap (core dumped) cc: error: clang frontend command failed due to signal (use -v to see invocation) FreeBSD clang version 3.6.0 (tags/RELEASE_360/final 230434) 20150225 Target: x86_64-unknown-freebsd11.0 Thread model: posix cc: note: diagnostic msg: PLEASE submit a bug report to https://bugs.freebsd.org/submit/ and include the crash backtrace, preprocessed source, and associated run script. cc: note: diagnostic msg: ******************** PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: cc: note: diagnostic msg: /tmp/sched_ule-ec2890.c cc: note: diagnostic msg: /tmp/sched_ule-ec2890.sh cc: note: diagnostic msg: ******************** *** Error code 254
Created attachment 156996 [details] compressed source file
Created attachment 156997 [details] script
I must also note that the problem happens with a locally modified source tree. In particular there is some "hardcore" stuff in SDT_PROBE_FUNC_(), SDT_CALL_START(), STD_CALL_END_().
Reproduced and filed upstream here: http://llvm.org/PR23621 The problem is that several .comm symbols get defined multiple times, with the same name. Apparently the clang MC assembler has an assertion for this. As a workaround, you can either try to ensure the .comm symbols all have unique names, or use the -no-integrated-as flag, to use the GNU assembler, which apparently just ignores the duplicated .comm symbols.
(In reply to Dimitry Andric from comment #4) Thank you very much for the research, the upstream report and the suggestions! I'm using a workaround now.
Seems like that this was fixed in clang more than a year ago and the fix is already in FreeBSD.