1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
2000-03-27 16:11:27 +00:00
|
|
|
|
1998-03-07 19:24:35 +00:00
|
|
|
PROG= ld-elf.so.1
|
2003-05-29 22:58:26 +00:00
|
|
|
SRCS= rtld_start.S rtld.c rtld_lock.c map_object.c malloc.c \
|
1999-12-27 04:44:04 +00:00
|
|
|
xmalloc.c debug.c reloc.c
|
2001-03-26 14:22:12 +00:00
|
|
|
MAN= rtld.1
|
2003-06-04 05:42:04 +00:00
|
|
|
CSTD?= gnu99
|
2003-05-29 22:58:26 +00:00
|
|
|
CFLAGS+= -Wall -DFREEBSD_ELF -DIN_RTLD
|
|
|
|
CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
|
1999-04-09 00:28:43 +00:00
|
|
|
LDFLAGS+= -nostdlib -e .rtld_start
|
2001-05-28 16:58:35 +00:00
|
|
|
INSTALLFLAGS= -fschg -C -b
|
2003-08-17 08:06:00 +00:00
|
|
|
BINDIR= /libexec
|
|
|
|
SYMLINKS= ${BINDIR}/ld-elf.so.1 /usr/libexec/ld-elf.so.1
|
2003-02-13 23:07:28 +00:00
|
|
|
MLINKS= rtld.1 ld-elf.so.1.1 \
|
|
|
|
rtld.1 ld.so.1
|
1998-09-04 19:03:57 +00:00
|
|
|
|
2003-04-07 16:21:26 +00:00
|
|
|
#
|
|
|
|
# To enable the libmap.conf functionality please
|
|
|
|
# add 'WITH_LIBMAP=yes' to /etc/make.conf, recompile
|
|
|
|
# and reinstall rtld-elf.
|
|
|
|
.ifdef WITH_LIBMAP
|
|
|
|
CFLAGS+= -DWITH_LIBMAP
|
|
|
|
SRCS+= libmap.c
|
|
|
|
.endif
|
|
|
|
|
1999-04-09 00:28:43 +00:00
|
|
|
.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
|
|
|
|
.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
|
|
|
|
.endif
|
1999-02-15 05:02:54 +00:00
|
|
|
|
1999-04-09 00:28:43 +00:00
|
|
|
# If LDSCRIPT is defined, we build the dynamic linker as an
|
|
|
|
# executable. Otherwise we build it as a shared object. We ignore
|
|
|
|
# LDSCRIPT if the running kernel is too old to support it.
|
|
|
|
.if defined(LDSCRIPT)
|
|
|
|
KERN_OSRELDATE!= /sbin/sysctl -n kern.osreldate 2>/dev/null || echo 0
|
|
|
|
.if ${KERN_OSRELDATE} >= 400001
|
|
|
|
LDSO_IS_EXECUTABLE= yes
|
|
|
|
.endif
|
1998-09-04 19:03:57 +00:00
|
|
|
.endif
|
|
|
|
|
1999-04-09 00:28:43 +00:00
|
|
|
.ifdef LDSO_IS_EXECUTABLE
|
|
|
|
OBJS+= dyn_hack.so
|
|
|
|
LDFLAGS+= -Wl,-T,${LDSCRIPT} -Wl,-E -Wl,-Bstatic
|
2000-03-27 16:11:27 +00:00
|
|
|
DPADD= ${LIBC}
|
|
|
|
LDADD= -lc
|
1999-04-09 00:28:43 +00:00
|
|
|
.else
|
|
|
|
CFLAGS+= -fpic -DPIC
|
|
|
|
LDFLAGS+= -shared -Wl,-Bsymbolic
|
2000-03-27 16:11:27 +00:00
|
|
|
DPADD= ${LIBC_PIC}
|
|
|
|
LDADD= -lc_pic
|
1999-04-09 00:28:43 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
dyn_hack.so:
|
|
|
|
${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
|
1998-03-07 19:24:35 +00:00
|
|
|
|
1998-09-04 19:03:57 +00:00
|
|
|
.PATH: ${.CURDIR}/${MACHINE_ARCH}
|
1998-03-07 19:24:35 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|