Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] How do I compile GCC-3.4 on my AMD64 box?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
magnesium
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 280
Location: Toronto, Canada

PostPosted: Fri Sep 24, 2004 4:19 pm    Post subject: [Solved] How do I compile GCC-3.4 on my AMD64 box? Reply with quote

[Edit: I've updated the title to Solved. The sollution is in a post below]

I'm really going quite crazy trying to figure out how to install any version of gcc >= 3.4 on my Athelon 64 box.

I try to compile gcc and get
Code:
emerge -pv gcc

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] sys-devel/gcc-3.3.4-r2  -X -bootstrap -build -debug -f77 -gcj (-hardened) -multilib +nls -objc -pic -static (-uclibc) 0 kB

Total size of downloads: 0 kB


so I try to specify the package I want and get the following
Code:
emerge -pv gcc-3.4.2-r2

These are the packages that I would merge, in order:

Calculating dependencies

!!! Problem in sys-devel/gcc-3.4.2-r2 dependencies.
!!! "Specific key requires an operator (sys-devel/gcc-3.4.2-r2) (try adding an '=')" exceptions


I've tried to figure it out through reading the forums and it seems like everyone can do it but me, but don't actually share HOW to do it. The closest that I found is this thread, and when I try to piece together the information I type and get the following
Code:
USE=multilib FEATURES=-sandbox emerge -pv /usr/portage/sys-devel/gcc/gcc-3.4.2-r2.ebuild portage

!!! Warning: emerge /path/to/ebuild is broken and considered dangerous.
!!! Don't use it. I'm serious, we're coming after you if you use it.

>>> Waiting 10 seconds before starting...
>>> (Control-C to abort)...
Continuing with emerge /path/to/ebuild in: 10 9 8 7 6 5 4 3 2 1

These are the packages that I would merge, in order:

Calculating dependencies   sys-devel/gcc-3.4.2-r2                              ...done!
[ebuild  N    ] app-emulation/emul-linux-x86-glibc-1.1  3,238 kB
[ebuild  N    ] sys-devel/gcc-3.4.2-r2  -bootstrap -build -debug -f77 -gcj -gtk (-hardened) -n32 -n64 +nls -nomultilib -objc -static (-uclibc) 27,332 kB
[ebuild  N    ] sys-libs/libstdc++-v3-3.3.4  -debug +nls 0 kB
[ebuild   R   ] sys-apps/portage-2.0.51_rc1  -build +multilib* (-selinux) 0 kB

Total size of downloads: 30,570 kB


It looks like it might actually install, but the warning message is a BIG demoralizer and I doubt that this is the way it's supposed to be done.

Here's my /etc/make.conf contents
Code:
cat /etc/make.conf

# These settings were set by the catalyst build script that automatically built this stage
# Please consult /etc/make.conf.example for a more detailed example
CFLAGS="-O2 -march=athlon64 -ftracer -fprefetch-loop-arrays -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden"
MAKEOPTS="-j2"
GENTOO_MIRRORS="http://ftp-mirror.internap.com/pub/gentoo/ http://ftp.ntua.gr/pub/linux/gentoo/ ftp://ftp.ndlug.nd.edu/pub/gentoo/"
USE="-X -motif -xmms -xv -avi -mpeg -quicktime -gnome -gtk -gtk2 -qt -kde -arts -berkdb -foomaticdb -libg++ doc alsa oss mysql ssl apache2 dvd cdr sockets"
ALSA_CARDS="via82xx"
ACCEPT_KEYWORDS="~amd64"


please help the noob. please please please!
_________________
Adopt an unanswered post


Last edited by magnesium on Fri Sep 24, 2004 7:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
GuidoJ
Guru
Guru


Joined: 24 Dec 2002
Posts: 444
Location: Netherlands

PostPosted: Fri Sep 24, 2004 4:34 pm    Post subject: Reply with quote

You must select the correct profile with the symbolic link /etc/make.profile. Look in /usr/portage/profiles for all available profiles. Look for "gcc34-amd64" in the directory name.
Back to top
View user's profile Send private message
magnesium
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 280
Location: Toronto, Canada

PostPosted: Fri Sep 24, 2004 4:51 pm    Post subject: Reply with quote

Thanks for getting back to me, but I'm still confused.

I updated my symlink like so
Code:
ls -l /etc/make.profile
lrwxrwxrwx  1 root root 44 Aug 25 19:31 /etc/make.profile -> ../usr/portage/profiles/default-amd64-2004.2

ln -s /usr/portage/profiles/gcc34-amd64-2004.1 /etc/make.profile

ls -l /etc/make.profile
lrwxrwxrwx  1 root root 44 Aug 25 19:31 /etc/make.profile -> ../usr/portage/profiles/default-amd64-2004.2


but I get the same results as I posted above when I try to emerge either gcc or gcc-3.4.2-r2

I even tried to run
Code:
env-update && source /etc/profile
hopeing that that would help, but it did not.

Still confused.
_________________
Adopt an unanswered post
Back to top
View user's profile Send private message
elvelind
n00b
n00b


Joined: 13 Dec 2003
Posts: 34

PostPosted: Fri Sep 24, 2004 6:21 pm    Post subject: Reply with quote

you still have the symlink pointing to the default profile. use ln -sf to force the creation of the new link
Back to top
View user's profile Send private message
magnesium
Apprentice
Apprentice


Joined: 28 Oct 2003
Posts: 280
Location: Toronto, Canada

PostPosted: Fri Sep 24, 2004 7:32 pm    Post subject: Reply with quote

Thank you so much!
I can't believe that I didn't notice the symlink didn't change :oops:

So here's how I got it to work for me:

First you need to update the /etc/make.profile link to point to the version of gcc you want for your architecture. To find out which one you want, do
Code:
ls /usr/portage/profiles/

For my architecture I wanted to use the "gcc34-amd64-2004.1" profile (most current profile for the version of gcc I want to use and for my platform).

To invoke this change I had to delete the symbolic link I had to replace it, otherwise my link would appear within the other /etc/make.profile/ link directory. To do this at the time of writting for my architecture I ran:
Code:
rm /etc/make.profile
ln -sf /usr/portage/profiles/gcc34-amd64-2004.1 /etc/make.profile

the rm command deletes the file. the ln -sf creates forces a symbolic link to be created to destination from link file.

at that point you can check if the right version of gcc will compile by running
Code:
emerge -pv gcc


Then do it for real
Code:
emerge -v gcc


Once that completes, you need to let the system know what version of gcc you want to run. To output my choices I ran and got returned
Code:
gcc-config -l
[1] x86_64-pc-linux-gnu-3.3.4
[2] x86_64-pc-linux-gnu-3.4.2


The output "x86_64-pc-linux-gnu-3.4.2" is the version that I want to use so I run
Code:
gcc-config x86_64-pc-linux-gnu-3.4.2
to which gcc tells me it's changing gcc versions.

Now, I want to update the environment that I am using to be able to use this new version of gcc. I run
Code:
env-update && source /etc/profile


and finally I test that all is cool. The test I run and the return I got are as follows
Code:
gcc --version
gcc (GCC) 3.4.2  (Gentoo Linux 3.4.2-r2, ssp-3.4.1-1, pie-8.7.6.5)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Sweet! I'm rockin the newest version of gcc! :twisted:
_________________
Adopt an unanswered post
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 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