summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkurt <kurt@openbsd.org>2008-06-25 02:47:59 +0000
committerkurt <kurt@openbsd.org>2008-06-25 02:47:59 +0000
commitff1ea5ecdb984d4c1c87631fe48f3c48330c9846 (patch)
treeb68906c576e816bbd4fd2884f44e588e0e2589f9
parentMake pic compatiable. From and okay drahn@ no objection miod@ (diff)
downloadwireguard-openbsd-ff1ea5ecdb984d4c1c87631fe48f3c48330c9846.tar.xz
wireguard-openbsd-ff1ea5ecdb984d4c1c87631fe48f3c48330c9846.zip
Build pic versions of crt0, crtbegin & crtend for amd64, i386, powerpc,
sparc64. The rest will come later. okay drahn@ no objection miod@ "Get it in" deraadt@
-rw-r--r--lib/csu/amd64/Makefile25
-rw-r--r--lib/csu/i386/Makefile25
-rw-r--r--lib/csu/powerpc/Makefile23
-rw-r--r--lib/csu/sparc64/Makefile25
4 files changed, 91 insertions, 7 deletions
diff --git a/lib/csu/amd64/Makefile b/lib/csu/amd64/Makefile
index ddbe9a140f7..9142d06958e 100644
--- a/lib/csu/amd64/Makefile
+++ b/lib/csu/amd64/Makefile
@@ -1,7 +1,10 @@
-# $OpenBSD: Makefile,v 1.1 2004/01/28 01:46:17 mickey Exp $
+# $OpenBSD: Makefile,v 1.2 2008/06/25 02:47:59 kurt Exp $
CFLAGS+= -DLIBC_SCCS -fno-omit-frame-pointer
-OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o
+OBJS= crt0.o pcrt0.o gcrt0.o
+OBJS+= crtbegin.o crtend.o
+OBJS+= crtbeginP.o crtendP.o
+OBJS+= crtbeginS.o crtendS.o
SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
ELFDIR= ${.CURDIR}/../common_elf
@@ -18,6 +21,12 @@ crt0.o: crt0.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+pcrt0.o: crt0.c
+ @echo ${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
gcrt0.o: crt0.c
@echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
@${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
@@ -30,6 +39,12 @@ crtbegin.o: crtbegin.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtbeginP.o: crtbegin.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtbeginS.o: crtbeginS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
@@ -42,6 +57,12 @@ crtend.o: crtend.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtendP.o: crtend.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtendS.o: crtendS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o
diff --git a/lib/csu/i386/Makefile b/lib/csu/i386/Makefile
index 0155a11ac85..fb2c4f76508 100644
--- a/lib/csu/i386/Makefile
+++ b/lib/csu/i386/Makefile
@@ -1,8 +1,11 @@
-# $OpenBSD: Makefile,v 1.9 2004/01/08 14:59:15 drahn Exp $
+# $OpenBSD: Makefile,v 1.10 2008/06/25 02:47:59 kurt Exp $
# from: @(#)Makefile 5.5 (Berkeley) 5/21/91
CFLAGS+= -DLIBC_SCCS -fno-omit-frame-pointer
-OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o
+OBJS= crt0.o pcrt0.o gcrt0.o
+OBJS+= crtbegin.o crtend.o
+OBJS+= crtbeginP.o crtendP.o
+OBJS+= crtbeginS.o crtendS.o
SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
ELFDIR= ${.CURDIR}/../common_elf
@@ -19,6 +22,12 @@ crt0.o: crt0.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+pcrt0.o: crt0.c
+ @echo ${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
gcrt0.o: crt0.c
@echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
@${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
@@ -31,6 +40,12 @@ crtbegin.o: crtbegin.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtbeginP.o: crtbegin.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtbeginS.o: crtbeginS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
@@ -43,6 +58,12 @@ crtend.o: crtend.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtendP.o: crtend.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtendS.o: crtendS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o
diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile
index 47adc13a1d1..595d4a7d12e 100644
--- a/lib/csu/powerpc/Makefile
+++ b/lib/csu/powerpc/Makefile
@@ -2,7 +2,10 @@
# from: @(#)Makefile 8.1 (Berkeley) 6/1/93
CFLAGS+= -DLIBC_SCCS
-OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o
+OBJS= crt0.o pcrt0.o gcrt0.o
+OBJS+= crtbegin.o crtend.o
+OBJS+= crtbeginS.o crtendS.o
+OBJS+= crtbeginP.o crtendP.o
SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
ELFDIR= ${.CURDIR}/../common_elf
@@ -19,6 +22,12 @@ crt0.o: crt0.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+pcrt0.o: crt0.c
+ @echo ${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
gcrt0.o: crt0.c
@echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
@${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
@@ -31,6 +40,12 @@ crtbegin.o: crtbegin.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtbeginP.o: crtbegin.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtbeginS.o: crtbeginS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
@@ -43,6 +58,12 @@ crtend.o: crtend.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtendP.o: crtend.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtendS.o: crtendS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o
diff --git a/lib/csu/sparc64/Makefile b/lib/csu/sparc64/Makefile
index e63640416b8..e7d297e3013 100644
--- a/lib/csu/sparc64/Makefile
+++ b/lib/csu/sparc64/Makefile
@@ -1,8 +1,11 @@
-# $OpenBSD: Makefile,v 1.3 2004/01/08 14:59:15 drahn Exp $
+# $OpenBSD: Makefile,v 1.4 2008/06/25 02:47:59 kurt Exp $
# $NetBSD: Makefile,v 1.6 1996/10/18 05:27:38 thorpej Exp $
CFLAGS+= -DLIBC_SCCS -DELFSIZE=64
-OBJS= crt0.o gcrt0.o crtbegin.o crtend.o crtbeginS.o crtendS.o
+OBJS= crt0.o pcrt0.o gcrt0.o
+OBJS+= crtbegin.o crtend.o
+OBJS+= crtbeginP.o crtendP.o
+OBJS+= crtbeginS.o crtendS.o
SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
ELFDIR= ${.CURDIR}/../common_elf
@@ -19,6 +22,12 @@ crt0.o: crt0.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+pcrt0.o: crt0.c
+ @echo ${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
gcrt0.o: crt0.c
@echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
@${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
@@ -31,6 +40,12 @@ crtbegin.o: crtbegin.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtbeginP.o: crtbegin.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtbeginS.o: crtbeginS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
@@ -43,6 +58,12 @@ crtend.o: crtend.c
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
+crtendP.o: crtend.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtend.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
crtendS.o: crtendS.c
@echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
@${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o