Index: contrib/jemalloc/src/jemalloc.c =================================================================== --- contrib/jemalloc/src/jemalloc.c +++ contrib/jemalloc/src/jemalloc.c @@ -4,9 +4,11 @@ /******************************************************************************/ /* Data. */ +#if LIB_MIN_COMPAT <= 7 /* 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); } +#if LIB_MIN_COMPAT <= 7 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 @@ -127,7 +127,13 @@ VERSION_DEF=${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS=${SYM_MAPS} +.if ${MK_SYMVER} == "no" +# Set minimum compatability higher than any FreeBSD release +CFLAGS+=-DLIB_MIN_COMPAT=999999 +.else CFLAGS+= -DSYMBOL_VERSIONING +CFLAGS+=-DLIB_MIN_COMPAT=${ARCH_LIB_MIN_COMPAT} +.endif # If there are no machine dependent sources, append all the # machine-independent sources: Index: lib/libc/aarch64/Makefile.inc =================================================================== --- lib/libc/aarch64/Makefile.inc +++ lib/libc/aarch64/Makefile.inc @@ -7,3 +7,4 @@ GDTOASRCS+=strtorQ.c MDSRCS+=machdep_ldisQ.c SYM_MAPS+=${LIBC_SRCTOP}/aarch64/Symbol.map +ARCH_LIB_MIN_COMPAT=11 Index: lib/libc/amd64/Makefile.inc =================================================================== --- lib/libc/amd64/Makefile.inc +++ lib/libc/amd64/Makefile.inc @@ -7,3 +7,4 @@ GDTOASRCS+=strtorx.c MDSRCS+=machdep_ldisx.c SYM_MAPS+=${LIBC_SRCTOP}/amd64/Symbol.map +ARCH_LIB_MIN_COMPAT=7 Index: lib/libc/arm/Makefile.inc =================================================================== --- lib/libc/arm/Makefile.inc +++ lib/libc/arm/Makefile.inc @@ -14,4 +14,5 @@ .if ${MACHINE_ARCH:Marm*hf*} != "" SYM_MAPS+=${LIBC_SRCTOP}/arm/Symbol_vfp.map .endif +ARCH_LIB_MIN_COMPAT=10 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; +#if LIB_MIN_COMPAT <= 10 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)); } +#if LIB_MIN_COMPAT <= 7 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); } +#if LIB_MIN_COMPAT <= 7 __sym_compat(ttyslot, __ttyslot, FBSD_1.0); +#endif Index: lib/libc/i386/Makefile.inc =================================================================== --- lib/libc/i386/Makefile.inc +++ lib/libc/i386/Makefile.inc @@ -4,3 +4,4 @@ GDTOASRCS+=strtorx.c MDSRCS+=machdep_ldisx.c SYM_MAPS+=${LIBC_SRCTOP}/i386/Symbol.map +ARCH_LIB_MIN_COMPAT=7 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__ +#if LIB_MIN_COMPAT <= 7 #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/mips/Makefile.inc =================================================================== --- lib/libc/mips/Makefile.inc +++ lib/libc/mips/Makefile.inc @@ -5,3 +5,4 @@ MDSRCS+= machdep_ldisd.c SYM_MAPS+= ${LIBC_SRCTOP}/mips/Symbol.map +ARCH_LIB_MIN_COMPAT=7 Index: lib/libc/powerpc/Makefile.inc =================================================================== --- lib/libc/powerpc/Makefile.inc +++ lib/libc/powerpc/Makefile.inc @@ -5,3 +5,4 @@ # Long double is 64-bits MDSRCS+=machdep_ldisd.c SYM_MAPS+=${LIBC_SRCTOP}/powerpc/Symbol.map +ARCH_LIB_MIN_COMPAT=7 Index: lib/libc/powerpc64/Makefile.inc =================================================================== --- lib/libc/powerpc64/Makefile.inc +++ lib/libc/powerpc64/Makefile.inc @@ -5,3 +5,4 @@ # Long double is 64-bits MDSRCS+=machdep_ldisd.c SYM_MAPS+=${LIBC_SRCTOP}/powerpc64/Symbol.map +ARCH_LIB_MIN_COMPAT=7 Index: lib/libc/riscv/Makefile.inc =================================================================== --- lib/libc/riscv/Makefile.inc +++ lib/libc/riscv/Makefile.inc @@ -7,3 +7,4 @@ GDTOASRCS+=strtorQ.c MDSRCS+=machdep_ldisQ.c SYM_MAPS+=${LIBC_SRCTOP}/riscv/Symbol.map +ARCH_LIB_MIN_COMPAT=11 Index: lib/libc/sparc64/Makefile.inc =================================================================== --- lib/libc/sparc64/Makefile.inc +++ lib/libc/sparc64/Makefile.inc @@ -11,3 +11,4 @@ GDTOASRCS+=strtorQ.c MDSRCS+=machdep_ldisQ.c SYM_MAPS+=${LIBC_SRCTOP}/sparc64/Symbol.map +ARCH_LIB_MIN_COMPAT=7 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); +#if LIB_MIN_COMPAT <= 8 __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); +#if LIB_MIN_COMPAT <= 7 __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); +#if LIB_MIN_COMPAT <= 7 __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