kernel - Intel user/kernel separation MMU bug fix part 2/3
[dragonfly.git] / libexec / rtld-elf / Makefile
blob19f1111779778cbb6e531184156cce7acdac5c23
1 # $FreeBSD$
3 PROG= ld-elf.so.2
4 SRCS= rtld_start.S \
5 reloc.c rtld.c rtld_lock.c rtld_printf.c map_object.c \
6 malloc.c xmalloc.c debug.c libmap.c
7 MAN= rtld.1
8 BINDIR= /libexec
9 SYMLINKS= ${BINDIR}/${PROG} /usr/libexec/${PROG}
10 WARNS?= 2
12 # DO NOT USE -static, this is a special case
13 .undef NOSHARED
15 # To activate LD_DEBUG functionality, define ENABLE_DEBUG
16 # e.g. make -DENABLE_DEBUG
18 # for now do not let the use of -flto
19 .if ${CFLAGS:M-flto}
20 CFLAGS+= -fno-lto
21 LDFLAGS+= -flto
22 .endif
24 CFLAGS+= -DIN_RTLD
25 CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR} -D__thread=
26 CFLAGS+= -I${.CURDIR}/../../lib/csu/common
27 LDFLAGS+= -nostdlib -e .rtld_start -Wl,--no-undefined
28 INSTALLFLAGS= -C -b
29 .ifndef NOFSCHG
30 INSTALLFLAGS+= -fschg
31 .endif
32 MLINKS= rtld.1 ld-elf.so.1.1
33 MLINKS+= rtld.1 ld-elf.so.2.1
34 MLINKS+= rtld.1 _rtld_functrace.3
36 .if !defined(NO_SYMVER)
37 VERSION_DEF= ${.CURDIR}/../../lib/libc/Versions.def
38 SYMBOL_MAPS= ${.CURDIR}/Symbol.map
39 VERSION_MAP= Version.map
40 LDFLAGS+= -Wl,--version-script=${VERSION_MAP}
42 rtld.c: ${VERSION_MAP}
44 .if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map)
45 SYMBOL_MAPS+= ${.CURDIR}/${MACHINE_ARCH}/Symbol.map
46 .endif
47 .endif
49 .if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
50 .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
51 .endif
53 CFLAGS+= -fpic -DPIC
54 LDFLAGS+= -shared -Wl,-Bsymbolic
55 DPADD= ${.OBJDIR}/../../lib/libc_rtld/libc_rtld_pic.a
56 LDADD= -L${.OBJDIR}/../../lib/libc_rtld -lc_rtld_pic
58 .ifdef ENABLE_DEBUG
59 CFLAGS+= -DDEBUG
60 .endif
62 # Since moving rtld-elf to /libexec, we need to create a symlink.
63 # Fixup the existing binary that's there so we can symlink over it.
64 beforeinstall:
65 .if exists(${DESTDIR}/usr/libexec/${PROG})
66 chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
67 .endif
69 .PATH: ${.CURDIR}/${MACHINE_ARCH}
71 .include <bsd.symver.mk>
72 .include <bsd.prog.mk>