From 6882fd36bf9a83183c420be42ab90683fddce1b1 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 1 Mar 2011 17:15:44 +0000 Subject: [PATCH] Put in a temporary workaround for ctfmerge hanging on processing kernel.debug (or possibly other files), when WITH_CTF is active. This is caused by a bug in clang's integrated assembler, causing malloc to sometimes hang during initialization in statically linked executables that use threading, such as the copy of ctfmerge that is built during the bootstrap stage of buildworld. The bug has been submitted upstream: http://llvm.org/bugs/show_bug.cgi?id=9352 Note that you might have to rebuild and install libc first, to get your kernel build to finish, because the ctfmerge binary built during bootstrap is linked with your base system's copy of libc.a, which might already contain a bad copy of malloc.o. --- lib/libc/stdlib/Makefile.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc index ee4c4e22e20e..47e3188efd19 100644 --- a/lib/libc/stdlib/Makefile.inc +++ b/lib/libc/stdlib/Makefile.inc @@ -51,3 +51,7 @@ MLINKS+=tsearch.3 tdelete.3 tsearch.3 tfind.3 tsearch.3 twalk.3 CFLAGS+= -DMALLOC_PRODUCTION .endif +.if ${CC:T:Mclang} == "clang" +# XXX: Temporary workaround for LLVM PR 9352 +CFLAGS+= ${.IMPSRC:T:Mmalloc.c:C/^.+$/-no-integrated-as/} +.endif