Subject: mrs/cpsr_all and delay() symbol on kernel link.
To: None <port-arm32@netbsd.org, port-hpcarm@netbsd.org>
From: Dirk-Willem van Gulik <dirkx@webweaving.org>
List: port-arm32
Date: 11/23/2001 07:41:17
Whilst cross compiling on a clean install of 1.5.2 x86 from the multiboot
iso on netbsd.org

- Either a 'cvs co src'(*) from anoncvs with a ./build.sh -m hpcarm ... 

- OR with the instructions from
	http://www.netbsd.org/Ports/hpcarm/howto-use.html 

I can fully build userland - but -not- the generic kernel.

I run into the same to problems:

Problem 1: arch/hpcarm/hpcarm/softintr.c
	#ifdef __GNUC__
        	asm volatile("mrs %0, cpsr_all\n orr r1, %0, %1\n msr cpsr_all,
		r1" : "=r" (saved_cpsr) : "i" (I32_bit) : "r1");
	#else   
        	saved_cpsr = SetCPSR(I32_bit, I32_bit);
	#endif

	gives me an assembler error for the mrs instructions. I worked
around this by undefing __GNUC__ after the includes. Then I hit problem 2:

Problem 2
	final linking of netbsd gives me a ARM26 delay symbol not
	defined. See full output below.

Any hints as how to get around this ? (Full story: trying to  see if
a www.tuxscreen.net would even boot :-).

Dw

Ad '*':	A clean 'cvs co src' did give me errors on man; ksym and
 	grep - and needed a 'cvs update -P -d' to delete the
	grep/man/ksym subdirectories.

Full linking error

sh ../../../../conf/newvers.sh
/usr/pkg/cross/bin/arm-netbsd-gcc  -O2 -Werror -Wall -Wcomment
-Wpointer-arith -Wno-uninitialized -Wno-main -I. -I../../../../arch
-I../../../.. -nostdinc -DHPCARM -DSAIP -DLKM -DDIAGNOSTIC
-DCONSPEED="0x4b00" -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT -Dhpcarm -Darm32
-c vers.c
rm -f netbsd
/usr/pkg/cross/bin/arm-netbsd-ld -Ttext C0040000 -e start -X -o netbsd
${SYSTEM_OBJ} vers.o
mii_bitbang.o(.text+0x30): undefined reference to `delay'
mii_bitbang.o(.text+0x30): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x50): undefined reference to `delay'
mii_bitbang.o(.text+0x50): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x68): undefined reference to `delay'
mii_bitbang.o(.text+0x68): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0xac): undefined reference to `delay'
mii_bitbang.o(.text+0xac): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0xe8): undefined reference to `delay'
mii_bitbang.o(.text+0xe8): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x104): more undefined references to `delay' follow
mii_bitbang.o(.text+0x104): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x11c): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x1b4): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x1d4): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x1ec): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x220): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x238): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x280): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x298): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x2bc): relocation truncated to fit: ARM26 delay
mii_bitbang.o(.text+0x380): relocation truncated to fit: ARM26 delay
wi.o(.text+0xcc4): undefined reference to `microtime'
wi.o(.text+0xcc4): relocation truncated to fit: ARM26 microtime
wi.o(.text+0x11f8): undefined reference to `delay'
wi.o(.text+0x11f8): relocation truncated to fit: ARM26 delay
wi.o(.text+0x12a0): undefined reference to `delay'
wi.o(.text+0x12a0): relocation truncated to fit: ARM26 delay
wi.o(.text+0x1390): undefined reference to `delay'
wi.o(.text+0x1390): relocation truncated to fit: ARM26 delay
wi.o(.text+0x13b4): undefined reference to `delay'
wi.o(.text+0x13b4): relocation truncated to fit: ARM26 delay
dp8390.o(.text+0x348): undefined reference to `delay'
dp8390.o(.text+0x348): relocation truncated to fit: ARM26 delay
ne2000.o(.text+0x3ec): more undefined references to `delay' follow
ne2000.o(.text+0x3ec): relocation truncated to fit: ARM26 delay
ne2000.o(.text+0x430): relocation truncated to fit: ARM26 delay
ne2000.o(.text+0x46c): relocation truncated to fit: ARM26 delay
ne2000.o(.text+0x504): relocation truncated to fit: ARM26 delay
ne2000.o(.text+0xb64): relocation truncated to fit: ARM26 delay
ne2000.o(.text+0x1098): relocation truncated to fit: ARM26 delay
com.o(.text+0x408): relocation truncated to fit: ARM26 delay
com.o(.text+0x448): relocation truncated to fit: ARM26 delay
com.o(.text+0x24ec): relocation truncated to fit: ARM26 delay
com.o(.text+0x2550): undefined reference to `microtime'
com.o(.text+0x2550): relocation truncated to fit: ARM26 microtime
com.o(.text+0x2610): undefined reference to `microtime'
com.o(.text+0x2610): relocation truncated to fit: ARM26 microtime
dl10019.o(.text+0x78): undefined reference to `delay'
dl10019.o(.text+0x78): relocation truncated to fit: ARM26 delay
dl10019.o(.text+0x9c): undefined reference to `delay'
dl10019.o(.text+0x9c): relocation truncated to fit: ARM26 delay
rnd.o(.text+0x974): undefined reference to `microtime'
rnd.o(.text+0x974): relocation truncated to fit: ARM26 microtime
rnd.o(.text+0xacc): undefined reference to `microtime'
rnd.o(.text+0xacc): relocation truncated to fit: ARM26 microtime
kern_clock.o(.text+0xa4): undefined reference to `cpu_initclocks'
kern_clock.o(.text+0xa4): relocation truncated to fit: ARM26
cpu_initclocks
kern_clock.o(.text+0xb24): undefined reference to `setstatclockrate'
kern_clock.o(.text+0xb24): relocation truncated to fit: ARM26
setstatclockrate
kern_ktrace.o(.text+0x14c): undefined reference to `microtime'
kern_ktrace.o(.text+0x14c): relocation truncated to fit: ARM26 microtime
kern_resource.o(.text+0x8a8): undefined reference to `microtime'
kern_resource.o(.text+0x8a8): relocation truncated to fit: ARM26 microtime
kern_synch.o(.text+0xbe4): undefined reference to `microtime'
kern_synch.o(.text+0xbe4): relocation truncated to fit: ARM26 microtime
kern_synch.o(.text+0xd60): undefined reference to `microtime'
kern_synch.o(.text+0xd60): relocation truncated to fit: ARM26 microtime
kern_time.o(.text+0x188): undefined reference to `resettodr'
kern_time.o(.text+0x188): relocation truncated to fit: ARM26 resettodr
kern_time.o(.text+0x1c8): undefined reference to `microtime'
kern_time.o(.text+0x1c8): relocation truncated to fit: ARM26 microtime
kern_time.o(.text+0x54c): undefined reference to `microtime'
kern_time.o(.text+0x54c): relocation truncated to fit: ARM26 microtime
uipc_usrreq.o(.text+0x940): undefined reference to `microtime'
uipc_usrreq.o(.text+0x940): relocation truncated to fit: ARM26 microtime
vfs_syscalls.o(.text+0x3978): undefined reference to `microtime'
vfs_syscalls.o(.text+0x3978): relocation truncated to fit: ARM26 microtime
kernfs_vnops.o(.text+0x3b4): undefined reference to `microtime'
kernfs_vnops.o(.text+0x3b4): relocation truncated to fit: ARM26 microtime
kernfs_vnops.o(.text+0x890): more undefined references to `microtime'
follow
kernfs_vnops.o(.text+0x890): relocation truncated to fit: ARM26 microtime
bpf.o(.text+0x122c): relocation truncated to fit: ARM26 microtime
if.o(.text+0x123c): relocation truncated to fit: ARM26 microtime
if.o(.text+0x12d8): relocation truncated to fit: ARM26 microtime
ip_icmp.o(.text+0x120c): relocation truncated to fit: ARM26 microtime
ip_input.o(.text+0x2494): relocation truncated to fit: ARM26 microtime
tcp_input.o(.text+0x3ba8): relocation truncated to fit: ARM26 microtime
nfs_subs.o(.text+0xb6c): relocation truncated to fit: ARM26 microtime
nfs_vfsops.o(.text+0x1108): undefined reference to `inittodr'
nfs_vfsops.o(.text+0x1108): relocation truncated to fit: ARM26 inittodr
ffs_vfsops.o(.text+0x1b4): undefined reference to `inittodr'
ffs_vfsops.o(.text+0x1b4): relocation truncated to fit: ARM26 inittodr
mfs_vfsops.o(.text+0x24c): undefined reference to `inittodr'
mfs_vfsops.o(.text+0x24c): relocation truncated to fit: ARM26 inittodr
arm32_machdep.o(.text+0xe78): undefined reference to `memory_disc_size'
stubs.o(.text+0x4a8): undefined reference to `delay'
stubs.o(.text+0x4a8): relocation truncated to fit: ARM26 delay
sa11x0_com.o(.text+0x244): undefined reference to `delay'
sa11x0_com.o(.text+0x244): relocation truncated to fit: ARM26 delay
sa11x0_com.o(.text+0x368): undefined reference to `delay'
sa11x0_com.o(.text+0x368): relocation truncated to fit: ARM26 delay
sa11x0_com.o(.text+0x37c): undefined reference to `delay'
sa11x0_com.o(.text+0x37c): relocation truncated to fit: ARM26 delay
sed_saip.o(.text+0x31c): undefined reference to `j720lcdpower'
wsmux.o(.text+0x650): undefined reference to `microtime'
wsmux.o(.text+0x650): relocation truncated to fit: ARM26 microtime
pcmcia_cis.o(.text+0x284): undefined reference to `delay'
pcmcia_cis.o(.text+0x284): relocation truncated to fit: ARM26 delay
pcmcia_cis.o(.text+0x300): undefined reference to `delay'
pcmcia_cis.o(.text+0x300): relocation truncated to fit: ARM26 delay
pcmcia_cis.o(.text+0x4e8): undefined reference to `delay'
pcmcia_cis.o(.text+0x4e8): relocation truncated to fit: ARM26 delay
pcmcia_cis.o(.text+0x54c): undefined reference to `delay'
pcmcia_cis.o(.text+0x54c): relocation truncated to fit: ARM26 delay
if_wi_pcmcia.o(.text+0x7b4): undefined reference to `delay'
if_wi_pcmcia.o(.text+0x7b4): relocation truncated to fit: ARM26 delay
if_wi_pcmcia.o(.text+0x944): more undefined references to `delay' follow
if_wi_pcmcia.o(.text+0x944): relocation truncated to fit: ARM26 delay
sa11xx_pcic.o(.text+0x78c): relocation truncated to fit: ARM26 delay
*** Error code 1

Stop.