--- - branch: MAIN date: Wed Mar 20 13:50:37 UTC 2024 files: - new: '1.395' old: '1.394' path: src/share/mk/bsd.lib.mk pathrev: src/share/mk/bsd.lib.mk@1.395 type: modified id: 20240320T135037Z.0e2d7f60ed66cad33d8752c0f6e7858230095b1d log: | bsd.lib.mk: Check expected vs actual symbols at build-time. If, for LIB=foo, you create a file foo.expsym, bsd.lib.mk will list the dynamic symbols and their versions with nm --dynamic --extern-only --defined-only --with-symbol-versions and compare the names (not addresses or types) to foo.expsym. If there are any differences, they will be printed and the build will fail. foo.expsym should be sorted with `LANG=C sort -u'. This way, you can verify changes don't inadvertently add or remove symbols. If you do want to add (or, if you're bumping the major, remove) symbols, you can verify the changes and edit the foo.expsym file accordingly. This will also help to enforce rules about symbol changes on pullups in release branches. Note that using a version map (-Wl,--version-script=...) doesn't catch symbol removal -- ld quietly ignores symbols in the version map that aren't actually defined by any object in the library. So this supplements the version map. Proposed on tech-userlevel: https://mail-index.NetBSD.org/tech-userlevel/2024/03/16/msg014264.html module: src subject: 'CVS commit: src/share/mk' unixtime: '1710942637' user: riastradh