View previous topic :: View next topic |
Author |
Message |
behd Apprentice
Joined: 11 Feb 2003 Posts: 155
|
Posted: Tue Mar 04, 2003 8:31 am Post subject: gcc 3.2.2 seems to be crap, what to do ?!? |
|
|
Hie everyone,
I would need some guru advice !!! well I started to emerge a brand new system (no problem with stage 1 or 2). But when I tried to emerge mysql, it failed with silly error... having a look @ forum, it seems it doesn't compile with any release of gcc 3.2.2 !?!
So what would be the best solution ?!?
- having 2 version of gcc installed ?
- downgrading to an earlier version (3.2.1 seems fine)
- using some specific settings / flags with 3.2.2 (but which ???)
For any of those solutions what would be the best way to do it on gentoo ?
Thanks for any advice !!! |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Tue Mar 04, 2003 8:42 am Post subject: |
|
|
Try to make your CFLAGS gentle: "-march=<your cpu> -O3 -pipe" and nothing more. If that doesn't work, downgrade to the previous version (3.2.1) but do _not_ go to a 2-serie (incompatibility). |
|
Back to top |
|
|
behd Apprentice
Joined: 11 Feb 2003 Posts: 155
|
Posted: Tue Mar 04, 2003 8:47 am Post subject: |
|
|
I am a bit confused about CFLAGS, I've setuped in my make.conf
MARCH=pentium3 with optimization 04 but when I compile mysql,
it seems to use -03 and -AMDsmth ?!? (does the package have some rulez that could take precedence over your own settings ?) |
|
Back to top |
|
|
cederberg Guru
Joined: 23 Jan 2003 Posts: 349 Location: Stockholm / Sweden
|
Posted: Tue Mar 04, 2003 10:22 am Post subject: |
|
|
Yes, ebuilds may filter your CFLAGS. This is to avoid compilation breakages such as the one you encountered.
I'd personally go for this one if you want to play it safe:
Code: | CFLAGS="-O -march=i686 -pipe" |
If your problem is indeed solved by changing your CFLAGS, please submit a bug report to the Gentoo bug database. The MySQL ebuild should filter the flags a bit better in that case.
BTW. It is recommended that you do not optimize past -O3. |
|
Back to top |
|
|
behd Apprentice
Joined: 11 Feb 2003 Posts: 155
|
Posted: Tue Mar 04, 2003 12:22 pm Post subject: |
|
|
Thanks for your informations so far...
But if I need to downgrade my gcc, how could I do that in order to keep my system clean and functionnal ???
Does I have to unmerge current gcc and then emerge a previous version ??? (but by doing such, it seems I could have problem to run emerge after I deinstalled gcc 3.2.2, in fact I don't even see how I would compile old gcc 3.2.1?!?)
-> won't it be better to have 2 gcc installed then remove the 3.2.2 (or will it mess the library) ?
Anyway I don't even have a clue on how to emerge another package than last version synced... (-> how can I specify that I want to emerge version 3.2.1 ?!?)
Many thanks !!! |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Tue Mar 04, 2003 12:58 pm Post subject: |
|
|
You should not remove the 3.2.2. Just emerge the 3.2.1 by issuing
Code: |
~# emerge /usr/portage/sys-devel/gcc/gcc-3.2.1.ebuild
|
|
|
Back to top |
|
|
tyler n00b
Joined: 28 Aug 2002 Posts: 59 Location: toronto, ontario, canada
|
Posted: Tue Mar 04, 2003 2:48 pm Post subject: |
|
|
behd wrote: | I am a bit confused about CFLAGS, I've setuped in my make.conf
MARCH=pentium3 with optimization 04 but when I compile mysql,
it seems to use -03 and -AMDsmth ?!? (does the package have some rulez that could take precedence over your own settings ?) |
if you mean "-O4" when you say optimization O4, that's odd, because the maximum level of optimization for gcc is -O3.
read up here:
http://freshmeat.net/articles/view/730/
if it's a typo, then nevermind. |
|
Back to top |
|
|
Sven Vermeulen Retired Dev
Joined: 29 Aug 2002 Posts: 1345 Location: Mechelen, Belgium
|
Posted: Tue Mar 04, 2003 3:11 pm Post subject: |
|
|
Every -O# with # > 3 will result in "-O3". gcc won't complain. |
|
Back to top |
|
|
ebrostig Bodhisattva
Joined: 20 Jul 2002 Posts: 3152 Location: Orlando, Fl
|
Posted: Tue Mar 04, 2003 10:11 pm Post subject: |
|
|
For more info on GCC and optimizer flags see the following 2 articles:
GCC Myths and Facts
Optimizing GCC
Erik _________________ 'Yes, Firefox is indeed greater than women. Can women block pops up for you? No. Can Firefox show you naked women? Yes.' |
|
Back to top |
|
|
behd Apprentice
Joined: 11 Feb 2003 Posts: 155
|
Posted: Wed Mar 05, 2003 3:32 pm Post subject: |
|
|
- to all who provided infos: thanks !!!
- to tyler: nope I was using -04 (really )... from my previous readings and knowledge, I used to think it can provide better optimization (even if apps could became unstable).
- to the one who has written somewhere in forum that the reading of gcc src code could be interesting and provide lot of infos: well even if knowledge is power, I am glad to sacrifice a bit of my knowledge and enjoy nightlife
---
My problem has finally been solved by using this flag for CFLAGS & CXXFLAGS: "-DHAVE_ERRNO_AS_DEFINE=1"
(btw. none of FLAGS proposed in this thread worked / being less agressive doesn't helped too)
cf. https://forums.gentoo.org/viewtopic.php?t=37732&highlight=mysql+errno
---
For the story, I having now exactly the same problem with 2 others packages:
- krb5
- smth related Xfree
Compiling hang again with:
Code: | undefined reference to `errno'
collect2: ld returned 1 exit status |
pffff dunno if I am to blame or if gcc 3.2.2 have problems (maybe I falsely suspected it to be crap).... but anyway I installed 2 Gentoo flawlessly @work (but starting from stage2 & using gcc 3.2.1) and I keep running into problems @home (statring from stage1 & gcc 3.2.2) |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Wed Mar 05, 2003 7:44 pm Post subject: |
|
|
The issue with "undefined reference to errno" is caused by an incompatible change in glibc in 2.3.2-pre. Declaring errno as an extern int is no longer supported - <errno.h> must be included explicitly. See bug #16267 for more details. This is one of those cases where people running ~arch must be prepared to deal with problems. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
|