head	1.63;
access;
symbols
	RELENG_8_4:1.63.0.2
	RELENG_9_1_0_RELEASE:1.55.2.4.2.2
	RELENG_9_1:1.55.2.4.0.2
	RELENG_9_1_BP:1.55.2.4
	RELENG_8_3_0_RELEASE:1.46.2.1.8.1
	RELENG_8_3:1.46.2.1.0.8
	RELENG_8_3_BP:1.46.2.1
	RELENG_9_0_0_RELEASE:1.55.2.1.2.1
	RELENG_9_0:1.55.2.1.0.2
	RELENG_9_0_BP:1.55.2.1
	RELENG_9:1.55.0.2
	RELENG_9_BP:1.55
	RELENG_7_4_0_RELEASE:1.41.12.1
	RELENG_8_2_0_RELEASE:1.46.2.1.6.1
	RELENG_7_4:1.41.0.12
	RELENG_7_4_BP:1.41
	RELENG_8_2:1.46.2.1.0.6
	RELENG_8_2_BP:1.46.2.1
	RELENG_8_1_0_RELEASE:1.46.2.1.4.1
	RELENG_8_1:1.46.2.1.0.4
	RELENG_8_1_BP:1.46.2.1
	RELENG_7_3_0_RELEASE:1.41.10.1
	RELENG_7_3:1.41.0.10
	RELENG_7_3_BP:1.41
	RELENG_8_0_0_RELEASE:1.46.2.1.2.1
	RELENG_8_0:1.46.2.1.0.2
	RELENG_8_0_BP:1.46.2.1
	RELENG_8:1.46.0.2
	RELENG_8_BP:1.46
	RELENG_7_2_0_RELEASE:1.41.8.1
	RELENG_7_2:1.41.0.8
	RELENG_7_2_BP:1.41
	RELENG_7_1_0_RELEASE:1.41.6.1
	RELENG_6_4_0_RELEASE:1.36.12.1
	RELENG_7_1:1.41.0.6
	RELENG_7_1_BP:1.41
	RELENG_6_4:1.36.0.12
	RELENG_6_4_BP:1.36
	RELENG_7_0_0_RELEASE:1.41
	RELENG_6_3_0_RELEASE:1.36
	RELENG_7_0:1.41.0.4
	RELENG_7_0_BP:1.41
	RELENG_6_3:1.36.0.10
	RELENG_6_3_BP:1.36
	RELENG_7:1.41.0.2
	RELENG_7_BP:1.41
	RELENG_6_2_0_RELEASE:1.36
	RELENG_6_2:1.36.0.8
	RELENG_6_2_BP:1.36
	RELENG_5_5_0_RELEASE:1.31.2.2
	RELENG_5_5:1.31.2.2.0.4
	RELENG_5_5_BP:1.31.2.2
	RELENG_6_1_0_RELEASE:1.36
	RELENG_6_1:1.36.0.6
	RELENG_6_1_BP:1.36
	RELENG_6_0_0_RELEASE:1.36
	RELENG_6_0:1.36.0.4
	RELENG_6_0_BP:1.36
	RELENG_6:1.36.0.2
	RELENG_6_BP:1.36
	RELENG_5_4_0_RELEASE:1.31.2.2
	RELENG_5_4:1.31.2.2.0.2
	RELENG_5_4_BP:1.31.2.2
	RELENG_4_11_0_RELEASE:1.10.2.7
	RELENG_4_11:1.10.2.7.0.4
	RELENG_4_11_BP:1.10.2.7
	RELENG_5_3_0_RELEASE:1.31
	RELENG_5_3:1.31.0.4
	RELENG_5_3_BP:1.31
	RELENG_5:1.31.0.2
	RELENG_5_BP:1.31
	RELENG_4_10_0_RELEASE:1.10.2.7
	RELENG_4_10:1.10.2.7.0.2
	RELENG_4_10_BP:1.10.2.7
	RELENG_5_2_1_RELEASE:1.25
	RELENG_5_2_0_RELEASE:1.25
	RELENG_5_2:1.25.0.2
	RELENG_5_2_BP:1.25
	RELENG_4_9_0_RELEASE:1.10.2.6
	RELENG_4_9:1.10.2.6.0.6
	RELENG_4_9_BP:1.10.2.6
	RELENG_5_1_0_RELEASE:1.19
	RELENG_5_1:1.19.0.2
	RELENG_5_1_BP:1.19
	RELENG_4_8_0_RELEASE:1.10.2.6
	RELENG_4_8:1.10.2.6.0.4
	RELENG_4_8_BP:1.10.2.6
	RELENG_5_0_0_RELEASE:1.16
	RELENG_5_0:1.16.0.2
	RELENG_5_0_BP:1.16
	RELENG_4_7_0_RELEASE:1.10.2.6
	RELENG_4_7:1.10.2.6.0.2
	RELENG_4_7_BP:1.10.2.6
	RELENG_4_6_2_RELEASE:1.10.2.5
	RELENG_4_6_1_RELEASE:1.10.2.5
	RELENG_4_6_0_RELEASE:1.10.2.5
	RELENG_4_6:1.10.2.5.0.6
	RELENG_4_6_BP:1.10.2.5
	RELENG_4_5_0_RELEASE:1.10.2.5
	RELENG_4_5:1.10.2.5.0.4
	RELENG_4_5_BP:1.10.2.5
	RELENG_4_4_0_RELEASE:1.10.2.5
	RELENG_4_4:1.10.2.5.0.2
	RELENG_4_4_BP:1.10.2.5
	RELENG_4_3_0_RELEASE:1.10.2.3
	RELENG_4_3:1.10.2.3.0.2
	RELENG_4_3_BP:1.10.2.3
	RELENG_4_2_0_RELEASE:1.10.2.3
	RELENG_4_1_1_RELEASE:1.10.2.3
	PRE_SMPNG:1.13
	RELENG_4_1_0_RELEASE:1.10.2.3
	RELENG_3_5_0_RELEASE:1.4.2.6
	RELENG_4_0_0_RELEASE:1.10
	RELENG_4:1.10.0.2
	RELENG_4_BP:1.10
	RELENG_3_4_0_RELEASE:1.4.2.5
	RELENG_3_3_0_RELEASE:1.4.2.5
	RELENG_3_2_PAO:1.4.2.3.0.2
	RELENG_3_2_PAO_BP:1.4.2.3
	RELENG_3_2_0_RELEASE:1.4.2.3
	RELENG_3_1_0_RELEASE:1.4
	RELENG_3:1.4.0.2
	RELENG_3_BP:1.4
	RELENG_3_0_0_RELEASE:1.4
	jdp_1_0:1.1.1.1
	JDP:1.1.1;
locks; strict;
comment	@# @;


1.63
date	2013.01.20.00.42.45;	author svnexp;	state Exp;
branches
	1.63.2.1;
next	1.62;

1.62
date	2012.12.04.15.59.08;	author svnexp;	state Exp;
branches;
next	1.61;

1.61
date	2012.12.04.13.35.17;	author svnexp;	state Exp;
branches;
next	1.60;

1.60
date	2012.12.04.13.32.57;	author svnexp;	state Exp;
branches;
next	1.59;

1.59
date	2012.11.17.01.50.11;	author svnexp;	state Exp;
branches;
next	1.58;

1.58
date	2012.03.24.19.14.44;	author kib;	state Exp;
branches;
next	1.57;

1.57
date	2012.03.23.12.10.12;	author kib;	state Exp;
branches;
next	1.56;

1.56
date	2012.03.11.20.03.09;	author kib;	state Exp;
branches;
next	1.55;

1.55
date	2011.08.24.20.05.13;	author kib;	state Exp;
branches
	1.55.2.1;
next	1.54;

1.54
date	2011.06.08.13.23.35;	author nwhitehorn;	state Exp;
branches;
next	1.53;

1.53
date	2010.12.25.08.42.38;	author kib;	state Exp;
branches;
next	1.52;

1.52
date	2010.11.11.22.53.55;	author dim;	state Exp;
branches;
next	1.51;

1.51
date	2010.10.22.04.43.04;	author marcel;	state Exp;
branches;
next	1.50;

1.50
date	2010.08.24.23.19.14;	author nwhitehorn;	state Exp;
branches;
next	1.49;

1.49
date	2010.08.23.22.24.11;	author imp;	state Exp;
branches;
next	1.48;

1.48
date	2010.07.10.17.43.24;	author nwhitehorn;	state Exp;
branches;
next	1.47;

1.47
date	2010.01.02.09.50.19;	author ed;	state Exp;
branches;
next	1.46;

1.46
date	2009.07.14.21.19.13;	author kan;	state Exp;
branches
	1.46.2.1;
next	1.45;

1.45
date	2009.06.29.01.33.59;	author kan;	state Exp;
branches;
next	1.44;

1.44
date	2009.06.28.23.51.39;	author kan;	state Exp;
branches;
next	1.43;

1.43
date	2009.02.21.15.04.31;	author ru;	state Exp;
branches;
next	1.42;

1.42
date	2008.06.25.21.33.28;	author ru;	state Exp;
branches;
next	1.41;

1.41
date	2007.05.16.23.24.15;	author marcel;	state Exp;
branches
	1.41.2.1
	1.41.6.1
	1.41.8.1
	1.41.10.1
	1.41.12.1;
next	1.40;

1.40
date	2007.05.13.14.12.40;	author deischen;	state Exp;
branches;
next	1.39;

1.39
date	2007.04.29.16.12.06;	author kan;	state Exp;
branches;
next	1.38;

1.38
date	2007.04.09.23.00.29;	author kan;	state Exp;
branches;
next	1.37;

1.37
date	2007.04.03.19.01.06;	author kan;	state Exp;
branches;
next	1.36;

1.36
date	2004.11.14.22.18.31;	author ru;	state Exp;
branches
	1.36.2.1
	1.36.12.1;
next	1.35;

1.35
date	2004.11.14.21.14.06;	author schweikh;	state Exp;
branches;
next	1.34;

1.34
date	2004.11.14.12.47.20;	author schweikh;	state Exp;
branches;
next	1.33;

1.33
date	2004.11.03.18.01.19;	author ru;	state Exp;
branches;
next	1.32;

1.32
date	2004.10.24.15.32.34;	author ru;	state Exp;
branches;
next	1.31;

1.31
date	2004.06.17.19.01.53;	author cognet;	state Exp;
branches
	1.31.2.1;
next	1.30;

1.30
date	2004.06.17.17.53.16;	author cognet;	state Exp;
branches;
next	1.29;

1.29
date	2004.05.15.00.13.14;	author cognet;	state Exp;
branches;
next	1.28;

1.28
date	2004.05.14.21.01.52;	author se;	state Exp;
branches;
next	1.27;

1.27
date	2004.05.14.12.15.51;	author cognet;	state Exp;
branches;
next	1.26;

1.26
date	2004.03.21.01.21.26;	author peter;	state Exp;
branches;
next	1.25;

1.25
date	2003.09.13.21.50.35;	author mdodd;	state Exp;
branches;
next	1.24;

1.24
date	2003.08.17.22.12.26;	author gordon;	state Exp;
branches;
next	1.23;

1.23
date	2003.08.17.18.59.30;	author gordon;	state Exp;
branches;
next	1.22;

1.22
date	2003.08.17.18.50.56;	author gordon;	state Exp;
branches;
next	1.21;

1.21
date	2003.08.17.08.06.00;	author gordon;	state Exp;
branches;
next	1.20;

1.20
date	2003.06.04.05.42.04;	author obrien;	state Exp;
branches;
next	1.19;

1.19
date	2003.05.29.22.58.22;	author kan;	state Exp;
branches;
next	1.18;

1.18
date	2003.04.07.16.21.25;	author mdodd;	state Exp;
branches;
next	1.17;

1.17
date	2003.02.13.23.07.28;	author phantom;	state Exp;
branches;
next	1.16;

1.16
date	2002.06.10.21.51.16;	author jdp;	state Exp;
branches;
next	1.15;

1.15
date	2001.05.28.16.58.35;	author ru;	state Exp;
branches;
next	1.14;

1.14
date	2001.03.26.14.22.08;	author ru;	state Exp;
branches;
next	1.13;

1.13
date	2000.07.20.08.00.02;	author green;	state Exp;
branches;
next	1.12;

1.12
date	2000.07.08.03.27.54;	author jdp;	state Exp;
branches;
next	1.11;

1.11
date	2000.03.27.16.11.27;	author bde;	state Exp;
branches;
next	1.10;

1.10
date	2000.01.29.03.16.54;	author jdp;	state Exp;
branches
	1.10.2.1;
next	1.9;

1.9
date	99.12.27.04.44.00;	author jdp;	state Exp;
branches;
next	1.8;

1.8
date	99.08.28.00.10.09;	author peter;	state Exp;
branches;
next	1.7;

1.7
date	99.07.09.16.27.43;	author jdp;	state Exp;
branches;
next	1.6;

1.6
date	99.04.09.00.28.31;	author jdp;	state Exp;
branches;
next	1.5;

1.5
date	99.02.15.05.02.54;	author nate;	state Exp;
branches;
next	1.4;

1.4
date	98.09.04.19.03.57;	author dfr;	state Exp;
branches
	1.4.2.1;
next	1.3;

1.3
date	98.08.17.04.59.15;	author jdp;	state Exp;
branches;
next	1.2;

1.2
date	98.04.30.07.47.58;	author dfr;	state Exp;
branches;
next	1.1;

1.1
date	98.03.07.19.24.35;	author jdp;	state Exp;
branches
	1.1.1.1;
next	;

1.63.2.1
date	2013.01.20.00.42.45;	author svnexp;	state dead;
branches;
next	1.63.2.2;

1.63.2.2
date	2013.03.28.13.03.26;	author svnexp;	state Exp;
branches;
next	;

1.55.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.55.2.1.2.1;
next	1.55.2.2;

1.55.2.2
date	2012.03.30.09.34.19;	author kib;	state Exp;
branches;
next	1.55.2.3;

1.55.2.3
date	2012.04.06.04.30.22;	author kib;	state Exp;
branches;
next	1.55.2.4;

1.55.2.4
date	2012.04.07.05.43.50;	author kib;	state Exp;
branches
	1.55.2.4.2.1;
next	1.55.2.5;

1.55.2.5
date	2012.11.17.11.36.28;	author svnexp;	state Exp;
branches;
next	;

1.55.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.55.2.1.2.2;

1.55.2.1.2.2
date	2012.11.17.08.36.29;	author svnexp;	state Exp;
branches;
next	;

1.55.2.4.2.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.55.2.4.2.2;

1.55.2.4.2.2
date	2012.11.17.08.47.18;	author svnexp;	state Exp;
branches;
next	;

1.46.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.46.2.1.2.1
	1.46.2.1.4.1
	1.46.2.1.6.1
	1.46.2.1.8.1;
next	1.46.2.2;

1.46.2.2
date	2012.11.17.10.36.13;	author svnexp;	state Exp;
branches;
next	;

1.46.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.46.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.46.2.1.6.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.46.2.1.8.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.46.2.1.8.2;

1.46.2.1.8.2
date	2012.11.17.08.24.53;	author svnexp;	state Exp;
branches;
next	;

1.41.2.1
date	2012.11.17.08.03.18;	author svnexp;	state Exp;
branches;
next	;

1.41.6.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.41.8.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.41.10.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.41.12.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.41.12.2;

1.41.12.2
date	2012.11.17.08.16.52;	author svnexp;	state Exp;
branches;
next	;

1.36.2.1
date	2012.11.17.07.40.56;	author svnexp;	state Exp;
branches;
next	;

1.36.12.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.31.2.1
date	2004.11.21.10.34.59;	author schweikh;	state Exp;
branches;
next	1.31.2.2;

1.31.2.2
date	2005.02.13.07.23.15;	author obrien;	state Exp;
branches;
next	;

1.10.2.1
date	2000.07.08.10.01.43;	author obrien;	state Exp;
branches;
next	1.10.2.2;

1.10.2.2
date	2000.07.12.02.14.47;	author jdp;	state Exp;
branches;
next	1.10.2.3;

1.10.2.3
date	2000.07.20.11.16.05;	author obrien;	state Exp;
branches;
next	1.10.2.4;

1.10.2.4
date	2001.04.25.10.41.01;	author ru;	state Exp;
branches;
next	1.10.2.5;

1.10.2.5
date	2001.08.08.07.44.29;	author ru;	state Exp;
branches;
next	1.10.2.6;

1.10.2.6
date	2002.06.22.17.03.13;	author jdp;	state Exp;
branches;
next	1.10.2.7;

1.10.2.7
date	2004.02.03.21.04.16;	author fjoe;	state Exp;
branches;
next	1.10.2.8;

1.10.2.8
date	2012.11.17.07.24.13;	author svnexp;	state Exp;
branches;
next	;

1.4.2.1
date	99.03.24.23.39.14;	author nate;	state Exp;
branches;
next	1.4.2.2;

1.4.2.2
date	99.04.28.01.18.59;	author jdp;	state Exp;
branches;
next	1.4.2.3;

1.4.2.3
date	99.05.02.09.35.56;	author brian;	state Exp;
branches;
next	1.4.2.4;

1.4.2.4
date	99.08.22.17.20.50;	author jdp;	state Exp;
branches;
next	1.4.2.5;

1.4.2.5
date	99.08.29.15.04.07;	author peter;	state Exp;
branches;
next	1.4.2.6;

1.4.2.6
date	2000.01.21.02.31.49;	author jdp;	state Exp;
branches;
next	;

1.1.1.1
date	98.03.07.19.24.35;	author jdp;	state Exp;
branches;
next	;


desc
@@


1.63
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/245653
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@# $FreeBSD: head/libexec/rtld-elf/Makefile 245653 2013-01-19 04:34:33Z andrew $

.include <bsd.own.mk>
MK_SSP=		no

PROG?=		ld-elf.so.1
SRCS=		rtld_start.S \
		reloc.c rtld.c rtld_lock.c rtld_printf.c map_object.c \
		malloc.c xmalloc.c debug.c libmap.c
MAN=		rtld.1
CSTD?=		gnu99
TOPSRCDIR=	${.CURDIR}/../..
CFLAGS+=	-Wall -DFREEBSD_ELF -DIN_RTLD
CFLAGS+=	-I${TOPSRCDIR}/lib/csu/common
.if exists(${.CURDIR}/${MACHINE_ARCH})
RTLD_ARCH=	${MACHINE_ARCH}
.else
RTLD_ARCH=	${MACHINE_CPUARCH}
.endif
CFLAGS+=	-I${.CURDIR}/${RTLD_ARCH} -I${.CURDIR}
.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+=	-mcall-aixdesc
LDFLAGS+=	-nostdlib -e _rtld_start
.else
LDFLAGS+=	-nostdlib -e .rtld_start
.endif
WARNS?=		2
INSTALLFLAGS=	-C -b
PRECIOUSPROG=
BINDIR=		/libexec
SYMLINKS=	${BINDIR}/${PROG} /usr/libexec/${PROG}
MLINKS=		rtld.1 ld-elf.so.1.1 \
		rtld.1 ld.so.1

.if ${MACHINE_CPUARCH} == "sparc64"
CFLAGS+=	-fPIC
.else
CFLAGS+=	-fpic
.endif
CFLAGS+=	-DPIC $(DEBUG)
LDFLAGS+=	-shared -Wl,-Bsymbolic
DPADD=		${LIBC_PIC}
LDADD=		-lc_pic

.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no"
# Some of the required math functions (div & mod) are implemented in libgcc
# on ARM. The library also needs to be placed first to be correctly linked.
# As some of the functions are used before we have shared libraries.
DPADD+=		${LIBGCC}
LDADD+=		-lgcc
.endif



.if ${MK_SYMVER} == "yes"
LIBCDIR=	${TOPSRCDIR}/lib/libc
VERSION_DEF=	${LIBCDIR}/Versions.def
SYMBOL_MAPS=	${.CURDIR}/Symbol.map
VERSION_MAP=	Version.map
LDFLAGS+=	-Wl,--version-script=${VERSION_MAP}

${PROG}:	${VERSION_MAP}

.if exists(${.CURDIR}/${RTLD_ARCH}/Symbol.map)
SYMBOL_MAPS+=	${.CURDIR}/${RTLD_ARCH}/Symbol.map
.endif
.endif

.sinclude "${.CURDIR}/${RTLD_ARCH}/Makefile.inc"

# 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.
beforeinstall:
.if exists(${DESTDIR}/usr/libexec/${PROG})
	-chflags -h noschg ${DESTDIR}/usr/libexec/${PROG}
.endif

.PATH: ${.CURDIR}/${RTLD_ARCH}

.include <bsd.symver.mk>
.include <bsd.prog.mk>
@


1.63.2.1
log
@file Makefile was added on branch RELENG_8_4 on 2013-03-28 13:03:26 +0000
@
text
@d1 81
@


1.63.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 57
# $FreeBSD: releng/8.4/libexec/rtld-elf/Makefile 195697 2009-07-14 21:19:13Z kan $

.include <bsd.own.mk>
MK_SSP=		no

PROG?=		ld-elf.so.1
SRCS=		rtld_start.S \
		reloc.c rtld.c rtld_lock.c map_object.c \
		malloc.c xmalloc.c debug.c libmap.c
MAN=		rtld.1
CSTD?=		gnu99
CFLAGS+=	-Wall -DFREEBSD_ELF -DIN_RTLD
CFLAGS+=	-I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
LDFLAGS+=	-nostdlib -e .rtld_start
INSTALLFLAGS=	-C -b
PRECIOUSPROG=
BINDIR=		/libexec
SYMLINKS=	${BINDIR}/${PROG} /usr/libexec/${PROG}
MLINKS=		rtld.1 ld-elf.so.1.1 \
		rtld.1 ld.so.1

CFLAGS+=	-fpic -DPIC
LDFLAGS+=	-shared -Wl,-Bsymbolic
DPADD=		${LIBC_PIC}
LDADD=		-lc_pic -lssp_nonshared

.if ${MACHINE_ARCH} != "ia64"
.if ${MK_SYMVER} == "yes"
LIBCDIR=	${.CURDIR}/../../lib/libc
VERSION_DEF=	${LIBCDIR}/Versions.def
SYMBOL_MAPS=	${.CURDIR}/Symbol.map
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
.endif

.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.
beforeinstall:
.if exists(${DESTDIR}/usr/libexec/${PROG})
	-chflags noschg ${DESTDIR}/usr/libexec/${PROG}
.endif

.PATH: ${.CURDIR}/${MACHINE_ARCH}

.include <bsd.symver.mk>
.include <bsd.prog.mk>
@


1.62
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/243864
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/libexec/rtld-elf/Makefile 243864 2012-12-04 14:36:01Z pjd $
d45 10
@


1.61
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/243862
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/libexec/rtld-elf/Makefile 243862 2012-12-04 12:51:33Z pjd $
d31 1
a31 1
SYMLINKS=	../..${BINDIR}/${PROG} /usr/libexec/${PROG}
d65 1
a65 1
	-chflags noschg ${DESTDIR}/usr/libexec/${PROG}
@


1.60
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/243861
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d1 1
a1 1
# $FreeBSD: head/libexec/rtld-elf/Makefile 243861 2012-12-04 12:39:26Z pjd $
d30 2
a31 2
BINDIR=		../../libexec
SYMLINKS=	${BINDIR}/${PROG} /usr/libexec/${PROG}
@


1.59
log
@Switching exporter and resync
@
text
@d1 1
a1 1
# $FreeBSD: head/libexec/rtld-elf/Makefile 233431 2012-03-24 19:14:44Z kib $
d30 1
a30 1
BINDIR=		/libexec
@


1.58
log
@SVN rev 233431 on 2012-03-24 19:14:44Z by kib

Remove libssp_nonshared from the rtld linking set. The only use for the
library was definition for the weak alias of __stack_chk_fail.

No objections from:	kan
MFC after:	2 weeks
@
text
@d1 1
a1 1
# $FreeBSD$
@


1.57
log
@SVN rev 233360 on 2012-03-23 12:10:12Z by kib

Centralize the calculation of the top source directory.  This
simplifies the build of rtld with partial checkout, allowing to
override only one place to reference other tree.

Submitted by:	bde
MFC after:	2 weeks
@
text
@d43 1
a43 1
LDADD=		-lc_pic -lssp_nonshared
@


1.56
log
@SVN rev 232831 on 2012-03-11 20:03:09Z by kib

Add support for preinit, init and fini arrays.  Some ABIs, in
particular on ARM, do require working init arrays.

Traditional FreeBSD crt1 calls _init and _fini of the binary, instead
of allowing runtime linker to arrange the calls.  This was probably
done to have the same crt code serve both statically and dynamically
linked binaries.  Since ABI mandates that first is called preinit
array functions, then init, and then init array functions, the init
have to be called from rtld now.

To provide binary compatibility to old FreeBSD crt1, which calls _init
itself, rtld only calls intializers and finalizers for main binary if
binary has a note indicating that new crt was used for linking.  Add
parsing of ELF notes to rtld, and cache p_osrel value since we parsed
it anyway.

The patch is inspired by init_array support for DragonflyBSD, written
by John Marino.

Reviewed by:	kan
Tested by:	andrew (arm, previous version), flo (sparc64, previous version)
MFC after:	3 weeks
@
text
@d12 1
d14 1
a14 1
CFLAGS+=	-I${.CURDIR}/../../lib/csu/common
d46 1
a46 1
LIBCDIR=	${.CURDIR}/../../lib/libc
@


1.55
log
@SVN rev 225152 on 2011-08-24 20:05:13Z by kib

Rtld links with the specially built pic static libc library to get some
C runtime services, like printf(). Unfortunately, the multithread-safeness
measures in the libc do not work in rtld environment.

Rip the kernel printf() implementation and use it in the rtld instead of
libc version. This printf does not require any shared global data and thus
is mt-safe. Systematically use rtld_printf() and related functions, remove
the calls to err(3).

Note that stdio is still pulled from libc due to libmap implementaion using
fopen(). This is safe but unoptimal, and can be changed later.

Reported and tested by:	pgj
Diagnosed and reviewed by:	kan (previous version)
Approved by:	re (bz)
@
text
@d13 1
@


1.55.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.55.2.2
log
@SVN rev 233694 on 2012-03-30 09:34:19Z by kib

MFC r232831:
Add support for preinit, init and fini arrays to rtld.
Only binaries marked with proper ABI note gets array ctr/dtrs called.

MFC r232856:
When iterating over the dso program headers, the object is not initialized
yet, and object segments are not yet mapped.  Only parse the notes that
appear in the first page of the dso (as it should be anyway), and use
the preloaded page content.

MFC r232857 (by dim):
Fix a warning/error with clang.

MFC r232859 (by dim):
Amend r232857, now dropping the casts entirely, as they were not
necessary at all.
@
text
@a12 1
CFLAGS+=	-I${.CURDIR}/../../lib/csu/common
@


1.55.2.3
log
@SVN rev 233934 on 2012-04-06 04:30:22Z by kib

MFC r233360:
Centralize the calculation of the top source directory.
@
text
@a11 1
TOPSRCDIR=	${.CURDIR}/../..
d13 1
a13 1
CFLAGS+=	-I${TOPSRCDIR}/lib/csu/common
d45 1
a45 1
LIBCDIR=	${TOPSRCDIR}/lib/libc
@


1.55.2.4
log
@SVN rev 233987 on 2012-04-07 05:43:50Z by kib

MFC r233431:
Remove libssp_nonshared from the rtld linking set. The only use for the
library was definition for the weak alias of __stack_chk_fail.
@
text
@d43 1
a43 1
LDADD=		-lc_pic
@


1.55.2.5
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/9/libexec/rtld-elf/Makefile 233987 2012-04-07 05:43:50Z kib $
@


1.55.2.4.2.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.55.2.4.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.1/libexec/rtld-elf/Makefile 233987 2012-04-07 05:43:50Z kib $
@


1.55.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.55.2.1.2.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/9.0/libexec/rtld-elf/Makefile 225152 2011-08-24 20:05:13Z kib $
@


1.54
log
@SVN rev 222859 on 2011-06-08 13:23:35Z by nwhitehorn

Compile RTLD with global dot symbols on 64-bit PowerPC, as a crutch for
GDB's ability to locate r_debug_state (which is actually the only function
that need be compiled this way).
@
text
@d8 1
a8 1
		reloc.c rtld.c rtld_lock.c map_object.c \
@


1.53
log
@SVN rev 216694 on 2010-12-25 08:42:38Z by kib

Add a hook to pass debug flags to the build of rtld when doing make in
the rtld directory.

Reviewed by:	kan
@
text
@d20 1
@


1.52
log
@SVN rev 215148 on 2010-11-11 22:53:55Z by dim

Use -fPIC to build libexec/rtld-elf on sparc64, so it will also be able
to link with newer binutils, without overflowing the GOT.

Obtained from:	projects/binutils-2.17
@
text
@d37 1
a37 1
CFLAGS+=	-DPIC
@


1.51
log
@SVN rev 214194 on 2010-10-22 04:43:04Z by marcel

Unbreak ia64.

With r169630 I disabled symbol versioning because it broke rtld.  With
r211706 rtld got broken for ia64 & powerpc64.  It was fixed for powerpc64
with r212497.  In between, r211749 removed the exports table because the
version script handled the exports.  But wait, symbol versioning was
disabled on ia64.

With exports controlled by the version script and symbol versioning
disabled, all symbols are exported and too many symbols bind to the
definition in rtld. Let's just say that waird things happen.

So, enable symbol versioning on ia64 and apply a work-around for the
SIGSEGV that triggered r169630 to begin with: when rtld relocates
itself, it comes across r_debug_state and for some reason can't find the
definition. This causes a failure, relocation aborts and null pointers
galore. The work-around is to ignore the missing definition when rtld
is relocating itself and keep going.

Maybe with the next binutils this will all go away. Maybe not, in
which case I still need to figure out why r_debug_state cannot be found.

BTW: r_debug_state is in the symbol map -- I don't think any other rtld
symbols that rtld references are in the symbol map...
@
text
@d32 6
a37 1
CFLAGS+=	-fpic -DPIC
@


1.50
log
@SVN rev 211785 on 2010-08-24 23:19:14Z by nwhitehorn

Make RTLD work on powerpc64 again. If there is a sub-directory named
MACHINE_ARCH, use that specific one, otherwise use MACHINE_CPUARCH.

Reviewed by:	imp
@
text
@a36 1
.if ${MACHINE_CPUARCH} != "ia64"
a49 1
.endif
@


1.49
log
@SVN rev 211725 on 2010-08-23 22:24:11Z by imp

MFtbemd:

Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want
to test of all the CPUs of a given family conform.
@
text
@d13 6
a18 1
CFLAGS+=	-I${.CURDIR}/${MACHINE_CPUARCH} -I${.CURDIR}
d47 2
a48 2
.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map)
SYMBOL_MAPS+=	${.CURDIR}/${MACHINE_CPUARCH}/Symbol.map
d53 1
a53 3
.if exists(${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc)
.include "${.CURDIR}/${MACHINE_CPUARCH}/Makefile.inc"
.endif
d62 1
a62 1
.PATH: ${.CURDIR}/${MACHINE_CPUARCH}
@


1.48
log
@SVN rev 209885 on 2010-07-10 17:43:24Z by nwhitehorn

RTLD support for powerpc64. A few small modifications to the Makefile
and symbol map are required to support various consequences of the dot
symbol scheme:

- Symbols beginning with a dot are reserved, so start private symbols with
  an underscore.
- In order to set RTLD breakpoints, gdb must be able to locate the text
  entry point, not the data section function descriptor, so add
  .r_debug_state to the symbol map on powerpc64.

Obtained from:	projects/ppc64
@
text
@d13 1
a13 1
CFLAGS+=	-I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
d32 1
a32 1
.if ${MACHINE_ARCH} != "ia64"
d42 2
a43 2
.if exists(${.CURDIR}/${MACHINE_ARCH}/Symbol.map)
SYMBOL_MAPS+=	${.CURDIR}/${MACHINE_ARCH}/Symbol.map
d48 2
a49 2
.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
d59 1
a59 1
.PATH: ${.CURDIR}/${MACHINE_ARCH}
@


1.47
log
@SVN rev 201380 on 2010-01-02 09:50:19Z by ed

Make WARNS=6 the default for libexec/.

Just like bin/ and sbin/, I think setting WARNS to the highest value
possible will make it more attractive for people to fix warnings.

- The WARNS variable is set in the Makefile in the directory of the
  application itself, making it more likely that it will be removed out
  of curiosity to see what happens.
- New applications will most likely build with WARNS=6 out of the box,
  because the author would more likely fix the warnings during
  development than lower WARNS.

Unfortunately almost all apps in libexec require a lowered value of
WARNS.
@
text
@d14 3
d18 1
@


1.46
log
@SVN rev 195697 on 2009-07-14 21:19:13Z by kan

Second attempt at eliminating .text relocations in shared libraries
compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC
generates local calls to this function which result in absolute
relocations put into position-independent code segment, making dynamic
loader do extra work every time given shared library is being relocated
and making affected text pages non-shareable.

Reviewed by:        kib
Approved by:        re (kib)
@
text
@d15 1
@


1.46.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.46.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d1 1
a1 1
# $FreeBSD: stable/8/libexec/rtld-elf/Makefile 195697 2009-07-14 21:19:13Z kan $
@


1.46.2.1.8.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.46.2.1.8.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/8.3/libexec/rtld-elf/Makefile 195697 2009-07-14 21:19:13Z kan $
@


1.46.2.1.6.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.46.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.46.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.45
log
@SVN rev 195152 on 2009-06-29 01:33:59Z by kan

Back out previous revision until better tested fix is ready.

Approved by: re (impliciti, by approving previos check-in)
@
text
@d25 1
a25 1
LDADD=		-lc_pic
@


1.44
log
@SVN rev 195151 on 2009-06-28 23:51:39Z by kan

Eliminate .text relocations in shared libraries compiled with stack protector.

Use libssp_nonshared library to pull __stack_chk_fail_local symbol into
each library that needs it instead of pulling it from libc. GCC generates
local calls to this function which result in absolute relocations put into
position-independent code segment, making dynamic loader do extra work everys
time given shared library is being relocated and making affected text pages
non-shareable.

Reviewed by:        kib
Approved by:        re (kensmith)
@
text
@d25 1
a25 1
LDADD=		-lc_pic -lssp_nonshared
@


1.43
log
@SVN rev 188895 on 2009-02-21 15:04:31Z by ru

Fix build when WITH_SSP is set explicitly.

Submitted by:	Jeremie Le Hen
@
text
@d25 1
a25 1
LDADD=		-lc_pic
@


1.42
log
@SVN rev 180012 on 2008-06-25 21:33:28Z by ru

Enable GCC stack protection (aka Propolice) for userland:
- It is opt-out for now so as to give it maximum testing, but it may be
  turned opt-in for stable branches depending on the consensus.  You
  can turn it off with WITHOUT_SSP.
- WITHOUT_SSP was previously used to disable the build of GNU libssp.
  It is harmless to steal the knob as SSP symbols have been provided
  by libc for a long time, GNU libssp should not have been much used.
- SSP is disabled in a few corners such as system bootstrap programs
  (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves.
- It should be safe to use -fstack-protector-all to build world, however
  libc will be automatically downgraded to -fstack-protector because it
  breaks rtld otherwise.
- This option is unavailable on ia64.

Enable GCC stack protection (aka Propolice) for kernel:
- It is opt-out for now so as to give it maximum testing.
- Do not compile your kernel with -fstack-protector-all, it won't work.

Submitted by:	Jeremie Le Hen <jeremie@@le-hen.org>
@
text
@a2 2
WITHOUT_SSP=

d4 1
@


1.41
log
@Don't enable symbol versioning on ia64 for now. It causes
symbol lookup failures that later result in null-pointer
dereferences. This needs looking into, but since we're
close to release it's possible that it's not resolved before
that time.
@
text
@d3 2
@


1.41.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/7/libexec/rtld-elf/Makefile 169630 2007-05-16 23:24:15Z marcel $
@


1.41.12.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.41.12.2
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: releng/7.4/libexec/rtld-elf/Makefile 169630 2007-05-16 23:24:15Z marcel $
@


1.41.10.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.41.8.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.41.6.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.40
log
@Enable symbol versioning by default.  Use WITHOUT_SYMVER to disable it.
Warning, after symbol versioning is enabled, going back is not easy
(use WITHOUT_SYMVER at your own risk).

Change the default thread library to libthr.

There most likely still needs to be a version bump for at least the
thread libraries.  If necessary, this will happen later.
@
text
@d26 1
d40 1
@


1.39
log
@Retire rtld-specific Versions.def. Symbols exported by rtld are supposed
to override weak symbols exported by libc, so by definition these two
are using the same symbol version names.

Reflect the reality by referring to libc's Versions.def directly.
@
text
@d3 2
d26 1
a26 1
.if defined(SYMVER_ENABLED)
@


1.38
log
@Bring rtld exports in line with corresponding symbols exported from
libc.

Disable SYMVER_DEFAULT n rtld until its implications are understood
better.
@
text
@d24 3
a26 1
.if defined(SYMVER_ENABLED) && 0
a27 1
VERSION_DEF=	${.CURDIR}/Versions.def
@


1.37
log
@Prepare rtld for symbol versioning. Disable it by default for now.
@
text
@d24 1
a24 1
.if defined(SYMVER_ENABLED)
@


1.36
log
@So do it like we do in usr.bin/tip/tip/Makefile.  ;)
@
text
@a18 20
.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
d23 12
d37 3
a39 2
dyn_hack.so:
	${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
d50 1
@


1.36.2.1
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/6/libexec/rtld-elf/Makefile 137705 2004-11-14 22:18:31Z ru $
@


1.36.12.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.35
log
@Revert previous commit. As ru explains:

 In the old world (as the surrounding comment in makefile says), there
 was the /usr/libexec/ld-elf.so.1 binary which is now a symlink to
 /libexec/ld-elf.so.1. To symlink, we need to make sure that the
 _target_ (and the target is /usr/libexec/ld-elf.so.1) doesn't have
 "schg" flag set. A real solution is to protect the chflags call only if
 target exists, like we do in usr.bin/tip/tip/Makefile.

Requested by:	ru
@
text
@d51 1
d53 1
@


1.34
log
@Avoid an (ignored) error by invoking chflags on the link target, not the
symlink.

PR:		kern/73016
Submitted by:	John E. Hein <jhein@@timing.com>
MFC after:	1 week
@
text
@d51 1
a51 1
	-chflags noschg ${DESTDIR}/${BINDIR}/${PROG}
@


1.33
log
@Introduce the PRECIOUSPROG knob in bsd.prog.mk, similar
to PRECIOUSLIB from bsd.lib.mk.  The side effect of this
is making installing the world under jail(8) possible by
using another knob, NOFSCHG.

Reviewed by:	oliver
@
text
@d51 1
a51 1
	-chflags noschg ${DESTDIR}/usr/libexec/${PROG}
@


1.32
log
@For variables that are only checked with defined(), don't provide
any fake value.
@
text
@d12 2
a13 1
INSTALLFLAGS=	-fschg -C -b
@


1.31
log
@This comment should have been removed in the previous commit.

Spotted out by: marcus, simon
@
text
@d28 1
a28 1
LDSO_IS_EXECUTABLE=	yes
@


1.31.2.1
log
@MFC: test file existence before attempting chflags

PR:		kern/73016
Submitted by:	John E. Hein <jhein@@timing.com>
@
text
@a49 1
.if exists(${DESTDIR}/usr/libexec/${PROG})
a50 1
.endif
@


1.31.2.2
log
@MFC: For variables that are only checked with defined(), don't provide
     any fake value.
@
text
@d28 1
a28 1
LDSO_IS_EXECUTABLE=
@


1.30
log
@Woohoo !
the latest binutils import mades this gross hack useless, so just remove it.
@
text
@a3 1
# XXX: Hopefully this won't be needed after the next binutils import.
@


1.29
log
@Work around a problem somewhere with binutils (?) on arm, hopefully without
breaking any other arch this time.
@
text
@a4 1
.if ${MACHINE_ARCH} != "arm"
a7 1
.endif
@


1.28
log
@Fix breakage caused by alphabetically sorting SRCS: rtld_start.S must come first!
The previous version made all shared binaries dump core.
@
text
@d4 2
d9 1
@


1.27
log
@Import arm bits for rtld-elf.

Obtained from:	NetBSD
@
text
@d4 2
a5 1
SRCS=		reloc.c rtld.c rtld_start.S rtld_lock.c map_object.c \
@


1.26
log
@Add initial support for compiling a special 32 bit version of
ld-elf.so.1 on 64 bit systems.  Most of this involves using alternate
paths, environment variables and diagnostic messages.

The build glue is seperate.
@
text
@d4 2
a5 2
SRCS=		rtld_start.S rtld.c rtld_lock.c map_object.c malloc.c \
		xmalloc.c debug.c reloc.c libmap.c
@


1.25
log
@Retire the WITH_LIBMAP compile knob; libmap is now a standard feature.
@
text
@d3 1
a3 1
PROG=		ld-elf.so.1
@


1.24
log
@Forgot one instance of ld-elf.so.1. Convert to ${PROG}

Pointed out by:	obrien
@
text
@d5 1
a5 1
		xmalloc.c debug.c reloc.c
a15 9

#
# 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
@


1.23
log
@Don't forget to honor DESTDIR. Also switch over to using PROG instead of
the binary name directly.
@
text
@d13 1
a13 1
SYMLINKS=	${BINDIR}/ld-elf.so.1 /usr/libexec/${PROG}
@


1.22
log
@Don't forget to chflags noschg the existing binary so we can symlink
over it safely.

Pointed out by:	yosimoto@@waishi.jp
@
text
@d13 1
a13 1
SYMLINKS=	${BINDIR}/ld-elf.so.1 /usr/libexec/ld-elf.so.1
d58 1
a58 1
	-chflags noschg /usr/libexec/ld-elf.so.1
@


1.21
log
@As long threatened, stage 2 of making a dynamically-linked root a reality.
Install rtld into /libexec.
@
text
@d55 5
@


1.20
log
@Set CSTD to gnu99.	We can only use on of the gnu?9 C languages.
We can't use c89 due to use of 'inline', and c99 produces bad code.
@
text
@d12 2
@


1.19
log
@Allow threading libraries to register their own locking
implementation in case default one provided by rtld is
not suitable.

Consolidate various identical MD lock implementation into
a single file using appropriate machine/atomic.h.

Approved by:	re (scottl)
@
text
@d7 1
@


1.18
log
@Dynamic object dependency mapping: libmap.

This is an optional feature, disabled by default.

This will be useful to people testing the various POSIX threading
libraries under -CURRENT but can easily serve other needs.
@
text
@d4 1
a4 1
SRCS=		rtld_start.S rtld.c lockdflt.c map_object.c malloc.c \
d7 2
a8 1
CFLAGS+=	-Wall -DFREEBSD_ELF -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
@


1.17
log
@Advertize rtld(1) as ld.so(1) in manual pages world
@
text
@d13 9
@


1.16
log
@Dillon's recent commits to the dynamic linker without running them
by me first have given me a good excuse to drop my MAINTAINERship.

MFC after:	1 week
@
text
@d10 2
a11 1
MLINKS=		rtld.1 ld-elf.so.1.1
@


1.15
log
@Use new backup feature of install(1).
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.14 2001/03/26 14:22:08 ru Exp $
a2 1
MAINTAINER=	jdp
@


1.14
log
@- Backout botched attempt to intoduce MANSECT feature.
- MAN[1-9] -> MAN.
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.13 2000/07/20 08:00:02 green Exp $
d10 1
a10 1
INSTALLFLAGS+=	-fschg -C
a44 13

# Keep the previous version of the dynamic linker for recovery
# purposes.  This must come after the include of <bsd.prog.mk> so that
# BINDIR is set for the exists(...) constructs.
beforeinstall:
.if exists(${DESTDIR}${BINDIR}/${PROG})
	-chflags noschg ${DESTDIR}${BINDIR}/${PROG}
.if exists(${DESTDIR}${BINDIR}/${PROG}.old)
	-chflags noschg ${DESTDIR}${BINDIR}/${PROG}.old
.endif
	${INSTALL} -C -p ${DESTDIR}${BINDIR}/${PROG} \
	    ${DESTDIR}${BINDIR}/${PROG}.old
.endif
@


1.13
log
@We shouldn't use cp to save the old ld-elf.so.1.  Use the sanctioned tool
${INSTALL} with -C -p instead.
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.12 2000/07/08 03:27:54 jdp Exp $
d7 1
a7 1
MAN1=		rtld.1
@


1.12
log
@When installing the dynamic linker, save the previous version in
"ld-elf.so.1.old".  The dynamic linker is a critical component of
the system, and it is difficult to recover if it is damaged and
there isn't a working backup available.  For instance, parts of
the toolchain such as the assembler are dynamically linked, making
it impossible to build a new dynamic linker if the installed one
doesn't work.
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.11 2000/03/27 16:11:27 bde Exp $
d55 2
a56 1
	cp -p ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}${BINDIR}/${PROG}.old
@


1.11
log
@Fixed missing DPADDs.

Fixed some style bugs (some usual ones for LDADD, and misformatting of
$FreeBSD$).
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.10 2000/01/29 03:16:54 jdp Exp $
d45 12
@


1.10
log
@Add a manual page for the ELF dynamic linker.  I initially created
rtld.1 by means of a repository copy from "src/libexec/rtld-aout/rtld.1".
Then I edited it to make it (more) accurate for the ELF dynamic
linker.
@
text
@d1 2
a2 3
#
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.9 1999/12/27 04:44:00 jdp Exp $
#
d30 2
a31 1
LDADD+=		-lc
d35 2
a36 1
LDADD+=		-lc_pic
@


1.10.2.1
log
@MFC: rev 1.12 (save previous dynamic linker)
@
text
@d2 1
a2 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.10 2000/01/29 03:16:54 jdp Exp $
a43 12

# Keep the previous version of the dynamic linker for recovery
# purposes.  This must come after the include of <bsd.prog.mk> so that
# BINDIR is set for the exists(...) constructs.
beforeinstall:
.if exists(${DESTDIR}${BINDIR}/${PROG})
	-chflags noschg ${DESTDIR}${BINDIR}/${PROG}
.if exists(${DESTDIR}${BINDIR}/${PROG}.old)
	-chflags noschg ${DESTDIR}${BINDIR}/${PROG}.old
.endif
	cp -p ${DESTDIR}${BINDIR}/${PROG} ${DESTDIR}${BINDIR}/${PROG}.old
.endif
@


1.10.2.2
log
@MFC 1.10 -> 1.11: Fix missing DPADDs and some style bugs.
@
text
@d1 3
a3 2
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.11 2000/03/27 16:11:27 bde Exp $

d31 1
a31 2
DPADD=		${LIBC}
LDADD=		-lc
d35 1
a35 2
DPADD=		${LIBC_PIC}
LDADD=		-lc_pic
@


1.10.2.3
log
@MFC: rev 1.13 (use install(1) rather than cp)
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.10.2.2 2000/07/12 02:14:47 jdp Exp $
d55 1
a55 2
	${INSTALL} -C -p ${DESTDIR}${BINDIR}/${PROG} \
	    ${DESTDIR}${BINDIR}/${PROG}.old
@


1.10.2.4
log
@MFC: MAN[1-9] -> MAN.
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.10.2.3 2000/07/20 11:16:05 obrien Exp $
d7 1
a7 1
MAN=		rtld.1
@


1.10.2.5
log
@MFC: 1.15: Use new backup feature of install(1).

Approved by:	re
@
text
@d1 1
a1 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.10.2.4 2001/04/25 10:41:01 ru Exp $
d10 1
a10 1
INSTALLFLAGS=	-fschg -C -b
d45 13
@


1.10.2.6
log
@MFC 1.16: Remove maintainer line.
@
text
@d1 1
a1 1
# $FreeBSD$
d3 1
@


1.10.2.7
log
@MFC:

Dynamic object dependency mapping: libmap.

PR:		58133
@
text
@d5 1
a5 1
		xmalloc.c debug.c reloc.c libmap.c
@


1.10.2.8
log
@Switch importer
@
text
@d1 1
a1 1
# $FreeBSD: stable/4/libexec/rtld-elf/Makefile 125402 2004-02-03 21:04:16Z fjoe $
@


1.9
log
@Add a new function dllockinit() for registering thread locking
functions to be used by the dynamic linker.  This can be called by
threads packages at start-up time.  I will add the call to libc_r
soon.

Also add a default locking method that is used up until dllockinit()
is called.  The default method works by blocking SIGVTALRM, SIGPROF,
and SIGALRM in critical sections.  It is based on the observation
that most user-space threads packages implement thread preemption
with one of these signals (usually SIGVTALRM).

The dynamic linker has never been reentrant, but it became less
reentrant in revision 1.34 of "src/libexec/rtld-elf/rtld.c".
Starting with that revision, multiple threads each doing lazy
binding could interfere with each other.  The usual symptom was
that a symbol was falsely reported as undefined at start-up time.
It was rare but not unseen.  This commit fixes it.
@
text
@d2 1
a2 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.8 1999/08/28 00:10:09 peter Exp $
d8 1
a8 1
NOMAN=		true
d12 1
@


1.8
log
@$Id$ -> $FreeBSD$
@
text
@d2 1
a2 1
# $FreeBSD$
d6 2
a7 2
SRCS=		rtld_start.S rtld.c map_object.c malloc.c xmalloc.c debug.c \
		reloc.c
@


1.7
log
@Add a MAINTAINER line naming myself.  We control the vertical.  We
control the horizontal.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.6 1999/04/09 00:28:31 jdp Exp $
@


1.6
log
@Eliminate all machine-dependent code from the main source body and
the Makefile, and move it down into the architecture-specific
subdirectories.

Eliminate an asm() statement for the i386.

Make the dynamic linker work if it is built as an executable instead
of as a shared library.  See i386/Makefile.inc to find out how to
do it.  Note, this change is not enabled and it might never be
enabled.  But it might be useful in the future.  Building the
dynamic linker as an executable should make it start up faster,
because it won't have any relocations.  But in practice I suspect
the difference is negligible.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.5 1999/02/15 05:02:54 nate Exp $
d4 1
@


1.5
log
@- Set the system immutable flag when installing ld.so to avoid people
  accidentally clobbering it.

Submitted by:	numberous people on -current
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.4 1998/09/04 19:03:57 dfr Exp $
a3 1

d8 3
a10 2
CFLAGS+=	-fpic -Wall -DFREEBSD_ELF -I${.CURDIR}
LDADD+=		-lc_pic
d12 3
d16 8
a23 6
.if	${MACHINE_ARCH} == "alpha"
CFLAGS+=	-mno-fp-regs
LDFLAGS+=	-nostdlib -Wl,-Bshareable,-Bsymbolic -e .rtld_start
.elif	${MACHINE_ARCH} == "i386"
CFLAGS+=	-elf
LDFLAGS+=	-elf -nostdlib -Wl,-Bshareable,-Bsymbolic
d26 12
a37 2
# Atomic installation with "-C" is very important for this program.
INSTALLFLAGS+=	-fschg -C
@


1.4
log
@Add alpha support.

Submitted by: John Birrell <jb@@cimlogic.com.au> (with extra hacks by me)
Obtained from: Probably NetBSD
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.3 1998/08/17 04:59:15 jdp Exp $
d12 1
d22 1
a22 1
INSTALLFLAGS+=	-C
@


1.4.2.1
log
@MFC: Install with -fschg to protect the loader from accidental removal.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.5 1999/02/15 05:02:54 nate Exp $
a11 1

d21 1
a21 1
INSTALLFLAGS+=	-fschg -C
@


1.4.2.2
log
@MFC (1999/04/08 17:28:44 PDT):

Isolate architecture dependencies better.
Eliminate some asm().
Make the dynamic linker work if it is built as an executable.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.4.2.1 1999/03/24 23:39:14 nate Exp $
d4 1
d9 2
a10 3
CFLAGS+=	-Wall -DFREEBSD_ELF -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}
LDFLAGS+=	-nostdlib -e .rtld_start
INSTALLFLAGS+=	-fschg -C
a11 3
.if exists(${.CURDIR}/${MACHINE_ARCH}/Makefile.inc)
.include "${.CURDIR}/${MACHINE_ARCH}/Makefile.inc"
.endif
d13 6
a18 8
# 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
d21 2
a22 12
.ifdef LDSO_IS_EXECUTABLE
OBJS+=		dyn_hack.so
LDFLAGS+=	-Wl,-T,${LDSCRIPT} -Wl,-E -Wl,-Bstatic
LDADD+=		-lc
.else
CFLAGS+=	-fpic -DPIC
LDFLAGS+=	-shared -Wl,-Bsymbolic
LDADD+=		-lc_pic
.endif

dyn_hack.so:
	${CC} -shared -nostdlib -o dyn_hack.so -x c /dev/null
@


1.4.2.3
log
@MFC: Use realhostname() and trimdomain().
     main() returns int
     Silence egcs (yeah, I know....)
     Reprompt if given an empty login name in uucpd
     Correct errno handling in uucpd.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.6 1999/04/09 00:28:31 jdp Exp $
@


1.4.2.4
log
@MFC 1.6 -> 1.7: Mark my turf as maintainer.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.4.2.3 1999/05/02 09:35:56 brian Exp $
a3 1
MAINTAINER=	jdp
@


1.4.2.5
log
@$Id$ -> $FreeBSD$
@
text
@d2 1
a2 1
# $FreeBSD$
@


1.4.2.6
log
@Sync with -current: add locking support to the dynamic linker.
@
text
@d2 1
a2 1
# $FreeBSD: src/libexec/rtld-elf/Makefile,v 1.4.2.5 1999/08/29 15:04:07 peter Exp $
d6 2
a7 2
SRCS=		rtld_start.S rtld.c lockdflt.c map_object.c malloc.c \
		xmalloc.c debug.c reloc.c
@


1.3
log
@Add "-C" to INSTALLFLAGS to install atomically.  An elf->elf
installworld dies at this point otherwise, leaving the system
without a dynamic linker.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.2 1998/04/30 07:47:58 dfr Exp $
d6 2
a7 1
SRCS=		rtld_start.S rtld.c map_object.c malloc.c xmalloc.c debug.c
d9 8
a16 2
CFLAGS+=	-elf -fpic -DFREEBSD_ELF
CFLAGS+=	-Wall
d18 2
a19 1
LDADD+=		-lc_pic
d23 1
a23 1
.PATH: ${.CURDIR}/${MACHINE}
@


1.2
log
@Add GDB support.  The method and some of the code came from NetBSD's elf
runtime linker.
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.1.1.1 1998/03/07 19:24:35 jdp Exp $
d12 2
@


1.1
log
@Initial revision
@
text
@d2 1
a2 1
#	$Id: Makefile,v 1.5 1998/03/05 21:05:47 jdp Exp $
d8 1
a8 1
CFLAGS+=	-elf -fpic
@


1.1.1.1
log
@Import the ELF dynamic linker.  This is the ElfKit version with
quite a few enhancements and bug fixes.  There are still some known
deficiencies, but it should be adequate to get us started with ELF.

Submitted by:	John Polstra <jdp@@polstra.com>
@
text
@@
