From: "Phil Staub" <phils@windriver.com>
To: "David Daney" <david.s.daney@gmail.com>,
"octane indice" <octane@alinto.com>
Cc: "Dmitri Vorobiev" <dmitri.vorobiev@gmail.com>, linux-mips@linux-mips.org
Subject: Re: Cross compiling MIPS kernel under x86
Date: Tue, 08 Jun 2010 14:57:48 -0700 [thread overview]
Message-ID: <op.vdz4mmlornd9a3@poker> (raw)
In-Reply-To: <4BFEE551.8000306@gmail.com>
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
next prev parent reply other threads:[~2010-06-08 21:58 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-06-09 14:48 ` octane indice
2010-06-09 14:48 ` octane indice
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.vdz4mmlornd9a3@poker \
--to=phils@windriver.com \
--cc=david.s.daney@gmail.com \
--cc=dmitri.vorobiev@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=octane@alinto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox