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