Mailing List Archive

bootstrap.sh on asus wl500g
Hi,

I have an asus wl500g (same chip as the linksys wrt54g). I put openwrt
on it and chrooted into a
experimental/mips/embedded/stages/stage1-mipsel-uclibc-2005.0.tar.bz2
tarball, with the idea of changing the profile and rebuiling.

I set up make.conf like so:

CFLAGS="-Os -pipe -march=mips1"
CHOST="mipsel-unknown-linux-gnu"

and the profile like so:

make.profile -> /usr/portage/profiles/default-linux/mips/2005.0

then ran scripts/bootstrap.sh


gnuconfig had some bus errors, but didn't stop the script:

>>> Install gnuconfig-20050602 into
>>> /var/tmp/portage/gnuconfig-20050602/image/ category sys-devel
man:
prepallstrip:
strip: strip --strip-unneeded
strip: strip --strip-unneeded
usr/share/gnuconfig/config.sub
/usr/lib/portage/bin/prepstrip: line 19: 12405 Bus error
${STRIP} -g "${x}"
usr/share/gnuconfig/config.sub
/usr/lib/portage/bin/prepstrip: line 19: 12406 Bus error
${STRIP} "${x}"
usr/share/gnuconfig/config.sub
/usr/lib/portage/bin/prepstrip: line 19: 12407 Bus error
${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
readelf: Error: Unable to read in 0x656e bytes of section headers
readelf: Error: Not an ELF file - it has the wrong magic bytes at the
start
usr/share/gnuconfig/config.guess
/usr/lib/portage/bin/prepstrip: line 19: 12411 Bus error
${STRIP} -g "${x}"
usr/share/gnuconfig/config.guess
/usr/lib/portage/bin/prepstrip: line 19: 12412 Bus error
${STRIP} "${x}"
usr/share/gnuconfig/config.guess
/usr/lib/portage/bin/prepstrip: line 19: 12413 Bus error
${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
readelf: Error: Unable to read in 0x6d65 bytes of section headers
readelf: Error: Not an ELF file - it has the wrong magic bytes at the
start
>>> Completed installing gnuconfig-20050602 into
>>> /var/tmp/portage/gnuconfig-20050602/image/


and glibc failed during configure:

checking for suffix of object files... configure: error: cannot compute
suffix of object files: cannot compile
See `config.log' for more details.

!!! ERROR: sys-libs/glibc-2.3.5 failed.
!!! Function glibc_do_configure, Line 938, Exitcode 1
!!! failed to configure glibc


any ideas? I see the mips project website was just updated today, and I
just realized last night that the cobalt images are little endian (the
asus wl500g is little endian), so I'll try chrooting into one of those
images next.

Thanks,
Jason Pepas

--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
hmm, this guy had a similar problem, and it turned out his path was
incorrect:

http://www.linuxquestions.org/questions/history/339554

-jason pepas

On Fri, Sep 16, 2005 at 08:34:43AM -0500, Jason Pepas wrote:
> Hi,
>
> I have an asus wl500g (same chip as the linksys wrt54g). I put openwrt
> on it and chrooted into a
> experimental/mips/embedded/stages/stage1-mipsel-uclibc-2005.0.tar.bz2
> tarball, with the idea of changing the profile and rebuiling.
>
> I set up make.conf like so:
>
> CFLAGS="-Os -pipe -march=mips1"
> CHOST="mipsel-unknown-linux-gnu"
>
> and the profile like so:
>
> make.profile -> /usr/portage/profiles/default-linux/mips/2005.0
>
> then ran scripts/bootstrap.sh
>
>
> gnuconfig had some bus errors, but didn't stop the script:
>
> >>> Install gnuconfig-20050602 into
> >>> /var/tmp/portage/gnuconfig-20050602/image/ category sys-devel
> man:
> prepallstrip:
> strip: strip --strip-unneeded
> strip: strip --strip-unneeded
> usr/share/gnuconfig/config.sub
> /usr/lib/portage/bin/prepstrip: line 19: 12405 Bus error
> ${STRIP} -g "${x}"
> usr/share/gnuconfig/config.sub
> /usr/lib/portage/bin/prepstrip: line 19: 12406 Bus error
> ${STRIP} "${x}"
> usr/share/gnuconfig/config.sub
> /usr/lib/portage/bin/prepstrip: line 19: 12407 Bus error
> ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
> readelf: Error: Unable to read in 0x656e bytes of section headers
> readelf: Error: Not an ELF file - it has the wrong magic bytes at the
> start
> usr/share/gnuconfig/config.guess
> /usr/lib/portage/bin/prepstrip: line 19: 12411 Bus error
> ${STRIP} -g "${x}"
> usr/share/gnuconfig/config.guess
> /usr/lib/portage/bin/prepstrip: line 19: 12412 Bus error
> ${STRIP} "${x}"
> usr/share/gnuconfig/config.guess
> /usr/lib/portage/bin/prepstrip: line 19: 12413 Bus error
> ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
> readelf: Error: Unable to read in 0x6d65 bytes of section headers
> readelf: Error: Not an ELF file - it has the wrong magic bytes at the
> start
> >>> Completed installing gnuconfig-20050602 into
> >>> /var/tmp/portage/gnuconfig-20050602/image/
>
>
> and glibc failed during configure:
>
> checking for suffix of object files... configure: error: cannot compute
> suffix of object files: cannot compile
> See `config.log' for more details.
>
> !!! ERROR: sys-libs/glibc-2.3.5 failed.
> !!! Function glibc_do_configure, Line 938, Exitcode 1
> !!! failed to configure glibc
>
>
> any ideas? I see the mips project website was just updated today, and I
> just realized last night that the cobalt images are little endian (the
> asus wl500g is little endian), so I'll try chrooting into one of those
> images next.
>
> Thanks,
> Jason Pepas
>
> --
> gentoo-mips@gentoo.org mailing list
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Ok, my config.log looks like so:

configure:2660: checking for suffix of object files
configure:2681: gcc -c -pipe -march=mips1 -O2 -O2 conftest.c >&5
gcc: Internal error: Segmentation fault (program as)
Please submit a full bug report.
See <URL:http://bugs.gentoo.org/> for instructions.
configure:2684: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "c-library"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "glibc"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2698: error: cannot compute suffix of object files: cannot
compile
See `config.log' for more details.


hmm, other than the fact that gcc segfaulted, this doesn't seem to be
much help...

-jason pepas

--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Ok, there are several serious problems with what you are trying to do...

> Hi,
>
> I have an asus wl500g (same chip as the linksys wrt54g).

Actually, it isn't identical, but that doesn't really matter...

> I put openwrt
> on it and chrooted into a
> experimental/mips/embedded/stages/stage1-mipsel-uclibc-2005.0.tar.bz2
> tarball, with the idea of changing the profile and rebuiling.

Ok, stop right here. Do you realize how little memory this device has?
You would be lucky to even be able to build some of the more simple
programs without some sort of ICE or out of memory error.

> I set up make.conf like so:
>
> CFLAGS="-Os -pipe -march=mips1"

You would really want -march=mips32 anyway.

> CHOST="mipsel-unknown-linux-gnu"
>
> and the profile like so:
>
> make.profile -> /usr/portage/profiles/default-linux/mips/2005.0

That is not even close to the correct profile for uclibc. You really
want /usr/portage/profiles/uclibc/mips

> then ran scripts/bootstrap.sh

You'll be extremely lucky if this ever works on that device...again, not
enough memory.

> gnuconfig had some bus errors, but didn't stop the script:

This is probably telling that you have some serious issues...

*snip*

> and glibc failed during configure:
>
> checking for suffix of object files... configure: error: cannot compute
> suffix of object files: cannot compile
> See `config.log' for more details.
>
> !!! ERROR: sys-libs/glibc-2.3.5 failed.
> !!! Function glibc_do_configure, Line 938, Exitcode 1
> !!! failed to configure glibc

Uhhh...you realize you can't install glibc on a uclibc userland, right?
This is from selecting the wrong profile, aside from the fact that
glibc even doesn't have a snowballs chance in hell of building on such a
device.

> any ideas? I see the mips project website was just updated today, and I
> just realized last night that the cobalt images are little endian (the
> asus wl500g is little endian), so I'll try chrooting into one of those
> images next.

That is an even worse idea. The cobalt stages are optimized for
-march=mips4, which probably won't run on that cpu. Not only that, but
they are glibc based, which is way too heavy to run on a wl500g

The moral of this story is, a broadcom based router is not good for
using gentoo in the capacity you are trying to. What you *really* want
to do is emerge crossdev on a nice fast box, use that to build a
crosstoolchain, and cross-compile a custom userland to run on your router.

-Steve
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Jason Pepas wrote:
> and the profile like so:
>
> make.profile -> /usr/portage/profiles/default-linux/mips/2005.0

That's the wrong profile for uclibc stages, this will try to replace uclibc with
glibc and that's a bad thing. You should probablly be using
/usr/portage/profile/uclibc/mips. Using the uclibc stages it should not try to
build glibc like it is below.

> any ideas? I see the mips project website was just updated today, and I
> just realized last night that the cobalt images are little endian (the
> asus wl500g is little endian), so I'll try chrooting into one of those
> images next.

Don't bother using the cobalt stages, the wl500g has no where near enough memory
to run a glibc system.

Hardave
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
> You would really want -march=mips32 anyway.
>
>> CHOST="mipsel-unknown-linux-gnu"

I also just realized you got your CHOST wrong. You should *never*
change the CHOST that the stage ships with. It really should be
something like mipsel-unknown-linux-uclibc.

-Steve
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
On Fri, Sep 16, 2005 at 09:48:34AM -0400, Stephen P. Becker wrote:
> >I put openwrt
> >on it and chrooted into a
> >experimental/mips/embedded/stages/stage1-mipsel-uclibc-2005.0.tar.bz2
> >tarball, with the idea of changing the profile and rebuiling.
>
> Ok, stop right here. Do you realize how little memory this device has?
> You would be lucky to even be able to build some of the more simple
> programs without some sort of ICE or out of memory error.

I have 256MB of swap enabled - it shouldn't be a problem.

> That is not even close to the correct profile for uclibc. You really
> want /usr/portage/profiles/uclibc/mips

Well, I want to switch to glibc, but I couldn't get any mips3 or mips4
stages running (I think they are the wrong endian-ness). So I thought
the correct thing to was grab a stage1 and change the profile.

Am I going about this the wrong way? I am fairly new to gentoo.

> Uhhh...you realize you can't install glibc on a uclibc userland, right?
> This is from selecting the wrong profile, aside from the fact that
> glibc even doesn't have a snowballs chance in hell of building on such a
> device.
>
> >any ideas? I see the mips project website was just updated today, and I
> >just realized last night that the cobalt images are little endian (the
> >asus wl500g is little endian), so I'll try chrooting into one of those
> >images next.
>
> That is an even worse idea. The cobalt stages are optimized for
> -march=mips4, which probably won't run on that cpu. Not only that, but
> they are glibc based, which is way too heavy to run on a wl500g
>
> The moral of this story is, a broadcom based router is not good for
> using gentoo in the capacity you are trying to. What you *really* want
> to do is emerge crossdev on a nice fast box, use that to build a
> crosstoolchain, and cross-compile a custom userland to run on your router.

Hmm, that sounds more like what I want to do. What I really want is a
stage1-mips1-2005.1.tar.bz2, but that doesn't exist. Can I use crossdev
to accomplish that?

Thanks,
Jason Pepas

--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Hardave Riar wrote:
> Jason Pepas wrote:
>
>> and the profile like so:
>>
>> make.profile -> /usr/portage/profiles/default-linux/mips/2005.0
>
>
> That's the wrong profile for uclibc stages, this will try to replace
> uclibc with glibc and that's a bad thing. You should probablly be using
> /usr/portage/profile/uclibc/mips. Using the uclibc stages it should not
> try to build glibc like it is below.
>
>> any ideas? I see the mips project website was just updated today, and I
>> just realized last night that the cobalt images are little endian (the
>> asus wl500g is little endian), so I'll try chrooting into one of those
>> images next.
>
>
> Don't bother using the cobalt stages, the wl500g has no where near
> enough memory to run a glibc system.

Not to mention, the Cobalt stages are MIPS IV, and therefore includes
some 64-bit instructions, the WL500g will be MIPS32, and does not
understand 64-bit instructions.

So you can expect illegal instructions left, right & centre.

As Stephen has pointed out too, messing with CHOST is asking for it... I
speak from experience. :-)
(tried it on my x86-based laptop ... boy did I have fun finding the
pieces and putting them back together again :-/)
--
____ _ Stuart Longland (a.k.a Redhatter)
/ _ \ ___ ___ __| |__ __ __ Gentoo Linux/MIPS Cobalt and Docs
- (_) \ / \ ; \(__ __)/ \ / \ Developer
\ // O _| / /\ \ | | | /\ | /\ |
/ / \ /__| / \ \ | | | \/ | \/ |
(___/ \____/|_; |_| \_/ \__/ \__/ http://dev.gentoo.org/~redhatter
Re: bootstrap.sh on asus wl500g [ In reply to ]
On Fri, Sep 16, 2005 at 07:52:18AM -0600, Hardave Riar wrote:
> That's the wrong profile for uclibc stages, this will try to replace uclibc
> with glibc and that's a bad thing.

That's precisely what I want to accomplish :) I have plenty of swap
available, and no time constraints with this device. If it turns out
32MB of RAM is too little to run a glibc system, so be it, but I would
like to learn that the hard way. I think I'll learn quite a bit in the
process.

Thanks,
Jason Pepas

--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Jason Pepas wrote:
> On Fri, Sep 16, 2005 at 07:52:18AM -0600, Hardave Riar wrote:
>
>>That's the wrong profile for uclibc stages, this will try to replace uclibc
>>with glibc and that's a bad thing.
>
>
> That's precisely what I want to accomplish :) I have plenty of swap
> available, and no time constraints with this device. If it turns out
> 32MB of RAM is too little to run a glibc system, so be it, but I would
> like to learn that the hard way. I think I'll learn quite a bit in the
> process.

Ok, so obviously you aren't quite listening to what we are saying.
First of all, 256mb is *not* plenty of swap with so little physical
RAM...even to build uclibc. Typically, we've found that you can't even
build glibc and/or gcc on gentoo/mips with 64mb of RAM, no matter how
much swap you give the box. Also, wl500g does *not* have 32mb of RAM,
but rather 16mb. I know, because I have one. Furthermore, isn't isn't
necessarily the running of glibc, but more the building of glibc that is
your issue. The only thing you'll be learning in this process is the
fact that you wished you would have listened to us in the first place.

-Steve
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Jason Pepas wrote:
> On Fri, Sep 16, 2005 at 09:48:34AM -0400, Stephen P. Becker wrote:
>
>>>I put openwrt
>>>on it and chrooted into a
>>>experimental/mips/embedded/stages/stage1-mipsel-uclibc-2005.0.tar.bz2
>>>tarball, with the idea of changing the profile and rebuiling.
>>
>>Ok, stop right here. Do you realize how little memory this device has?
>> You would be lucky to even be able to build some of the more simple
>>programs without some sort of ICE or out of memory error.
>
>
> I have 256MB of swap enabled - it shouldn't be a problem.

Yes, it's a big problem.

>>That is not even close to the correct profile for uclibc. You really
>>want /usr/portage/profiles/uclibc/mips
>
>
> Well, I want to switch to glibc, but I couldn't get any mips3 or mips4
> stages running (I think they are the wrong endian-ness). So I thought
> the correct thing to was grab a stage1 and change the profile.

Of course they are the wrong endianness. Not only that, but they
contain instructions that will only run on 64-bit cpus.

> Am I going about this the wrong way? I am fairly new to gentoo.

Not just the wrong way, but the impossible way.

> Hmm, that sounds more like what I want to do. What I really want is a
> stage1-mips1-2005.1.tar.bz2, but that doesn't exist. Can I use crossdev
> to accomplish that?

No.

-Steve
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
On Fri, Sep 16, 2005 at 10:25:19AM -0400, Stephen P. Becker wrote:
> Also, wl500g does *not* have 32mb of RAM,
> but rather 16mb. I know, because I have one.

I am sorry, I misinformed you. I have the "deluxe" model, which has 32
MB of RAM.

> Furthermore, isn't isn't
> necessarily the running of glibc, but more the building of glibc that is
> your issue.

I guess this is the part I don't understand. As far as I understand it,
a page of memory exists either in physical RAM, or on a swap device, and
the only entity who can tell the difference is the kernel. Please
understand that it's not that I am not listening, it's that I don't
understand how what you are saying can be true. The interesting thing
for me at this point would be to find out how a process can fail if it
is given swap instead of RAM.

Imagine a person whose life experience tells them the sky is blue, and
they understand the mechanics of light which cause it to be that way,
and then they encounter someone who tells them that there is a certain
place in the world where the sky is orange. It's not that they don't
believe them, but they sure would like to figure out why that is the
case, so that they can plug the apparent hole in their knowledge.

-jason pepas

--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
On Fri, Sep 16, 2005 at 10:28:20AM -0400, Stephen P. Becker wrote:
> >Hmm, that sounds more like what I want to do. What I really want is a
> >stage1-mips1-2005.1.tar.bz2, but that doesn't exist. Can I use crossdev
> >to accomplish that?
>
> No.

How can I do this? Would this require some combination of catalyst and
a cross compiling toolchain?

Thanks for helping me out with this - you obviously have quite a bit
more experience in this area than I, and I value your wisdom.

-jason pepas
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Jason Pepas wrote:
> I guess this is the part I don't understand. As far as I understand it,
> a page of memory exists either in physical RAM, or on a swap device, and
> the only entity who can tell the difference is the kernel. Please
> understand that it's not that I am not listening, it's that I don't
> understand how what you are saying can be true. The interesting thing
> for me at this point would be to find out how a process can fail if it
> is given swap instead of RAM.

The kernel can only swap out pages that are not active. So on your box if a
single running process requires more than 32MB of active memory it will fail
since the kernel can not give it that much, even if you have 3Tb of swap space.
Where this seems to bite alot of people on mips is doing the actual compile of
glibc, where certain parts of it fail if you have less than 128MB because a
single gcc process requires that much.

Hardave
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Jason Pepas wrote:
> How can I do this? Would this require some combination of catalyst and
> a cross compiling toolchain?

You would use catalyst, but last I tried to build to build mips1 glibc based
stages it failed, most likely due mips1 support being bitrotten in our
toolchain. I'm also not sure where catalyst is in regards to crosscompiling, I
think there is some code there to do it, but it's not supported and hasn't been
tried by anyone on the mips team. Trust us when we say that a stage3 uclibc is
your best bet to start with gentoo on that box. Once you get comfortable with
that, then start experimenting.

Hardave
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
On Fri, Sep 16, 2005 at 09:37:50AM -0600, Hardave Riar wrote:
> The kernel can only swap out pages that are not active. So on your box if a
> single running process requires more than 32MB of active memory it will
> fail since the kernel can not give it that much, even if you have 3Tb of
> swap space. Where this seems to bite alot of people on mips is doing the
> actual compile of glibc, where certain parts of it fail if you have less
> than 128MB because a single gcc process requires that much.

Ahh, now I see. Thanks for explaining that.

-jason pepas
--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
On Fri, Sep 16, 2005 at 09:44:36AM -0600, Hardave Riar wrote:
> You would use catalyst, but last I tried to build to build mips1 glibc
> based stages it failed, most likely due mips1 support being bitrotten in
> our toolchain. I'm also not sure where catalyst is in regards to
> crosscompiling, I think there is some code there to do it, but it's not
> supported and hasn't been tried by anyone on the mips team. Trust us when
> we say that a stage3 uclibc is your best bet to start with gentoo on that
> box. Once you get comfortable with that, then start experimenting.

Thanks for the advice. As it turns out, that's just what I did. I have
been tooling around with a stage3-uclibc tarball for a couple of weeks,
and when I tried to update the profile to a non-deprecated uclibc-mips
profile and rebuild everything, rsync developed a problem where it would
randomly crap out. That's when I decided to start experimenting.

I'll keep looking into it and report back.

-jason pepas

--
gentoo-mips@gentoo.org mailing list
Re: bootstrap.sh on asus wl500g [ In reply to ]
Hardave Riar wrote:
> Jason Pepas wrote:
>
>> How can I do this? Would this require some combination of catalyst and
>> a cross compiling toolchain?

To elaborate on this a bit further for informational purposes, this is
theoretically possible. However, too many packages in portage don't
take very well to cross-compiling yet. A large chunk of "emerge system"
would fail, for example.

> You would use catalyst, but last I tried to build to build mips1 glibc
> based stages it failed, most likely due mips1 support being bitrotten in
> our toolchain.

Hmm, seriously? I think crossdev builds a mips1 toolchain by default,
and it works fine. But then, that just means glibc is only optimized
for mips1. Either way, the machine Jason wants to run stages on here is
MIPS32, so that would be what he really wants I think.

-Steve

P.S. Any reason why openwrt isn't good enough? If you download the
buildroot source, it cross-compiles everything for you, including a wide
selection of packages of your choice that are selectable from menus. It
works quite well, and is really the optimal sort of distro for these
devices. Gentoo is really intended for machines with bigger nuts.
--
gentoo-mips@gentoo.org mailing list