diff --git a/libexec/Makefile b/libexec/Makefile index a890115fd15a..f1e99e580e97 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -1,122 +1,126 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ .include +.include + SUBDIR= ${_atf} \ ${_atrun} \ ${_blacklistd-helper} \ ${_comsat} \ ${_dma} \ flua \ getty \ ${_hyperv} \ ${_mail.local} \ ${_makewhatis.local} \ ${_mknetid} \ ${_phttpget} \ ${_pppoed} \ rc \ revnetgroup \ ${_rlogind} \ rpc.rquotad \ rpc.rstatd \ rpc.rusersd \ rpc.rwalld \ rpc.sprayd \ ${_rshd} \ ${_rtld-elf} \ save-entropy \ ${_smrsh} \ ${_tests} \ ${_tftp-proxy} \ ulog-helper \ ${_ypxfr} .if ${MK_AT} != "no" _atrun= atrun .endif .if ${MK_BLACKLIST} != "no" _blacklistd-helper+= blacklistd-helper .endif .if ${MK_BOOTPD} != "no" SUBDIR+= bootpd .endif .if ${MK_FINGER} != "no" SUBDIR+= fingerd .endif .if ${MK_FREEBSD_UPDATE} != "no" _phttpget= phttpget .endif .if ${MK_FTP} != "no" SUBDIR+= ftpd .endif .if ${MK_MAIL} != "no" _comsat= comsat .endif .if ${MK_DMAGENT} != "no" _dma= dma .endif .if ${MK_HYPERV} != "no" _hyperv+= hyperv .endif .if ${MK_NIS} != "no" _mknetid= mknetid _ypxfr= ypxfr .endif .if ${MK_NETGRAPH} != "no" _pppoed= pppoed .endif .if ${MK_PF} != "no" _tftp-proxy= tftp-proxy .endif .if !defined(NO_PIC) && !defined(NO_RTLD) _rtld-elf= rtld-elf -SUBDIR.${MK_LIB32}+= rtld-elf32 +.for LIBCOMPAT libcompat in ${_ALL_LIBCOMPATS_libcompats} +SUBDIR.${MK_LIB${LIBCOMPAT}}+= rtld-elf${libcompat} +.endfor .endif .if ${MK_RBOOTD} != "no" SUBDIR+= rbootd .endif .if ${MK_SENDMAIL} != "no" _mail.local= mail.local _smrsh= smrsh .endif .if ${MK_MAN_UTILS} != "no" _makewhatis.local= makewhatis.local .endif .if ${MK_TALK} != "no" SUBDIR+= talkd .endif .if ${MK_TCP_WRAPPERS} != "no" SUBDIR+= tcpd .endif .if ${MK_TFTP} != "no" SUBDIR+= tftpd .endif .if ${MK_TESTS} != "no" _atf= atf _tests= tests .endif .include .include diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index a132c756723f..5a31ca674a53 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -1,99 +1,103 @@ # $FreeBSD$ # Use the following command to build local debug version of dynamic # linker: # make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all RTLD_ELF_DIR:= ${.PARSEDIR} .include PACKAGE= clibs MK_PIE= no # Always position independent using local rules # Not compatible with sanitizer instrumentation or SSP. MK_ASAN= no MK_SSP= no MK_UBSAN= no +.include + .if !defined(NEED_COMPAT) CONFS= libmap.conf .endif PROG?= ld-elf.so.1 -.if (${PROG:M*ld-elf32*} != "") -TAGS+= lib32 +.for _libcompat in ${_ALL_libcompats} +.if ${PROG:M*ld-elf${_libcompat}[-.]*} != "" +TAGS+= lib${_libcompat} .endif +.endfor SRCS= \ crtbrand.S \ rtld_start.S \ reloc.c \ rtld.c \ rtld_lock.c \ rtld_malloc.c \ rtld_printf.c \ map_object.c \ xmalloc.c \ debug.c \ libmap.c MAN?= rtld.1 ACFLAGS+= -DLOCORE CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding CFLAGS+= -I${SRCTOP}/lib/csu/common .if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH:S/powerpc64le/powerpc64/}) RTLD_ARCH= ${MACHINE_ARCH:S/powerpc64le/powerpc64/} .else RTLD_ARCH= ${MACHINE_CPUARCH} .endif CFLAGS+= -I${RTLD_ELF_DIR}/${RTLD_ARCH} -I${RTLD_ELF_DIR} NO_WCAST_ALIGN= yes INSTALLFLAGS= -C -b PRECIOUSPROG= BINDIR= /libexec SYMLINKS= ../..${BINDIR}/${PROG} ${LIBEXECDIR}/${PROG} MLINKS?= rtld.1 ld-elf.so.1.1 \ rtld.1 ld.so.1 CFLAGS+= -fpic -DPIC $(DEBUG) LDFLAGS+= -shared -Wl,-Bsymbolic -Wl,-z,defs -nostdlib -e ${RTLD_ENTRY} # Pull in the dependencies that we use from libc .include "rtld-libc/Makefile.inc" VERSION_DEF= ${LIBCSRCDIR}/Versions.def SYMBOL_MAPS= ${RTLD_ELF_DIR}/Symbol.map VERSION_MAP= Version.map LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .if exists(${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map) SYMBOL_MAPS+= ${RTLD_ELF_DIR}/${RTLD_ARCH}/Symbol.map .endif .sinclude "${RTLD_ELF_DIR}/${RTLD_ARCH}/Makefile.inc" RTLD_ENTRY?= .rtld_start # Since moving rtld-elf to /libexec, we need to create a symlink. # Fixup the existing binary that's there so we can symlink over it. beforeinstall: .if exists(${DESTDIR}/usr/libexec/${PROG}) && ${MK_STAGING} == "no" -chflags -h noschg ${DESTDIR}/usr/libexec/${PROG} .endif .PATH: ${RTLD_ELF_DIR}/${RTLD_ARCH} ${SRCTOP}/lib/csu/common .if ${.CURDIR} == ${RTLD_ELF_DIR} HAS_TESTS= SUBDIR.${MK_TESTS}+= tests .endif # Some of the required math functions (div & mod) are implemented in # libcompiler_rt on some architectures. LIBADD+= compiler_rt .include ${PROG_FULL}: ${VERSION_MAP} .include .if ${COMPILER_TYPE} == "gcc" # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls .endif