Subject: toolchain/29758: Cross compiling of Netbsd 2.0 fails on AMD64
To: None <toolchain-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <netbsd@kaervek.net>
List: netbsd-bugs
Date: 03/21/2005 22:44:00
>Number:         29758
>Category:       toolchain
>Synopsis:       Cross compiling of Netbsd 2.0 fails on AMD64
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 21 22:44:00 +0000 2005
>Originator:     Ralf Huvendiek
>Release:        2
>Organization:
>Environment:
Linux helios 2.6.10-amd64 #7 Sat Feb 5 18:17:03 CET 2005 x86_64 AMD Athlon(tm) 64 Processor 3200+ AuthenticAMD GNU/Linux
>Description:
I try to cross compile a netbsd 2 distribution on a linux amd64 machine (yes, shame on me :) ). I got the newest (2.0) sources via cvs up -dPAC -rnetbsd-2.
Building the toolchain works, but the kernel fails on sha2.c with
/tmp/ccUQgz9R.s: Assembler messages:
/tmp/ccUQgz9R.s:94: Error: bignum invalid
[lots of that]

*** Failed target:  sha2.o
*** Failed command: echo '# ' "compile server/sha2.o"; echo /tmp/build/obj/tooldir.Linux-2.6.10-amd64-AMD_Athlon_64_Processor_3200+/bin/i386--netbsdelf-gcc -ffreestanding -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Di386 -I. -I/home/kaervek/netbsd-server/usr/src/sys/arch -I/home/kaervek/netbsd-server/usr/src/sys -nostdinc -DMAXUSERS=128 -D_KERNEL -D_KERNEL_OPT -I/home/kaervek/netbsd-server/usr/src/sys/dist/ipf -c /home/kaervek/netbsd-server/usr/src/sys/crypto/sha2/sha2.c; /tmp/build/obj/tooldir.Linux-2.6.10-amd64-AMD_Athlon_64_Processor_3200+/bin/i386--netbsdelf-gcc -ffreestanding -O2 -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -fno-zero-initialized-in-bss -Di386 -I. -I/home/kaervek/netbsd-server/usr/src/sys/arch -I/home/kaervek/netbsd-server/usr/src/sys -nostdinc -DMAXUSERS=128 -D_KERNE
 L -D_KERNEL_OPT -I/home/kaervek/netbsd-server/usr/src/sys/dist/ipf -c /home/kaervek/netbsd-server/usr/src/sys/crypto/sha2/sha2.c
*** Error code 1

If I remove crypto/cgd and ipsec from my kernel config everything builds  fine. As I do not really need this atm, this is no big problem for me.

>How-To-Repeat:
Checkout netbsd2, cross compile on a linux amd64 machine. You need
pseudo-device 	crypto		# opencrypto framework
pseudo-device	cgd		4	# cryptographic disk devices

Otherwise it will not compile sha2.c

Then build this kernel and it should fail.
>Fix:
None, sorry :(