NetBSD-Bugs archive

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

toolchain/58810: src/sys/arch/evbppc/compile/walnut-mkimg.sh uses platform's awk



>Number:         58810
>Category:       toolchain
>Synopsis:       src/sys/arch/evbppc/compile/walnut-mkimg.sh uses platform's awk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 04 02:50:00 +0000 2024
>Originator:     Kouichi Hashikawa
>Release:        NetBSD-current, 10, 9
>Organization:
>Environment:
>Description:
When building evbppc's kernels, src/sys/arch/evbppc/compile/walnut-mkimg.sh uses platform's awk.
(and, we already have tools/bin/nbfile, but uses platform's file).
>How-To-Repeat:
always.
>Fix:
I think,
--- src/share/mk/bsd.own.mk-dist        2024-09-06 19:50:26.343160969 +0900
+++ src/share/mk/bsd.own.mk     2024-11-04 11:02:25.240351238 +0900
@@ -435,6 +435,7 @@
 TOOL_EQN=              ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
 TOOL_FDISK=            ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
 TOOL_FGEN=             ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
+TOOL_FILE=             ${TOOLDIR}/bin/${_TOOL_PREFIX}file
 TOOL_GENASSYM=         ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
 TOOL_GENCAT=           ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
 TOOL_GMAKE=            ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
@@ -560,6 +561,7 @@
 TOOL_EQN=              eqn
 TOOL_FDISK=            fdisk
 TOOL_FGEN=             fgen
+TOOL_FILE=             file
 TOOL_GENASSYM=         genassym
 TOOL_GENCAT=           gencat
 TOOL_GMAKE=            gmake
--- src/distrib/evbppc/md-kernel/Makefile-dist  2015-01-31 00:04:35.000000000 +0900
+++ src/distrib/evbppc/md-kernel/Makefile       2024-11-04 11:33:05.193462752 +0900
@@ -16,8 +16,10 @@
 MDSET_SUFFIXES.-=      img create-img
 
 create-img= \
-       OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
-               export OBJDUMP OBJCOPY STAT; ${MKIMG} ${.TARGET:R} ${.TARGET}
+       AWK=${TOOL_AWK}; FILE=${TOOL_FILE}; \
+               OBJDUMP=${OBJDUMP}; OBJCOPY=${OBJCOPY}; STAT=${TOOL_STAT}; \
+               export AWK FILE OBJDUMP OBJCOPY STAT; \
+               ${MKIMG} ${.TARGET:R} ${.TARGET}
 
 .include "${DISTRIBDIR}/common/Makefile.mdset"
 
--- src/sys/arch/evbppc/compile/walnut-mkimg.sh-dist    2014-03-04 03:25:14.000000000 +0900
+++ src/sys/arch/evbppc/compile/walnut-mkimg.sh 2024-11-04 10:52:44.908386095 +0900
@@ -16,14 +16,16 @@
 input=$1; shift
 output=$1; shift
 
+: ${AWK=awk}
+: ${FILE=file}
 : ${OBJDUMP=objdump}
 : ${OBJCOPY=objcopy}
 : ${STAT=stat}
 
-file=$( file $input )
+file=$( ${FILE} $input )
 case $file in
 *:\ ELF\ *)
-       start=`${OBJDUMP} -f ${input} | awk '/start address/ { print $NF }'`
+       start=`${OBJDUMP} -f ${input} | ${AWK} '/start address/ { print $NF }'`
        start=`printf "%d" $start`
        ${OBJCOPY} -O binary ${input} ${input}.bin.$$
        ;;



Home | Main Index | Thread Index | Old Index