1# $FreeBSD$ 2 3WITHOUT_SSP= 4 5.include <bsd.own.mk> 6 7PROG?= ld-elf.so.1 8SRCS= rtld_start.S \ 9 reloc.c rtld.c rtld_lock.c map_object.c \ 10 malloc.c xmalloc.c debug.c libmap.c 11MAN= rtld.1 12CSTD?= gnu99 13CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD 14CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} 15LDFLAGS+= -nostdlib -e .rtld_start 16INSTALLFLAGS= -C -b 17PRECIOUSPROG= 18BINDIR= /libexec 19SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG} 20MLINKS= rtld.1 ld-elf.so.1.1 \ 21 rtld.1 ld.so.1 22 23CFLAGS+= -fpic -DPIC 24LDFLAGS+= -shared -Wl,-Bsymbolic 25DPADD= ${LIBC_PIC} 26LDADD= -lc_pic 27 28.if ${MACHINE_ARCH} != "ia64" 29.if ${MK_SYMVER} == "yes" 30LIBCDIR= ${.CURDIR}/../../lib/libc 31VERSION_DEF= ${LIBCDIR}/Versions.def 32SYMBOL_MAPS= ${.CURDIR}/Symbol.map 33VERSION_MAP= Version.map 34LDFLAGS+= -Wl,--version-script=${VERSION_MAP} 35 36${PROG}: ${VERSION_MAP} 37 38.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map) 39SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map 40.endif 41.endif 42.endif 43 44.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc) 45.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc" 46.endif 47 48# Since moving rtld-elf to /libexec, we need to create a symlink. 49# Fixup the existing binary that's there so we can symlink over it. 50beforeinstall: 51.if exists(${DESTDIR}/usr/libexec/${PROG}) 52 -chflags noschg ${DESTDIR}/usr/libexec/${PROG} 53.endif 54 55.PATH: ${.CURDIR}/${MACHINE_ARCH} 56 57.include <bsd.symver.mk> 58.include <bsd.prog.mk> 59