Module Name: src Committed By: isaki Date: Thu Jan 16 13:15:47 UTC 2020
Modified Files: src/sys/arch/x68k/stand/boot_ufs: Makefile src/sys/arch/x68k/stand/boot_ustar: Makefile src/sys/arch/x68k/stand/xxboot: Makefile.xxboot Log Message: Rewrite limit check using cross-build tools. This eliminates use of hosts tr(1) and bc(1). (But I'm going to remove this again soon due to other reason) To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/arch/x68k/stand/boot_ufs/Makefile cvs rdiff -u -r1.24 -r1.25 src/sys/arch/x68k/stand/boot_ustar/Makefile cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x68k/stand/boot_ufs/Makefile diff -u src/sys/arch/x68k/stand/boot_ufs/Makefile:1.30 src/sys/arch/x68k/stand/boot_ufs/Makefile:1.31 --- src/sys/arch/x68k/stand/boot_ufs/Makefile:1.30 Sat Apr 8 19:53:23 2017 +++ src/sys/arch/x68k/stand/boot_ufs/Makefile Thu Jan 16 13:15:47 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.30 2017/04/08 19:53:23 christos Exp $ +# $NetBSD: Makefile,v 1.31 2020/01/16 13:15:47 isaki Exp $ NOMAN= # defined @@ -59,13 +59,11 @@ $(PROG): $(OBJS) : $(LD) $(LINKFLAGS) -o $(PROG).x $(OBJS) $(LDADD) >$(PROG).map @grep first_kbyte $(PROG).map - @if [ `(echo ibase=16; \ - ${TOOL_SED} -n -e '/[ ]first_kbyte/{' \ - -e 's/.*0x\([0-9a-fA-F]*\).*/\1-$(TEXT)-400/p' \ - -e '}' $(PROG).map | \ - tr a-f A-F) | bc` -gt 0 ]; \ - then echo '$(BOOT): first_kbyte exceeds the first killobyte'; \ - exit 1; \ + @if [ `${TOOL_AWK} \ + '/first_kbyte/ {print "eval(eval("$$1")-eval(0x'$(TEXT)'))"}' \ + $(PROG).map | ${TOOL_M4} -` -gt 1024 ]; \ + then echo '$(BOOT): first_kbyte exceeds the first killobyte'; \ + exit 1; \ fi mv -f $(PROG).x $(PROG) Index: src/sys/arch/x68k/stand/boot_ustar/Makefile diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.24 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.25 --- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.24 Sat Apr 8 19:53:23 2017 +++ src/sys/arch/x68k/stand/boot_ustar/Makefile Thu Jan 16 13:15:47 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.24 2017/04/08 19:53:23 christos Exp $ +# $NetBSD: Makefile,v 1.25 2020/01/16 13:15:47 isaki Exp $ NOMAN= # defined @@ -50,19 +50,15 @@ ${PROG}: $(OBJS) ${_MKTARGET_LINK} $(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDADD) > $(PROG).map @grep first_kbyte $(PROG).map - @if [ `(echo ibase=16; \ - ${TOOL_SED} -n \ - 's/^.*0x\([0-9a-f]*\).* first_kbyte$$/\1-$(TEXT)-400/p' \ - $(PROG).map | \ - tr a-f A-F) | bc` -gt 0 ]; \ + @if [ `${TOOL_AWK} \ + '/first_kbyte/ {print "eval(eval("$$1")-eval(0x'$(TEXT)'))"}' \ + $(PROG).map | ${TOOL_M4} -` -gt 1024 ]; \ then echo '$(BOOT): first_kbyte exceeds the first killobyte'; \ rm $(PROG) ; exit 1; \ fi - @if [ `(echo ibase=16; \ - ${TOOL_SED} -n \ - 's/^.*0x\([0-9a-f]*\).* _edata *= *\.$$/\1-$(TEXT)-2000/p' \ - $(PROG).map | \ - tr a-f A-F) | bc` -gt 0 ]; \ + @if [ `${TOOL_AWK} \ + '/_edata/ {print "eval(eval("$$1")-eval(0x'$(TEXT)'))"}' \ + $(PROG).map | ${TOOL_M4} -` -gt 8192 ]; \ then echo '$(BOOT): text+data is too large'; \ rm $(PROG) ; exit 1; \ fi Index: src/sys/arch/x68k/stand/xxboot/Makefile.xxboot diff -u src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.5 src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.6 --- src/sys/arch/x68k/stand/xxboot/Makefile.xxboot:1.5 Thu Jan 16 12:54:16 2020 +++ src/sys/arch/x68k/stand/xxboot/Makefile.xxboot Thu Jan 16 13:15:47 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.xxboot,v 1.5 2020/01/16 12:54:16 isaki Exp $ +# $NetBSD: Makefile.xxboot,v 1.6 2020/01/16 13:15:47 isaki Exp $ NOMAN= # defined @@ -64,19 +64,17 @@ ${PROG}: $(OBJS) ${_MKTARGET_LINK} $(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDLIBS) > $(PROG).map @grep first_kbyte $(PROG).map - @if [ `(echo ibase=16; \ - ${TOOL_SED} -n \ - 's/^.*0x\([0-9a-f]*\).* first_kbyte$$/\1-$(TEXT)-400/p' \ - $(PROG).map | \ - tr a-f A-F) | bc` -gt 0 ]; \ + @if [ `${TOOL_AWK} \ + '/first_kbyte/ {print "eval(eval("$$1")-eval(0x'$(TEXT)'))"}' \ + $(PROG).map | ${TOOL_M4} -` -gt 1024 ]; \ then echo '$(BOOT): first_kbyte exceeds the first killobyte'; \ rm $(PROG) ; exit 1; \ fi - @if [ `(echo ibase=16; \ - ${TOOL_SED} -n \ - 's/^.*0x\([0-9a-f]*\).* _edata *= *\.$$/\1-$(TEXT)-$(TEXTDATASIZE)/p' \ - $(PROG).map | \ - tr a-f A-F) | bc` -gt 0 ]; \ + @if [ `${TOOL_AWK} \ + '/_edata/ {print "eval(eval("$$1")-eval(0x'$(TEXT)'))"}' \ + $(PROG).map | ${TOOL_M4} -` \ + -gt \ + `echo 'eval(0x$(TEXTDATASIZE))' | ${TOOL_M4} -` ]; \ then echo '$(BOOT): text+data is too large'; \ rm $(PROG) ; exit 1; \ fi