> From: Pascal Stumpf <pas...@stumpf.co> > Date: Mon, 17 Apr 2017 18:51:57 +0200 > > On Mon, 17 Apr 2017 18:25:34 +0200 (CEST), Mark Kettenis wrote: > > > Date: Sun, 16 Apr 2017 22:00:23 +0200 (CEST) > > > From: Mark Kettenis <mark.kette...@xs4all.nl> > > > > > > > Date: Sun, 16 Apr 2017 21:21:24 +0200 > > > > From: Patrick Wildt <patr...@blueri.se> > > > > > > > > Hi, > > > > > > > > this diff disables the color diagnostics by default so that LLVM's lld > > > > does not throw any ANSI sequences. > > > > > > > > ok? > > > > > > Wouldn't it be better to just change > > > lib/Support/Unix/Process.inc:terminalHasColors() to always return false? > > > > > > that should take care of the color stuff in all the different llvm tools. > > > > So here is a diff I was thinking of. Fixes the issue that Theo > > discovered. I think this means the other diffs can be reverted, but > > I'll do that in a separate diff. > > > > ok? > > #undef'ing HAVE_TERMINFO in config.h is a bit cleaner. This also means > that we can drop -ltermlib everywhere. Note that this approach breaks > colour autodetection (-fcolor-diagnostics=auto), but I don't think we > care at this point. Testing this diff now:
I suppose that works as well. > Index: clang/Makefile > =================================================================== > RCS file: /cvs/src/gnu/usr.bin/clang/clang/Makefile,v > retrieving revision 1.7 > diff -u -p -r1.7 Makefile > --- clang/Makefile 27 Mar 2017 15:32:38 -0000 1.7 > +++ clang/Makefile 17 Apr 2017 16:50:28 -0000 > @@ -9,9 +9,6 @@ SRCS= driver.cpp \ > cc1_main.cpp \ > cc1as_main.cpp > > -LDADD+= -ltermlib > -DPADD+= ${LIBTERMLIB} > - > LINKS= ${BINDIR}/clang ${BINDIR}/clang++ \ > ${BINDIR}/clang ${BINDIR}/clang-cpp > MLINKS= clang.1 clang++.1 \ > Index: include/llvm/Config/config.h > =================================================================== > RCS file: /cvs/src/gnu/usr.bin/clang/include/llvm/Config/config.h,v > retrieving revision 1.3 > diff -u -p -r1.3 config.h > --- include/llvm/Config/config.h 24 Jan 2017 08:44:47 -0000 1.3 > +++ include/llvm/Config/config.h 17 Apr 2017 16:50:28 -0000 > @@ -242,7 +242,7 @@ > #define HAVE_SYS_UIO_H 1 > > /* Define if the setupterm() function is supported this platform. */ > -#define HAVE_TERMINFO 1 > +/* #undef HAVE_TERMINFO */ > > /* Define if the xar_open() function is supported this platform. */ > /* #undef HAVE_LIBXAR */ > Index: llc/Makefile > =================================================================== > RCS file: /cvs/src/gnu/usr.bin/clang/llc/Makefile,v > retrieving revision 1.1 > diff -u -p -r1.1 Makefile > --- llc/Makefile 5 Sep 2016 10:56:50 -0000 1.1 > +++ llc/Makefile 17 Apr 2017 16:50:28 -0000 > @@ -3,9 +3,6 @@ > PROG= llc > NOMAN= > > -LDADD+= -ltermlib > -DPADD+= ${LIBTERMLIB} > - > SRCS= llc.cpp > > .PATH: ${.CURDIR}/../../../llvm/tools/llc > Index: lld/Makefile > =================================================================== > RCS file: /cvs/src/gnu/usr.bin/clang/lld/Makefile,v > retrieving revision 1.7 > diff -u -p -r1.7 Makefile > --- lld/Makefile 27 Mar 2017 15:32:38 -0000 1.7 > +++ lld/Makefile 17 Apr 2017 16:50:28 -0000 > @@ -7,9 +7,6 @@ BINDIR= /usr/bin > SRCS= lld.cpp > NOMAN= > > -LDADD+= -ltermlib > -DPADD+= ${LIBTERMLIB} > - > .if ${COMPILER_VERSION:L} == "clang" > LINKS= ${BINDIR}/ld.lld ${BINDIR}/ld > .endif > > > Index: gnu/llvm/lib/Support/Unix/Process.inc > > =================================================================== > > RCS file: /cvs/src/gnu/llvm/lib/Support/Unix/Process.inc,v > > retrieving revision 1.1.1.3 > > diff -u -p -r1.1.1.3 Process.inc > > --- gnu/llvm/lib/Support/Unix/Process.inc 24 Jan 2017 08:33:36 -0000 > > 1.1.1.3 > > +++ gnu/llvm/lib/Support/Unix/Process.inc 17 Apr 2017 16:21:16 -0000 > > @@ -342,7 +342,7 @@ static ManagedStatic<sys::Mutex> TermCol > > #endif > > > > static bool terminalHasColors(int fd) { > > -#ifdef HAVE_TERMINFO > > +#if defined(HAVE_TERMINFO) && !defined(__OpenBSD__) > > // First, acquire a global lock because these C routines are thread > > hostile. > > MutexGuard G(*TermColorMutex); > > > > >