Skip to contentSkip to conversation

crosscompile doesn't work :(

DISCUSSION Gabor Kerenyi 4 participants 4 messages Apr 28, 2003 MIPS

lore
Share & tools
lore
#0 lore raw

hi!

I'm totally new to MIPS and the bigger trouble that I'm also new to cross compiling.
I will get a little MIPS board with PCMCIA, USB, serial, Ethernet, 4Mb flash memory. I have to build a linux for it from scratch but I have never done cross compiling before.

I use debian (Woody) and I installed the toolchain package, configured for mipsel-linux, I built the binutils and gcc, (binutils 2.12, gcc 3.2.3)

I did:
tpkg-make mipsel-linux
cd binutils
debuild
debi

tpkg-install-libc mipsel-linux

cd ../gcc-3.2.3
debuild
debi

I can compile a simple c code, but I can't compile the kernel. I tried to compile 2.4.19 and I ran into trouble at the beginning:

the 'as' said that -mcpu option is not recognized. OK, I removed this option. Then everything seemed to be fine but when the compilation arrived to the arch/mips directiory than I got the following error messages:

make[1]: Leaving directory `/usr/src/linux/arch/mips/math-emu' make CFLAGS="-D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I /usr/src/linux/include/asm/gcc -G 0 -mno-abicalls -fno-pic -pipe -mips2 -Wa,--trap " -C arch/mips/sni make[1]: Entering directory `/usr/src/linux/arch/mips/sni' mipsel-linux-gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -I /usr/src/linux/include/asm/gcc -G 0 -mno-abicalls -fno-pic -pipe -mips2 -Wa,--trap -c int-handler.S -o int-handler.o
/usr/src/linux/include/asm/mipsregs.h: Assembler messages:
/usr/src/linux/include/asm/mipsregs.h:562: Error: unrecognized opcode static inline void tlb_probe(void)' /usr/src/linux/include/asm/mipsregs.h:563: Warning: rest of line ignored; first ignored character is {' /usr/src/linux/include/asm/mipsregs.h:564: Error: unrecognized opcode __asm__ __volatile__(' /usr/src/linux/include/asm/mipsregs.h:565: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:566: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:567: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:568: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:569: Warning: rest of line ignored; first ignored character is }'

The board chose was only a test bacause I don't know anything about the board I'm going to use. There is a nice Japanese page about it, but I can't read it.

http://www.tcs-8000.info/products/

Can anyone help? I have to bulid a complete little system in 4Mb within a month.

I also tried to build the cross compile environment from the sources directly not using toolchain but I got much less success. it didn't compile at all (gcc).

Thanks a lot,

Gabor

#1 lore raw

wait on vr4181 part 2

If there is no wait, then what's that in arch/mips/vr4181/osprey/reset.c ? void nec_osprey_halt(void)

{
	printk("KERN_NOTICE "\n** You can safely turn off the power.\n");
	while(1)
		__asm__(".set\tmips3\n\t"
			"wait\n\t"
			".set\tmips0");
}

Steve

#2 lore raw

Re: wait on vr4181 part 2

Quoted 1 line · Steven Seeger

If there is no wait, then what's that in arch/mips/vr4181/osprey/reset.c ?

Simple - it is a bug. :)

I got a confirmation from NEC that Vr4181 does _not_ have wait instruction. It should generate an exception though.

In the halt case, kernel is probably in such a zombie state that we don't even see the exception.

Jun

Quoted 11 lines

void nec_osprey_halt(void)

{
	printk("KERN_NOTICE "\n** You can safely turn off the power.\n");
	while(1)
		__asm__(".set\tmips3\n\t"
			"wait\n\t"
			".set\tmips0");
}

Steve

#3 lore raw
In reply to Gabor Kerenyi

Gabor:

I just got binutils 2.12, gcc 3.2.3, and glibc 2.2.5 working on my Red Hat Linux boxen, and I'm targeting mipsel-linux. If you would like the source / binary RPMs to see what I did, let me know; maybe Alien can fix them up for you.

I feel your pain concerning the cross compiling. I at first tried to install GCC 3.2 everything to /opt/toolchains using --prefix and/or other options, but it seemed like GCC was particularly upset with --prefix. I tried the gcc 3.2.3 source WITHOUT --prefix, and it seemed to configure itself properly and coexist OK.

Best of luck!

-Jeff

Quoted 79 lines · Gabor Kerenyi

hi!

I'm totally new to MIPS and the bigger trouble that I'm also new to cross compiling.
I will get a little MIPS board with PCMCIA, USB, serial, Ethernet, 4Mb flash memory. I have to build a linux for it from scratch but I have never done cross compiling before.

I use debian (Woody) and I installed the toolchain package, configured for mipsel-linux, I built the binutils and gcc, (binutils 2.12, gcc 3.2.3)

I did:
tpkg-make mipsel-linux
cd binutils
debuild
debi

tpkg-install-libc mipsel-linux

cd ../gcc-3.2.3
debuild
debi

I can compile a simple c code, but I can't compile the kernel. I tried to compile 2.4.19 and I ran into trouble at the beginning:

the 'as' said that -mcpu option is not recognized. OK, I removed this option. Then everything seemed to be fine but when the compilation arrived to the arch/mips directiory than I got the following error messages:

make[1]: Leaving directory `/usr/src/linux/arch/mips/math-emu' make CFLAGS="-D__KERNEL__ -I/usr/src/linux/include -Wall

(quoted diff) +0 -2
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing 
-fno-common -fomit-frame-pointer -I /usr/src/linux/include/asm/gcc -G 

0 -mno-abicalls -fno-pic -pipe -mips2 -Wa,--trap " -C arch/mips/sni make[1]: Entering directory `/usr/src/linux/arch/mips/sni' mipsel-linux-gcc -D__KERNEL__ -I/usr/src/linux/include -Wall

(quoted diff) +0 -2
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing 
-fno-common -fomit-frame-pointer -I /usr/src/linux/include/asm/gcc -G 

0 -mno-abicalls -fno-pic -pipe -mips2 -Wa,--trap -c int-handler.S -o int-handler.o
/usr/src/linux/include/asm/mipsregs.h: Assembler messages:
/usr/src/linux/include/asm/mipsregs.h:562: Error: unrecognized opcode static inline void tlb_probe(void)' /usr/src/linux/include/asm/mipsregs.h:563: Warning: rest of line ignored; first ignored character is {' /usr/src/linux/include/asm/mipsregs.h:564: Error: unrecognized opcode __asm__ __volatile__(' /usr/src/linux/include/asm/mipsregs.h:565: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:566: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:567: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:568: Warning: rest of line ignored; first ignored character is "' /usr/src/linux/include/asm/mipsregs.h:569: Warning: rest of line ignored; first ignored character is }'

The board chose was only a test bacause I don't know anything about the board I'm going to use. There is a nice Japanese page about it, but I can't read it.

http://www.tcs-8000.info/products/

Can anyone help? I have to bulid a complete little system in 4Mb within a month.

I also tried to build the cross compile environment from the sources directly not using toolchain but I got much less success. it didn't compile at all (gcc).

Thanks a lot,

Gabor

Signature · 7 lines
         Jeffrey Baitis - Associate Software Engineer

                    Evolution Robotics, Inc.
                     130 West Union Street
                       Pasadena CA 91103

 tel: 626.535.2776  |  fax: 626.535.2777  |  [email protected]