Index: stable/11/contrib/mdocml/lib.in =================================================================== --- stable/11/contrib/mdocml/lib.in (revision 331741) +++ stable/11/contrib/mdocml/lib.in (revision 331742) @@ -1,131 +1,132 @@ /* $Id: lib.in,v 1.19 2016/11/23 20:22:13 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * Copyright (c) 2009, 2012 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * These are all possible .Lb strings. When a new library is added, add * its short-string to the left-hand side and formatted string to the * right-hand side. * * Be sure to escape strings. */ LINE("lib80211", "802.11 Wireless Network Management Library (lib80211, \\-l80211)") LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)") LINE("libc", "Standard C\\~Library (libc, \\-lc)") LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") LINE("libcasper", "Casper Library (libcasper, \\-lcasper)") LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)") LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)") LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevctl", "Device Control Library (libdevctl, \\-ldevctl)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") +LINE("libdl", "Dynamic Linker Services Filter (libdl, \\-ldl)") LINE("libdm", "Device Mapper Library (libdm, \\-ldm)") LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") LINE("libelf", "ELF Access Library (libelf, \\-lelf)") LINE("libevent", "Event Notification Library (libevent, \\-levent)") LINE("libexecinfo", "Backtrace Information Library (libexecinfo, \\-lexecinfo)") LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") LINE("libfsid", "Filesystem Identification Library (libfsid, \\-lfsid)") LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") LINE("libipsec", "IPsec Policy Control Library (libipsec, \\-lipsec)") LINE("libiscsi", "iSCSI protocol library (libiscsi, \\-liscsi)") LINE("libisns", "Internet Storage Name Service Library (libisns, \\-lisns)") LINE("libjail", "Jail Library (libjail, \\-ljail)") LINE("libkcore", "Kernel Memory Core Access Library (libkcore, \\-lkcore)") LINE("libkiconv", "Kernel-side iconv Library (libkiconv, \\-lkiconv)") LINE("libkse", "N:M Threading Library (libkse, \\-lkse)") LINE("libkvm", "Kernel Data Access Library (libkvm, \\-lkvm)") LINE("libm", "Math Library (libm, \\-lm)") LINE("libm68k", "m68k Architecture Library (libm68k, \\-lm68k)") LINE("libmagic", "Magic Number Recognition Library (libmagic, \\-lmagic)") LINE("libmandoc", "Mandoc Macro Compiler Library (libmandoc, \\-lmandoc)") LINE("libmd", "Message Digest (MD4, MD5, etc.) Support Library (libmd, \\-lmd)") LINE("libmemstat", "Kernel Memory Allocator Statistics Library (libmemstat, \\-lmemstat)") LINE("libmenu", "Curses Menu Library (libmenu, \\-lmenu)") LINE("libmj", "Minimalist JSON library (libmj, \\-lmj)") LINE("libnetgraph", "Netgraph User Library (libnetgraph, \\-lnetgraph)") LINE("libnetpgp", "Netpgp Signing, Verification, Encryption and Decryption (libnetpgp, \\-lnetpgp)") LINE("libnetpgpverify", "Netpgp Verification (libnetpgpverify, \\-lnetpgpverify)") LINE("libnpf", "NPF Packet Filter Library (libnpf, \\-lnpf)") LINE("libnv", "Name/value pairs library (libnv, \\-lnv)") LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)") LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") LINE("libpanel", "Z-order for curses windows (libpanel, \\-lpanel)") LINE("libpcap", "Packet capture Library (libpcap, \\-lpcap)") LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") LINE("libposix1e", "POSIX.1e Security API Library (libposix1e, \\-lposix1e)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") LINE("libproc", "Processor Monitoring and Analysis Library (libproc, \\-lproc)") LINE("libprocstat", "Process and Files Information Retrieval (libprocstat, \\-lprocstat)") LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") LINE("libpthread", "POSIX Threads Library (libpthread, \\-lpthread)") LINE("libpthread_dbg", "POSIX Debug Threads Library (libpthread_dbg, \\-lpthread_dbg)") LINE("libpuffs", "puffs Convenience Library (libpuffs, \\-lpuffs)") LINE("libquota", "Disk Quota Access and Control Library (libquota, \\-lquota)") LINE("libradius", "RADIUS Client Library (libradius, \\-lradius)") LINE("librefuse", "File System in Userspace Convenience Library (librefuse, \\-lrefuse)") LINE("libresolv", "DNS Resolver Library (libresolv, \\-lresolv)") LINE("librpcsec_gss", "RPC GSS-API Authentication Library (librpcsec_gss, \\-lrpcsec_gss)") LINE("librpcsvc", "RPC Service Library (librpcsvc, \\-lrpcsvc)") LINE("librt", "POSIX Real\\-time Library (librt, \\-lrt)") LINE("librtld_db", "Debugging interface to the runtime linker Library (librtld_db, \\-lrtld_db)") LINE("librumpclient", "Clientside Stubs for rump Kernel Remote Protocols (librumpclient, \\-lrumpclient)") LINE("libsaslc", "Simple Authentication and Security Layer client library (libsaslc, \\-lsaslc)") LINE("libsbuf", "Safe String Composition Library (libsbuf, \\-lsbuf)") LINE("libsdp", "Bluetooth Service Discovery Protocol User Library (libsdp, \\-lsdp)") LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") LINE("libSystem", "System Library (libSystem, \\-lSystem)") LINE("libsysdecode", "System Argument Decoding Library (libsysdecode, \\-lsysdecode)") LINE("libtacplus", "TACACS+ Client Library (libtacplus, \\-ltacplus)") LINE("libtcplay", "TrueCrypt-compatible API library (libtcplay, \\-ltcplay)") LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)") LINE("libterminfo", "Terminal Information Library (libterminfo, \\-lterminfo)") LINE("libthr", "1:1 Threading Library (libthr, \\-lthr)") LINE("libufs", "UFS File System Access Library (libufs, \\-lufs)") LINE("libugidfw", "File System Firewall Interface Library (libugidfw, \\-lugidfw)") LINE("libulog", "User Login Record Library (libulog, \\-lulog)") LINE("libusbhid", "USB Human Interface Devices Library (libusbhid, \\-lusbhid)") LINE("libutil", "System Utilities Library (libutil, \\-lutil)") LINE("libvgl", "Video Graphics Library (libvgl, \\-lvgl)") LINE("libx86_64", "x86_64 Architecture Library (libx86_64, \\-lx86_64)") LINE("libxo", "Text, XML, JSON, and HTML Output Emission Library (libxo, \\-lxo)") LINE("libz", "Compression Library (libz, \\-lz)") Index: stable/11/lib/Makefile =================================================================== --- stable/11/lib/Makefile (revision 331741) +++ stable/11/lib/Makefile (revision 331742) @@ -1,327 +1,332 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ .include # The SUBDIR_BOOTSTRAP list is a small set of libraries which are used by many # of the other libraries. These are built first with a .WAIT between them # and the main list to avoid needing a SUBDIR_DEPEND line on every library # naming just these few items. SUBDIR_BOOTSTRAP= \ csu \ .WAIT \ libc \ libc_nonshared \ libcompiler_rt \ ${_libclang_rt} \ ${_libcplusplus} \ ${_libcxxrt} \ libelf \ msun # The main list; please keep these sorted alphabetically. SUBDIR= ${SUBDIR_BOOTSTRAP} \ .WAIT \ libalias \ libarchive \ ${_libatm} \ libauditd \ libbegemot \ ${_libblacklist} \ libblocksruntime \ ${_libbluetooth} \ ${_libbsnmp} \ libbsdstat \ libbsm \ libbz2 \ libcalendar \ libcam \ libcapsicum \ ${_libcasper} \ ${_libcom_err} \ libcompat \ libcrypt \ libdevctl \ libdevdctl \ libdevinfo \ libdevstat \ + ${_libdl} \ libdwarf \ libedit \ ${_libefivar} \ libelftc \ libevent \ libexecinfo \ libexpat \ libfetch \ libfigpar \ libgeom \ ${_libgpio} \ ${_libgssapi} \ ${_librpcsec_gss} \ ${_libiconv_modules} \ libipsec \ libjail \ libkiconv \ libkvm \ ${_libldns} \ liblzma \ ${_libmagic} \ libmemstat \ libmd \ ${_libmilter} \ ${_libmp} \ libmt \ ${_libnandfs} \ lib80211 \ libnetbsd \ ${_libnetgraph} \ ${_libngatm} \ libnv \ libopenbsd \ libopie \ libpam \ libpcap \ ${_libpe} \ libpjdlog \ ${_libpmc} \ ${_libproc} \ libprocstat \ ${_libradius} \ librpcsvc \ librt \ ${_librtld_db} \ libsbuf \ ${_libsdp} \ ${_libsm} \ libsmb \ ${_libsmdb} \ ${_libsmutil} \ libsqlite3 \ libstdbuf \ libstdthreads \ libsysdecode \ libtacplus \ ${_libtelnet} \ ${_libthr} \ libthread_db \ libucl \ libufs \ libugidfw \ libulog \ ${_libunbound} \ ${_libusbhid} \ ${_libusb} \ libutil \ ${_libvgl} \ ${_libvmmapi} \ libwrap \ libxo \ liby \ ${_libypclnt} \ libz \ ncurses \ ${_atf} \ ${_clang} \ ${_cuse} \ ${_tests} # Inter-library dependencies. When the makefile for a library contains LDADD # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd SUBDIR_DEPEND_libatm= libmd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++:= libcxxrt SUBDIR_DEPEND_libc= libcompiler_rt SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcasper= libnv SUBDIR_DEPEND_libdevstat= libkvm SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libgeom= libexpat libsbuf SUBDIR_DEPEND_librpcsec_gss= libgssapi SUBDIR_DEPEND_libmagic= libz SUBDIR_DEPEND_libmemstat= libkvm SUBDIR_DEPEND_libopie= libmd SUBDIR_DEPEND_libpam= libcrypt libopie ${_libradius} librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err} SUBDIR_DEPEND_libpjdlog= libutil SUBDIR_DEPEND_libprocstat= libkvm libutil SUBDIR_DEPEND_libradius= libmd SUBDIR_DEPEND_libsmb= libkiconv SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} SUBDIR_DEPEND_liblzma= ${_libthr} # NB: keep these sorted by MK_* knobs .if ${MK_ATM} != "no" _libngatm= libngatm .endif .if ${MK_BLACKLIST} != "no" _libblacklist= libblacklist .endif .if ${MK_BLUETOOTH} != "no" _libbluetooth= libbluetooth _libsdp= libsdp .endif .if ${MK_BSNMP} != "no" _libbsnmp= libbsnmp .endif .if ${MK_CASPER} != "no" _libcasper= libcasper .endif .if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP) _clang= clang .endif .if ${MK_CUSE} != "no" _cuse= libcuse .endif .if ${MK_TOOLCHAIN} != "no" _libpe= libpe .endif SUBDIR.${MK_DIALOG}+= libdpv .if ${MK_FILE} != "no" _libmagic= libmagic .endif .if ${MK_GPIO} != "no" _libgpio= libgpio .endif .if ${MK_GSSAPI} != "no" _libgssapi= libgssapi _librpcsec_gss= librpcsec_gss .endif .if ${MK_ICONV} != "no" _libiconv_modules= libiconv_modules .endif .if ${MK_KERBEROS_SUPPORT} != "no" _libcom_err= libcom_err .endif .if ${MK_LDNS} != "no" _libldns= libldns .endif # The libraries under libclang_rt can only be built by clang, and only make # sense to build when clang is enabled at all. Furthermore, they can only be # built for certain architectures. .if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \ (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ (${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \ (${MACHINE_CPUARCH} == "i386")) _libclang_rt= libclang_rt .endif .if ${MK_LIBCPLUSPLUS} != "no" _libcxxrt= libcxxrt _libcplusplus= libc++ .endif .if ${MK_EFI} != "no" _libefivar= libefivar .endif .if ${MK_LIBTHR} != "no" _libthr= libthr .endif .if ${MK_NAND} != "no" _libnandfs= libnandfs .endif .if ${MK_NETGRAPH} != "no" _libnetgraph= libnetgraph .endif .if ${MK_NIS} != "no" _libypclnt= libypclnt .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _libvgl= libvgl _libproc= libproc _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "amd64" .if ${MK_BHYVE} != "no" _libvmmapi= libvmmapi .endif .endif .if ${MACHINE_CPUARCH} == "mips" _libproc= libproc _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "powerpc" _libproc= libproc _librtld_db= librtld_db +.endif + +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mfilter} +_libdl= libdl .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "riscv" _libproc= libproc _librtld_db= librtld_db .endif .if ${MK_OPENSSL} != "no" _libmp= libmp .endif .if ${MK_PMC} != "no" _libpmc= libpmc .endif .if ${MK_RADIUS_SUPPORT} != "no" _libradius= libradius .endif .if ${MK_SENDMAIL} != "no" _libmilter= libmilter _libsm= libsm _libsmdb= libsmdb _libsmutil= libsmutil .endif .if ${MK_TELNET} != "no" _libtelnet= libtelnet .endif .if ${MK_TESTS_SUPPORT} != "no" _atf= atf .endif .if ${MK_TESTS} != "no" _tests= tests .endif .if ${MK_UNBOUND} != "no" _libunbound= libunbound .endif .if ${MK_USB} != "no" _libusbhid= libusbhid _libusb= libusb .endif .if !make(install) SUBDIR_PARALLEL= .endif .include Index: stable/11/lib/libc/gen/dlfcn.c =================================================================== --- stable/11/lib/libc/gen/dlfcn.c (revision 331741) +++ stable/11/lib/libc/gen/dlfcn.c (revision 331742) @@ -1,253 +1,263 @@ /*- * Copyright (c) 1998 John D. Polstra * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); +#if !defined(IN_LIBDL) || defined(PIC) + /* * Linkage to services provided by the dynamic linker. */ #include #include #include #include #include "namespace.h" #include #include "un-namespace.h" #include "libc_private.h" static char sorry[] = "Service unavailable"; void _rtld_thread_init(void *); void _rtld_atfork_pre(int *); void _rtld_atfork_post(int *); /* * For ELF, the dynamic linker directly resolves references to its * services to functions inside the dynamic linker itself. These * weak-symbol stubs are necessary so that "ld" won't complain about * undefined symbols. The stubs are executed only when the program is * linked statically, or when a given service isn't implemented in the * dynamic linker. They must return an error if called, and they must * be weak symbols so that the dynamic linker can override them. */ #pragma weak _rtld_error void _rtld_error(const char *fmt __unused, ...) { } #pragma weak dladdr int dladdr(const void *addr __unused, Dl_info *dlip __unused) { _rtld_error(sorry); return (0); } #pragma weak dlclose int dlclose(void *handle __unused) { _rtld_error(sorry); return (-1); } #pragma weak dlerror char * dlerror(void) { return (sorry); } #pragma weak dllockinit void dllockinit(void *context, void *(*lock_create)(void *context) __unused, void (*rlock_acquire)(void *lock) __unused, void (*wlock_acquire)(void *lock) __unused, void (*lock_release)(void *lock) __unused, void (*lock_destroy)(void *lock) __unused, void (*context_destroy)(void *context) __unused) { if (context_destroy != NULL) context_destroy(context); } #pragma weak dlopen void * dlopen(const char *name __unused, int mode __unused) { _rtld_error(sorry); return (NULL); } #pragma weak dlsym void * dlsym(void * __restrict handle __unused, const char * __restrict name __unused) { _rtld_error(sorry); return (NULL); } #pragma weak dlfunc dlfunc_t dlfunc(void * __restrict handle __unused, const char * __restrict name __unused) { _rtld_error(sorry); return (NULL); } #pragma weak dlvsym void * dlvsym(void * __restrict handle __unused, const char * __restrict name __unused, const char * __restrict version __unused) { _rtld_error(sorry); return (NULL); } #pragma weak dlinfo int dlinfo(void * __restrict handle __unused, int request __unused, void * __restrict p __unused) { _rtld_error(sorry); return (0); } #pragma weak _rtld_thread_init void _rtld_thread_init(void *li __unused) { _rtld_error(sorry); } +#ifndef IN_LIBDL static pthread_once_t dl_phdr_info_once = PTHREAD_ONCE_INIT; static struct dl_phdr_info phdr_info; static void dl_init_phdr_info(void) { Elf_Auxinfo *auxp; unsigned int i; for (auxp = __elf_aux_vector; auxp->a_type != AT_NULL; auxp++) { switch (auxp->a_type) { case AT_BASE: phdr_info.dlpi_addr = (Elf_Addr)auxp->a_un.a_ptr; break; case AT_EXECPATH: phdr_info.dlpi_name = (const char *)auxp->a_un.a_ptr; break; case AT_PHDR: phdr_info.dlpi_phdr = (const Elf_Phdr *)auxp->a_un.a_ptr; break; case AT_PHNUM: phdr_info.dlpi_phnum = (Elf_Half)auxp->a_un.a_val; break; } } for (i = 0; i < phdr_info.dlpi_phnum; i++) { if (phdr_info.dlpi_phdr[i].p_type == PT_TLS) { phdr_info.dlpi_tls_modid = 1; phdr_info.dlpi_tls_data = (void*)phdr_info.dlpi_phdr[i].p_vaddr; } } phdr_info.dlpi_adds = 1; } +#endif #pragma weak dl_iterate_phdr int dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *) __unused, void *data __unused) { +#ifndef IN_LIBDL __init_elf_aux_vector(); if (__elf_aux_vector == NULL) return (1); _once(&dl_phdr_info_once, dl_init_phdr_info); return (callback(&phdr_info, sizeof(phdr_info), data)); +#else + return (0); +#endif } #pragma weak fdlopen void * fdlopen(int fd __unused, int mode __unused) { _rtld_error(sorry); return (NULL); } #pragma weak _rtld_atfork_pre void _rtld_atfork_pre(int *locks __unused) { } #pragma weak _rtld_atfork_post void _rtld_atfork_post(int *locks __unused) { } #pragma weak _rtld_addr_phdr int _rtld_addr_phdr(const void *addr __unused, struct dl_phdr_info *phdr_info_a __unused) { return (0); } #pragma weak _rtld_get_stack_prot int _rtld_get_stack_prot(void) { return (PROT_EXEC | PROT_READ | PROT_WRITE); } #pragma weak _rtld_is_dlopened int _rtld_is_dlopened(void *arg __unused) { return (0); } + +#endif /* !defined(IN_LIBDL) || defined(PIC) */ Index: stable/11/lib/libc/gen/dlopen.3 =================================================================== --- stable/11/lib/libc/gen/dlopen.3 (revision 331741) +++ stable/11/lib/libc/gen/dlopen.3 (revision 331742) @@ -1,408 +1,416 @@ .\" This source code is a product of Sun Microsystems, Inc. and is provided .\" for unrestricted use provided that this legend is included on all tape .\" media and as a part of the software program in whole or part. Users .\" may copy or modify this source code without charge, but are not authorized .\" to license or distribute it to anyone else except as part of a product or .\" program developed by the user. .\" .\" THIS PROGRAM CONTAINS SOURCE CODE COPYRIGHTED BY SUN MICROSYSTEMS, INC. .\" SUN MICROSYSTEMS, INC., MAKES NO REPRESENTATIONS ABOUT THE SUITABLITY .\" OF SUCH SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT .\" EXPRESS OR IMPLIED WARRANTY OF ANY KIND. SUN MICROSYSTEMS, INC. DISCLAIMS .\" ALL WARRANTIES WITH REGARD TO SUCH SOURCE CODE, INCLUDING ALL IMPLIED .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN .\" NO EVENT SHALL SUN MICROSYSTEMS, INC. BE LIABLE FOR ANY SPECIAL, INDIRECT, .\" INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING .\" FROM USE OF SUCH SOURCE CODE, REGARDLESS OF THE THEORY OF LIABILITY. .\" .\" This source code is provided with no support and without any obligation on .\" the part of Sun Microsystems, Inc. to assist in its use, correction, .\" modification or enhancement. .\" .\" SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE .\" INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS .\" SOURCE CODE OR ANY PART THEREOF. .\" .\" Sun Microsystems, Inc. .\" 2550 Garcia Avenue .\" Mountain View, California 94043 .\" .\" Copyright (c) 1991 Sun Microsystems, Inc. .\" .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd February 14, 2015 +.Dd July 7, 2017 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , .Nm fdlopen , .Nm dlsym , .Nm dlfunc , .Nm dlerror , .Nm dlclose .Nd programmatic interface to the dynamic linker .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In dlfcn.h .Ft void * .Fn dlopen "const char *path" "int mode" .Ft void * .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" .Ft char * .Fn dlerror "void" .Ft int .Fn dlclose "void *handle" .Sh DESCRIPTION These functions provide a simple programmatic interface to the services of the dynamic linker. Operations are provided to add new shared objects to a program's address space, to obtain the address bindings of symbols defined by such objects, and to remove such objects when their use is no longer required. .Pp The .Fn dlopen function provides access to the shared object in .Fa path , returning a descriptor that can be used for later references to the object in calls to .Fn dlsym and .Fn dlclose . If .Fa path was not in the address space prior to the call to .Fn dlopen , it is placed in the address space. When an object is first loaded into the address space in this way, its function .Fn _init , if any, is called by the dynamic linker. If .Fa path has already been placed in the address space in a previous call to .Fn dlopen , it is not added a second time, although a reference count of .Fn dlopen operations on .Fa path is maintained. A null pointer supplied for .Fa path is interpreted as a reference to the main executable of the process. The .Fa mode argument controls the way in which external function references from the loaded object are bound to their referents. It must contain one of the following values, possibly ORed with additional flags which will be described subsequently: .Bl -tag -width RTLD_LAZYX .It Dv RTLD_LAZY Each external function reference is resolved when the function is first called. .It Dv RTLD_NOW All external function references are bound immediately by .Fn dlopen . .El .Pp .Dv RTLD_LAZY is normally preferred, for reasons of efficiency. However, .Dv RTLD_NOW is useful to ensure that any undefined symbols are discovered during the call to .Fn dlopen . .Pp One of the following flags may be ORed into the .Fa mode argument: .Bl -tag -width RTLD_NODELETE .It Dv RTLD_GLOBAL Symbols from this shared object and its directed acyclic graph (DAG) of needed objects will be available for resolving undefined references from all other shared objects. .It Dv RTLD_LOCAL Symbols in this shared object and its DAG of needed objects will be available for resolving undefined references only from other objects in the same DAG. This is the default, but it may be specified explicitly with this flag. .It Dv RTLD_TRACE When set, causes dynamic linker to exit after loading all objects needed by this shared object and printing a summary which includes the absolute pathnames of all objects, to standard output. With this flag .Fn dlopen will return to the caller only in the case of error. .It Dv RTLD_NODELETE Prevents unload of the loaded object on .Fn dlclose . The same behaviour may be requested by .Fl "z nodelete" option of the static linker .Xr ld 1 . .It Dv RTLD_NOLOAD Only return valid handle for the object if it is already loaded in the process address space, otherwise .Dv NULL is returned. Other mode flags may be specified, which will be applied for promotion for the found object. .El .Pp If .Fn dlopen fails, it returns a null pointer, and sets an error condition which may be interrogated with .Fn dlerror . .Pp The .Fn fdlopen function is similar to .Fn dlopen , but it takes the file descriptor argument .Fa fd , which is used for the file operations needed to load an object into the address space. The file descriptor .Fa fd is not closed by the function regardless a result of execution, but a duplicate of the file descriptor is. This may be important if a .Xr lockf 3 lock is held on the passed descriptor. The .Fa fd argument -1 is interpreted as a reference to the main executable of the process, similar to .Va NULL value for the .Fa name argument to .Fn dlopen . The .Fn fdlopen function can be used by the code that needs to perform additional checks on the loaded objects, to prevent races with symlinking or renames. .Pp The .Fn dlsym function returns the address binding of the symbol described in the null-terminated character string .Fa symbol , as it occurs in the shared object identified by .Fa handle . The symbols exported by objects added to the address space by .Fn dlopen can be accessed only through calls to .Fn dlsym . Such symbols do not supersede any definition of those symbols already present in the address space when the object is loaded, nor are they available to satisfy normal dynamic linking references. .Pp If .Fn dlsym is called with the special .Fa handle .Dv NULL , it is interpreted as a reference to the executable or shared object from which the call is being made. Thus a shared object can reference its own symbols. .Pp If .Fn dlsym is called with the special .Fa handle .Dv RTLD_DEFAULT , the search for the symbol follows the algorithm used for resolving undefined symbols when objects are loaded. The objects searched are as follows, in the given order: .Bl -enum .It The referencing object itself (or the object from which the call to .Fn dlsym is made), if that object was linked using the .Fl Bsymbolic option to .Xr ld 1 . .It All objects loaded at program start-up. .It All objects loaded via .Fn dlopen with the .Dv RTLD_GLOBAL flag set in the .Fa mode argument. .It All objects loaded via .Fn dlopen which are in needed-object DAGs that also contain the referencing object. .El .Pp If .Fn dlsym is called with the special .Fa handle .Dv RTLD_NEXT , then the search for the symbol is limited to the shared objects which were loaded after the one issuing the call to .Fn dlsym . Thus, if the function is called from the main program, all the shared libraries are searched. If it is called from a shared library, all subsequent shared libraries are searched. .Dv RTLD_NEXT is useful for implementing wrappers around library functions. For example, a wrapper function .Fn getpid could access the .Dq real .Fn getpid with .Li dlsym(RTLD_NEXT, \&"getpid\&") . (Actually, the .Fn dlfunc interface, below, should be used, since .Fn getpid is a function and not a data object.) .Pp If .Fn dlsym is called with the special .Fa handle .Dv RTLD_SELF , then the search for the symbol is limited to the shared object issuing the call to .Fn dlsym and those shared objects which were loaded after it. .Pp The .Fn dlsym function returns a null pointer if the symbol cannot be found, and sets an error condition which may be queried with .Fn dlerror . .Pp The .Fn dlfunc function implements all of the behavior of .Fn dlsym , but has a return type which can be cast to a function pointer without triggering compiler diagnostics. (The .Fn dlsym function returns a data pointer; in the C standard, conversions between data and function pointer types are undefined. Some compilers and .Xr lint 1 utilities warn about such casts.) The precise return type of .Fn dlfunc is unspecified; applications must cast it to an appropriate function pointer type. .Pp The .Fn dlerror function returns a null-terminated character string describing the last error that occurred during a call to .Fn dlopen , .Fn dladdr , .Fn dlinfo , .Fn dlsym , .Fn dlfunc , or .Fn dlclose . If no such error has occurred, .Fn dlerror returns a null pointer. At each call to .Fn dlerror , the error indication is reset. Thus in the case of two calls to .Fn dlerror , where the second call follows the first immediately, the second call will always return a null pointer. .Pp The .Fn dlclose function deletes a reference to the shared object referenced by .Fa handle . If the reference count drops to 0, the object is removed from the address space, and .Fa handle is rendered invalid. Just before removing a shared object in this way, the dynamic linker calls the object's .Fn _fini function, if such a function is defined by the object. If .Fn dlclose is successful, it returns a value of 0. Otherwise it returns -1, and sets an error condition that can be interrogated with .Fn dlerror . .Pp The object-intrinsic functions .Fn _init and .Fn _fini are called with no arguments, and are not expected to return values. .Sh NOTES ELF executables need to be linked using the .Fl export-dynamic option to .Xr ld 1 for symbols defined in the executable to become visible to .Fn dlsym . +.Pp +Other ELF platforms require linking with +.Lb libdl +to provide +.Fn dlopen +and other functions. +.Fx +does not require linking with the library, but supports it for compatibility. .Pp In previous implementations, it was necessary to prepend an underscore to all external symbols in order to gain symbol compatibility with object code compiled from the C language. This is still the case when using the (obsolete) .Fl aout option to the C language compiler. .Sh ERRORS The .Fn dlopen , .Fn fdlopen , .Fn dlsym , and .Fn dlfunc functions return a null pointer in the event of errors. The .Fn dlclose function returns 0 on success, or -1 if an error occurred. Whenever an error has been detected, a message detailing it can be retrieved via a call to .Fn dlerror . .Sh SEE ALSO .Xr ld 1 , .Xr rtld 1 , .Xr dladdr 3 , .Xr dlinfo 3 , .Xr link 5 Index: stable/11/lib/libdl/Makefile =================================================================== --- stable/11/lib/libdl/Makefile (nonexistent) +++ stable/11/lib/libdl/Makefile (revision 331742) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +LIB=dl +SHLIB_MAJOR=1 + +.PATH: ${SRCTOP}/lib/libc/gen +CFLAGS+=-I${SRCTOP}/lib/libc/include +CFLAGS+=-DIN_LIBDL +LDFLAGS+=-Wl,-F,libc.so.7 +VERSION_DEF=${SRCTOP}/lib/libc/Versions.def +SYMBOL_MAPS=${.CURDIR}/Symbol.map + +SRCS = dlfcn.c + +.include Property changes on: stable/11/lib/libdl/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: stable/11/lib/libdl/Symbol.map =================================================================== --- stable/11/lib/libdl/Symbol.map (nonexistent) +++ stable/11/lib/libdl/Symbol.map (revision 331742) @@ -0,0 +1,20 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.0 { + dladdr; + dlclose; + dlerror; + dlfunc; + dlopen; + dlsym; + dlvsym; + dlinfo; + dl_iterate_phdr; +}; + + +FBSD_1.3 { + fdlopen; +}; Property changes on: stable/11/lib/libdl/Symbol.map ___________________________________________________________________ Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Index: stable/11/share/mk/bsd.libnames.mk =================================================================== --- stable/11/share/mk/bsd.libnames.mk (revision 331741) +++ stable/11/share/mk/bsd.libnames.mk (revision 331742) @@ -1,193 +1,194 @@ # $FreeBSD$ # The include file define library names. # Other include files (e.g. bsd.prog.mk, bsd.lib.mk) include this # file where necessary. .if !target(____) .error bsd.libnames.mk cannot be included directly. .endif .sinclude # Src directory locations are also defined in src.libnames.mk. LIBCRT0?= ${DESTDIR}${LIBDIR_BASE}/crt0.o LIB80211?= ${DESTDIR}${LIBDIR_BASE}/lib80211.a LIBALIAS?= ${DESTDIR}${LIBDIR_BASE}/libalias.a LIBARCHIVE?= ${DESTDIR}${LIBDIR_BASE}/libarchive.a LIBASN1?= ${DESTDIR}${LIBDIR_BASE}/libasn1.a LIBATM?= ${DESTDIR}${LIBDIR_BASE}/libatm.a LIBAUDITD?= ${DESTDIR}${LIBDIR_BASE}/libauditd.a LIBAVL?= ${DESTDIR}${LIBDIR_BASE}/libavl.a LIBBEGEMOT?= ${DESTDIR}${LIBDIR_BASE}/libbegemot.a LIBBLACKLIST?= ${DESTDIR}${LIBDIR_BASE}/libblacklist.a LIBBLUETOOTH?= ${DESTDIR}${LIBDIR_BASE}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR_BASE}/libbsdxml.a LIBBSM?= ${DESTDIR}${LIBDIR_BASE}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR_BASE}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR_BASE}/libbz2.a LIBC?= ${DESTDIR}${LIBDIR_BASE}/libc.a LIBCALENDAR?= ${DESTDIR}${LIBDIR_BASE}/libcalendar.a LIBCAM?= ${DESTDIR}${LIBDIR_BASE}/libcam.a LIBCAP_DNS?= ${DESTDIR}${LIBDIR_BASE}/libcap_dns.a LIBCAP_GRP?= ${DESTDIR}${LIBDIR_BASE}/libcap_grp.a LIBCAP_PWD?= ${DESTDIR}${LIBDIR_BASE}/libcap_pwd.a LIBCAP_RANDOM?= ${DESTDIR}${LIBDIR_BASE}/libcap_random.a LIBCAP_SYSCTL?= ${DESTDIR}${LIBDIR_BASE}/libcap_sysctl.a LIBCASPER?= ${DESTDIR}${LIBDIR_BASE}/libcasper.a LIBCOMPAT?= ${DESTDIR}${LIBDIR_BASE}/libcompat.a LIBCOMPILER_RT?=${DESTDIR}${LIBDIR_BASE}/libcompiler_rt.a LIBCOM_ERR?= ${DESTDIR}${LIBDIR_BASE}/libcom_err.a LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR_BASE}/libc++.a LIBCRYPT?= ${DESTDIR}${LIBDIR_BASE}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR_BASE}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR_BASE}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR_BASE}/libcurses.a LIBCUSE?= ${DESTDIR}${LIBDIR_BASE}/libcuse.a LIBCXGB4?= ${DESTDIR}${LIBDIR_BASE}/libcxgb4.a LIBCXXRT?= ${DESTDIR}${LIBDIR_BASE}/libcxxrt.a LIBC_PIC?= ${DESTDIR}${LIBDIR_BASE}/libc_pic.a LIBDEVCTL?= ${DESTDIR}${LIBDIR_BASE}/libdevctl.a LIBDEVDCTL?= ${DESTDIR}${LIBDIR_BASE}/libdevdctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR_BASE}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR_BASE}/libdevstat.a LIBDIALOG?= ${DESTDIR}${LIBDIR_BASE}/libdialog.a +LIBDL?= ${DESTDIR}${LIBDIR_BASE}/libdl.a LIBDNS?= ${DESTDIR}${LIBDIR_BASE}/libdns.a LIBDPV?= ${DESTDIR}${LIBDIR_BASE}/libdpv.a LIBDTRACE?= ${DESTDIR}${LIBDIR_BASE}/libdtrace.a LIBDWARF?= ${DESTDIR}${LIBDIR_BASE}/libdwarf.a LIBEDIT?= ${DESTDIR}${LIBDIR_BASE}/libedit.a LIBEFIVAR?= ${DESTDIR}${LIBDIR_BASE}/libefivar.a LIBELF?= ${DESTDIR}${LIBDIR_BASE}/libelf.a LIBEXECINFO?= ${DESTDIR}${LIBDIR_BASE}/libexecinfo.a LIBFETCH?= ${DESTDIR}${LIBDIR_BASE}/libfetch.a LIBFIGPAR?= ${DESTDIR}${LIBDIR_BASE}/libfigpar.a LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR_BASE}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR_BASE}/libg2c.a LIBGEOM?= ${DESTDIR}${LIBDIR_BASE}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR_BASE}/libgnuregex.a LIBGPIO?= ${DESTDIR}${LIBDIR_BASE}/libgpio.a LIBGSSAPI?= ${DESTDIR}${LIBDIR_BASE}/libgssapi.a LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR_BASE}/libgssapi_krb5.a LIBHDB?= ${DESTDIR}${LIBDIR_BASE}/libhdb.a LIBHEIMBASE?= ${DESTDIR}${LIBDIR_BASE}/libheimbase.a LIBHEIMNTLM?= ${DESTDIR}${LIBDIR_BASE}/libheimntlm.a LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR_BASE}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR_BASE}/libhx509.a LIBIBCM?= ${DESTDIR}${LIBDIR_BASE}/libibcm.a LIBIBCOMMON?= ${DESTDIR}${LIBDIR_BASE}/libibcommon.a LIBIBMAD?= ${DESTDIR}${LIBDIR_BASE}/libibmad.a LIBIBSDP?= ${DESTDIR}${LIBDIR_BASE}/libibsdp.a LIBIBUMAD?= ${DESTDIR}${LIBDIR_BASE}/libibumad.a LIBIBVERBS?= ${DESTDIR}${LIBDIR_BASE}/libibverbs.a LIBIPSEC?= ${DESTDIR}${LIBDIR_BASE}/libipsec.a LIBJAIL?= ${DESTDIR}${LIBDIR_BASE}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR_BASE}/libkadm5clnt.a LIBKADM5SRV?= ${DESTDIR}${LIBDIR_BASE}/libkadm5srv.a LIBKAFS5?= ${DESTDIR}${LIBDIR_BASE}/libkafs5.a LIBKDC?= ${DESTDIR}${LIBDIR_BASE}/libkdc.a LIBKEYCAP?= ${DESTDIR}${LIBDIR_BASE}/libkeycap.a LIBKICONV?= ${DESTDIR}${LIBDIR_BASE}/libkiconv.a LIBKRB5?= ${DESTDIR}${LIBDIR_BASE}/libkrb5.a LIBKVM?= ${DESTDIR}${LIBDIR_BASE}/libkvm.a LIBL?= ${DESTDIR}${LIBDIR_BASE}/libl.a LIBLN?= "don't use LIBLN, use LIBL" LIBLZMA?= ${DESTDIR}${LIBDIR_BASE}/liblzma.a LIBM?= ${DESTDIR}${LIBDIR_BASE}/libm.a LIBMAGIC?= ${DESTDIR}${LIBDIR_BASE}/libmagic.a LIBMD?= ${DESTDIR}${LIBDIR_BASE}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR_BASE}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR_BASE}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR_BASE}/libmilter.a LIBMLX4?= ${DESTDIR}${LIBDIR_BASE}/libmlx4.a LIBMP?= ${DESTDIR}${LIBDIR_BASE}/libmp.a LIBMT?= ${DESTDIR}${LIBDIR_BASE}/libmt.a LIBMTHCA?= ${DESTDIR}${LIBDIR_BASE}/libmthca.a LIBNANDFS?= ${DESTDIR}${LIBDIR_BASE}/libnandfs.a LIBNCURSES?= ${DESTDIR}${LIBDIR_BASE}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR_BASE}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR_BASE}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR_BASE}/libngatm.a LIBNV?= ${DESTDIR}${LIBDIR_BASE}/libnv.a LIBNVPAIR?= ${DESTDIR}${LIBDIR_BASE}/libnvpair.a LIBOPENSM?= ${DESTDIR}${LIBDIR_BASE}/libopensm.a LIBOPIE?= ${DESTDIR}${LIBDIR_BASE}/libopie.a LIBOSMCOMP?= ${DESTDIR}${LIBDIR_BASE}/libosmcomp.a LIBOSMVENDOR?= ${DESTDIR}${LIBDIR_BASE}/libosmvendor.a LIBPAM?= ${DESTDIR}${LIBDIR_BASE}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR_BASE}/libpanel.a LIBPANELW?= ${DESTDIR}${LIBDIR_BASE}/libpanelw.a LIBPCAP?= ${DESTDIR}${LIBDIR_BASE}/libpcap.a LIBPJDLOG?= ${DESTDIR}${LIBDIR_BASE}/libpjdlog.a LIBPMC?= ${DESTDIR}${LIBDIR_BASE}/libpmc.a LIBPROC?= ${DESTDIR}${LIBDIR_BASE}/libproc.a LIBPROCSTAT?= ${DESTDIR}${LIBDIR_BASE}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR_BASE}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR_BASE}/libradius.a LIBRDMACM?= ${DESTDIR}${LIBDIR_BASE}/librdmacm.a LIBROKEN?= ${DESTDIR}${LIBDIR_BASE}/libroken.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR_BASE}/librpcsec_gss.a LIBRPCSVC?= ${DESTDIR}${LIBDIR_BASE}/librpcsvc.a LIBRT?= ${DESTDIR}${LIBDIR_BASE}/librt.a LIBRTLD_DB?= ${DESTDIR}${LIBDIR_BASE}/librtld_db.a LIBSBUF?= ${DESTDIR}${LIBDIR_BASE}/libsbuf.a LIBSDP?= ${DESTDIR}${LIBDIR_BASE}/libsdp.a LIBSMB?= ${DESTDIR}${LIBDIR_BASE}/libsmb.a LIBSSL?= ${DESTDIR}${LIBDIR_BASE}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR_BASE}/libssp_nonshared.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR_BASE}/libstdc++.a LIBSTDTHREADS?= ${DESTDIR}${LIBDIR_BASE}/libstdthreads.a LIBSYSDECODE?= ${DESTDIR}${LIBDIR_BASE}/libsysdecode.a LIBTACPLUS?= ${DESTDIR}${LIBDIR_BASE}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR_BASE}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR_BASE}/libtermcapw.a LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" LIBUFS?= ${DESTDIR}${LIBDIR_BASE}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR_BASE}/libugidfw.a LIBULOG?= ${DESTDIR}${LIBDIR_BASE}/libulog.a LIBUMEM?= ${DESTDIR}${LIBDIR_BASE}/libumem.a LIBUSB?= ${DESTDIR}${LIBDIR_BASE}/libusb.a LIBUSBHID?= ${DESTDIR}${LIBDIR_BASE}/libusbhid.a LIBUTIL?= ${DESTDIR}${LIBDIR_BASE}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR_BASE}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR_BASE}/libvgl.a LIBVMMAPI?= ${DESTDIR}${LIBDIR_BASE}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR_BASE}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR_BASE}/libwrap.a LIBXO?= ${DESTDIR}${LIBDIR_BASE}/libxo.a LIBXPG4?= ${DESTDIR}${LIBDIR_BASE}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR_BASE}/liby.a LIBYPCLNT?= ${DESTDIR}${LIBDIR_BASE}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR_BASE}/libz.a LIBZFS?= ${DESTDIR}${LIBDIR_BASE}/libzfs.a LIBZFS_CORE?= ${DESTDIR}${LIBDIR_BASE}/libzfs_core.a LIBZPOOL?= ${DESTDIR}${LIBDIR_BASE}/libzpool.a # enforce the 2 -lpthread and -lc to always be the last in that exact order .if defined(LDADD) .if ${LDADD:M-lpthread} LDADD:= ${LDADD:N-lpthread} -lpthread .endif .if ${LDADD:M-lc} LDADD:= ${LDADD:N-lc} -lc .endif .endif # Only do this for src builds. .if defined(SRCTOP) .if defined(_LIBRARIES) && defined(LIB) && \ ${_LIBRARIES:M${LIB}} != "" .if !defined(LIB${LIB:tu}) .error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${DESTDIR}$${LIBDIR_BASE}/lib${LIB}.a .endif .endif # Derive LIB*SRCDIR from LIB*DIR .for lib in ${_LIBRARIES} LIB${lib:tu}SRCDIR?= ${SRCTOP}/${LIB${lib:tu}DIR:S,^${OBJTOP}/,,} .endfor .endif Index: stable/11/share/mk/bsd.linker.mk =================================================================== --- stable/11/share/mk/bsd.linker.mk (revision 331741) +++ stable/11/share/mk/bsd.linker.mk (revision 331742) @@ -1,93 +1,96 @@ # $FreeBSD$ # Setup variables for the linker. # # LINKER_TYPE is the major type of linker. Currently binutils and lld support # automatic detection. # # LINKER_VERSION is a numeric constant equal to: # major * 10000 + minor * 100 + tiny # It too can be overridden on the command line. # # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # # - build-id : support for generating a Build-ID note # # These variables with an X_ prefix will also be provided if XLD is set. # # This file may be included multiple times, but only has effect the first time. # .if !target(____) ____: .for ld X_ in LD $${_empty_var_} XLD X_ .if ${ld} == "LD" || !empty(XLD) # Try to import LINKER_TYPE and LINKER_VERSION from parent make. # The value is only used/exported for the same environment that impacts # LD and LINKER_* settings here. _exported_vars= ${X_}LINKER_TYPE ${X_}LINKER_VERSION ${X_}LINKER_FEATURES ${X_}_ld_hash= ${${ld}}${MACHINE}${PATH} ${X_}_ld_hash:= ${${X_}_ld_hash:hash} # Only import if none of the vars are set somehow else. _can_export= yes .for var in ${_exported_vars} .if defined(${var}) _can_export= no .endif .endfor .if ${_can_export} == yes .for var in ${_exported_vars} .if defined(${var}.${${X_}_ld_hash}) ${var}= ${${var}.${${X_}_ld_hash}} .endif .endfor .endif .if ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) .if !defined(${X_}LINKER_TYPE) || !defined(${X_}LINKER_VERSION) _ld_version!= (${${ld}} --version || echo none) | head -n 1 .if ${_ld_version} == "none" .warning Unable to determine linker type from ${ld}=${${ld}} .endif .if ${_ld_version:[1..2]} == "GNU ld" ${X_}LINKER_TYPE= bfd _v= ${_ld_version:M[1-9].[0-9]*:[1]} .elif ${_ld_version:[1]} == "LLD" ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} .else .warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd ${X_}LINKER_TYPE= bfd _v= 2.17.50 .endif ${X_}LINKER_VERSION!= echo "${_v:M[1-9].[0-9]*}" | \ awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3;}' .undef _ld_version .undef _v ${X_}LINKER_FEATURES= .if ${${X_}LINKER_TYPE} != "bfd" || ${${X_}LINKER_VERSION} > 21750 ${X_}LINKER_FEATURES+= build-id .endif +.if ${${X_}LINKER_TYPE} == "bfd" +${X_}LINKER_FEATURES+= filter +.endif .endif .else # Use LD's values X_LINKER_TYPE= ${LINKER_TYPE} X_LINKER_VERSION= ${LINKER_VERSION} X_LINKER_FEATURES= ${LINKER_FEATURES} .endif # ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) # Export the values so sub-makes don't have to look them up again, using the # hash key computed above. .for var in ${_exported_vars} ${var}.${${X_}_ld_hash}:= ${${var}} .export-env ${var}.${${X_}_ld_hash} .undef ${var}.${${X_}_ld_hash} .endfor .endif # ${ld} == "LD" || !empty(XLD) .endfor # .for ld in LD XLD .endif # !target(____) Index: stable/11/share/mk/src.libnames.mk =================================================================== --- stable/11/share/mk/src.libnames.mk (revision 331741) +++ stable/11/share/mk/src.libnames.mk (revision 331742) @@ -1,577 +1,578 @@ # $FreeBSD$ # # The include file define library names suitable # for INTERNALLIB and PRIVATELIB definition .if !target(____) .error src.libnames.mk cannot be included directly. .endif .if !target(____) ____: .include _PRIVATELIBS= \ atf_c \ atf_cxx \ bsdstat \ devdctl \ event \ heimipcc \ heimipcs \ ldns \ sqlite3 \ ssh \ ucl \ unbound _INTERNALLIBS= \ amu \ bsnmptools \ cron \ elftc \ fifolog \ ipf \ lpr \ netbsd \ ntp \ ntpevent \ openbsd \ opts \ parse \ pe \ readline \ sl \ sm \ smdb \ smutil \ telnet \ vers _LIBRARIES= \ ${_PRIVATELIBS} \ ${_INTERNALLIBS} \ ${LOCAL_LIBRARIES} \ 80211 \ alias \ archive \ asn1 \ auditd \ avl \ begemot \ bluetooth \ bsdxml \ bsm \ bsnmp \ bz2 \ c \ c_pic \ calendar \ cam \ casper \ cap_dns \ cap_grp \ cap_pwd \ cap_random \ cap_sysctl \ com_err \ compiler_rt \ crypt \ crypto \ ctf \ cuse \ cxxrt \ devctl \ devdctl \ devinfo \ devstat \ dialog \ + dl \ dpv \ dtrace \ dwarf \ edit \ efivar \ elf \ execinfo \ fetch \ figpar \ geom \ gnuregex \ gpio \ gssapi \ gssapi_krb5 \ hdb \ heimbase \ heimntlm \ heimsqlite \ hx509 \ ipsec \ jail \ kadm5clnt \ kadm5srv \ kafs5 \ kdc \ kiconv \ krb5 \ kvm \ l \ lzma \ m \ magic \ md \ memstat \ mp \ mt \ nandfs \ ncurses \ ncursesw \ netgraph \ ngatm \ nv \ nvpair \ opie \ pam \ panel \ panelw \ pcap \ pcsclite \ pjdlog \ pmc \ proc \ procstat \ pthread \ radius \ readline \ roken \ rpcsec_gss \ rpcsvc \ rt \ rtld_db \ sbuf \ sdp \ sm \ smb \ ssl \ ssp_nonshared \ stdthreads \ supcplusplus \ sysdecode \ tacplus \ termcap \ termcapw \ ufs \ ugidfw \ ulog \ umem \ usb \ usbhid \ util \ uutil \ vmmapi \ wind \ wrap \ xo \ y \ ypclnt \ z \ zfs_core \ zfs \ zpool \ .if ${MK_BLACKLIST} != "no" _LIBRARIES+= \ blacklist \ .endif .if ${MK_OFED} != "no" _LIBRARIES+= \ cxgb4 \ ibcm \ ibcommon \ ibmad \ ibsdp \ ibumad \ ibverbs \ mlx4 \ mthca \ opensm \ osmcomp \ osmvendor \ rdmacm \ .endif # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. _DP_80211= sbuf bsdxml _DP_archive= z bz2 lzma bsdxml .if ${MK_BLACKLIST} != "no" _DP_blacklist+= pthread .endif .if ${MK_OPENSSL} != "no" _DP_archive+= crypto .else _DP_archive+= md .endif _DP_sqlite3= pthread _DP_ssl= crypto _DP_ssh= crypto crypt z .if ${MK_LDNS} != "no" _DP_ssh+= ldns .endif _DP_edit= ncursesw .if ${MK_OPENSSL} != "no" _DP_bsnmp= crypto .endif _DP_geom= bsdxml sbuf _DP_cam= sbuf _DP_kvm= elf _DP_casper= nv _DP_cap_dns= nv _DP_cap_grp= nv _DP_cap_pwd= nv _DP_cap_random= nv _DP_cap_sysctl= nv _DP_pjdlog= util _DP_opie= md _DP_usb= pthread _DP_unbound= ssl crypto pthread _DP_rt= pthread .if ${MK_OPENSSL} == "no" _DP_radius= md .else _DP_radius= crypto .endif _DP_procstat= kvm util elf .if ${MK_CXX} == "yes" .if ${MK_LIBCPLUSPLUS} != "no" _DP_proc= cxxrt .else _DP_proc= supcplusplus .endif .endif .if ${MK_CDDL} != "no" _DP_proc+= ctf .endif _DP_proc+= elf rtld_db util _DP_mp= crypto _DP_memstat= kvm _DP_magic= z _DP_mt= sbuf bsdxml _DP_ldns= crypto .if ${MK_OPENSSL} != "no" _DP_fetch= ssl crypto .else _DP_fetch= md .endif _DP_execinfo= elf _DP_dwarf= elf _DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c _DP_devstat= kvm _DP_pam= radius tacplus opie md util .if ${MK_KERBEROS} != "no" _DP_pam+= krb5 .endif .if ${MK_OPENSSH} != "no" _DP_pam+= ssh .endif .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif _DP_readline= ncursesw _DP_roken= crypt _DP_kadm5clnt= com_err krb5 roken _DP_kadm5srv= com_err hdb krb5 roken _DP_heimntlm= crypto com_err krb5 roken _DP_hx509= asn1 com_err crypto roken wind _DP_hdb= asn1 com_err krb5 roken sqlite3 _DP_asn1= com_err roken _DP_kdc= roken hdb hx509 krb5 heimntlm asn1 crypto _DP_wind= com_err roken _DP_heimbase= pthread _DP_heimipcc= heimbase roken pthread _DP_heimipcs= heimbase roken pthread _DP_kafs5= asn1 krb5 roken _DP_krb5+= asn1 com_err crypt crypto hx509 roken wind heimbase heimipcc _DP_gssapi_krb5+= gssapi krb5 crypto roken asn1 com_err _DP_lzma= pthread _DP_ucl= m _DP_vmmapi= util _DP_ctf= z _DP_dtrace= ctf elf proc pthread rtld_db _DP_xo= util # The libc dependencies are not strictly needed but are defined to make the # assert happy. _DP_c= compiler_rt .if ${MK_SSP} != "no" _DP_c+= ssp_nonshared .endif _DP_stdthreads= pthread _DP_tacplus= md _DP_panel= ncurses _DP_panelw= ncursesw _DP_rpcsec_gss= gssapi _DP_smb= kiconv _DP_ulog= md _DP_fifolog= z _DP_ipf= kvm _DP_zfs= md pthread umem util uutil m nvpair avl bsdxml geom nvpair z \ zfs_core _DP_zfs_core= nvpair _DP_zpool= md pthread z nvpair avl umem .if ${MK_OFED} != "no" _DP_cxgb4= ibverbs pthread _DP_ibcm= ibverbs _DP_ibmad= ibcommon ibumad _DP_ibumad= ibcommon _DP_mlx4= ibverbs pthread _DP_mthca= ibverbs pthread _DP_opensm= pthread _DP_osmcomp= pthread _DP_osmvendor= ibumad opensm osmcomp pthread _DP_rdmacm= ibverbs .endif # Define special cases LDADD_supcplusplus= -lsupc++ LIBATF_C= ${DESTDIR}${LIBDIR_BASE}/libprivateatf-c.a LIBATF_CXX= ${DESTDIR}${LIBDIR_BASE}/libprivateatf-c++.a LDADD_atf_c= -lprivateatf-c LDADD_atf_cxx= -lprivateatf-c++ .for _l in ${_PRIVATELIBS} LIB${_l:tu}?= ${DESTDIR}${LIBDIR_BASE}/libprivate${_l}.a .endfor .for _l in ${_LIBRARIES} .if ${_INTERNALLIBS:M${_l}} LDADD_${_l}_L+= -L${LIB${_l:tu}DIR} .endif DPADD_${_l}?= ${LIB${_l:tu}} .if ${_PRIVATELIBS:M${_l}} LDADD_${_l}?= -lprivate${_l} .else LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l} .endif # Add in all dependencies for static linkage. .if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \ (defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO"))) .for _d in ${_DP_${_l}} DPADD_${_l}+= ${DPADD_${_d}} LDADD_${_l}+= ${LDADD_${_d}} .endfor .endif .endfor # These are special cases where the library is broken and anything that uses # it needs to add more dependencies. Broken usually means that it has a # cyclic dependency and cannot link its own dependencies. This is bad, please # fix the library instead. # Unless the library itself is broken then the proper place to define # dependencies is _DP_* above. # libatf-c++ exposes libatf-c abi hence we need to explicit link to atf_c for # atf_cxx DPADD_atf_cxx+= ${DPADD_atf_c} LDADD_atf_cxx+= ${LDADD_atf_c} # Detect LDADD/DPADD that should be LIBADD, before modifying LDADD here. _BADLDADD= .for _l in ${LDADD:M-l*:N-l*/*:C,^-l,,} .if ${_LIBRARIES:M${_l}} && !${_PRIVATELIBS:M${_l}} _BADLDADD+= ${_l} .endif .endfor .if !empty(_BADLDADD) .error ${.CURDIR}: These libraries should be LIBADD+=foo rather than DPADD/LDADD+=-lfoo: ${_BADLDADD} .endif .for _l in ${LIBADD} DPADD+= ${DPADD_${_l}} LDADD+= ${LDADD_${_l}} .endfor # INTERNALLIB definitions. LIBELFTCDIR= ${OBJTOP}/lib/libelftc LIBELFTC?= ${LIBELFTCDIR}/libelftc.a LIBPEDIR= ${OBJTOP}/lib/libpe LIBPE?= ${LIBPEDIR}/libpe.a LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a LIBSMDIR= ${OBJTOP}/lib/libsm LIBSM?= ${LIBSMDIR}/libsm.a LIBSMDBDIR= ${OBJTOP}/lib/libsmdb LIBSMDB?= ${LIBSMDBDIR}/libsmdb.a LIBSMUTILDIR= ${OBJTOP}/lib/libsmutil LIBSMUTIL?= ${LIBSMUTILDIR}/libsmutil.a LIBNETBSDDIR?= ${OBJTOP}/lib/libnetbsd LIBNETBSD?= ${LIBNETBSDDIR}/libnetbsd.a LIBVERSDIR?= ${OBJTOP}/kerberos5/lib/libvers LIBVERS?= ${LIBVERSDIR}/libvers.a LIBSLDIR= ${OBJTOP}/kerberos5/lib/libsl LIBSL?= ${LIBSLDIR}/libsl.a LIBIPFDIR= ${OBJTOP}/sbin/ipf/libipf LIBIPF?= ${LIBIPFDIR}/libipf.a LIBTELNETDIR= ${OBJTOP}/lib/libtelnet LIBTELNET?= ${LIBTELNETDIR}/libtelnet.a LIBCRONDIR= ${OBJTOP}/usr.sbin/cron/lib LIBCRON?= ${LIBCRONDIR}/libcron.a LIBNTPDIR= ${OBJTOP}/usr.sbin/ntp/libntp LIBNTP?= ${LIBNTPDIR}/libntp.a LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts LIBOPTS?= ${LIBOPTSDIR}/libopts.a LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse LIBPARSE?= ${LIBPARSEDIR}/libparse.a LIBLPRDIR= ${OBJTOP}/usr.sbin/lpr/common_source LIBLPR?= ${LIBLPRDIR}/liblpr.a LIBFIFOLOGDIR= ${OBJTOP}/usr.sbin/fifolog/lib LIBFIFOLOG?= ${LIBFIFOLOGDIR}/libfifolog.a LIBBSNMPTOOLSDIR= ${OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a LIBAMUDIR= ${OBJTOP}/usr.sbin/amd/libamu LIBAMU?= ${LIBAMUDIR}/libamu.a # Define a directory for each library. This is useful for adding -L in when # not using a --sysroot or for meta mode bootstrapping when there is no # Makefile.depend. These are sorted by directory. LIBAVLDIR= ${OBJTOP}/cddl/lib/libavl LIBCTFDIR= ${OBJTOP}/cddl/lib/libctf LIBDTRACEDIR= ${OBJTOP}/cddl/lib/libdtrace LIBNVPAIRDIR= ${OBJTOP}/cddl/lib/libnvpair LIBUMEMDIR= ${OBJTOP}/cddl/lib/libumem LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4 LIBIBCMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcm LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon LIBIBMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibmad LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibumad LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibverbs LIBMLX4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libmlx4 LIBMTHCADIR= ${OBJTOP}/contrib/ofed/usr.lib/libmthca LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libopensm LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp LIBOSMVENDORDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/usr.lib/librdmacm LIBIBSDPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libsdp LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp LIBGNUREGEXDIR= ${OBJTOP}/gnu/lib/libregex LIBSSPDIR= ${OBJTOP}/gnu/lib/libssp LIBSSP_NONSHAREDDIR= ${OBJTOP}/gnu/lib/libssp/libssp_nonshared LIBSUPCPLUSPLUSDIR= ${OBJTOP}/gnu/lib/libsupc++ LIBASN1DIR= ${OBJTOP}/kerberos5/lib/libasn1 LIBGSSAPI_KRB5DIR= ${OBJTOP}/kerberos5/lib/libgssapi_krb5 LIBGSSAPI_NTLMDIR= ${OBJTOP}/kerberos5/lib/libgssapi_ntlm LIBGSSAPI_SPNEGODIR= ${OBJTOP}/kerberos5/lib/libgssapi_spnego LIBHDBDIR= ${OBJTOP}/kerberos5/lib/libhdb LIBHEIMBASEDIR= ${OBJTOP}/kerberos5/lib/libheimbase LIBHEIMIPCCDIR= ${OBJTOP}/kerberos5/lib/libheimipcc LIBHEIMIPCSDIR= ${OBJTOP}/kerberos5/lib/libheimipcs LIBHEIMNTLMDIR= ${OBJTOP}/kerberos5/lib/libheimntlm LIBHX509DIR= ${OBJTOP}/kerberos5/lib/libhx509 LIBKADM5CLNTDIR= ${OBJTOP}/kerberos5/lib/libkadm5clnt LIBKADM5SRVDIR= ${OBJTOP}/kerberos5/lib/libkadm5srv LIBKAFS5DIR= ${OBJTOP}/kerberos5/lib/libkafs5 LIBKDCDIR= ${OBJTOP}/kerberos5/lib/libkdc LIBKRB5DIR= ${OBJTOP}/kerberos5/lib/libkrb5 LIBROKENDIR= ${OBJTOP}/kerberos5/lib/libroken LIBWINDDIR= ${OBJTOP}/kerberos5/lib/libwind LIBATF_CDIR= ${OBJTOP}/lib/atf/libatf-c LIBATF_CXXDIR= ${OBJTOP}/lib/atf/libatf-c++ LIBALIASDIR= ${OBJTOP}/lib/libalias/libalias LIBBLACKLISTDIR= ${OBJTOP}/lib/libblacklist LIBBLOCKSRUNTIMEDIR= ${OBJTOP}/lib/libblocksruntime LIBBSNMPDIR= ${OBJTOP}/lib/libbsnmp/libbsnmp LIBCASPERDIR= ${OBJTOP}/lib/libcasper/libcasper LIBCAP_DNSDIR= ${OBJTOP}/lib/libcasper/services/cap_dns LIBCAP_GRPDIR= ${OBJTOP}/lib/libcasper/services/cap_grp LIBCAP_PWDDIR= ${OBJTOP}/lib/libcasper/services/cap_pwd LIBCAP_RANDOMDIR= ${OBJTOP}/lib/libcasper/services/cap_random LIBCAP_SYSCTLDIR= ${OBJTOP}/lib/libcasper/services/cap_sysctl LIBBSDXMLDIR= ${OBJTOP}/lib/libexpat LIBKVMDIR= ${OBJTOP}/lib/libkvm LIBPTHREADDIR= ${OBJTOP}/lib/libthr LIBMDIR= ${OBJTOP}/lib/msun LIBFORMDIR= ${OBJTOP}/lib/ncurses/form LIBFORMLIBWDIR= ${OBJTOP}/lib/ncurses/formw LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto LIBSSHDIR= ${OBJTOP}/secure/lib/libssh LIBSSLDIR= ${OBJTOP}/secure/lib/libssl LIBTEKENDIR= ${OBJTOP}/sys/teken/libteken LIBEGACYDIR= ${OBJTOP}/tools/build LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib LIBTERMCAPDIR= ${LIBNCURSESDIR} LIBTERMCAPWDIR= ${LIBNCURSESWDIR} # Default other library directories to lib/libNAME. .for lib in ${_LIBRARIES} LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} .endfor # Validate that listed LIBADD are valid. .for _l in ${LIBADD} .if empty(_LIBRARIES:M${_l}) _BADLIBADD+= ${_l} .endif .endfor .if !empty(_BADLIBADD) .error ${.CURDIR}: Invalid LIBADD used which may need to be added to ${_this:T}: ${_BADLIBADD} .endif # Sanity check that libraries are defined here properly when building them. .if defined(LIB) && ${_LIBRARIES:M${LIB}} != "" .if !empty(LIBADD) && \ (!defined(_DP_${LIB}) || ${LIBADD:O:u} != ${_DP_${LIB}:O:u}) .error ${.CURDIR}: Missing or incorrect _DP_${LIB} entry in ${_this:T}. Should match LIBADD for ${LIB} ('${LIBADD}' vs '${_DP_${LIB}}') .endif # Note that OBJTOP is not yet defined here but for the purpose of the check # it is fine as it resolves to the SRC directory. .if !defined(LIB${LIB:tu}DIR) || !exists(${SRCTOP}/${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,}) .error ${.CURDIR}: Missing or incorrect value for LIB${LIB:tu}DIR in ${_this:T}: ${LIB${LIB:tu}DIR:S,^${OBJTOP}/,,} .endif .if ${_INTERNALLIBS:M${LIB}} != "" && !defined(LIB${LIB:tu}) .error ${.CURDIR}: Missing value for LIB${LIB:tu} in ${_this:T}. Likely should be: LIB${LIB:tu}?= $${LIB${LIB:tu}DIR}/lib${LIB}.a .endif .endif .endif # !target(____) Index: stable/11 =================================================================== --- stable/11 (revision 331741) +++ stable/11 (revision 331742) Property changes on: stable/11 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r320872