Date: Thu, 18 Apr 2024 23:35:19 +0000 From: Brooks Davis <brooks@freebsd.org> To: freebsd-arch@freebsd.org Cc: Michael Dexter <editor@callfortesting.org> Subject: RFC: linking with --no-undefined-version Message-ID: <ZiGuN-ML65sN2shW@spindle.one-eyed-alien.net>
next in thread | raw e-mail | index | archive | help
As of LLVM 16, lld default to --no-undefined-version which means that if a symbol is listed in the symbol version map it must be present or lld will fail to link. This is good because it prevents that accidental loss of symbols which breaks our ABI compatibility. Unfortunately, it's somewhat complicating because our symbol version maps may vary per-architecture or based on options. As a result we added --undefined-version to LDFLAGS. In the process of validating my libsys work I decided I wanted to enable this option to make sure I wasn't losing symbols along the way. I added WITH(OUT)_UNDEFINED_SYMBOLS control this behavior and worked to resolve issues in the build with WITHOUT_UNDEFINED_SYMBOLS enabled. I've got tinderbox building successfully with just a few patches outstanding. I've hung them off the following review that sets WITHOUT_UNDEFINED_SYMBOLS by default: https://reviews.freebsd.org/D44216 There are probably still some issues to be fixed with non-default options, but I'm not in a position to discover all of them. Hopefully Michael's build options survey will turn them up. They are generally easy to fix and various revisions associated with the above review provide examples. I'm looking for feedback on flipping the switch so we start detecting regressions by default. -- Brooks P.S. This isn't the complete ABI story, but it at least prevents the worst regressions. I have a first cut at something more complete (including symbol versions but short of a full ABI checker) at https://reviews.freebsd.org/D44271
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZiGuN-ML65sN2shW>