Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] GCC 4.6.3 i486/i686 toolchain architecture mismatch
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Tue Mar 26, 2013 3:48 pm    Post subject: [SOLVED] GCC 4.6.3 i486/i686 toolchain architecture mismatch Reply with quote

Hello,

Can anyone please provide a gcc-4.6.3 binary package for i686 with optimizations up to SSE1? Or does anyone have an alternative idea on how to fix the i486/i686 toolchain mismatch issue.

I was unaware of the specific gcc upgrade issue and did what mahdi1234 also stumbled upon; NeddySeagoon provided the solution for his machine (doesn't work for mine).

mahdi1234 wrote:
I got broke gcc so I took the one from tinderbox - http://tinderbox.dev.gentoo.org/default/linux/x86/sys-devel/gcc-4.6.3.tbz2 for which I had to change CHOST to i486 to be able install it. Now I can compile, but only with i486 however, I want i686 back.


[...]

NeddySeagoon wrote:
I'm not 100% sure this will work as the CHOST value is hard coded into the toolchain all over the place and your current toolchain is a mix of CHOST i486 and CHOST i686.
That may be permanently broken.

I may have gcc-4.6.3 built on a 32 bit Intel Atom, which I could turn into a binary package for you. That will be built with a i686 CHOST.
[...]
CFLAGS are
Code:
CFLAGS="-O2 -msse3 -march=prescott -mfpmath=sse -pipe -fomit-frame-pointer"


For my Athlon XP 2500+ processor, I would require something with up to SSE1 optimizations. The processor does not have SSE2 or SSE3 instructions.

Thanks.


Last edited by Palhoto on Thu Mar 28, 2013 2:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Tue Mar 26, 2013 8:32 pm    Post subject: Reply with quote

Palhoto,

Extract the files you need from a stage3 tarball.

The essential steps are as follows. Make a dir, I'll use /mnt/stage3 but you can use where ever you have some space.
mkdir /mnt/stage3
Fetch a i686 stage3 tarball
Untar it, just like the handbook says but into /mnt/stage3.
Mount /proc and /dev as per the handbook.

Bind mount your /usrportage to /mnt/stage3/usr/portage
This shares your portage tree and distfiles with the install in /mnt/stage3
Copy over /etc/resolv.conf
do the chroot as per the handbook.

The rest of the steps are carried out in the chroot.

In /etc/portage/make.conf set FEATURES="buildpkg", or add it to the existing FEATURES.
This saves a binary package of everything you build into /usr/portage/packages. Because of the bind mount, thats the same places both inside and outside the chroot.
emerge gentoolkit.
For gcc, you can run
Code:
quickpkg gcc
to make a binary package of gcc and put it into /usr/portage/package.
If you want gcc with your normal USE flags, set the profile and use flags in the chroot.

What you have now is an unbootable rescue gentoo installed in /mnt/stage3. You can only use it via chrooting into it.
When you are done saving binary packages and building things, exit the chroot.
You can install the packages in your real system with
Code:
emerge -K =catagory/package-version


If emerge needs gcc, then treat the gcc tarball in /usr/portage/packages as a mini stage3 and untar it to your root filesystem.
Code:
tar xpf /path/to/tarball -C /

Use gcc-config to select your new gcc, even if its the sme version as your broken installed one. Follow the on screen instructions.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Wed Mar 27, 2013 12:02 am    Post subject: Reply with quote

Thank you NeddySeagoon for such a detailed explanation. I understood perfectly what is to be done. I should be able to carry these instructions out and report back in a few days.
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Wed Mar 27, 2013 5:22 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Fetch a i686 stage3 tarball

Seems like the last available i686 one is stage3-i686-20121213, downloading now. The current autobuilds are all i486.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Wed Mar 27, 2013 7:20 pm    Post subject: Reply with quote

Palhoto,

If that stage3 has the wrong gcc version in it, you can emerge the one you need.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Wed Mar 27, 2013 8:39 pm    Post subject: Reply with quote

NeddySeagoon wrote:
Palhoto,

If that stage3 has the wrong gcc version in it, you can emerge the one you need.


Yep, the gcc screen saver is still cranking it out.
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Thu Mar 28, 2013 2:24 pm    Post subject: Reply with quote

NeddySeagoon wrote:
For gcc, you can run
Code:
quickpkg gcc
to make a binary package of gcc and put it into /usr/portage/package.

How do I get quickpkg to package the 4.6.3 version of GCC instead of 4.5.4 which it does by default? I've already switched to 4.6.3 with gcc-config and ran
Code:
. /etc/profile
. Do I need to remove 4.5.4 from the chroot environment?
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Thu Mar 28, 2013 2:29 pm    Post subject: Reply with quote

Palhoto wrote:
How do I get quickpkg to package the 4.6.3 version of GCC instead of 4.5.4 which it does by default?

Didn't RTFM completely, just searched for SLOT or slot without success in the man page.

Answer:
Code:
quickpkg =sys-devel/gcc-4.6.3
Back to top
View user's profile Send private message
Palhoto
Tux's lil' helper
Tux's lil' helper


Joined: 27 Feb 2003
Posts: 111
Location: Iberian Peninsula

PostPosted: Thu Mar 28, 2013 2:40 pm    Post subject: Reply with quote

NeddySeagoon wrote:
You can install the packages in your real system with
Code:
emerge -K =catagory/package-version


Done. Tested re-emerging nasm (a small C package) successfully. Thank you NeddySeagoon for your support. Are there any other user tests I can perform to be sure I've got the toolchain properly setup (besides re-emerging the whole portage tree)?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Thu Mar 28, 2013 7:02 pm    Post subject: Reply with quote

Palhoto,

If gcc works for one package, it should work for them all.

No other testing should be needed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum