diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-22 19:40:08 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-08-22 19:40:08 +0000 |
commit | 727aafc0b540434e1fd357c1d8f5f8c69edb767d (patch) | |
tree | 7d21fe0fbfd622e64c0935ee9e16cb9f07c3bf45 /lib/libc/Makefile | |
parent | 8d4535f091aae3aa7de18be996e7469123baad89 (diff) |
Explicitly list the symbols permitted to be exported by libc.
This is primed with the current list of exported symbols so it doesn't
change the ABI yet, but will prevent unintentional additions in the future
and sets the stage for reductions.
ok deraadt@ kettenis@
Diffstat (limited to 'lib/libc/Makefile')
-rw-r--r-- | lib/libc/Makefile | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 3417cd658d3..97515ea163f 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.34 2014/06/09 20:47:10 miod Exp $ +# $OpenBSD: Makefile,v 1.35 2015/08/22 19:40:06 guenther Exp $ # # The NLS (message catalog) functions are always in libc. To choose that # strerror(), perror(), strsignal(), psignal(), etc. actually call the NLS @@ -15,6 +15,11 @@ CFLAGS+=-Wimplicit #CFLAGS+=-Werror LDADD=-nodefaultlibs -lgcc +VERSION_SCRIPT= Symbols.map +SYMBOL_LISTS= ${LIBCSRCDIR}/Symbols.list \ + ${LIBCSRCDIR}/arch/${MACHINE_CPU}/Symbols.list + + LIBCSRCDIR=${.CURDIR} .include "${LIBCSRCDIR}/Makefile.inc" @@ -36,4 +41,9 @@ beforeinstall: ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 tags \ ${DESTDIR}/var/db/lib${LIB}.tags +${VERSION_SCRIPT}: ${SYMBOL_LISTS} + { printf '{\n\tglobal:\n'; \ + sed '/^[._a-zA-Z]/s/$$/;/; s/^/ /' ${SYMBOL_LISTS}; \ + printf '\n\tlocal:\n\t\t*;\n};\n'; } >$@.tmp && mv $@.tmp $@ + .include <bsd.lib.mk> |