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.
This commit is contained in:
Dimitry Andric 2011-03-01 17:15:44 +00:00
parent dde5f9b938
commit 6882fd36bf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219139

View File

@ -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