Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gcc 3.2.2 seems to be crap, what to do ?!?
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
behd
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 155

PostPosted: Tue Mar 04, 2003 8:31 am    Post subject: gcc 3.2.2 seems to be crap, what to do ?!? Reply with quote

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
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Tue Mar 04, 2003 8:42 am    Post subject: Reply with quote

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
View user's profile Send private message
behd
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 155

PostPosted: Tue Mar 04, 2003 8:47 am    Post subject: Reply with quote

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
View user's profile Send private message
cederberg
Guru
Guru


Joined: 23 Jan 2003
Posts: 349
Location: Stockholm / Sweden

PostPosted: Tue Mar 04, 2003 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
behd
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 155

PostPosted: Tue Mar 04, 2003 12:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Tue Mar 04, 2003 12:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
tyler
n00b
n00b


Joined: 28 Aug 2002
Posts: 59
Location: toronto, ontario, canada

PostPosted: Tue Mar 04, 2003 2:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Tue Mar 04, 2003 3:11 pm    Post subject: Reply with quote

Every -O# with # > 3 will result in "-O3". gcc won't complain.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Tue Mar 04, 2003 10:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
behd
Apprentice
Apprentice


Joined: 11 Feb 2003
Posts: 155

PostPosted: Wed Mar 05, 2003 3:32 pm    Post subject: Reply with quote

- 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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Wed Mar 05, 2003 7:44 pm    Post subject: Reply with quote

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
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