For at least 20 years gnu/lib/libgcc/Makefile has included its own set of make rules rather than using share/mk/bsd.lib.mk. As a result it's excluded from common DEBUG_FLAGS / WITH_DEBUG_FILES handling and does not get built with debug info.
A commit references this bug: Author: emaste Date: Tue Jan 19 03:54:38 UTC 2016 New revision: 294308 URL: https://svnweb.freebsd.org/changeset/base/294308 Log: Remove local override for .cpp.So rule The standard bsd.lib.mk rule is suitable for libgcc_s's C++ source. The local rule had the following non-functional argument differences or additions: 1. -DSHARED (rather than -DPIC from bsd.lib.mk) The C++ sources don't have an #ifdef for either one. 2. -fexceptions This is enabled by default for C++ so does not need to be set explicitly. 3. -D__GLIBC__=3 Not used by LLVM libunwind. 4. -DElfW=__ElfN LLVM libunwind provides its own definition. PR: 206381 Differential Revision: The FreeBSD Foundation Changes: head/gnu/lib/libgcc/Makefile
Comparing the C++ build rules, the only functional differences between the current Makefile and bsd.lib.mk are the addition of -fvisibility=hidden and -fPIC in the .o and .po rules. (Other differences have no effect on the LLVM libunwind C++ source, and differences in the .cpp.So rule were entirely non-functional.)
A commit references this bug: Author: emaste Date: Tue Jan 19 17:40:29 UTC 2016 New revision: 294331 URL: https://svnweb.freebsd.org/changeset/base/294331 Log: Remove local override for .cpp.o and .cpp.po rules The local build rule used to set -fvisibility=hidden and -fPIC, in addition to -fexceptions and -D defines that had no effect. With -fvisibility=hidden and -fPIC in STATIC_CXXFLAGS the standard bsd.lib.mk rules are suitable for libgcc_s's C++ source. PR: 206381 Sponsored by: The FreeBSD Foundation Changes: head/gnu/lib/libgcc/Makefile
This is fixed for the C++ stack unwinder source by using the standard bsd.lib.mk rules, in r294308 and r294331. For the C source in libgcc_s.so it's a bit awkward as libgcc's Makefile overrides the standard .c.o, .c.po, .c.So rules for each libgcc source file. I suspect the path to addressing this will be to just handle WITH_DEBUG_FILES in gnu/lib/libgcc/Makefile directly.
kan fixed the C source in r294935 https://svnweb.freebsd.org/changeset/base/294935
A commit references this bug: Author: emaste Date: Fri May 20 19:05:33 UTC 2016 New revision: 300321 URL: https://svnweb.freebsd.org/changeset/base/300321 Log: MFC r294935 (kan): Make .debug file for libgcc_s.so.1 more useful. The files compiled into libgcc_s.so.1 did not have -g on compiler command line, making generated .debug quite pointless. PR: 206381 Changes: _U stable/10/ stable/10/gnu/lib/libgcc/Makefile
Move to GNU. Appears to be fixed up to 10.x already.