Bug 205183 - powerpc64 11.0-CURRENT clang (3.7) crashes during buildworld's atf-check.cpp compile
Summary: powerpc64 11.0-CURRENT clang (3.7) crashes during buildworld's atf-check.cpp ...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: powerpc Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-10 10:03 UTC by Mark Millard
Modified: 2016-07-11 11:04 UTC (History)
0 users

See Also:


Attachments
c++: note: diagnostic msg: /tmp/atf-check-a96a03.cpp (and .sh) (365.50 KB, application/zip)
2015-12-10 10:03 UTC, Mark Millard
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Millard 2015-12-10 10:03:15 UTC
Created attachment 164033 [details]
c++: note: diagnostic msg: /tmp/atf-check-a96a03.cpp (and .sh)

Clang crashed and requested a submittal during a buildworld attempt for 11.0-CURRENT.

# freebsd-version -ku; uname -aKU
11.0-CURRENT
11.0-CURRENT
FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #17 r291745M: Sat Dec  5 08:20:20 PST 2015     root@FBSDG5C0:/usr/obj/usr/src/sys/GENERIC64vtsc-NODEBUG  powerpc 1100091 1100091


c++: error: unable to execute command: Abort trap (core dumped)
c++: error: clang frontend command failed due to signal (use -v to see invocation)
FreeBSD clang version 3.7.0 (tags/RELEASE_370/final 246257) 20150906
Target: powerpc64-unknown-freebsd11.0
Thread model: posix
c++: 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.

backtrace:

Core was generated by `c++'.
Program terminated with signal SIGABRT, Aborted.

warning: Unexpected size of section `.reg2/100217' in core file.
#0  0x00000000128b9658 in .__sys_thr_kill ()
(gdb) bt
#0  0x00000000128b9658 in .__sys_thr_kill ()
#1  0x00000000128b960c in .__raise ()
#2  0x00000000128b95a0 in .abort ()
#3  0x00000000128da5d8 in .__assert ()
#4  0x0000000012543838 in .llvm::MCObjectStreamer::emitAbsoluteSymbolDiff(llvm::MCSymbol const*, llvm::MCSymbol const*, unsigned int) ()
#5  0x0000000011cbb990 in .llvm::AsmPrinter::EmitLabelDifference(llvm::MCSymbol const*, llvm::MCSymbol const*, unsigned int) const ()
#6  0x0000000011cd9f9c in .llvm::EHStreamer::emitExceptionTable() ()
#7  0x0000000011d1186c in .llvm::DwarfCFIException::endFunction(llvm::MachineFunction const*) ()
#8  0x0000000011cc59d4 in .llvm::AsmPrinter::EmitFunctionBody() ()
#9  0x000000001187ac8c in .(anonymous namespace)::PPCAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) ()
#10 0x0000000011fda1b8 in .llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ()
#11 0x00000000125f4ae8 in .llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#12 0x00000000125f504c in .llvm::FPPassManager::runOnModule(llvm::Module&) ()
#13 0x00000000125f3f50 in .llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#14 0x000000001042d264 in .clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*) ()
#15 0x000000001042becc in .clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#16 0x000000001066db30 in .clang::ParseAST(clang::Sema&, bool, bool) ()
#17 0x00000000101ff814 in .clang::ASTFrontendAction::ExecuteAction() ()
#18 0x00000000104274f0 in .clang::CodeGenAction::ExecuteAction() ()
#19 0x00000000102003a0 in .clang::FrontendAction::Execute() ()
#20 0x000000001022b5c8 in .clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#21 0x00000000101c6678 in .clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#22 0x00000000101bd628 in cc1_main (Argv=..., Argv0=<optimized out>, MainAddr=0x13239ad8 <GetExecutablePath(char const*, bool)>)
    at /usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/tools/driver/cc1_main.cpp:116
#23 0x00000000101828e4 in ExecuteCC1Tool (Tool=..., argv=...) at /usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/tools/driver/driver.cpp:360
#24 main (argc_=<optimized out>, argv_=<optimized out>) at /usr/src/usr.bin/clang/clang/../../../contrib/llvm/tools/clang/tools/driver/driver.cpp:406
Comment 1 Mark Millard 2015-12-10 18:34:09 UTC
I should have noted that the running powerpc64 11.0-CURRENT system was built with a modern devel/powerpc-gcc that was running on the powerpc64. (Sort of a self-hosted cross compile.) It is WITH_LIBCPLUSPLUS based, no gcc 4.2.1 present. WITHOUT_CLANG_BOOTSTRAP= but WITH_CLANG= .

devel/powerpc-gcc had been build by lang/gcc49.

Other environment oddities in use for the powerpc64-gcc based context:

# ls -al /usr/lib/libstdc*
lrwxr-xr-x  1 root  wheel  8 Dec  5 05:41 /usr/lib/libstdc++.a -> libc++.a
lrwxr-xr-x  1 root  wheel  9 Dec  5 05:41 /usr/lib/libstdc++.so -> libc++.so

# ls -l /usr/bin/g[c+][c+]
lrwxr-xr-x  1 root  wheel  48 Dec  5 05:38 /usr/bin/g++ -> /usr/local/bin/powerpc64-portbld-freebsd11.0-g++
lrwxr-xr-x  1 root  wheel  48 Dec  5 05:38 /usr/bin/gcc -> /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc

# svnlite diff /usr/src/
Index: /usr/src/sys/boot/ofw/Makefile.inc
===================================================================
--- /usr/src/sys/boot/ofw/Makefile.inc	(revision 291891)
+++ /usr/src/sys/boot/ofw/Makefile.inc	(working copy)
@@ -2,7 +2,7 @@

.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+=	-m32 -mcpu=powerpc
-LDFLAGS+=	-m elf32ppc_fbsd
+LDFLAGS+=	-Wl,-m -Wl,elf32ppc_fbsd
.endif

.include "../Makefile.inc"
Index: /usr/src/sys/boot/powerpc/Makefile.inc
===================================================================
--- /usr/src/sys/boot/powerpc/Makefile.inc	(revision 291891)
+++ /usr/src/sys/boot/powerpc/Makefile.inc	(working copy)
@@ -2,6 +2,7 @@

.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+=	-m32 -mcpu=powerpc
+LDFLAGS+=	-Wl,-m -Wl,elf32ppc_fbsd
.endif

.include "../Makefile.inc"
Index: /usr/src/sys/boot/uboot/Makefile.inc
===================================================================
--- /usr/src/sys/boot/uboot/Makefile.inc	(revision 291891)
+++ /usr/src/sys/boot/uboot/Makefile.inc	(working copy)
@@ -2,7 +2,7 @@

.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+=	-m32 -mcpu=powerpc
-LDFLAGS+=	-m elf32ppc_fbsd
+LDFLAGS+=	-Wl,-m -Wl,elf32ppc_fbsd
.endif

.include "../Makefile.inc"

(I've not listed the sys/powerpc/ofw/ofw_machdep.c hack for making PowerMac G5's boot reliably.)
Comment 2 Mark Millard 2016-07-11 11:04:24 UTC
11.0 progressed from clang 3.7.0 to clang 3.8.0 after this was subimtted.