From: Kumba <kumba@gentoo.org>
To: linux-mips@linux-mips.org
Subject: Re: Solving the cross-compiler issue (Was: Trouble compiling MIPS cross-compiler)
Date: Thu, 22 Jan 2004 15:32:10 -0500 [thread overview]
Message-ID: <4010334A.5050500@gentoo.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0401211633240.31973-101000@zcar.ghs.com>
Nathan Field wrote:
> This email is a bit long so here's the short version:
> Building cross tools is basically impossible without knowledge
> which isn't available on the www.linux-mips.org web site
> glibc seems to have obvious syntax errors and won't even compile
> The prebuilt tools referenced in the FAQ are so out of date
> they're useless
> Even tools provided by various commercial Linux vendors are out of
> date (at least what MontaVista lets us see in their preview kits)
> This could all be solved if someone wrote a script to do all the
> work which contains all the logic necessary to get a known set of tools to
> build
>
> I've written a script which will do all the work, but because there are
> failures in building glibc it doesn't work. If someone could help me get
> my script to work it could be used to update the cross compile section of
> the FAQ. The script as it stands is attached. It needs some configuration
> (which is why it exits by default), but if you're trying to build a cross
> compiler you'd better have at least some knowledge of what you're doing.
>
> Here's what it does:
> it wgets specific versions of binutils, gcc and glibc
> it sets some environment variables
> it uncompresses and builds the tools in the "correct" sequence
> with the correct options
>
> There are 2 problems with this script:
> 1. It references a specific binutils snapshot which will probably
> go away in a few days
> 2. It doesn't f'ing work
>
> That said, here's where things are breaking:
>
> I'm also trying to build a newer cross toolchain since MontaVista doesn't
> seem to provide one recent enough to even build the linux_2_4 branch from
> the linux-mips cvs repository (it builds, but when I run it on my Malta
> board it crashes immediately). I'm coming up against problems that just
> seem stupidly obvious... Enough ranting though, here are the details.
>
I also coded my own cross-compiler script, which is partially integrated
with gentoo's package management system, portage. It uses the portage
API to determine the most recent version, download, and patch sources,
then the script takes over the building process. It's not flawless, but
it does work for generating mips[el] cross-compilers on i686 and
linux-sparc64 hosts (among other targets).
If anyone runs gentoo, it's available as sys-devel/crossdev in the
portage tree.
> Kumba suggested using:
>
>>I'd recommend the following:
>>binutils-2.14.90.0.7 (or you can try the latest .8 release, it has some
>>more mips fixes in it)
>>glibc-2.3.2 (or 2.3.1)
>>gcc-3.3.2
>
> I couldn't find a version of binutils like that, so I grabbed
> yesterdays snapshot, which builds and runs fine. Then I built the gcc
> bootstrap fine. Then I tried building glibc-2.3.2. That failed when it got
> to stdio-common/sscanf. The declaration of sscanf:
That version of binutils is a linux-only release maintained by HJ Lu.
He even announces new versions to this list. You can find all the
versions of this specific branch of binutils at:
http://www.kernel.org/pub/linux/devel/binutils/
> sscanf (s, format)
> const char *s;
> const char *format;
>
> Doesn't match the function, and it should be:
>
> sscanf (const char *s, const char *format, ...)
>
> Does no one even bother to test to see if these things compile before they
> are released? I've had similar syntax error type problems when building
> several older (2.2.x) versions of glibc for PPC.
This was a bug in early versions of glibc I believe, and is fixed in any
modern glibc checkout you do from the libc-alpha CVS.
> Anyway, after I fixed that I now get a link failure:
>
> /space1/ndf/linux/mips/tools/glibc-build/elf/ld.so.1: undefined reference
> to `elf_machine_rela.7'
>
> The command which generates this is:
[snip]
> Interestingly when I try glibc 2.3.1 I get the same syntax error in sscanf
> but the linker complains about elf_machine_rela, without the .7.
>
> It would be wonderful if I could get some help on this. It seems like a
> chicken and egg problem which will only get worse as more and more people
> try to build the 2.6 kernels.
Another glibc bug, also fixed in modern CVS. The patch that does fix
the issue is here:
http://honk.physik.uni-konstanz.de/linux-mips/glibc/patches/applied/elf-machine-rela-mips.dpatch
--Kumba
--
"Such is oft the course of deeds that move the wheels of the world:
small hands do them because they must, while the eyes of the great are
elsewhere." --Elrond
prev parent reply other threads:[~2004-01-22 20:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-17 7:11 Trouble compiling MIPS cross-compiler Adam Nielsen
2004-01-17 7:36 ` Adam Nielsen
2004-01-17 16:27 ` Thiemo Seufer
2004-01-17 16:35 ` Ralf Baechle
2004-01-17 16:33 ` Ralf Baechle
2004-01-18 1:19 ` Adam Nielsen
2004-01-18 1:54 ` Adam Nielsen
2004-01-18 3:46 ` Ralf Baechle
2004-01-18 4:14 ` Eric Christopher
2004-01-18 5:10 ` Adam Nielsen
2004-01-18 5:31 ` Eric Christopher
2004-01-18 5:36 ` Kumba
2004-01-18 6:46 ` Adam Nielsen
2004-01-18 6:56 ` Eric Christopher
2004-01-18 7:28 ` Thiemo Seufer
2004-01-18 7:35 ` Unscribe this maillist ??(zhufeng)
2004-01-18 7:35 ` ??(zhufeng)
2004-01-18 19:41 ` Trouble compiling MIPS cross-compiler Eric Christopher
2004-01-18 7:18 ` Kumba
2004-01-18 7:17 ` Eric Christopher
2004-01-18 8:04 ` Adam Nielsen
2004-01-18 8:13 ` Kumba
2004-01-18 10:05 ` Geert Uytterhoeven
2004-01-22 2:32 ` Solving the cross-compiler issue (Was: Trouble compiling MIPS cross-compiler) Nathan Field
2004-01-22 20:12 ` Daniel Jacobowitz
2004-01-22 20:32 ` Kumba [this message]
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=4010334A.5050500@gentoo.org \
--to=kumba@gentoo.org \
--cc=linux-mips@linux-mips.org \
/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