From: deraadt Date: Mon, 5 Jun 2017 12:43:57 +0000 (+0000) Subject: The arm* architectures edit the ld.script, creating a copy in the compile X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=660d6abbabad3055020e472b67224d99026eea24;p=openbsd The arm* architectures edit the ld.script, creating a copy in the compile directories. Copy it in the same way on other architectures, for the same effect. Something upcoming will want that file there anyways. --- diff --git a/sys/arch/alpha/conf/Makefile.alpha b/sys/arch/alpha/conf/Makefile.alpha index 847f52326aa..468ee699105 100644 --- a/sys/arch/alpha/conf/Makefile.alpha +++ b/sys/arch/alpha/conf/Makefile.alpha @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.alpha,v 1.96 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.alpha,v 1.97 2017/06/05 12:43:57 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -39,8 +39,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -T ${LDSCRIPT} -X -N -G 4 --warn-common -nopie +LINKFLAGS= -T ld.script -X -N -G 4 --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -70,7 +69,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -114,6 +113,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/amd64/conf/Makefile.amd64 b/sys/arch/amd64/conf/Makefile.amd64 index 37468abbe1e..675daaa8ba5 100644 --- a/sys/arch/amd64/conf/Makefile.amd64 +++ b/sys/arch/amd64/conf/Makefile.amd64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.amd64,v 1.79 2017/06/04 17:03:39 tb Exp $ +# $OpenBSD: Makefile.amd64,v 1.80 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -46,8 +46,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -T ${LDSCRIPT} -X --warn-common -nopie +LINKFLAGS= -T ld.script -X --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -77,7 +76,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore0.o gap.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -122,6 +121,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script ld.script + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/arm64/conf/Makefile.arm64 b/sys/arch/arm64/conf/Makefile.arm64 index 1fdae6d4214..3b4c7208eca 100644 --- a/sys/arch/arm64/conf/Makefile.arm64 +++ b/sys/arch/arm64/conf/Makefile.arm64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.arm64,v 1.8 2017/06/04 17:03:39 tb Exp $ +# $OpenBSD: Makefile.arm64,v 1.9 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -44,7 +44,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LINKFLAGS= -T ldscript -X --warn-common -nopie +LINKFLAGS= -T ld.script -X --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -74,12 +74,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore0.o gap.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ -SYSTEM_LD_HEAD+=; \ - cat ${_archdir}/conf/kern.ldscript | \ - sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \ - -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ldscript SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ echo ${OBJS} param.o ioconf.o vers.o | tr " " "\n" | ${SORTR} > lorder; \ @@ -123,6 +119,11 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail + cat ${_archdir}/conf/kern.ldscript | \ + sed -e 's/@KERNEL_BASE_PHYS@/${KERNEL_BASE_PHYS}/' \ + -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' > ld.script + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/armv7/conf/Makefile.armv7 b/sys/arch/armv7/conf/Makefile.armv7 index d0bb28bd5c7..cd8a7847c6e 100644 --- a/sys/arch/armv7/conf/Makefile.armv7 +++ b/sys/arch/armv7/conf/Makefile.armv7 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.armv7,v 1.22 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.armv7,v 1.23 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -37,7 +37,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LINKFLAGS= -T ldscript --warn-common -nopie +LINKFLAGS= -T ld.script --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -67,13 +67,8 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= ${_mach}_start.o locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ -SYSTEM_LD_HEAD+=; \ - cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ - sed -e 's/@KERNEL_BASE_PHYS@/0/' \ - -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \ - -e 's/(KERNEL_BASE_phys)/(KERNEL_BASE_virt)/' > ldscript SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_HEAD} vers.o ${OBJS} @@ -116,6 +111,12 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail + cat ${_archdir}/conf/ldscript.head ${_archdir}/conf/ldscript.tail | \ + sed -e 's/@KERNEL_BASE_PHYS@/0/' \ + -e 's/@KERNEL_BASE_VIRT@/${KERNEL_BASE_VIRT}/' \ + -e 's/(KERNEL_BASE_phys)/(KERNEL_BASE_virt)/' > ld.script + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/hppa/conf/Makefile.hppa b/sys/arch/hppa/conf/Makefile.hppa index 11c91ae2971..7030f989533 100644 --- a/sys/arch/hppa/conf/Makefile.hppa +++ b/sys/arch/hppa/conf/Makefile.hppa @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.hppa,v 1.90 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.hppa,v 1.91 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -35,8 +35,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -X -T ${LDSCRIPT} -Ttext 80000 --warn-common -nopie +LINKFLAGS= -X -T ld.script -Ttext 80000 --warn-common -nopie .if ${IDENT:M-DDDB} != "" CFLAGS+= -fno-omit-frame-pointer @@ -78,7 +77,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -122,6 +121,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/i386/conf/Makefile.i386 b/sys/arch/i386/conf/Makefile.i386 index 641de19221d..919ba8b722b 100644 --- a/sys/arch/i386/conf/Makefile.i386 +++ b/sys/arch/i386/conf/Makefile.i386 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.i386,v 1.106 2017/06/04 17:03:39 tb Exp $ +# $OpenBSD: Makefile.i386,v 1.107 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -41,8 +41,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -T ${LDSCRIPT} -X --warn-common -nopie +LINKFLAGS= -T ld.script -X --warn-common -nopie .if ${MACHINE} == "amd64" CFLAGS+= -m32 @@ -78,7 +77,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore0.o gap.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} param.o ioconf.o -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -123,6 +122,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/loongson/conf/Makefile.loongson b/sys/arch/loongson/conf/Makefile.loongson index 6c38fd94abb..450c2060347 100644 --- a/sys/arch/loongson/conf/Makefile.loongson +++ b/sys/arch/loongson/conf/Makefile.loongson @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.loongson,v 1.55 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.loongson,v 1.56 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -44,8 +44,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -e start -T ${LDSCRIPT} -Ttext=${LINK_ADDRESS} -warn-common -nopie +LINKFLAGS= -e start -T ld.script -Ttext=${LINK_ADDRESS} -warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -75,7 +74,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -119,6 +118,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/luna88k/conf/Makefile.luna88k b/sys/arch/luna88k/conf/Makefile.luna88k index 5b2e5be82bc..1252f8fd4d6 100644 --- a/sys/arch/luna88k/conf/Makefile.luna88k +++ b/sys/arch/luna88k/conf/Makefile.luna88k @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.luna88k,v 1.67 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.luna88k,v 1.68 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -39,8 +39,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -T ${LDSCRIPT} -Ttext 0x80000 -e __start -X -N --warn-common -nopie +LINKFLAGS= -T ld.script -Ttext 0x80000 -e __start -X -N --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -74,7 +73,7 @@ PROFILE_C= ${CC} -S -c ${CFLAGS} ${CPPFLAGS} $<; \ # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -118,6 +117,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/octeon/conf/Makefile.octeon b/sys/arch/octeon/conf/Makefile.octeon index 8934b2ff55e..e291ac3f727 100644 --- a/sys/arch/octeon/conf/Makefile.octeon +++ b/sys/arch/octeon/conf/Makefile.octeon @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.octeon,v 1.31 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.octeon,v 1.32 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -44,8 +44,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -e start -T ${LDSCRIPT} -Ttext=${LINK_ADDRESS} -nopie +LINKFLAGS= -e start -T ld.script -Ttext=${LINK_ADDRESS} -nopie STRIPFLAGS= -g -x .if ${IDENT:M-DDDB_STRUCT} @@ -76,7 +75,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -120,6 +119,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/sgi/conf/Makefile.sgi b/sys/arch/sgi/conf/Makefile.sgi index 5832d04ed5a..aebfb5e074e 100644 --- a/sys/arch/sgi/conf/Makefile.sgi +++ b/sys/arch/sgi/conf/Makefile.sgi @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sgi,v 1.79 2017/06/03 22:21:33 deraadt Exp $ +# $OpenBSD: Makefile.sgi,v 1.80 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -44,8 +44,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -e start -T ${LDSCRIPT} -Ttext=${LINK_ADDRESS} --warn-common -nopie +LINKFLAGS= -e start -T ld.script -Ttext=${LINK_ADDRESS} --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -75,7 +74,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -119,6 +118,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c diff --git a/sys/arch/sparc64/conf/Makefile.sparc64 b/sys/arch/sparc64/conf/Makefile.sparc64 index 06bec23968a..78fece436a4 100644 --- a/sys/arch/sparc64/conf/Makefile.sparc64 +++ b/sys/arch/sparc64/conf/Makefile.sparc64 @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.sparc64,v 1.82 2017/06/03 22:21:34 deraadt Exp $ +# $OpenBSD: Makefile.sparc64,v 1.83 2017/06/05 12:43:59 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -37,8 +37,7 @@ DEBUG?= -g COPTS?= -O2 CFLAGS= ${DEBUG} ${CWARNFLAGS} ${CMACHFLAGS} ${COPTS} ${PIPE} AFLAGS= -D_LOCORE -x assembler-with-cpp ${CWARNFLAGS} ${CMACHFLAGS} -LDSCRIPT= ${_machdir}/conf/ld.script -LINKFLAGS= -n -T ${LDSCRIPT} --warn-common -nopie +LINKFLAGS= -n -T ld.script --warn-common -nopie .if ${IDENT:M-DDDB_STRUCT} DB_STRUCTINFO= db_structinfo.h @@ -68,7 +67,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_TAIL} SYSTEM_HEAD= locore.o param.o ioconf.o SYSTEM_OBJ= ${SYSTEM_HEAD} ${OBJS} -SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ${LDSCRIPT} +SYSTEM_DEP= Makefile ${SYSTEM_OBJ} ld.script SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_HEAD} vers.o $${OBJS}'; \ umask 007; \ @@ -112,6 +111,9 @@ mcount.o: $S/lib/libkern/mcount.c Makefile ioconf.o: ioconf.c ${NORMAL_C} +ld.script: ${_machdir}/conf/ld.script + cp ${_machdir}/conf/ld.script $@ + vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} sh $S/conf/newvers.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c