diff --git a/lib/clang/Makefile.inc b/lib/clang/Makefile.inc --- a/lib/clang/Makefile.inc +++ b/lib/clang/Makefile.inc @@ -1,13 +1,15 @@ -.include +.include PACKAGE= clang MK_PIE:= no # Explicit libXXX.a references +.if ${MK_LLVM_FULL_DEBUGINFO} == "no" .if ${COMPILER_TYPE} == "clang" DEBUG_FILES_CFLAGS= -gline-tables-only .else DEBUG_FILES_CFLAGS= -g1 .endif +.endif WARNS?= 0 diff --git a/lib/clang/headers/Makefile b/lib/clang/headers/Makefile --- a/lib/clang/headers/Makefile +++ b/lib/clang/headers/Makefile @@ -1,4 +1,5 @@ +.include .include "../clang.pre.mk" .PATH: ${CLANG_SRCS}/lib/Headers diff --git a/lib/clang/libclang/Makefile b/lib/clang/libclang/Makefile --- a/lib/clang/libclang/Makefile +++ b/lib/clang/libclang/Makefile @@ -1,5 +1,5 @@ -.include +.include .include "../clang.pre.mk" LIB= clang diff --git a/lib/clang/libclangminimal/Makefile b/lib/clang/libclangminimal/Makefile --- a/lib/clang/libclangminimal/Makefile +++ b/lib/clang/libclangminimal/Makefile @@ -1,4 +1,5 @@ +.include .include "../clang.pre.mk" LIB= clangminimal diff --git a/lib/clang/liblldb/Makefile b/lib/clang/liblldb/Makefile --- a/lib/clang/liblldb/Makefile +++ b/lib/clang/liblldb/Makefile @@ -1,4 +1,5 @@ +.include .include "../lldb.pre.mk" LIB= lldb diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile --- a/lib/clang/libllvm/Makefile +++ b/lib/clang/libllvm/Makefile @@ -1,5 +1,5 @@ -.include +.include .include "../llvm.pre.mk" LIB= llvm diff --git a/lib/clang/libllvmminimal/Makefile b/lib/clang/libllvmminimal/Makefile --- a/lib/clang/libllvmminimal/Makefile +++ b/lib/clang/libllvmminimal/Makefile @@ -1,4 +1,5 @@ +.include .include "../llvm.pre.mk" LIB= llvmminimal diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd November 13, 2023 +.Dd February 16, 2024 .Dt SRC.CONF 5 .Os .Sh NAME @@ -929,6 +929,9 @@ tool. .It Va WITHOUT_LLVM_CXXFILT Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt. +.It Va WITH_LLVM_FULL_DEBUGINFO +Generate full debug information for LLVM libraries and tools, which uses +more disk space and build resources, but allows for easier debugging. .It Va WITHOUT_LLVM_TARGET_AARCH64 Do not build LLVM target support for AArch64. The diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -205,6 +205,7 @@ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_BINUTILS \ + LLVM_FULL_DEBUGINFO \ MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ diff --git a/tools/build/options/WITH_LLVM_FULL_DEBUGINFO b/tools/build/options/WITH_LLVM_FULL_DEBUGINFO new file mode 100644 --- /dev/null +++ b/tools/build/options/WITH_LLVM_FULL_DEBUGINFO @@ -0,0 +1,2 @@ +Generate full debug information for LLVM libraries and tools, which uses +more disk space and build resources, but allows for easier debugging. diff --git a/usr.bin/clang/Makefile.inc b/usr.bin/clang/Makefile.inc --- a/usr.bin/clang/Makefile.inc +++ b/usr.bin/clang/Makefile.inc @@ -1,14 +1,16 @@ -WARNS?= 0 - -.include +.include MK_PIE:= no # Explicit libXXX.a references +.if ${MK_LLVM_FULL_DEBUGINFO} == "no" .if ${COMPILER_TYPE} == "clang" DEBUG_FILES_CFLAGS= -gline-tables-only .else DEBUG_FILES_CFLAGS= -g1 .endif +.endif + +WARNS?= 0 .include "../Makefile.inc"