Forums

Skip to content

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

GCC 4.1.1 and glibc 2.4 stable on x86 and amd64

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
389 posts
  • Page 6 of 16
    • Jump to page:
  • Previous
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • 8
  • …
  • 16
  • Next
Author
Message
literfizzer
n00b
n00b
Posts: 19
Joined: Wed Aug 30, 2006 4:50 pm

  • Quote

Post by literfizzer » Fri Sep 01, 2006 6:46 pm

lazarusrat wrote:
literfizzer wrote: That post doesn't explain why it's necessary to emerge system, then world. On my system, at least, emerge -e world recompiles everything that was already recompiled in the previous emerge -e system step. This makes no sense to me. The recompile is because of a C++ ABI change. It has nothing to do with other dependent libs, kernel headers, or anything else, as some of the other replies have said. So recompiling more than once is a waste. It will generate exactly the same object code the second time.

Code: Select all

$ emerge --pretend --emptytree system | grep '^\[ebuild' | sed 's/^.*] //' | sort >/tmp/system
$ emerge --pretend --emptytree world | grep '^\[ebuild' | sed 's/^.*] //' | sort >/tmp/world
$ diff -u /tmp/system /tmp/world | grep '^-'
It's the same reason fresh installs are bootstrapped, compiling the toolchain multiple times. Assuming you start with gcc 3.4.6 and follow the guide:

emerge -u gcc gives you a gcc 4.1.1 compiled with gcc 3.4.6.
emerge -e system gives you a toolchain partially compiled with a gcc 4.1.1 that was compiled with gcc 3.4.6, and partially compiled with a gcc 4.1.1 that was compiled with gcc 4.1.1 (including gcc itself)
emerge -e world gives you everything compiled with a gcc 4.1.1 that was compiled with gcc 4.1.1

Not that I would call all that "necessary."
You're right, it's not. The gcc build itself does a three-stage build: once against the current system gcc, a second time against the new version of gcc just built (but not yet installed), and a third time, to sanity-check that the resulting binaries are the same as in stage 2.

In any case, gcc has already been rebuilt this way even before doing `emerge -e system`. If you then do `emerge -e world`, gcc has been re-merged three times, for a total of nine complete builds! This seems crazy.

Where did this bit of tribal knowledge come from? Whoever first pronounced 'you must re-merge system, then world' must have had a reason.
Top
depontius
Advocate
Advocate
Posts: 3533
Joined: Wed May 05, 2004 4:06 pm

  • Quote

Post by depontius » Fri Sep 01, 2006 7:30 pm

Sachankara wrote:
CRV§ADER//KY wrote:won't nptlonly break binary packages that don't support it? what are the ups and downs in enabling/not enabling it?
NPTL is fully backwards compatible with LinuxThreads. At least I've never had a problem with binary only stuff.
Then perhaps my problems weren't with nptlonly, but with some other aspect of my system. I had a system built with nptlonly, but found that there were several binary-only CAD (Computer Aided Design - Silicon CAD, more specifically) that I simply couldn't run. Once things got to "LD_ASSUME_KERNEL=2.4.1 (or 2.4.19) it was as if the system got amnesia, and couldn't run spit in that session, with ld.so complaining about not being able to find libc.so.5.

I'd love it if someone could tell me what went wrong after LD_ASSUME_KERNEL=2.4.x, so I could go ahead and do the full upgrade. Otherwise it looks like staying at glibc-2.3 is going to make Gentoo into a real pain. I plan to upgrade my home systems as I get time, but won't touch my work systems until this is resolved.

Actually, I need OpenAFS at work, and at present it says in the ebuild that it simply won't work with glibc-2.4, so I'm in a pickle on my work machines. The incompatibility is flagged in the ebuild, but I see nothing about it in the FORUMs. Is this on the radar screen?
.sigs waste space and bandwidth
Top
chtephan
Apprentice
Apprentice
User avatar
Posts: 266
Joined: Tue Feb 03, 2004 5:11 pm
Location: Offenburg, Germany
Contact:
Contact chtephan
Website

  • Quote

Post by chtephan » Fri Sep 01, 2006 7:35 pm

Yes, but there are also some glibc - gcc cross-dependencies which are very important when moving from a non-nptlonly to an nptlonly system. In order get this right when both are upgrade, they both should be compiled at least twice. By following the official upgrade guide everything should work.
First, gcc is compiled. This makes the c++ library symbols it would like to use available. It also makes all subsequent builds use the gcc 4 ABI. Then system is reemerged. This means that gcc is rebuilt against dependencies that were compiled using gcc 4 and you get a glibc using gcc 4 features. Then, when emerging world, gcc is rebuilt a third time and can now use features provided by a gcc4-compiled and nptl enabled glibc.

You can probably get away with even fewer recompiles but you really have to know what you are doing. emerge -e system and emerge -e world twice is really overkill. This should only be required if some ABI has really completely changed and it is required to have dependencies of dependencies linked against the correct version and stuff.
Top
drphibes
Guru
Guru
User avatar
Posts: 432
Joined: Tue Nov 30, 2004 3:13 pm

  • Quote

Post by drphibes » Fri Sep 01, 2006 7:58 pm

what i do is first nail down the toolchain with two passes:

Code: Select all

emerge --oneshot linux-headers glibc binutils-config binutils gcc-config gcc
emerge --oneshot linux-headers glibc binutils-config binutils gcc-config gcc
then i build the system and save packages simultaneously:

Code: Select all

emerge --emptytree --buildpkg system
and then i build world, but tell it to use system packages already built:

Code: Select all

emerge --emptytree --usepkg world
this has worked reliably for me and I have the last step in progress now.
Top
oldefortran
l33t
l33t
Posts: 652
Joined: Sat Feb 28, 2004 8:54 pm

Re: GCC 4.1.1 and glibc 2.4 stable on x86 and amd64

  • Quote

Post by oldefortran » Fri Sep 01, 2006 7:59 pm

Is there any programs that have problems with the new compiler?
Top
drphibes
Guru
Guru
User avatar
Posts: 432
Joined: Tue Nov 30, 2004 3:13 pm

  • Quote

Post by drphibes » Fri Sep 01, 2006 8:14 pm

the only thing i am noticing is many more warnings due to -fstrict-aliasing now being implied with -O2
and higher optimization. of course any program built with -Werror will not compile with such warnings,
but i haven't run into one yet.
Top
geniux
Veteran
Veteran
User avatar
Posts: 1400
Joined: Thu Feb 19, 2004 6:43 am
Location: /home

  • Quote

Post by geniux » Fri Sep 01, 2006 8:21 pm

GCC upgraded without errors, but the nvidia module wont work anymore. I've reinstalled, unmerged and remerge, even tried the unstable versions of both media-video/nvidia and x11-drivers/nvidia-driver but it gives me the same message:

Code: Select all

FATAL: Error inserting nvidia (/lib/modules/2.6.17-beyond2.2/video/nvidia.ko): Invalid module format
Anyone else who got this problem? Everything else are working just fine
AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20
Top
drphibes
Guru
Guru
User avatar
Posts: 432
Joined: Tue Nov 30, 2004 3:13 pm

  • Quote

Post by drphibes » Fri Sep 01, 2006 8:22 pm

geniux wrote:GCC upgraded without errors, but the nvidia module wont work anymore. I've reinstalled, unmerged and remerge, even tried the unstable versions of both media-video/nvidia and x11-drivers/nvidia-driver but it gives me the same message:

Code: Select all

FATAL: Error inserting nvidia (/lib/modules/2.6.17-beyond2.2/video/nvidia.ko): Invalid module format
Anyone else who got this problem? Everything else are working just fine
did u rebuild the kernel with the new toolchain (you should)?
Top
CRV§ADER//KY
Guru
Guru
User avatar
Posts: 405
Joined: Mon Aug 30, 2004 6:47 pm
Location: Torino
Contact:
Contact CRV§ADER//KY
Website

  • Quote

Post by CRV§ADER//KY » Fri Sep 01, 2006 8:25 pm

Dominique_71 wrote:-Os is for embeded system. It depend also of the arch, but on x86, it is not recommended for a desktop.
nonsense. I've been using -Os for over a year on my AthlonXP 2000+ desktop AND my celeron 466 laptop and I'm very happy with it. it's stable, slightly faster than -O3 (which in turn is INSANELY bigger), and much faster than -O2. As a plus, I save disk space, RAM and loading times.


insight-6.1 failed. 563 packages to go....
Kyrie, Ignis Divine, Eleison ~ Elfen Lied
Top
CRV§ADER//KY
Guru
Guru
User avatar
Posts: 405
Joined: Mon Aug 30, 2004 6:47 pm
Location: Torino
Contact:
Contact CRV§ADER//KY
Website

  • Quote

Post by CRV§ADER//KY » Fri Sep 01, 2006 8:33 pm

geniux wrote:GCC upgraded without errors, but the nvidia module wont work anymore. I've reinstalled, unmerged and remerge, even tried the unstable versions of both media-video/nvidia and x11-drivers/nvidia-driver but it gives me the same message:

Code: Select all

FATAL: Error inserting nvidia (/lib/modules/2.6.17-beyond2.2/video/nvidia.ko): Invalid module format
Anyone else who got this problem? Everything else are working just fine
has your kernel been compiled with the new toolchain? I bet not :wink:
Kyrie, Ignis Divine, Eleison ~ Elfen Lied
Top
geniux
Veteran
Veteran
User avatar
Posts: 1400
Joined: Thu Feb 19, 2004 6:43 am
Location: /home

  • Quote

Post by geniux » Fri Sep 01, 2006 8:52 pm

drphibes wrote: did u rebuild the kernel with the new toolchain (you should)?
CRV§ADER//KY wrote: has your kernel been compiled with the new toolchain? I bet not :wink:
My kernel were compiled with the new toolchain, I followed the steps I've read at the forum, but I choose the wrong kernelimage at boot :oops: Sorry about that guys. Thank you much anyway
AMD Athlon64 X2 4200+ AM2
MSI K9N SLI Platinum, Enermax Liberty 500W
1GB RAM Crucial DDR2 667MHz, MSI nVidia 7600GS 256MB
400GB + 250GB Samsung SATAII HDD
Gentoo - BeyondSources 2.6.19-20
Top
gami
Apprentice
Apprentice
Posts: 297
Joined: Fri Jun 02, 2006 12:32 am

  • Quote

Post by gami » Fri Sep 01, 2006 9:13 pm

iphands wrote:Am I the only one here who has seen a broken compiler after the upgrade? This is strange because the methods I used on two systems worked for one but hosed the other.....

Any one with:

Code: Select all

checking for C compiler default output file name... configure: error: C compiler cannot create executables
or

Code: Select all

/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bin/ld:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../libc.so: file format not recognized; treating as linker script
/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../../i686-pc-linux-gnu/bin/ld:/usr/lib/gcc/i686-pc-linux-gnu/3.4.6/../../../libc.so:5: syntax error
collect2: ld returned 1 exit status
please speak up (there is power in numbers)...

p.s. I get this when selecting gcc 4.0, 4.1, 3.3 or 3.4. And as it happened only after I emerged the new glibc package that is where I am pointing my finger.
I had this issue, too, that halfway through emerge -eav system it suddenly could no longer compile more packages. A little bit of digging around on the system showed that there were some older slotted versions of binutils still installed The latest version (2.16.*) had not overwritten the symbolic links installed by the 2.15.* version(s) of binutils. I uninstalled the older versions (emerge -Cav "<binutils-2.16*") and could continue the interrupted emerge (emerge --resume).
Top
literfizzer
n00b
n00b
Posts: 19
Joined: Wed Aug 30, 2006 4:50 pm

  • Quote

Post by literfizzer » Fri Sep 01, 2006 9:34 pm

geniux wrote:My kernel were compiled with the new toolchain, I followed the steps I've read at the forum, but I choose the wrong kernelimage at boot :oops: Sorry about that guys. Thank you much anyway
That makes sense. I believe that only the C++ ABI changed, so C programs don't need to be recompiled when upgrading to gcc-4.1.1.
Top
thorak
n00b
n00b
Posts: 9
Joined: Thu Jul 14, 2005 10:32 pm

  • Quote

Post by thorak » Fri Sep 01, 2006 9:36 pm

Brilliant, thanks gami, that fixed it for me!
If you're ever in Oslo, let me know and I'll buy you some beers.
Top
dave-gallagher
n00b
n00b
Posts: 29
Joined: Wed Mar 01, 2006 2:01 am

Re: GCC 4.1.1 and glibc 2.4 stable on x86 and amd64

  • Quote

Post by dave-gallagher » Fri Sep 01, 2006 10:28 pm

Last edited by dave-gallagher on Fri Jan 13, 2023 1:31 am, edited 4 times in total.
Top
sonicbhoc
Veteran
Veteran
User avatar
Posts: 1805
Joined: Mon Oct 24, 2005 7:52 pm
Location: In front of the computer screen
Contact:
Contact sonicbhoc
Website

  • Quote

Post by sonicbhoc » Fri Sep 01, 2006 10:50 pm

Sachankara wrote:
CRV§ADER//KY wrote:won't nptlonly break binary packages that don't support it? what are the ups and downs in enabling/not enabling it?
NPTL is fully backwards compatible with LinuxThreads. At least I've never had a problem with binary only stuff.
My glibc has (-nptl) and (-nptlonly) and I can't change it <_<

Without nptl I can't have a bootsplash... I was hoping I could put one on there for my pastor, who's computer is nearly perfect now, aside from this last issue.

So what am I doing wrong?
Top
STrRedWolf
n00b
n00b
Posts: 72
Joined: Mon Sep 02, 2002 5:41 am
Contact:
Contact STrRedWolf
Website

  • Quote

Post by STrRedWolf » Fri Sep 01, 2006 11:25 pm

So, the main problem is that many packages are rebuilt up to three times, and that chews up time... but if we do some filtering, we can cut this out.

Code: Select all

# Build the listings...
emerge -p gcc glibc libtool | perl -nle 'print $1 if(/\]\s+(\S+)\s+\[/);' > gcc.txt
emerge -ep system | perl -nle 'print $1 if(/\]\s+(\S+)\s+\[/);' > system.txt
emerge -ep world | perl -nle 'print $1 if(/\]\s+(\S+)\s+\[/);' > world.txt

# Filter already built ebuilds out.  We need sort, of course, because uniq only compares two lines at a time.
cat gcc.txt system.txt | sort | uniq -u | xargs echo emerge -av > build.system
cat gcc.txt system.txt world.txt | sort | uniq -u | xargs echo emerge -av > build.world
Then "sh build.system" instead of "emerge -eav system" and the same for world.

Now only if they can put in a --readlistfrom option in emerge...[/code]
Top
depontius
Advocate
Advocate
Posts: 3533
Joined: Wed May 05, 2004 4:06 pm

  • Quote

Post by depontius » Fri Sep 01, 2006 11:41 pm

chtephan wrote:Yes, but there are also some glibc - gcc cross-dependencies which are very important when moving from a non-nptlonly to an nptlonly system. In order get this right when both are upgrade, they both should be compiled at least twice. By following the official upgrade guide everything should work.
First, gcc is compiled. This makes the c++ library symbols it would like to use available. It also makes all subsequent builds use the gcc 4 ABI. Then system is reemerged. This means that gcc is rebuilt against dependencies that were compiled using gcc 4 and you get a glibc using gcc 4 features. Then, when emerging world, gcc is rebuilt a third time and can now use features provided by a gcc4-compiled and nptl enabled glibc.

You can probably get away with even fewer recompiles but you really have to know what you are doing. emerge -e system and emerge -e world twice is really overkill. This should only be required if some ABI has really completely changed and it is required to have dependencies of dependencies linked against the correct version and stuff.
Were you answering me or someone else?

Are you saying that the problems I had with nptlonly and LD_ASSUME_KERNEL=2.4.x killing ld.so were not strictly related to nptlonly, and that it might have been my build sequence?

I guess I'm still stuck with glibc-2.4 problems though, because OpenAFS won't build with it, and I need OpenAFS.
.sigs waste space and bandwidth
Top
hielvc
Advocate
Advocate
Posts: 2805
Joined: Fri Apr 19, 2002 5:55 pm
Location: Oceanside, Ca

  • Quote

Post by hielvc » Sat Sep 02, 2006 12:23 am

STrRedWolf youir method will screw your system up. Your totally throwing out the build time dependencies. Look at my script
Note This isnt in the upgrade guide
An emerge wrapper for more correctly building the toolchain. If you choose to use emwrap.sh you need to

Code: Select all

 USE="-fortran" emerge -1O gcc 
gcc-config  -l   <<< lower case L
gcc-config  #    <<< number of gcc-4.1.1
emwrap.sh -seb1  << builds TC, then system files minus the TC
emwrap.sh -S     <<< this is to be safe. Rebuilds the system minus the TC files. If I have probs I do it and a 2nd "-W"
emwrap.sh -W     <<< builds the world files minus the system files minus the TC
This also a good time to update your /etc/make.profile link.

Code: Select all

cd /etc
rm make.profile
ln -s /usr/portage/profiles/default-linux/x86/2006.1/desktop /etc/make.profile
Then do the above.

EDIT Fixed details
Last edited by hielvc on Sat Sep 02, 2006 1:33 am, edited 1 time in total.
An A-Z Index of the Linux BASH command line
Top
icb410
n00b
n00b
Posts: 55
Joined: Thu Jul 01, 2004 11:29 am

did wrong libtool fix

  • Quote

Post by icb410 » Sat Sep 02, 2006 1:12 am

Hi,

I started upgrading to gcc 4.1.1 and am now doing the 'emerge -e system' step. However, I realized that instead of doing:

fix_libtool_files.sh 3.4.6

I did:

fix_libtool_files.sh 4.1.1

Is this going to screw me over? Should I stop my 'emerge -e system' and go back to the previous steps?

Thanks,
Ian
Top
Nicias
Guru
Guru
Posts: 446
Joined: Tue Dec 06, 2005 2:40 am

  • Quote

Post by Nicias » Sat Sep 02, 2006 2:39 am

Ok, I have seriously screwed up my system I think.

A few of my friends share emerge jobs by doing a central emerge using distcc and then distributing the binaries and using -k.

So I when gcc4 when stable, I did my part though rebuilding libtool. Then his machine did the emerge -e system's and world's.

I copied the binary packages, and then *I think here is my error* did a emerge -ek world.
(maybe I should have done system first?)

Now nothing will emerge. Worse then that, things like "rm", "install", and "mv" don't work. I get these kinds of errors:

Code: Select all

rm: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by rm)
How in the world do I fix this? I guess I should reboot from a CD etc, but I don't want to try and just muck around until I fix it somehow. I would rather have a plan I know will work.

My idea is this, put in an install CD, boot into that. And then install they binary packages I already have for system by changin $ROOT and $PORTAGE_CONFIGROOT to be /mnt/gentoo/ (If I chroot I will have the same problems)

Will this work?


Update:
It worked, I also had to manually set PORtDIR and PKGDIR, but then an emerge -k1 glibc worked.
Last edited by Nicias on Sat Sep 02, 2006 3:30 pm, edited 1 time in total.
Top
Gergan Penkov
Veteran
Veteran
User avatar
Posts: 1464
Joined: Sat Jul 17, 2004 9:42 pm
Location: das kleinste Kuhdorf Deutschlands :)

  • Quote

Post by Gergan Penkov » Sat Sep 02, 2006 2:53 am

you should find a way to install glibc from your friends bin pkgs, it seems that you are missing it.
the correct order would have been, emerge -ek glibc and after that emerge -ek system (or probably just world)
"I knew when an angel whispered into my ear,
You gotta get him away, yeah
Hey little bitch!
Be glad you finally walked away or you may have not lived another day."
Godsmack
Top
Isaiah
Guru
Guru
Posts: 359
Joined: Tue Feb 25, 2003 3:55 am

Re: GCC 4.1.1 and glibc 2.4 stable on x86 and amd64

  • Quote

Post by Isaiah » Sat Sep 02, 2006 5:30 am

amne wrote: I want to upgrade from gcc 3.4 to gcc 4.1 - which instructions do i use?
Please follow the general instructions.
Well done people - this was perfect (no runs, drips, or errors) - thank you very much 8)
Top
Orific
n00b
n00b
Posts: 67
Joined: Fri Oct 14, 2005 2:41 pm

libdv problem

  • Quote

Post by Orific » Sat Sep 02, 2006 8:24 am

During my emerge -e world, libdv broke my up to now flawless gcc upgrade :( .
So after investigation, I found out that libdv build fails with gcc-4 without a certain patch (see here and here).
Now that patch is used in the latest ~x86 version (libdv-0.104-r1), but not in the stable version (0.102), which I am using.
My question is: could I add "media-lib/libdv ~x86" to my /etc/portage/package.keywords now without breaking --resume ?
Thanx.
Top
DrSnoegler
n00b
n00b
User avatar
Posts: 30
Joined: Tue Apr 26, 2005 9:54 pm
Location: Switzerland

glibc-compat20 use-flag removed

  • Quote

Post by DrSnoegler » Sat Sep 02, 2006 8:28 am

why sys-libs/glibc-2.4-r3 has no glibc-compat20 useflag? i really really use this to run matlab!

I've wrongly updated glibc to 2.4-r3 and now I can't downgrade back to sys-libs/glibc-2.3.6-r4.
I've still sys-devel/gcc-3.4.6-r1 installed and really have to downgrade glibc!
can I edit the ebuild to do this anyway?

@gian:
have you still keep the old version to save 'your application' ? :-)
Top
Post Reply

389 posts
  • Page 6 of 16
    • Jump to page:
  • Previous
  • 1
  • …
  • 4
  • 5
  • 6
  • 7
  • 8
  • …
  • 16
  • 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