summaryrefslogtreecommitdiffstats
path: root/libexec/rtld-elf/Makefile
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2007-04-03 19:01:06 +0000
committerkan <kan@FreeBSD.org>2007-04-03 19:01:06 +0000
commit98adf88c304eb2eadbd10ec8472a845aeb755736 (patch)
tree8128149729aeb70909229b9d329024aabba0a14d /libexec/rtld-elf/Makefile
parentd6c8ea9c78c51df998f734054595d574676131fa (diff)
downloadFreeBSD-src-98adf88c304eb2eadbd10ec8472a845aeb755736.zip
FreeBSD-src-98adf88c304eb2eadbd10ec8472a845aeb755736.tar.gz
Prepare rtld for symbol versioning. Disable it by default for now.
Diffstat (limited to 'libexec/rtld-elf/Makefile')
-rw-r--r--libexec/rtld-elf/Makefile38
1 files changed, 16 insertions, 22 deletions
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 3179495..fb5bb98 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -16,34 +16,27 @@ SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG}
MLINKS= rtld.1 ld-elf.so.1.1 \
rtld.1 ld.so.1
-.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
-.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
-.endif
-
-# 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=
-.endif
-.endif
-
-.ifdef LDSO_IS_EXECUTABLE
-OBJS+= dyn_hack.so
-LDFLAGS+= -Wl,-T,${LDSCRIPT} -Wl,-E -Wl,-Bstatic
-DPADD= ${LIBC}
-LDADD= -lc
-.else
CFLAGS+= -fpic -DPIC
LDFLAGS+= -shared -Wl,-Bsymbolic
DPADD= ${LIBC_PIC}
LDADD= -lc_pic
+
+.if defined(SYMVER_ENABLED)
+SYMBOL_MAPS= ${.CURDIR}/Symbol.map
+VERSION_DEF= ${.CURDIR}/Versions.def
+VERSION_MAP= Version.map
+LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
+
+${PROG}: ${VERSION_MAP}
+
+.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map)
+SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map
+.endif
.endif
-dyn_hack.so:
- ${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
+.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
+.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
+.endif
# 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.
@@ -54,4 +47,5 @@ beforeinstall:
.PATH: ${.CURDIR}/${MACHINE_ARCH}
+.include <bsd.symver.mk>
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud