Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Echo exact objects (swap*.o etc.) when linking kernel.



details:   https://anonhg.NetBSD.org/src/rev/239c00a26870
branches:  trunk
changeset: 810341:239c00a26870
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Thu Aug 27 03:17:46 2015 +0000

description:
Echo exact objects (swap*.o etc.) when linking kernel.

diffstat:

 sys/arch/usermode/conf/Makefile.usermode |  12 ++++++++----
 sys/conf/Makefile.kern.inc               |  18 +++++++++++-------
 2 files changed, 19 insertions(+), 11 deletions(-)

diffs (79 lines):

diff -r 0a0ad586cd1a -r 239c00a26870 sys/arch/usermode/conf/Makefile.usermode
--- a/sys/arch/usermode/conf/Makefile.usermode  Thu Aug 27 02:43:20 2015 +0000
+++ b/sys/arch/usermode/conf/Makefile.usermode  Thu Aug 27 03:17:46 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.usermode,v 1.37 2015/08/24 14:04:25 uebayasi Exp $
+# $NetBSD: Makefile.usermode,v 1.38 2015/08/27 03:17:46 uebayasi Exp $
 
 USETOOLS?=                     no
 NEED_OWN_INSTALL_TARGET?=      no
@@ -70,11 +70,15 @@
 LINKFLAGS_NORMAL=      -X
 KERNLDSCRIPT?= ${USERMODE}/conf/kern.ldscript
 
-SYSTEM_LD=     @${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
+SYSTEM_LD=     @do_system_ld() { \
+               target=$$1; shift; \
+               ${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
                ${_MKSHECHO}\
-               ${CC} -static ${COPTS} -Wl,-Map,$@.map -o $@ ${LINKFORMAT} -Ttext ${TEXTADDR} '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o ${USERMODE_LIBS}; \
+               ${CC} -static ${COPTS} -Wl,-Map,$@.map -o $@ ${LINKFORMAT} -Ttext ${TEXTADDR} '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o ${USERMODE_LIBS} $$@; \
                ${SYSTEM_LD_FIX} \
-               ${CC} -static ${COPTS} -Wl,-Map,$@.map -o $@ ${LINKFORMAT} -Ttext ${TEXTADDR} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o ${USERMODE_LIBS}
+               ${CC} -static ${COPTS} -Wl,-Map,$@.map -o $@ ${LINKFORMAT} -Ttext ${TEXTADDR} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o ${USERMODE_LIBS} $$@; \
+               }; \
+               do_system_ld
 NVFLAGS=       -n
 
 ##
diff -r 0a0ad586cd1a -r 239c00a26870 sys/conf/Makefile.kern.inc
--- a/sys/conf/Makefile.kern.inc        Thu Aug 27 02:43:20 2015 +0000
+++ b/sys/conf/Makefile.kern.inc        Thu Aug 27 03:17:46 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.kern.inc,v 1.193 2015/08/26 03:00:52 uebayasi Exp $
+#      $NetBSD: Makefile.kern.inc,v 1.194 2015/08/27 03:17:46 uebayasi Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -235,10 +235,14 @@
 SYSTEM_CTFMERGE= ${_MKSHECHO}
 .endif
 SYSTEM_LD_HEAD?=@rm -f $@
-SYSTEM_LD?=    @${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
+SYSTEM_LD?=    @do_system_ld() { \
+               target=$$1; shift; \
+               ${_MKSHMSG} "   link  ${.CURDIR:T}/${.TARGET}"; \
                ${_MKSHECHO}\
-               ${LD} -Map $@.map --cref ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o; \
-               ${LD} -Map $@.map --cref ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o
+               ${LD} -Map $@.map --cref ${LINKFLAGS} -o $${target} '$${SYSTEM_OBJ}' '$${EXTRA_OBJ}' vers.o $$@; \
+               ${LD} -Map $@.map --cref ${LINKFLAGS} -o $${target} ${SYSTEM_OBJ} ${EXTRA_OBJ} vers.o $$@; \
+               }; \
+               do_system_ld
 
 # Give MD generated ldscript dependency on ${SYSTEM_OBJ}
 .if defined(KERNLDSCRIPT)
@@ -576,20 +580,20 @@
 .if !defined(COPY_SYMTAB)
 build_kernel: .USE
        ${SYSTEM_LD_HEAD}
-       ${SYSTEM_LD} swap${.TARGET}.o
+       ${SYSTEM_LD} ${.TARGET} swap${.TARGET}.o
        ${SYSTEM_LD_TAIL_STAGE2}
 .else
 build_kernel: .USE
        ${CC} ${CFLAGS} ${CPPFLAGS} -DCOPY_SYMTAB \
            -c $S/kern/kern_ksyms_buf.c -o kern_ksyms_buf.o
        ${SYSTEM_LD_HEAD}
-       ${SYSTEM_LD} swap${.TARGET}.o kern_ksyms_buf.o
+       ${SYSTEM_LD} ${.TARGET} swap${.TARGET}.o kern_ksyms_buf.o
        ${SYSTEM_LD_TAIL_STAGE1}
        ${CC} ${CFLAGS} ${CPPFLAGS} -DCOPY_SYMTAB \
            -DSYMTAB_SPACE=$$(${DBSYM} -P ${.TARGET}${TARGETSFX}) \
            -c $S/kern/kern_ksyms_buf.c -o kern_ksyms_buf_real.o
        ${SYSTEM_LD_HEAD}
-       ${SYSTEM_LD} swap${.TARGET}.o kern_ksyms_buf_real.o
+       ${SYSTEM_LD} ${.TARGET} swap${.TARGET}.o kern_ksyms_buf_real.o
        ${SYSTEM_LD_TAIL_STAGE2}
 .endif
 



Home | Main Index | Thread Index | Old Index