summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-12-02 21:39:54 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-12-02 21:39:54 +0000
commitc4a1cde95eb58f68da1b396292ec7229f1fb3bde (patch)
treecc33c72fac489779ebf8712df2aafcdcd8bc8df6
parent9687ef88965705cdc3143122402b44792f8f5e1d (diff)
downloadsrc-test2-c4a1cde95eb58f68da1b396292ec7229f1fb3bde.tar.gz
src-test2-c4a1cde95eb58f68da1b396292ec7229f1fb3bde.zip
MFC r367304:
Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt Since elftoolchain's cxxfilt is rather far behind on features, and we ran into several bugs, add an option to use llvm-cxxfilt as an drop-in replacement. It supports the same options as elftoolchain cxxfilt, though it doesn't have support for old ARM (C++ Annotated Reference Manual, not the CPU) and GNU v2 manglings. But these are irrelevant in 2020. Note: as we already compile the required libraries as part of libllvm, this will not add any significant build time either. PR: 250702 Reviewed by: emaste, yuri Differential Revision: https://reviews.freebsd.org/D27071 MFC r367712: Ensure make delete-old does not unlink the llvm-cxxfilt and its manpage, after r367304 and r367324, when WITH_LLVM_CXXFILT is enabled. Noticed by: "Herbert J. Skuhra" <herbert@gojira.at>
Notes
Notes: svn path=/stable/11/; revision=368285
-rw-r--r--share/man/man5/src.conf.54
-rw-r--r--share/mk/src.opts.mk1
-rw-r--r--tools/build/mk/OptionalObsoleteFiles.inc7
-rw-r--r--tools/build/options/WITHOUT_LLVM_CXXFILT2
-rw-r--r--tools/build/options/WITH_LLVM_CXXFILT2
-rw-r--r--usr.bin/Makefile2
-rw-r--r--usr.bin/clang/Makefile5
-rw-r--r--usr.bin/clang/llvm-cxxfilt/Makefile7
8 files changed, 26 insertions, 4 deletions
diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5
index dfa98dfbf526..c7eb52a95eb4 100644
--- a/share/man/man5/src.conf.5
+++ b/share/man/man5/src.conf.5
@@ -1,6 +1,6 @@
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
.\" $FreeBSD$
-.Dd September 12, 2020
+.Dd December 2, 2020
.Dt SRC.CONF 5
.Os
.Sh NAME
@@ -1013,6 +1013,8 @@ tool.
.Pp
This is a default setting on
amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, pc98/i386, powerpc/powerpc and powerpc/powerpc64.
+.It Va WITH_LLVM_CXXFILT
+Install LLVM's llvm-cxxfilt as c++filt, instead of ELF Tool Chain's cxxfilt.
.It Va WITHOUT_LLVM_LIBUNWIND
Set to use GCC's stack unwinder (instead of LLVM's libunwind).
.Pp
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
index 904ed6ea78fd..28894f43e2a4 100644
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -200,6 +200,7 @@ __DEFAULT_NO_OPTIONS = \
LIBSOFT \
LINT \
LLVM_ASSERTIONS \
+ LLVM_CXXFILT \
LOADER_FIREWIRE \
LOADER_FORCE_LE \
LOADER_VERBOSE \
diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index eaf5dfbb177a..fd0b3586f051 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -1728,7 +1728,6 @@ OLD_FILES+=usr/bin/lli
OLD_FILES+=usr/bin/llvm-as
OLD_FILES+=usr/bin/llvm-bcanalyzer
OLD_FILES+=usr/bin/llvm-cxxdump
-OLD_FILES+=usr/bin/llvm-cxxfilt
OLD_FILES+=usr/bin/llvm-diff
OLD_FILES+=usr/bin/llvm-dis
OLD_FILES+=usr/bin/llvm-dwarfdump
@@ -1752,7 +1751,6 @@ OLD_FILES+=usr/share/man/man1/llc.1.gz
OLD_FILES+=usr/share/man/man1/lli.1.gz
OLD_FILES+=usr/share/man/man1/llvm-as.1.gz
OLD_FILES+=usr/share/man/man1/llvm-bcanalyzer.1.gz
-OLD_FILES+=usr/share/man/man1/llvm-cxxfilt.1.gz
OLD_FILES+=usr/share/man/man1/llvm-diff.1.gz
OLD_FILES+=usr/share/man/man1/llvm-dis.1.gz
OLD_FILES+=usr/share/man/man1/llvm-dwarfdump.1
@@ -1769,6 +1767,11 @@ OLD_FILES+=usr/share/man/man1/opt.1.gz
OLD_FILES+=usr/bin/clang-format
.endif
+.if ${MK_CLANG_EXTRAS} == no && ${MK_LLVM_CXXFILT} == no
+OLD_FILES+=usr/bin/llvm-cxxfilt
+OLD_FILES+=usr/share/man/man1/llvm-cxxfilt.1.gz
+.endif
+
.if ${MK_CPP} == no
OLD_FILES+=usr/bin/cpp
OLD_FILES+=usr/share/man/man1/cpp.1.gz
diff --git a/tools/build/options/WITHOUT_LLVM_CXXFILT b/tools/build/options/WITHOUT_LLVM_CXXFILT
new file mode 100644
index 000000000000..e729f6c4c8e0
--- /dev/null
+++ b/tools/build/options/WITHOUT_LLVM_CXXFILT
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt.
diff --git a/tools/build/options/WITH_LLVM_CXXFILT b/tools/build/options/WITH_LLVM_CXXFILT
new file mode 100644
index 000000000000..e80c0e9c1f35
--- /dev/null
+++ b/tools/build/options/WITH_LLVM_CXXFILT
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Install LLVM's llvm-cxxfilt as c++filt, instead of ELF Tool Chain's cxxfilt.
diff --git a/usr.bin/Makefile b/usr.bin/Makefile
index 283e17c7ee03..3729b9cbac9c 100644
--- a/usr.bin/Makefile
+++ b/usr.bin/Makefile
@@ -274,7 +274,9 @@ SUBDIR.${MK_TOOLCHAIN}+= ar
SUBDIR.${MK_TOOLCHAIN}+= c89
SUBDIR.${MK_TOOLCHAIN}+= c99
SUBDIR.${MK_TOOLCHAIN}+= ctags
+.if ${MK_LLVM_CXXFILT} == "no"
SUBDIR.${MK_TOOLCHAIN}+= cxxfilt
+.endif
SUBDIR.${MK_TOOLCHAIN}+= elfcopy
SUBDIR.${MK_TOOLCHAIN}+= file2c
# ARM64TODO gprof does not build
diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile
index 68b3c1537d90..6f5a065b9ae7 100644
--- a/usr.bin/clang/Makefile
+++ b/usr.bin/clang/Makefile
@@ -16,6 +16,10 @@ SUBDIR+= llvm-nm
SUBDIR+= llvm-objdump
SUBDIR+= llvm-symbolizer
+.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLVM_CXXFILT} != "no"
+SUBDIR+= llvm-cxxfilt
+.endif
+
.if ${MK_CLANG_EXTRAS} != "no"
SUBDIR+= bugpoint
SUBDIR+= llc
@@ -23,7 +27,6 @@ SUBDIR+= lli
SUBDIR+= llvm-as
SUBDIR+= llvm-bcanalyzer
SUBDIR+= llvm-cxxdump
-SUBDIR+= llvm-cxxfilt
SUBDIR+= llvm-diff
SUBDIR+= llvm-dis
SUBDIR+= llvm-dwarfdump
diff --git a/usr.bin/clang/llvm-cxxfilt/Makefile b/usr.bin/clang/llvm-cxxfilt/Makefile
index b5aa8b34b8e2..3b452a1f8e12 100644
--- a/usr.bin/clang/llvm-cxxfilt/Makefile
+++ b/usr.bin/clang/llvm-cxxfilt/Makefile
@@ -1,8 +1,15 @@
# $FreeBSD$
+.include <src.opts.mk>
+
PROG_CXX= llvm-cxxfilt
SRCDIR= llvm/tools/llvm-cxxfilt
SRCS+= llvm-cxxfilt.cpp
+.if ${MK_LLVM_CXXFILT} != "no"
+LINKS= ${BINDIR}/llvm-cxxfilt ${BINDIR}/c++filt
+MLINKS= llvm-cxxfilt.1 c++filt.1
+.endif
+
.include "../llvm.prog.mk"