Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

Weird CHOST settings causing compile mixup - Changing CHOST

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
64 posts
  • Previous
  • 1
  • 2
  • 3
  • Next
Author
Message
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Thu Sep 07, 2006 11:13 am

sinanqapudan: Thanks for the feedback, good to hear it works. :D
Dinosaur week! (Ok, this thread is so last week)
Top
mirojira
l33t
l33t
Posts: 685
Joined: Sat Feb 18, 2006 2:56 pm

  • Quote

Post by mirojira » Fri Sep 08, 2006 1:45 pm

amne wrote:mirojira: Thanks for your feedback even though that method is deprecated now. ;)
You may want to check your /etc/env.d for files that don't belong there any more as described in the new guide, too.
I switched from i386 to i686 and after emerge -e world i removed old versions of gcc. Everything seems to be OK. I checked /etc/env.d following your howto and I have

Code: Select all

localhost gcc # grep 586 /etc/env.d/
localhost gcc # grep 386 /etc/env.d/
localhost gcc # 
But

Code: Select all

localhost gcc # ls -la
total 16
drwxr-xr-x 2 root root   80 Sep  5 15:22 .
drwxr-xr-x 4 root root 4096 Sep  4 18:50 ..
-rw-r--r-- 1 root root   32 Sep  4 01:29 config
-rw-r--r-- 1 root root   32 Sep  3 18:14 config-i686-pc-linux-gnu
-rw-r--r-- 1 root root  292 Sep  4 01:29 i686-pc-linux-gnu-4.1.1

Code: Select all

localhost gcc # cat config-i686-pc-linux-gnu
CURRENT=i386-pc-linux-gnu-3.3.6
Is it OK? Or should I remove config-i686-pc-linux-gnu?
I did not run

Code: Select all

# env-update && source /etc/profile
Sould I run it?
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Fri Sep 08, 2006 2:00 pm

mirojira wrote:

Code: Select all

localhost gcc # cat config-i686-pc-linux-gnu
CURRENT=i386-pc-linux-gnu-3.3.6
Is it OK? Or should I remove config-i686-pc-linux-gnu?
Yeah, that one can be deleted.
mirojira wrote:I did not run

Code: Select all

# env-update && source /etc/profile
Sould I run it?
env-update just recreates the files in /etc/env.d/ (by looking in the subdirs gcc and binutils among other stuff), so it can never be wrong to do that.
source /etc/profile is only needed if you update the stuff in /etc/env.d and continue working in the same shell (e.g. to rebuild world). Nothing wrong with doing that as often as you want either. ;)
Dinosaur week! (Ok, this thread is so last week)
Top
wilson
n00b
n00b
Posts: 23
Joined: Tue Apr 05, 2005 10:54 pm

  • Quote

Post by wilson » Sun Sep 10, 2006 11:57 am

I had the same problem as another poster that glibc-2.4-r3 wouldnt compile, which was due to the wrong version of gcc being used. Anyway its all fixed now.

Thanks for writing this guide, its saved me from recompiling the same thing 4 times which others have suggested :P

I also had to re-emerge "groff", as I had lib failures when using man pages. I hope others will add to the list of packages that need an re-emerge.
Top
polemoser
n00b
n00b
User avatar
Posts: 5
Joined: Tue Sep 12, 2006 9:38 am
Location: Switzerland

  • Quote

Post by polemoser » Tue Sep 12, 2006 9:54 am

Thanks for the mini-howto, which i followed.

On my Pentium 3, emerge -e world has now taken almost 4 days and has still not finished...

If you have installed courier / courier-imap - series, I'd highly recommend to recompie all these packages, including courierauth. Otherwise your won't be able to use any courier services because login will fail.

I experienced the lib failures as well with the manpages ( as wilson already mentioned );

In the CFLAGS in /etc/make.conf I have the flag -mcpu=i686 set. Now the compiler always yelles

Code: Select all

'-mcpu=' is deprecated. Use '-mtune=' or '-march=' instead.
In my opinion, the right decision is to take "-march=pentium3", because of:

Code: Select all

tux ~ $ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 8
model name      : Pentium III (Coppermine)
stepping        : 3
cpu MHz         : 733.468
cache size      : 256 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 sep mtrr pge mca cmov pat pse36 mmx fxsr sse
bogomips        : 1470.26
But if I change this from "-mcpu=i686" to "-march=pentium3": Will this have any unforseen sideffects? Will this brake anything? Thanks for your help.
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Tue Sep 12, 2006 5:29 pm

polemoser wrote:If you have installed courier / courier-imap - series, I'd highly recommend to recompie all these packages, including courierauth. Otherwise your won't be able to use any courier services because login will fail.
Thanks, will add that as soon i have a working environment again (got some hardware issues currently), as well as groff (thanks wilson).
polemoser wrote:But if I change this from "-mcpu=i686" to "-march=pentium3": Will this have any unforseen sideffects? Will this brake anything? Thanks for your help.
From man gcc:
-mcpu=cpu-type
A deprecated synonym for -mtune.
If you want the same behaviour as before, use -mcpu=i686, which builds binaries for i686 that can also be run on other cpus (but are optimized for i686).
If you use -march instead, the code will only run on the platform specified (and higher, e.g. pentium 4), so -march=i686 code would not run on an i586 cpu, but still on an athlon. If you use -march=pentium3, it also wouldn't run on an athlon (but still on a pentium 4).
Dinosaur week! (Ok, this thread is so last week)
Top
richfish
Apprentice
Apprentice
Posts: 202
Joined: Fri Mar 03, 2006 4:19 am
Location: Phoenix, AZ

feedback

  • Quote

Post by richfish » Wed Sep 13, 2006 7:49 am

amne,

Thanks very much for creating the guide. A couple of quick items:

1. Since the most common change will probably be i386 to i686, is it sensible to do a global search-replace of i686 with i386, and i586 with i686? That way most users following the guide should not need to do any translation and we might help them avoid mistakes. Particularly in the fixing up of env.d.

2. The "may want to run emerge -e world" part at the end feels risky to me. Just from the way it is worded, my guess is that quite a few users will try it without emerge -e world, and /then/ we'll find out their systems are broke. Does it make sense to strongly suggest at least an "emerge -e system", as everything else should be fixable if that works?
Top
G F0rce 1
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 115
Joined: Thu Dec 16, 2004 9:03 am
Location: 51.418961, 5.500932
Contact:
Contact G F0rce 1
Website

  • Quote

Post by G F0rce 1 » Thu Sep 14, 2006 9:28 am

Okay, I'm done following the guide and everyrhing seems to work just fine, the only package failed was iptraf. Everything seems to be fine. Is there definitive way to test if I've done everything the right way? And is it really not nessecary to do a emerge -e system? Or is that included with the emerge -e world ?
Reinoud.net
Top
richfish
Apprentice
Apprentice
Posts: 202
Joined: Fri Mar 03, 2006 4:19 am
Location: Phoenix, AZ

  • Quote

Post by richfish » Thu Sep 14, 2006 5:37 pm

Emerge -e world will rebuild system packages as well, so if that completed successfully, everything should be working for your system. I was suggesting emerge -e system as the alternative for those who don't emerge -e world.
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

Re: feedback

  • Quote

Post by amne » Fri Sep 15, 2006 5:08 pm

richfish wrote: 1. Since the most common change will probably be i386 to i686, is it sensible to do a global search-replace of i686 with i386, and i586 with i686? That way most users following the guide should not need to do any translation and we might help them avoid mistakes. Particularly in the fixing up of env.d.
When i wrote the doc, i wanted to keep as much as possible to the real life test i've been running (which was i686 to i586), but i think it's a good idea to change it.
richfish wrote: 2. The "may want to run emerge -e world" part at the end feels risky to me. Just from the way it is worded, my guess is that quite a few users will try it without emerge -e world, and /then/ we'll find out their systems are broke. Does it make sense to strongly suggest at least an "emerge -e system", as everything else should be fixable if that works?
It's intentionally worded like that, as it really shouldn't be necessary to do it. If you want to be 100% safe, you may want to do it, in general recompiling the packages mentioned in the guide (need to add those mentioned here recently yet) should really be enough. There's also some discussion about it in [bug]147502[/bug], see comment 3 and 4.
Dinosaur week! (Ok, this thread is so last week)
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Mon Sep 18, 2006 3:53 pm

JFYI, i've updated the guide and added some more packages that need to be rebuilt. It also explains how to migrate from i386 to i686 by default now as this is probably the most common task.
Dinosaur week! (Ok, this thread is so last week)
Top
wilson
n00b
n00b
Posts: 23
Joined: Tue Apr 05, 2005 10:54 pm

  • Quote

Post by wilson » Mon Sep 18, 2006 6:11 pm

Better add telnet as well:

telnet: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

oh also add mysql!
and nmap
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Mon Sep 18, 2006 9:46 pm

Those errors seem to happen when upgrading from gcc 3.3, which introduces some abi changes that require you to rebuild packages - so it is not a CHOST issue. Maybe the folks who had problems with groff etc can confirm that?
If you upgrade from gcc 3.3, please take a look at the gcc upgrade guide as well.
Dinosaur week! (Ok, this thread is so last week)
Top
wilson
n00b
n00b
Posts: 23
Joined: Tue Apr 05, 2005 10:54 pm

  • Quote

Post by wilson » Tue Sep 19, 2006 4:35 pm

The system had the latest 3.x gcc emerged, but I never changed the compiler via gcc-config (this is a new command for me!) So I will assume it was a 3.3 compiler
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Sat Sep 23, 2006 7:34 am

Update: Added a warning not to upgrade gcc at the same time as this can cause problems.
Dinosaur week! (Ok, this thread is so last week)
Top
T-O7
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 94
Joined: Wed Sep 01, 2004 4:58 pm
Location: Canada

  • Quote

Post by T-O7 » Sun Sep 24, 2006 1:00 am

Hello,
I followed the guide to migrate from i386 to i686. When upgrading my kernel though, I see several references to i386 when the kernel is compiling:

Code: Select all

SYMLINK include/asm -> include/asm-i386
scripts/kconfig/conf -s arch/i386/Kconfig

  CC      arch/i386/kernel/process.o
  CC      arch/i386/kernel/semaphore.o
  CC      arch/i386/kernel/signal.o
  AS      arch/i386/kernel/entry.o
  CC      arch/i386/kernel/traps.o
  etc...
Is there any way to correct this? Did I miss a step?
Top
desultory
Bodhisattva
Bodhisattva
User avatar
Posts: 9410
Joined: Fri Nov 04, 2005 6:07 pm

  • Quote

Post by desultory » Sun Sep 24, 2006 1:19 am

T-O7 wrote:I followed the guide to migrate from i386 to i686. When upgrading my kernel though, I see several references to i386 when the kernel is compiling:

Code: Select all

SYMLINK include/asm -> include/asm-i386
scripts/kconfig/conf -s arch/i386/Kconfig

  CC      arch/i386/kernel/process.o
  CC      arch/i386/kernel/semaphore.o
  CC      arch/i386/kernel/signal.o
  AS      arch/i386/kernel/entry.o
  CC      arch/i386/kernel/traps.o
  etc...
What is being indicated there is that the kernel being built is to be a 32 bit PC compatible executable, not that it is optimized specifically for a 386 processor. The source code in arch/i386 is used for processors ranging from Intel 80386 types through current 32 bit (and 64 bit used as 32 bit) PC compatible processors, the output quoted is to be expected when building a kernel to be used with such processors.
T-O7 wrote:Is there any way to correct this?
Use a different processor type, which is unlikely to be the type of fix you were considering.
T-O7 wrote:Did I miss a step?
While not in evidence here, it is also not excluded from possibility by the quoted output.
Top
cmcheung
n00b
n00b
Posts: 14
Joined: Sun Oct 02, 2005 10:37 pm

  • Quote

Post by cmcheung » Sun Sep 24, 2006 6:38 pm

Thanks very much for this guide!

I have some questions though. I'm paranoid about going through some of the steps, in fear of screwing my system up, so I'm going to try to get confirmation here in regards to what to do. Here goes...

I have done emerge -av1 binutils gcc glibc, which seemed to work fine. When i do gcc-config -l however, I get the following results:

Code: Select all

localhost ~ # gcc-config -l
 [1] i386-pc-linux-gnu-3.3.6
 [2] i386-pc-linux-gnu-3.3.6-hardened
 [3] i386-pc-linux-gnu-3.3.6-hardenednopie
 [4] i386-pc-linux-gnu-3.3.6-hardenednopiessp
 [5] i386-pc-linux-gnu-3.3.6-hardenednossp
 [6] i386-pc-linux-gnu-3.4.6
 [7] i386-pc-linux-gnu-3.4.6-hardened
 [8] i386-pc-linux-gnu-3.4.6-hardenednopie
 [9] i386-pc-linux-gnu-3.4.6-hardenednopiessp
 [10] i386-pc-linux-gnu-3.4.6-hardenednossp
 [11] i686-pc-linux-gnu-4.1.1 *
gcc-config -c, and both the binutils-config give the results listed on the how-to.

Next, when I grep 386 *, i get the following results:

Code: Select all

localhost env.d # grep 386 *
20java:LDPATH="/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/:
/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/native_threads/:
/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/client/:
/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/server/"
grep 686 * seems to give me what I want.

My question is if I can just go nuts and rm everything with i368-pc-linux*? Also, what should I do about the blackdown-jdk, in relation to i368?

Thanks for the help.

mod edit: added some line breaks to the code block
amne
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Sun Sep 24, 2006 7:54 pm

cmcheung wrote:I have done emerge -av1 binutils gcc glibc, which seemed to work fine. When i do gcc-config -l however, I get the following results:

Code: Select all

localhost ~ # gcc-config -l
 [1] i386-pc-linux-gnu-3.3.6
 [2] i386-pc-linux-gnu-3.3.6-hardened
 [3] i386-pc-linux-gnu-3.3.6-hardenednopie
 [4] i386-pc-linux-gnu-3.3.6-hardenednopiessp
 [5] i386-pc-linux-gnu-3.3.6-hardenednossp
 [6] i386-pc-linux-gnu-3.4.6
 [7] i386-pc-linux-gnu-3.4.6-hardened
 [8] i386-pc-linux-gnu-3.4.6-hardenednopie
 [9] i386-pc-linux-gnu-3.4.6-hardenednopiessp
 [10] i386-pc-linux-gnu-3.4.6-hardenednossp
 [11] i686-pc-linux-gnu-4.1.1 *
i386-*-3.4.6 is your old gcc is your old gcc version, the output is fine if you haven't removed it from your system yet.
Also take a look at the gcc upgrading howto for instructions on gcc updates. Once you're done with it and unmerged the old gcc, it should be gone.
cmcheung wrote:

Code: Select all

localhost env.d # grep 386 *
20java:LDPATH="/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/:
/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/native_threads/:
/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/client/:
/opt/blackdown-jdk-1.4.2.03/jre/lib/i386/server/"
Seems blackdown always uses i386 in the path whatever your CHOST is, so you can just leave that alone.
Dinosaur week! (Ok, this thread is so last week)
Top
ulor
n00b
n00b
Posts: 3
Joined: Thu Nov 09, 2006 1:12 pm

make.profile update

  • Quote

Post by ulor » Thu Nov 09, 2006 1:17 pm

In order to make this useful changing from CHOST=i386 to CHOST=i686 remember to update your make.profile so that it is no longer pointing to no-nptl.

http://www.gentoo.org/doc/en/gentoo-upgrading.xml

Bri
Top
ulor
n00b
n00b
Posts: 3
Joined: Thu Nov 09, 2006 1:12 pm

  • Quote

Post by ulor » Mon Nov 13, 2006 5:25 am

A good place to find a very sweet script for doing a emerge -e world

http://forums.gentoo.org/viewtopic-t-494331.html

Bri
Top
s0medude
n00b
n00b
User avatar
Posts: 7
Joined: Thu Jun 17, 2004 5:33 am

  • Quote

Post by s0medude » Sun Feb 11, 2007 10:33 am

Hi all,

I used the guide to switch from i386 to 1686 but found my emerge -e world breaking repeatedly on dev-python/sip-4.2.1.
After some digging I found a Makefile for sip in /var/tmp/portage that still contained a reference to i386 . After deleting all packages from /var/tmp/portage everything compiled flawlessly.

Perhaps, and I am by no means a Gentoo Elite so please disregard this if the problem was caused by my own stupidity, an extra step could be added to the guide to make sure everything in /tmp/portage is removed before starting the emerge -e world.

HTH and thanks for the great guide guys,

Bravo_Kernel.
Top
amne
Bodhisattva
Bodhisattva
User avatar
Posts: 6378
Joined: Sun Nov 17, 2002 6:00 pm
Location: Graz / EU

  • Quote

Post by amne » Sun Feb 11, 2007 10:38 am

s0medude wrote: After some digging I found a Makefile for sip in /var/tmp/portage that still contained a reference to i386 . After deleting all packages from /var/tmp/portage everything compiled flawlessly.
Strange, portage usually cleans up there before compiling so old Makefiles should be wiped as well. Do you have FEATURES="keepwork" enabled in your make.conf by chance?
Dinosaur week! (Ok, this thread is so last week)
Top
s0medude
n00b
n00b
User avatar
Posts: 7
Joined: Thu Jun 17, 2004 5:33 am

  • Quote

Post by s0medude » Sun Feb 11, 2007 11:54 am

Hi Amne,

Thanks for your fast reply. I just checked and there is no 'keepwork' anywhere in my make.conf so IMHO this could be a unusual hickup of Portage on my system or something structural but very rare (a bug).

Anyway, it is reported now so anybody experiencing the same thing should be able to fix it.

HTH,

Bravo_Kernel
Top
wrs4
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 98
Joined: Tue May 27, 2003 7:55 pm
Location: Alexandria, VA

emerge -e world breaks on c++ compiler error

  • Quote

Post by wrs4 » Thu Feb 22, 2007 9:38 pm

I have a dual-Xeon 2GHz that had CHOST=i386. I updated to i686, with gcc updates from 3.x to 4.1.1.

When I got to the emerge -e world step in the guide, emerge died on gmp. When I looked at the log, it said it couldn't find a c++ compiler. The config log showed that it had the right g++, and g++ --version confirmed it. After beating my head on the wall for a few minutes looking at log and config files (and finding nothing useful), I decided to re-emerge gcc and glibc, then rerun emerge -e world. That did the trick. Just a (hopefully useful) tip.
Top
Post Reply

64 posts
  • Previous
  • 1
  • 2
  • 3
  • Next

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic