diff options
author | deischen <deischen@FreeBSD.org> | 2006-03-13 00:56:02 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2006-03-13 00:56:02 +0000 |
commit | 2de255c506667cdc66e45b3676d710b49bab79b9 (patch) | |
tree | 8e6454eb124fa44498fc707e04785c8ac708125e /lib/libc/Makefile | |
parent | 138dd543577ce6140d439518ba00135e7f7ebdc5 (diff) | |
download | FreeBSD-src-2de255c506667cdc66e45b3676d710b49bab79b9.zip FreeBSD-src-2de255c506667cdc66e45b3676d710b49bab79b9.tar.gz |
Add hooks to build libc with symbol versioning. This is
disabled by default; add SYMVER_ENABLED=true to /etc/make.conf
to enable it. libc should get a version bump before this is
enabled by default.
Reviewed by: davidxu
Diffstat (limited to 'lib/libc/Makefile')
-rw-r--r-- | lib/libc/Makefile | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libc/Makefile b/lib/libc/Makefile index aea5031..b0780a3 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -18,6 +18,8 @@ CFLAGS+=-I${.CURDIR}/${MACHINE_ARCH} CLEANFILES+=tags INSTALL_PIC_ARCHIVE= PRECIOUSLIB= +VERSION_DEF=Versions.def +VERSION_MAP=Version.map # Define (empty) variables so that make doesn't give substitution # errors if the included makefiles don't change these: @@ -94,7 +96,19 @@ libkern.${MACHINE_ARCH}:: ${KMSRCS} cp -p ${.ALLSRC} ${DESTDIR}/sys/libkern/${MACHINE_ARCH} .endif +${VERSION_MAP}: ${SYM_MAPS} + awk -v vfile=${.CURDIR}/Versions.def -f ${.CURDIR}/version_gen.awk \ + ${SYM_MAPS} > ${.TARGET} + + .include <bsd.lib.mk> # Disable warnings in contributed sources. CWARNFLAGS:= ${.IMPSRC:Ngdtoa_*.c:C/^.+$/${CWARNFLAGS}/} + +.if defined(SYMVER_ENABLED) +CFLAGS+= -DSYMBOL_VERSIONING +LDFLAGS= -Wl,--version-script=${.OBJDIR}/${VERSION_MAP} + +${SHLIB_NAME}: ${VERSION_MAP} +.endif |