* Cross compiling MIPS kernel under x86
@ 2010-05-24 14:24 octane indice
2010-05-24 14:32 ` Jan Rovins
2010-05-24 14:33 ` Dmitri Vorobiev
0 siblings, 2 replies; 16+ messages in thread
From: octane indice @ 2010-05-24 14:24 UTC (permalink / raw)
To: linux-mips
Hello
I have an octeon board. I'm trying to use a custom kernel from kernel.org
instead of the Cavium one.
Under x86, I installed the CrossTools from kegel:
http://www.kegel.com/crosstool/
I tried to cross compile:
octane@darkstar:/opt/linux-2.6.34$ make ARCH=mips
CROSS_COMPILE=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin/mips-unknown-linux-gnu-
CHK include/linux/version.h
CHK include/generated/utsrelease.h
Checking missing-syscalls for N32
CALL scripts/checksyscalls.sh
Checking missing-syscalls for O32
CALL scripts/checksyscalls.sh
CALL scripts/checksyscalls.sh
CC scripts/mod/empty.o
Assembler messages:
Error: Bad value (octeon) for -march
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
So, I'm obviously missing a thing, but what?
Here is other information:
octane@darkstar:/opt$ cat world.c
#include <stdio.h>
int main()
{
printf("Hello world!\n");
return 0;
}
octane@darkstar:/opt$
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin/mips-unknown-linux-gnu-gcc
-march=octeon -o hello world.c
world.c:1: error: bad value (octeon) for -march
octane@darkstar:/opt$
octane@darkstar:/opt$ ls
/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin/
fix-embedded-paths* mips-unknown-linux-gnu-gcov*
mips-unknown-linux-gnu-addr2line* mips-unknown-linux-gnu-gprof*
mips-unknown-linux-gnu-ar* mips-unknown-linux-gnu-ld*
mips-unknown-linux-gnu-as* mips-unknown-linux-gnu-nm*
mips-unknown-linux-gnu-c++* mips-unknown-linux-gnu-objcopy*
mips-unknown-linux-gnu-c++filt* mips-unknown-linux-gnu-objdump*
mips-unknown-linux-gnu-cpp* mips-unknown-linux-gnu-ranlib*
mips-unknown-linux-gnu-g++* mips-unknown-linux-gnu-readelf*
mips-unknown-linux-gnu-gcc* mips-unknown-linux-gnu-size*
mips-unknown-linux-gnu-gcc-3.4.5* mips-unknown-linux-gnu-strings*
mips-unknown-linux-gnu-gccbug* mips-unknown-linux-gnu-strip*
So, is it a problem with octeon arch and gcc, or a mips problem?
Thanks
------------------------------------------------------------------------------------------
Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com
^ permalink raw reply [flat|nested] 16+ messages in thread* Re: Cross compiling MIPS kernel under x86 2010-05-24 14:24 Cross compiling MIPS kernel under x86 octane indice @ 2010-05-24 14:32 ` Jan Rovins 2010-05-24 14:33 ` Dmitri Vorobiev 1 sibling, 0 replies; 16+ messages in thread From: Jan Rovins @ 2010-05-24 14:32 UTC (permalink / raw) To: octane indice; +Cc: linux-mips octane indice wrote: > Hello > > I have an octeon board. I'm trying to use a custom kernel from kernel.org > instead of the Cavium one. > > Under x86, I installed the CrossTools from kegel: > http://www.kegel.com/crosstool/ > > I tried to cross compile: > octane@darkstar:/opt/linux-2.6.34$ make ARCH=mips > CROSS_COMPILE=/opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin/mips-unknown-linux-gnu- > CHK include/linux/version.h > CHK include/generated/utsrelease.h > Checking missing-syscalls for N32 > CALL scripts/checksyscalls.sh > Checking missing-syscalls for O32 > CALL scripts/checksyscalls.sh > CALL scripts/checksyscalls.sh > CC scripts/mod/empty.o > Assembler messages: > Error: Bad value (octeon) for -march > make[2]: *** [scripts/mod/empty.o] Error 1 > make[1]: *** [scripts/mod] Error 2 > make: *** [scripts] Error 2 > > So, I'm obviously missing a thing, but what? > > Here is other information: > octane@darkstar:/opt$ cat world.c > #include <stdio.h> > int main() > { > printf("Hello world!\n"); > return 0; > } > octane@darkstar:/opt$ > /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin/mips-unknown-linux-gnu-gcc > -march=octeon -o hello world.c > world.c:1: error: bad value (octeon) for -march > octane@darkstar:/opt$ > > octane@darkstar:/opt$ ls > /opt/crosstool/gcc-3.4.5-glibc-2.3.6/mips-unknown-linux-gnu/bin/ > fix-embedded-paths* mips-unknown-linux-gnu-gcov* > mips-unknown-linux-gnu-addr2line* mips-unknown-linux-gnu-gprof* > mips-unknown-linux-gnu-ar* mips-unknown-linux-gnu-ld* > mips-unknown-linux-gnu-as* mips-unknown-linux-gnu-nm* > mips-unknown-linux-gnu-c++* mips-unknown-linux-gnu-objcopy* > mips-unknown-linux-gnu-c++filt* mips-unknown-linux-gnu-objdump* > mips-unknown-linux-gnu-cpp* mips-unknown-linux-gnu-ranlib* > mips-unknown-linux-gnu-g++* mips-unknown-linux-gnu-readelf* > mips-unknown-linux-gnu-gcc* mips-unknown-linux-gnu-size* > mips-unknown-linux-gnu-gcc-3.4.5* mips-unknown-linux-gnu-strings* > mips-unknown-linux-gnu-gccbug* mips-unknown-linux-gnu-strip* > > So, is it a problem with octeon arch and gcc, or a mips problem? > > Thanks > > > > > > > > > ------------------------------------------------------------------------------------------ > > > Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com > > > > gcc-3.4.5-glibc-2.3.6 The recognition of "octeon" as an option does not show up in GCC until mainstream version 4.4. looks like your gcc is too old gcc-3.4.5-glibc-2.3.6 Jan ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-24 14:24 Cross compiling MIPS kernel under x86 octane indice 2010-05-24 14:32 ` Jan Rovins @ 2010-05-24 14:33 ` Dmitri Vorobiev 2010-05-25 13:13 ` Ralf Baechle 1 sibling, 1 reply; 16+ messages in thread From: Dmitri Vorobiev @ 2010-05-24 14:33 UTC (permalink / raw) To: octane indice; +Cc: linux-mips On Mon, May 24, 2010 at 5:24 PM, octane indice <octane@alinto.com> wrote: > > Hello > > I have an octeon board. I'm trying to use a custom kernel from kernel.org > instead of the Cavium one. > [skipped] > > So, I'm obviously missing a thing, but what? It looks like your toolchain is quite old. I just tried building a Cavium Octeon defconfig using my custom toolchain based on GCC 4.3.1 and binutils 2.19.51.20090304, and the build was successfull. Before you ask: yes, GCC did receive `-march=octeon' :) Dmitri ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-24 14:33 ` Dmitri Vorobiev @ 2010-05-25 13:13 ` Ralf Baechle 2010-05-25 13:48 ` Guenter Roeck 2010-05-25 13:58 ` octane indice 0 siblings, 2 replies; 16+ messages in thread From: Ralf Baechle @ 2010-05-25 13:13 UTC (permalink / raw) To: Dmitri Vorobiev; +Cc: octane indice, linux-mips On Mon, May 24, 2010 at 05:33:01PM +0300, Dmitri Vorobiev wrote: > It looks like your toolchain is quite old. I just tried building a > Cavium Octeon defconfig using my custom toolchain based on GCC 4.3.1 > and binutils 2.19.51.20090304, and the build was successfull. Before > you ask: yes, GCC did receive `-march=octeon' :) Tools requirements to build a kernel have become a little bit confusing. I'm sure there are more restrictions that I've forgot. * The Lemote 2F defconfig requires binutils 2.20 to build. * GCC 3.2 is a lost cause for building 64-bit kernels * GCC 3.3 is broken but can just about be kludged to build a 64-bit kernel. * GCC 4.4 or a patched older version is required to build a kernel O2 or Indigo² with R10000 processors. * GCC 3.2 used to work for the rest but it's a very long time since I tested this for a modern kernel. * Linux 2.6.29 and older need a GCC older than 4.4.0 to compile. Ralf ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-25 13:13 ` Ralf Baechle @ 2010-05-25 13:48 ` Guenter Roeck 2010-05-25 13:58 ` octane indice 1 sibling, 0 replies; 16+ messages in thread From: Guenter Roeck @ 2010-05-25 13:48 UTC (permalink / raw) To: Ralf Baechle; +Cc: Dmitri Vorobiev, octane indice, linux-mips@linux-mips.org On Tue, May 25, 2010 at 09:13:41AM -0400, Ralf Baechle wrote: > On Mon, May 24, 2010 at 05:33:01PM +0300, Dmitri Vorobiev wrote: > > > It looks like your toolchain is quite old. I just tried building a > > Cavium Octeon defconfig using my custom toolchain based on GCC 4.3.1 > > and binutils 2.19.51.20090304, and the build was successfull. Before > > you ask: yes, GCC did receive `-march=octeon' :) > > Tools requirements to build a kernel have become a little bit confusing. > I'm sure there are more restrictions that I've forgot. > > * The Lemote 2F defconfig requires binutils 2.20 to build. > * GCC 3.2 is a lost cause for building 64-bit kernels > * GCC 3.3 is broken but can just about be kludged to build a 64-bit kernel. > * GCC 4.4 or a patched older version is required to build a kernel O2 or > Indigo² with R10000 processors. > * GCC 3.2 used to work for the rest but it's a very long time since I > tested this for a modern kernel. > * Linux 2.6.29 and older need a GCC older than 4.4.0 to compile. > The toolchain from emdebian seems to work fine for me, though it is at times a bit difficult to set up due to bad dependencies. Guenter ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-25 13:13 ` Ralf Baechle 2010-05-25 13:48 ` Guenter Roeck @ 2010-05-25 13:58 ` octane indice 2010-05-25 14:44 ` Ralf Baechle 1 sibling, 1 reply; 16+ messages in thread From: octane indice @ 2010-05-25 13:58 UTC (permalink / raw) To: Ralf Baechle; +Cc: Dmitri Vorobiev, octane indice, linux-mips En réponse à Ralf Baechle <ralf@linux-mips.org> : > > On Mon, May 24, 2010 at 05:33:01PM +0300, Dmitri Vorobiev > wrote: > > > It looks like your toolchain is quite old. I just tried building a > > Cavium Octeon defconfig using my custom toolchain based on > > GCC 4.3.1 and binutils 2.19.51.20090304, and the build was > > successfull. Before you ask: yes, GCC did receive > > `-march=octeon' :) > Ok, thanks :) > Tools requirements to build a kernel have become a little bit > confusing. I'm sure there are more restrictions that I've forgot. > > * The Lemote 2F defconfig requires binutils 2.20 to build. > * GCC 3.2 is a lost cause for building 64-bit kernels > * GCC 3.3 is broken but can just about be kludged to build a > 64-bit kernel. > * GCC 4.4 or a patched older version is required to build a > kernel O2 or > Indigo² with R10000 processors. > * GCC 3.2 used to work for the rest but it's a very long time > since I tested this for a modern kernel. > * Linux 2.6.29 and older need a GCC older than 4.4.0 to > compile. > Ok. I'm following the info there: http://www.linux-mips.org/wiki/Toolchains but infos seems a bit old, so I followed the main idea with newer binutils and gcc-4.4.4 It is still compiling gcc. When it will finish, I will ping back and say if it compiles an octeon kernel 2.6.34 > ------------------- Fin du message d'origine --------------------- Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-25 13:58 ` octane indice @ 2010-05-25 14:44 ` Ralf Baechle 2010-05-26 13:11 ` octane indice 0 siblings, 1 reply; 16+ messages in thread From: Ralf Baechle @ 2010-05-25 14:44 UTC (permalink / raw) To: octane indice; +Cc: Dmitri Vorobiev, linux-mips On Tue, May 25, 2010 at 03:58:25PM +0200, octane indice wrote: > Ok. I'm following the info there: > http://www.linux-mips.org/wiki/Toolchains > but infos seems a bit old, so I followed the main idea > with newer binutils and gcc-4.4.4 That page just documents available toolchains and is suffering from too many details. Somebody should do a bit weed killing on that page. The build dependencies for the kernel are documented on http://www.linux-mips.org/wiki/Kernel_Build which I've updated just before my previous posting. > It is still compiling gcc. When it will finish, I will ping back > and say if it compiles an octeon kernel 2.6.34 It will :-) Ralf ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-25 14:44 ` Ralf Baechle @ 2010-05-26 13:11 ` octane indice 2010-05-26 14:26 ` Dmitri Vorobiev 0 siblings, 1 reply; 16+ messages in thread From: octane indice @ 2010-05-26 13:11 UTC (permalink / raw) To: Ralf Baechle; +Cc: linux-mips Sorry to bother you another time, but it's a FAIL :-( I'm exactly in that situation: http://gcc.gnu.org/ml/gcc-help/2009-08/msg00198.html I read some docs, relaunched the configure process another time, read that I should build with make all-gcc But error is still present. thanks En réponse à Ralf Baechle <ralf@linux-mips.org> : > ------------------ Début du message d'origine -------------------- > > On Tue, May 25, 2010 at 03:58:25PM +0200, octane indice wrote: > > > Ok. I'm following the info there: > > http://www.linux-mips.org/wiki/Toolchains > > but infos seems a bit old, so I followed the main idea > > with newer binutils and gcc-4.4.4 > > That page just documents available toolchains and is suffering > from too > many details. Somebody should do a bit weed killing on that > page. > > The build dependencies for the kernel are documented on > > http://www.linux-mips.org/wiki/Kernel_Build > > which I've updated just before my previous posting. > > > It is still compiling gcc. When it will finish, I will ping > back > > and say if it compiles an octeon kernel 2.6.34 > > It will :-) > > Ralf > > ------------------- Fin du message d'origine --------------------- Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-26 13:11 ` octane indice @ 2010-05-26 14:26 ` Dmitri Vorobiev 2010-05-27 16:29 ` octane indice 0 siblings, 1 reply; 16+ messages in thread From: Dmitri Vorobiev @ 2010-05-26 14:26 UTC (permalink / raw) To: octane indice; +Cc: Ralf Baechle, linux-mips On Wed, May 26, 2010 at 4:11 PM, octane indice <octane@alinto.com> wrote: > Sorry to bother you another time, but it's a FAIL :-( Just checked that the following steps result in a successful build of a vanilla 2.6.34 vmlinux: cd /work/tmp/zoo/src wget http://ftp.gnu.org/gnu/binutils/binutils-2.20.1.tar.bz2 cd ../build ../src/binutils-2.20.1/configure --prefix=/work/tmp/zoo --target=mips64-unknown-linux-gnu make export PATH=/work/tmp/zoo/bin:$PATH rm -rf * cd ../src/ wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.4/gcc-core-4.4.4.tar.bz2 tar jxf gcc-core-4.4.4.tar.bz2 cd ../build ../src/gcc-4.4.4/configure --target=mips64-unknown-linux-gnu --prefix=/work/tmp/zoo --disable-threads --disable-shared --disable-multilib --disable-libgcc --disable-libmudflap --disable-libssp --disable-libgomp make make install cd ../src wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.34.tar.bz2 tar jxf linux-2.6.34.tar.bz2 cd linux-2.6.34/ make ARCH=mips cavium-octeon_defconfig make ARCH=mips CROSS_COMPILE=/work/tmp/zoo/bin/mips64-unknown-linux-gnu- vmlinux Hope that helps. Dmitri ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-26 14:26 ` Dmitri Vorobiev @ 2010-05-27 16:29 ` octane indice 2010-05-27 21:12 ` Dmitri Vorobiev 2010-05-27 21:34 ` David Daney 0 siblings, 2 replies; 16+ messages in thread From: octane indice @ 2010-05-27 16:29 UTC (permalink / raw) To: Dmitri Vorobiev; +Cc: linux-mips Response to Dmitri Vorobiev <dmitri.vorobiev@gmail.com> : > Just checked that the following steps result in a successful > build of a vanilla 2.6.34 vmlinux: > Thanks for taking the time to do it. > http://ftp.gnu.org/gnu/gcc/gcc-4.4.4/gcc-core-4.4.4.tar.bz2 > tar jxf gcc-core-4.4.4.tar.bz2 > cd ../build > ../src/gcc-4.4.4/configure --target=mips64-unknown-linux-gnu > --prefix=/work/tmp/zoo --disable-threads --disable-shared > --disable-multilib --disable-libgcc --disable-libmudflap > --disable-libssp --disable-libgomp > make It fails here with something related to stdc++. With adding a --enable-language=c it works. So the configure line I used is: ../gcc-4.4.4/configure --target=mips64-unknown-linux-gnu --prefix=/var/samba/mips --disable-threads --disable-shared --disable-multilib --disable-libgcc --disable-libmudflap --disable-libssp --disable-libgomp --enable-languages=c > make ARCH=mips cavium-octeon_defconfig > make ARCH=mips > CROSS_COMPILE=/work/tmp/zoo/bin/mips64-unknown-linux-gnu- vmlinux > > Hope that helps. > It helped me a lot, thank you. The kernel compiles fine. The kernel is very huge: 39MBytes (!). After a mips64-unknown-linux-gnu-strip, it downsized to 3.3MBytes. But that kernel doesn't boot. The system in the board I have uses in U-boot: ext2load ide 0 4000000 vmlinux bootoctlinux 4000000 (other args..) But when I replace the vmlinux file with mine called 'mips', it says: RSEC-K1# ext2load ide 0 4000000 mips 3362840 bytes read WARNING: Data loaded outside of the reserved load area, memory corruption may occur. WARNING: Please refer to the bootloader memory map documentation for more information. RSEC-K1# bootoctlinux 4000000 ELF file is 64 bit Attempting to allocate memory for ELF segment: addr: 0xffffffff81100000 (adjusted to: 0x0000000001100000), size 0x355c00 Allocated memory for ELF segment: addr: 0xffffffff81100000, size 0x355c00 Attempting to allocate memory for ELF segment: addr: 0xffffffff81343da0 (adjusted to: 0x0000000001343da0), size 0x24 Error allocating memory for elf image! ## ERROR loading File! RSEC-K1# I tried a lot of different numbers like 2000000 or greater, depending of what I find in mailing lists, but I don't find the right value. Is there a way to compute it, or it's kernel I made that is not right? Thanks > ------------------- --------------------- Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-27 16:29 ` octane indice @ 2010-05-27 21:12 ` Dmitri Vorobiev 2010-05-27 21:34 ` David Daney 1 sibling, 0 replies; 16+ messages in thread From: Dmitri Vorobiev @ 2010-05-27 21:12 UTC (permalink / raw) To: octane indice; +Cc: linux-mips On Thu, May 27, 2010 at 7:29 PM, octane indice <octane@alinto.com> wrote: > Response to Dmitri Vorobiev <dmitri.vorobiev@gmail.com> : > > I tried a lot of different numbers like 2000000 or greater, depending of > what I find in mailing lists, but I don't find the right value. Is there a > way to compute it, or it's kernel I made that is not right? Well, I can't say offhand, and I don't have hardware to check that. One thing that attracts attention is that the size of 0x24 is apparently too small. Hard to say what's going on without knowing the hardware and seeing the docs for it. Dmitri ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-27 16:29 ` octane indice 2010-05-27 21:12 ` Dmitri Vorobiev @ 2010-05-27 21:34 ` David Daney 2010-05-27 22:17 ` Dmitri Vorobiev 2010-06-08 21:57 ` Phil Staub 1 sibling, 2 replies; 16+ messages in thread From: David Daney @ 2010-05-27 21:34 UTC (permalink / raw) To: octane indice; +Cc: Dmitri Vorobiev, linux-mips On 05/27/2010 09:29 AM, octane indice wrote: > Response to Dmitri Vorobiev<dmitri.vorobiev@gmail.com> : >> Just checked that the following steps result in a successful >> build of a vanilla 2.6.34 vmlinux: >> > Thanks for taking the time to do it. > >> http://ftp.gnu.org/gnu/gcc/gcc-4.4.4/gcc-core-4.4.4.tar.bz2 >> tar jxf gcc-core-4.4.4.tar.bz2 >> cd ../build >> ../src/gcc-4.4.4/configure --target=mips64-unknown-linux-gnu >> --prefix=/work/tmp/zoo --disable-threads --disable-shared >> --disable-multilib --disable-libgcc --disable-libmudflap >> --disable-libssp --disable-libgomp >> make > > It fails here with something related to stdc++. With adding a > --enable-language=c it works. So the configure line I used is: > ../gcc-4.4.4/configure --target=mips64-unknown-linux-gnu > --prefix=/var/samba/mips --disable-threads --disable-shared > --disable-multilib --disable-libgcc --disable-libmudflap --disable-libssp > --disable-libgomp --enable-languages=c > >> make ARCH=mips cavium-octeon_defconfig >> make ARCH=mips >> CROSS_COMPILE=/work/tmp/zoo/bin/mips64-unknown-linux-gnu- vmlinux >> >> Hope that helps. >> > It helped me a lot, thank you. The kernel compiles fine. > The kernel is very huge: 39MBytes (!). > After a mips64-unknown-linux-gnu-strip, it downsized to 3.3MBytes. > But that kernel doesn't boot. > > The system in the board I have uses in U-boot: > ext2load ide 0 4000000 vmlinux > bootoctlinux 4000000 (other args..) > > But when I replace the vmlinux file with mine called 'mips', it says: > RSEC-K1# ext2load ide 0 4000000 mips > > 3362840 bytes read > WARNING: Data loaded outside of the reserved load area, memory corruption > may occur. > WARNING: Please refer to the bootloader memory map documentation for more > information. > RSEC-K1# bootoctlinux 4000000 > ELF file is 64 bit > Attempting to allocate memory for ELF segment: addr: 0xffffffff81100000 > (adjusted to: 0x0000000001100000), size 0x355c00 > Allocated memory for ELF segment: addr: 0xffffffff81100000, size 0x355c00 > Attempting to allocate memory for ELF segment: addr: 0xffffffff81343da0 > (adjusted to: 0x0000000001343da0), size 0x24 > Error allocating memory for elf image! > ## ERROR loading File! > RSEC-K1# > Early Octeon bootloaders cannot handle PT_NOTE program headers, I think that is what is biting you here. If you can upgrade to an SDK-1.9 or later bootloader, I would recommend that. Otherwise remove the PT_NOTE from your kernel image (the technique for doing this is left as an excise for the reader, but I have found that emacs hexl mode works well). David Daney ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-27 21:34 ` David Daney @ 2010-05-27 22:17 ` Dmitri Vorobiev 2010-06-08 21:57 ` Phil Staub 1 sibling, 0 replies; 16+ messages in thread From: Dmitri Vorobiev @ 2010-05-27 22:17 UTC (permalink / raw) To: David Daney; +Cc: octane indice, linux-mips On Fri, May 28, 2010 at 12:34 AM, David Daney <david.s.daney@gmail.com> wrote: > On 05/27/2010 09:29 AM, octane indice wrote: >> > Otherwise remove the PT_NOTE from your kernel image (the technique > for doing this is left as an excise for the reader, but I have found that > emacs hexl mode works well). I still believe using objcopy should be a bit more straightforward :) Dmitri ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 2010-05-27 21:34 ` David Daney 2010-05-27 22:17 ` Dmitri Vorobiev @ 2010-06-08 21:57 ` Phil Staub 2010-06-09 14:48 ` octane indice 1 sibling, 1 reply; 16+ messages in thread From: Phil Staub @ 2010-06-08 21:57 UTC (permalink / raw) To: David Daney, octane indice; +Cc: Dmitri Vorobiev, linux-mips On Thu, 27 May 2010 14:34:09 -0700, David Daney <david.s.daney@gmail.com> wrote: > On 05/27/2010 09:29 AM, octane indice wrote: >> Response to Dmitri Vorobiev<dmitri.vorobiev@gmail.com> : >>> Just checked that the following steps result in a successful >>> build of a vanilla 2.6.34 vmlinux: >>> >> Thanks for taking the time to do it. >> >>> http://ftp.gnu.org/gnu/gcc/gcc-4.4.4/gcc-core-4.4.4.tar.bz2 >>> tar jxf gcc-core-4.4.4.tar.bz2 >>> cd ../build >>> ../src/gcc-4.4.4/configure --target=mips64-unknown-linux-gnu >>> --prefix=/work/tmp/zoo --disable-threads --disable-shared >>> --disable-multilib --disable-libgcc --disable-libmudflap >>> --disable-libssp --disable-libgomp >>> make >> >> It fails here with something related to stdc++. With adding a >> --enable-language=c it works. So the configure line I used is: >> ../gcc-4.4.4/configure --target=mips64-unknown-linux-gnu >> --prefix=/var/samba/mips --disable-threads --disable-shared >> --disable-multilib --disable-libgcc --disable-libmudflap >> --disable-libssp >> --disable-libgomp --enable-languages=c >> >>> make ARCH=mips cavium-octeon_defconfig >>> make ARCH=mips >>> CROSS_COMPILE=/work/tmp/zoo/bin/mips64-unknown-linux-gnu- vmlinux >>> >>> Hope that helps. >>> >> It helped me a lot, thank you. The kernel compiles fine. >> The kernel is very huge: 39MBytes (!). >> After a mips64-unknown-linux-gnu-strip, it downsized to 3.3MBytes. >> But that kernel doesn't boot. >> >> The system in the board I have uses in U-boot: >> ext2load ide 0 4000000 vmlinux >> bootoctlinux 4000000 (other args..) >> >> But when I replace the vmlinux file with mine called 'mips', it says: >> RSEC-K1# ext2load ide 0 4000000 mips >> >> 3362840 bytes read >> WARNING: Data loaded outside of the reserved load area, memory >> corruption >> may occur. >> WARNING: Please refer to the bootloader memory map documentation for >> more >> information. >> RSEC-K1# bootoctlinux 4000000 >> ELF file is 64 bit >> Attempting to allocate memory for ELF segment: addr: 0xffffffff81100000 >> (adjusted to: 0x0000000001100000), size 0x355c00 >> Allocated memory for ELF segment: addr: 0xffffffff81100000, size >> 0x355c00 >> Attempting to allocate memory for ELF segment: addr: 0xffffffff81343da0 >> (adjusted to: 0x0000000001343da0), size 0x24 >> Error allocating memory for elf image! >> ## ERROR loading File! >> RSEC-K1# >> > > Early Octeon bootloaders cannot handle PT_NOTE program headers, I think > that is what is biting you here. > > If you can upgrade to an SDK-1.9 or later bootloader, I would recommend > that. Otherwise remove the PT_NOTE from your kernel image (the > technique for doing this is left as an excise for the reader, but I have > found that emacs hexl mode works well). In the top level Makefile, you'll find this: # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ $(call cc-ldoption, -Wl$(comma)--build-id,)) Comment that out and it should fix you up. Phil > > David Daney > -- Phil Staub, Senior Member of Technical Staff, Wind River Direct: 702.290.0470 Fax: 702.982.0085 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 @ 2010-06-09 14:48 ` octane indice 0 siblings, 0 replies; 16+ messages in thread From: octane indice @ 2010-06-09 14:48 UTC (permalink / raw) To: phils, Phil Staub; +Cc: linux-mips En réponse à Phil Staub <phils@windriver.com> : > In the top level Makefile, you'll find this: > > # Use --build-id when available. > LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ > $(call cc-ldoption, -Wl$(comma)--build-id,)) > > Comment that out and it should fix you up. > Excellent. It boots. It fails next because it can't find the root device, but I know how to manage that > Phil > Thanks > -- > Phil Staub, Senior Member of Technical Staff, Wind River > Direct: 702.290.0470 Fax: 702.982.0085 > Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Cross compiling MIPS kernel under x86 @ 2010-06-09 14:48 ` octane indice 0 siblings, 0 replies; 16+ messages in thread From: octane indice @ 2010-06-09 14:48 UTC (permalink / raw) To: phils; +Cc: linux-mips En réponse à Phil Staub <phils@windriver.com> : > In the top level Makefile, you'll find this: > > # Use --build-id when available. > LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ > $(call cc-ldoption, -Wl$(comma)--build-id,)) > > Comment that out and it should fix you up. > Excellent. It boots. It fails next because it can't find the root device, but I know how to manage that > Phil > Thanks > -- > Phil Staub, Senior Member of Technical Staff, Wind River > Direct: 702.290.0470 Fax: 702.982.0085 > Envoyé avec Inmano, ma messagerie renversante et gratuite : http://www.inmano.com ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2010-06-09 14:49 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-05-24 14:24 Cross compiling MIPS kernel under x86 octane indice 2010-05-24 14:32 ` Jan Rovins 2010-05-24 14:33 ` Dmitri Vorobiev 2010-05-25 13:13 ` Ralf Baechle 2010-05-25 13:48 ` Guenter Roeck 2010-05-25 13:58 ` octane indice 2010-05-25 14:44 ` Ralf Baechle 2010-05-26 13:11 ` octane indice 2010-05-26 14:26 ` Dmitri Vorobiev 2010-05-27 16:29 ` octane indice 2010-05-27 21:12 ` Dmitri Vorobiev 2010-05-27 21:34 ` David Daney 2010-05-27 22:17 ` Dmitri Vorobiev 2010-06-08 21:57 ` Phil Staub 2010-06-09 14:48 ` octane indice 2010-06-09 14:48 ` octane indice
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.