libregex: Add a symbol map

kib points out that trying to re-use symbol versioning from libc is dirty
and wrong. The implementation in libregex is incompatible by design with the
implementation in libc. Using the symbol versions from libc can and likely
will cause confusions for linkers and bring unexpected behavior for
consumers that unwillingly (transitively) link against libregex.

Reported by:	kib
This commit is contained in:
Kyle Evans 2018-01-22 18:40:19 +00:00
parent 6a86483da1
commit e36cba8a36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328263
3 changed files with 24 additions and 1 deletions

View file

@ -9,9 +9,11 @@ SHLIB_MINOR= 0
CFLAGS+= -DLIBREGEX
LIBC_SRCTOP= ${.CURDIR:H}/libc
SYMBOL_MAPS= ${SYM_MAPS}
WARNS?= 2
VERSION_DEF= ${.CURDIR}/Versions.def
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
#HAS_TESTS=
SUBDIR.${MK_TESTS}+= tests

16
lib/libregex/Symbol.map Normal file
View file

@ -0,0 +1,16 @@
/*
* $FreeBSD$
*/
/*
* libregex uses a different version name because its symbols are not strictly
* compatible with those provided by libc. Re-using the version name from libc
* could cause linking headaches and make debugging more difficult than it needs
* to be.
*/
LIBREGEX_1.0 {
regcomp;
regerror;
regexec;
regfree;
};

View file

@ -0,0 +1,5 @@
# $FreeBSD$
LIBREGEX_1.0 {
};