Index: contrib/jemalloc/src/jemalloc.c =================================================================== --- contrib/jemalloc/src/jemalloc.c +++ contrib/jemalloc/src/jemalloc.c @@ -4,9 +4,11 @@ /******************************************************************************/ /* Data. */ +#ifdef SYMVER_COMPAT /* Work around : */ const char *__malloc_options_1_0 = NULL; __sym_compat(_malloc_options, __malloc_options_1_0, FBSD_1.0); +#endif /* Runtime configuration options. */ const char *je_malloc_conf JEMALLOC_ATTR(weak); Index: contrib/jemalloc/src/util.c =================================================================== --- contrib/jemalloc/src/util.c +++ contrib/jemalloc/src/util.c @@ -78,9 +78,11 @@ wrtmessage(NULL, s4); } +#ifdef SYMVER_COMPAT void (*__malloc_message_1_0)(const char *s1, const char *s2, const char *s3, const char *s4) = wrtmessage_1_0; __sym_compat(_malloc_message, __malloc_message_1_0, FBSD_1.0); +#endif /* * Wrapper around malloc_message() that avoids the need for Index: lib/libc/Makefile =================================================================== --- lib/libc/Makefile +++ lib/libc/Makefile @@ -33,6 +33,9 @@ .if ${MK_NLS} != "no" CFLAGS+=-DNLS .endif +.if ${MK_SYMVER} != "no" +CFLAGS+=-DSYMVER_COMPAT +.endif CLEANFILES+=tags INSTALL_PIC_ARCHIVE= PRECIOUSLIB= Index: lib/libc/db/mpool/Makefile.inc =================================================================== --- lib/libc/db/mpool/Makefile.inc +++ 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 Index: lib/libc/gen/Makefile.inc =================================================================== --- lib/libc/gen/Makefile.inc +++ lib/libc/gen/Makefile.inc @@ -49,7 +49,6 @@ fstab.c \ ftok.c \ fts.c \ - fts-compat.c \ ftw.c \ getbootfile.c \ getbsize.c \ @@ -137,7 +136,6 @@ ualarm.c \ ulimit.c \ uname.c \ - unvis-compat.c \ usleep.c \ utime.c \ utxdb.c \ @@ -147,6 +145,10 @@ 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 Index: lib/libc/gen/sem.c =================================================================== --- lib/libc/gen/sem.c +++ lib/libc/gen/sem.c @@ -109,6 +109,7 @@ static LIST_HEAD(, sem) named_sems = LIST_HEAD_INITIALIZER(named_sems); static pthread_mutex_t named_sems_mtx = PTHREAD_MUTEX_INITIALIZER; +#ifdef SYMVER_COMPAT FB10_COMPAT(_libc_sem_init_compat, sem_init); FB10_COMPAT(_libc_sem_destroy_compat, sem_destroy); FB10_COMPAT(_libc_sem_open_compat, sem_open); @@ -119,6 +120,7 @@ FB10_COMPAT(_libc_sem_timedwait_compat, sem_timedwait); FB10_COMPAT(_libc_sem_post_compat, sem_post); FB10_COMPAT(_libc_sem_getvalue_compat, sem_getvalue); +#endif static inline int sem_check_validity(sem_t *sem) Index: lib/libc/gen/semctl.c =================================================================== --- lib/libc/gen/semctl.c +++ lib/libc/gen/semctl.c @@ -61,6 +61,7 @@ return (__semctl(semid, semnum, cmd, semun_ptr)); } +#ifdef SYMVER_COMPAT int freebsd7_semctl(int semid, int semnum, int cmd, ...) { @@ -82,3 +83,4 @@ } __sym_compat(semctl, freebsd7_semctl, FBSD_1.0); +#endif Index: lib/libc/gen/ttyslot.c =================================================================== --- lib/libc/gen/ttyslot.c +++ lib/libc/gen/ttyslot.c @@ -42,4 +42,6 @@ return (0); } +#ifdef SYMVER_COMPAT __sym_compat(ttyslot, __ttyslot, FBSD_1.0); +#endif Index: lib/libc/iconv/Makefile.inc =================================================================== --- lib/libc/iconv/Makefile.inc +++ lib/libc/iconv/Makefile.inc @@ -14,7 +14,11 @@ 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 Index: lib/libc/include/compat.h =================================================================== --- lib/libc/include/compat.h +++ lib/libc/include/compat.h @@ -35,6 +35,7 @@ #ifndef __LIBC_COMPAT_H__ #define __LIBC_COMPAT_H__ +#ifdef SYMVER_COMPAT #define __sym_compat(sym,impl,verid) \ .symver impl, sym@verid @@ -43,6 +44,7 @@ __sym_compat(shmctl, freebsd7_shmctl, FBSD_1.0); #undef __sym_compat +#endif #define __weak_reference(sym,alias) \ .weak alias;.equ alias,sym Index: lib/libc/posix1e/Makefile.inc =================================================================== --- lib/libc/posix1e/Makefile.inc +++ lib/libc/posix1e/Makefile.inc @@ -11,7 +11,6 @@ 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 @@ 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 Index: lib/libc/secure/Makefile.inc =================================================================== --- lib/libc/secure/Makefile.inc +++ 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 Index: lib/libc/sys/openat.c =================================================================== --- lib/libc/sys/openat.c +++ lib/libc/sys/openat.c @@ -39,9 +39,11 @@ #include "libc_private.h" __weak_reference(__sys_openat, __openat); +#ifdef SYMVER_COMPAT __sym_compat(openat, __impl_openat, FBSD_1.1); __weak_reference(openat, __impl_openat); __sym_default(openat, openat, FBSD_1.2); +#endif #pragma weak openat int Index: lib/libc/sys/setcontext.c =================================================================== --- lib/libc/sys/setcontext.c +++ lib/libc/sys/setcontext.c @@ -38,9 +38,11 @@ #include "libc_private.h" __weak_reference(__sys_setcontext, __setcontext); +#ifdef SYMVER_COMPAT __sym_compat(setcontext, __impl_setcontext, FBSD_1.0); __weak_reference(setcontext, __impl_setcontext); __sym_default(setcontext, setcontext, FBSD_1.2); +#endif #pragma weak setcontext int Index: lib/libc/sys/swapcontext.c =================================================================== --- lib/libc/sys/swapcontext.c +++ lib/libc/sys/swapcontext.c @@ -39,9 +39,11 @@ #include "libc_private.h" __weak_reference(__sys_swapcontext, __swapcontext); +#ifdef SYMVER_COMPAT __sym_compat(swapcontext, __impl_swapcontext, FBSD_1.0); __weak_reference(swapcontext, __impl_swapcontext); __sym_default(swapcontext, swapcontext, FBSD_1.2); +#endif #pragma weak swapcontext int Index: lib/libthr/thread/thr_sem.c =================================================================== --- lib/libthr/thread/thr_sem.c +++ lib/libthr/thread/thr_sem.c @@ -43,6 +43,7 @@ #include "thr_private.h" +#ifdef SYMVER_COMPAT FB10_COMPAT(_sem_init_compat, sem_init); FB10_COMPAT(_sem_destroy_compat, sem_destroy); FB10_COMPAT(_sem_getvalue_compat, sem_getvalue); @@ -50,6 +51,7 @@ FB10_COMPAT(_sem_wait_compat, sem_wait); FB10_COMPAT(_sem_timedwait_compat, sem_timedwait); FB10_COMPAT(_sem_post_compat, sem_post); +#endif typedef struct sem *sem_t; Index: lib/libthread_db/thread_db.c =================================================================== --- lib/libthread_db/thread_db.c +++ lib/libthread_db/thread_db.c @@ -175,6 +175,7 @@ return (ta->ta_ops->to_thr_event_getmsg(th, msg)); } +#ifdef SYMVER_COMPAT td_err_e td_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info) { @@ -182,6 +183,7 @@ return (ta->ta_ops->to_thr_old_get_info(th, info)); } __sym_compat(td_thr_get_info, td_thr_old_get_info, FBSD_1.0); +#endif td_err_e td_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)