Subject: port-pmax/17874: pmax USETOOLS=no kernel builds fail due to elf2ecoff
To: None <gnats-bugs@gnats.netbsd.org>
From: None <jhawk@MIT.EDU>
List: netbsd-bugs
Date: 08/06/2002 14:05:23
>Number:         17874
>Category:       port-pmax
>Synopsis:       pmax USETOOLS=no kernel builds fail due to elf2ecoff
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-pmax-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 07 11:19:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        NetBSD 1.6_BETA5
>Organization:
MIT
>Environment:
	
	
System: NetBSD phantom.mit.edu NetBSD 1.6_BETA5 (PHANTOM) #0: Tue Aug  6 07:03:41 EDT 2002 pmax
Architecture: mipsel
Machine: pmax
>Description:
kernel builds with the native toolchain fail due to mk file lossage surrounding
elf2ecoff:

phantom# pwd
/usr/src/sys/arch/pmax/compile/PHANTOM
phantom# tail make.out
ld -T ../../../../arch/mips/conf/kern.ldscript -Ttext 0x80030000 -e start -EL -G 0 --oformat elf32-littlemips -x -o netbsd ${SYSTEM_OBJ} vers.o
text    data    bss     dec     hex     filename
2521580 64144   432772  3018496 2e0f00  netbsd
netbsd netbsd.ecoff
netbsd: not found
chmod: netbsd.ecoff: No such file or directory
*** Error code 1

Stop.
make: stopped in /usr/src/sys/arch/pmax/compile/PHANTOM


Apparently that's because Makefile.pmax.inc has:

SYSTEM_LD_TAIL_EXTRA=; \
                echo ${ELF2ECOFF} $@ $@.ecoff; ${ELF2ECOFF} $@ $@.ecoff; \
                chmod 755 $@.ecoff

And ELF2ECOFF is not defined. The kernel build Makefile includes
bsd.own.mk, which only defines ELF2ECOFF when USETOOLS=yes. Now,
bsd.sys.mk does define ELF2ECOFF, but that doesn't help us here.

>How-To-Repeat:
Try to compile a kernel natively without any USETOOLS specifications.
>Fix:
	
I'm not terribly USETOOLS-saavy. This fix appears to work.
Could someone verify its correctness, please?

--- sys/conf/Makefile.kern.inc	2002/08/06 17:53:22	1.1
+++ sys/conf/Makefile.kern.inc	2002/08/06 17:53:48
@@ -29,6 +29,7 @@
 OBJDUMP?=	objdump
 CSCOPE?=	cscope
 MKID?=		mkid
+ELF2ECOFF?=	elf2ecoff
 .MAKEOVERRIDES+=USETOOLS	# make sure proper value is propagated
 
 ##

>Release-Note:
>Audit-Trail:
>Unformatted: