From c38dac681dc4870327a8b734c94a436968e2bd9d Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 15 Mar 2016 19:26:32 +0000 Subject: [PATCH] libc: don't build compat functions if building WITHOUT_SYMVER WITHOUT_SYMVER necessarily implies building a system without symver backwards compatability. Sponsored by: The FreeBSD Foundation --- lib/libc/db/mpool/Makefile.inc | 5 ++++- lib/libc/gen/Makefile.inc | 6 ++++-- lib/libc/iconv/Makefile.inc | 6 +++++- lib/libc/posix1e/Makefile.inc | 4 +++- lib/libc/secure/Makefile.inc | 7 ++++--- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/libc/db/mpool/Makefile.inc b/lib/libc/db/mpool/Makefile.inc index bab7e6d2234f..76ec0ebe5cd2 100644 --- a/lib/libc/db/mpool/Makefile.inc +++ b/lib/libc/db/mpool/Makefile.inc @@ -3,4 +3,7 @@ .PATH: ${LIBC_SRCTOP}/db/mpool -SRCS+= mpool.c mpool-compat.c +SRCS+= mpool.c +.if ${MK_SYMVER} == yes +SRCS+= mpool-compat.c +.endif diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc index 7de8ce33d647..a68f5c7ff13f 100644 --- a/lib/libc/gen/Makefile.inc +++ b/lib/libc/gen/Makefile.inc @@ -49,7 +49,6 @@ SRCS+= __getosreldate.c \ fstab.c \ ftok.c \ fts.c \ - fts-compat.c \ ftw.c \ getbootfile.c \ getbsize.c \ @@ -137,7 +136,6 @@ SRCS+= __getosreldate.c \ ualarm.c \ ulimit.c \ uname.c \ - unvis-compat.c \ usleep.c \ utime.c \ utxdb.c \ @@ -147,6 +145,10 @@ SRCS+= __getosreldate.c \ waitpid.c \ waitid.c \ wordexp.c +.if ${MK_SYMVER} == yes +SRCS+= fts-compat.c \ + unvis-compat.c +.endif .PATH: ${LIBC_SRCTOP}/../../contrib/libc-pwcache SRCS+= pwcache.c pwcache.h diff --git a/lib/libc/iconv/Makefile.inc b/lib/libc/iconv/Makefile.inc index 5442f79c6e01..3b247376c399 100644 --- a/lib/libc/iconv/Makefile.inc +++ b/lib/libc/iconv/Makefile.inc @@ -14,7 +14,11 @@ SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_bcs_strtoul.c \ citrus_esdb.c citrus_hash.c citrus_iconv.c citrus_lookup.c \ citrus_lookup_factory.c citrus_mapper.c citrus_memstream.c \ citrus_mmap.c citrus_module.c citrus_none.c citrus_pivot_factory.c \ - citrus_prop.c citrus_stdenc.c bsd_iconv.c iconv_compat.c + citrus_prop.c citrus_stdenc.c bsd_iconv.c +.if ${MK_SYMVER} == yes +SRCS+= iconv_compat.c +.endif + SYM_MAPS+= ${LIBC_SRCTOP}/iconv/Symbol.map .if ${MK_ICONV} == yes diff --git a/lib/libc/posix1e/Makefile.inc b/lib/libc/posix1e/Makefile.inc index 2cc415818973..85fed32c140e 100644 --- a/lib/libc/posix1e/Makefile.inc +++ b/lib/libc/posix1e/Makefile.inc @@ -11,7 +11,6 @@ subr_acl_nfs4.c: ${LIBC_SRCTOP}/../../sys/kern/subr_acl_nfs4.c SRCS+= acl_branding.c \ acl_calc_mask.c \ acl_copy.c \ - acl_compat.c \ acl_delete.c \ acl_delete_entry.c \ acl_entry.c \ @@ -36,6 +35,9 @@ SRCS+= acl_branding.c \ mac_get.c \ mac_set.c \ subr_acl_nfs4.c +.if ${MK_SYMVER} == yes +SRCS+= acl_compat.c +.endif SYM_MAPS+=${LIBC_SRCTOP}/posix1e/Symbol.map diff --git a/lib/libc/secure/Makefile.inc b/lib/libc/secure/Makefile.inc index 6f18bded1ff5..e2e75c70603b 100644 --- a/lib/libc/secure/Makefile.inc +++ b/lib/libc/secure/Makefile.inc @@ -5,8 +5,9 @@ .PATH: ${LIBC_SRCTOP}/secure # Sources common to both syscall interfaces: -SRCS+= \ - stack_protector.c \ - stack_protector_compat.c +SRCS+= stack_protector.c +.if ${MK_SYMVER} == yes +SRCS+= stack_protector_compat.c +.endif SYM_MAPS+= ${LIBC_SRCTOP}/secure/Symbol.map