Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HowTo: Using the gcc34-x86-2004.2 profile
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Thu Aug 05, 2004 3:50 am    Post subject: HowTo: Using the gcc34-x86-2004.2 profile Reply with quote

This guide is intended to help those wanting to build a Gentoo system using the gcc34-x86-2004.2 profile, NPTL and a 2.6 kernel.

Getting started:
You will need a Gentoo 2004.2 LiveCD, and an internet connection.

Installing Gentoo Linux:
With your LiveCD burned to a disk and your Bios configured to boot from CD go head and restart your PC.

Refer to the Gentoo Hanbook for more information about obtaining and burning a Gentoo 2004.2 LiveCD.

Now boot from the LiveCD and type smp at the boot prompt.
Code:
boot: smp


smp is a 2.6 kernel that will allow proc to be populated with information from a running 2.6 kernel rather than a 2.4 kernel like gentoo.

Refer to the Gentoo Handbook for options passable to the kernel during boot.

Check to ensure your PC has the correct time.
Code:
date


Preparing your hard drive for Gentoo Linux:
In this guide i will use fdisk to partition my hard drive.
Code:
fdisk /dev/hda


You will need atleast a / (root) and swap partition.

Create filesystems and mount partitions.
Code:
mke2fs /dev/hda1
mke2fs -j /dev/hda5
mkswap /dev/hda6
swapon /dev/hda6
mount /dev/hda5 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/hda1 /mnt/gentoo/boot


It is important that you have booted using the smp kernel at this point in order for glibc to be compiled with NPTL support the kernel loaded must support it ie: 2.6

Installing the Gentoo Installation Files:
Change to the /mnt/gentoo directory.
Code:
cd /mnt/gentoo


Use links to download a stage1 tarball from a gentoo mirror.
Code:
links http://www.gentoo.org/main/en/mirrors.xml


You must have networking configured and enabled.

After downloading the stage1 tarball extract it.
Code:
tar -xvjpf stage?-*.tar.bz2 && rm stage?-*.tar.bz2


Mounting the proc filesystem.
Code:
mount -t proc none /mnt/gentoo/proc


Configuring make.conf.
Code:
nano -w /mnt/gentoo/etc/make.conf


Included as an example:
Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
USE="nptl"
ACCEPT_KEYWORDS="~x86"


Installing the Gentoo Base System
Optional
Selecting mirrors.
Code:
mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' >> /mnt/gentoo/etc/make.conf


This command will populate GENTOO_MIRRORS in make.conf.

Copy DNS info.
Code:
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf


Before we chroot into the new Gentoo environment you may want to run passwd to change the root password so it is possible to log into another vt.

Chrooting into the new Gentoo environment.
Code:
chroot /mnt/gentoo /bin/bash
env-update && source /etc/profile


Syncing the portage tree.
Code:
emerge sync


Changing to the gcc34-x86-2004.2 profile.
Code:
unlink /etc/make.profile
ln -sf /usr/portage/profiles/gcc34-x86-2004.2 /etc/make.profile


Installing the 2.6 kernel headers.
Code:
emerge -C linux-headers
emerge --oneshot --nodeps linux26-headers


Bootstrapping the system.
Code:
cd /usr/portage
scripts/bootstrap.sh && env-update && source /etc/profile


To check if NPTL support was compiled into glibc type: /lib/libc.so.6 you should see NTPL in the output.

Building the base system.
Code:
emerge system && env-update && source /etc/profile


Configuring the Kernel
Configure timezone.
Code:
ln -sf /usr/share/zoneinfo/UTC /etc/localtime


Remember to use your own timezone!

Selecting and configuring a kernel:
Code:
emerge gentoo-dev-sources


Refer to the Gentoo Handbook for other 2.6 kernels available and howto configure and install them.

Optional:
Installing udev.
Code:
emerge udev


Installing hotplug.
Code:
emerge hotplug && rc-update add hotplug default


Installing alsa.
Code:
emerge alsa-utils && nano -w /etc/modules.d/alsa && rc-update add alsasound boot


Refer to the ALSA Handbook for further information on configuring a sound card.

Configuring your System:
Refer to the Gentoo Handbook on editing fstab, rc.conf, and network configuration files.

Installing Necessary System Tools
Install a system logger.
Code:
emerge metalog && rc-update add metalog default


Install a cron daemon.
Code:
emerge vixie-cron && rc-update add vixie-cron default


Optional
Installing gentoolkit.
Code:
emerge gentoolkit

Contains tools for working with portage.

Configuring the Bootloader:
Installing grub.
Code:
emerge grub


Refer to the Gentoo Handbook on configuring grub.

Finishing up:
Setting a root password.
Code:
passwd


Creating a user.
Code:
useradd username -m -G users,wheel,audio,tty -s /bin/bash
passwd username


You can now safely exit and restart your PC and boot into your new Gentoo installation.
Code:
exit
cd /
umount /mnt/gentoo/boot
umount /mnt/gentoo/proc
umount /mnt/gentoo
reboot

_________________
ftp://lila-project.ath.cx


Last edited by Snooper on Fri Sep 03, 2004 7:59 pm; edited 5 times in total
Back to top
View user's profile Send private message
g1um
n00b
n00b


Joined: 19 Nov 2003
Posts: 32
Location: Thunder Bluff, Mulgore

PostPosted: Thu Aug 05, 2004 8:10 am    Post subject: Reply with quote

nice howto, thx!
Back to top
View user's profile Send private message
cybrjackle
Apprentice
Apprentice


Joined: 09 Jan 2003
Posts: 248
Location: USA

PostPosted: Fri Aug 06, 2004 5:40 pm    Post subject: Reply with quote

ln -sf /usr/portage/profiles/gcc34-x86-2004.2 /etc/make.profile

Your symlink is pointing to the wrong place on the profile.
Back to top
View user's profile Send private message
chimpsky
Tux's lil' helper
Tux's lil' helper


Joined: 22 Nov 2003
Posts: 109

PostPosted: Wed Aug 11, 2004 7:06 pm    Post subject: Reply with quote

when I try bootstraping it fails at gettext, I have a pentium-m and I'm using that in the march flag of my CFLAGS. Has anyone else had this problem ???
Back to top
View user's profile Send private message
cybrjackle
Apprentice
Apprentice


Joined: 09 Jan 2003
Posts: 248
Location: USA

PostPosted: Wed Aug 11, 2004 7:10 pm    Post subject: Reply with quote

You should probably put that in another forum instead of Tips & Tricks, with the error message you have. Start up a thread under "Installing" explain your problem and post error message.
Back to top
View user's profile Send private message
robertmcm
n00b
n00b


Joined: 25 Oct 2003
Posts: 50

PostPosted: Wed Aug 11, 2004 8:48 pm    Post subject: Reply with quote

Your instructions worked for me. I am now have kde up and running. It does seem faster. One question though what does the following do at the ent of the profile file
alias cp='cp -i'
alias ls='ls --color'
alias mv='mv -i'
alias rm='rm -i'

Thanks

Also is there any way to get a base system like this without the ~x86 in make config?
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Thu Aug 12, 2004 12:06 am    Post subject: Reply with quote

you can remove the ~x86 and just run emerge -epv system and see what it stops on then add that package to /etc/portage/package.keywords like so:
sys-libs/glibc ~x86
sys-devel/gcc ~x86

the things added to the end of etc/profile are to turn on color for ls, ask for confirmation before deleting a file, copying and moving. you can do a ls --help or mv --help cp --help etc and see what else ther is and add it there like say ls -l --color=auto this would display long version of file like permissions size and in color... it's not needed i have removed it from my other nptl guide and will update this soon i am working on a new profile with some stage1's that will already have 2.6 headers and compiled with gcc-3.4.1 and glibc-2.3.4 and use udev, nptl, and add gentoolkit to the system...
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
OneOfMany
Tux's lil' helper
Tux's lil' helper


Joined: 19 Nov 2003
Posts: 108
Location: Portland, OR USA

PostPosted: Fri Aug 13, 2004 10:35 pm    Post subject: Reply with quote

chimpsky:
From one of the 50 something pages in this thread titled GCC 3.4.

Quote:
Quote:
Quote:
2 robmoss2k: you mean it's better to use pentium-m for pentium4 processors?

Heh, no, I mean it's better to use pentium-m for Pentium M processors -march=pentium4 problems tend to relate to people using the flag on architectures they shouldn't do, such as the P-M.

no it isnt, it's better to use -mtune=pentium3, otherwise shit like glibc will break. gcc 3.4 bug :/


So I guess it could be related to this (if you're using -march=pentium-m). Otherwise I'd suggest looking for the first line of text that seems to indicate something is broken and post it ;).
Back to top
View user's profile Send private message
St_Andrew
n00b
n00b


Joined: 07 Feb 2004
Posts: 37

PostPosted: Tue Aug 17, 2004 9:15 pm    Post subject: Reply with quote

will this work with a 2004.1 live cd too? :)

or even 2004.0 :roll:
Back to top
View user's profile Send private message
cybrjackle
Apprentice
Apprentice


Joined: 09 Jan 2003
Posts: 248
Location: USA

PostPosted: Tue Aug 17, 2004 9:31 pm    Post subject: Reply with quote

I would assume YES, as long as you "emerge sync" before you ln gcc-3.4
Back to top
View user's profile Send private message
PhotonX
n00b
n00b


Joined: 14 Jul 2004
Posts: 33
Location: Irvine, CA

PostPosted: Tue Aug 17, 2004 9:53 pm    Post subject: Reply with quote

Thanks for the guide, ill install tonight and get back with results
_________________
g2|PhotonX
Gentoo Enemy Territory Clan :: #gentoo.et @ freenode
Back to top
View user's profile Send private message
St_Andrew
n00b
n00b


Joined: 07 Feb 2004
Posts: 37

PostPosted: Tue Aug 17, 2004 11:21 pm    Post subject: Reply with quote

cybrjackle wrote:
I would assume YES, as long as you "emerge sync" before you ln gcc-3.4


okay, thanks, for some reason it didn't work to boot with smp so i guess it's a lost case anyway...
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Wed Aug 18, 2004 12:56 am    Post subject: Reply with quote

You where unable to boot using the smp kernel?

You can even go the route of install gentoo using a gentoo kernel then once your done compiling and booted into the new system emerge glibc again and it will enable nptl. Thats how we did it before the smp kernel came around...
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
St_Andrew
n00b
n00b


Joined: 07 Feb 2004
Posts: 37

PostPosted: Wed Aug 18, 2004 2:07 am    Post subject: Reply with quote

Snooper wrote:
You where unable to boot using the smp kernel?

You can even go the route of install gentoo using a gentoo kernel then once your done compiling and booted into the new system emerge glibc again and it will enable nptl. Thats how we did it before the smp kernel came around...


yeah i only got a black screen 8O perhaps some frambuffer problem... but it worked with the gentoo kernel...

anyway i figured i could do something like that, so i will try it :) thanks :)
Back to top
View user's profile Send private message
PhotonX
n00b
n00b


Joined: 14 Jul 2004
Posts: 33
Location: Irvine, CA

PostPosted: Thu Aug 19, 2004 2:25 am    Post subject: Reply with quote

Some Questions:

1.Shouldnt we make a package.keywords file and include the following in it?
Code:
 
sys-kernel/linux26-headers -* ~x86
sys-kernel/gentoo-dev-sources -* ~x86


and also, do a
Code:

emerge patch
emerge -C linux-headers
emerge --oneshot linux26-headers


followed by a

Code:

nano -w /etc/make.profile/virtuals

*replace kernel entry with linux26-headers*
*replace os-headers entry with linux26-headers*


and use the bootstrap-2.6.sh script??

All of this is kinda confusing me, because of your last guide. Thanks
_________________
g2|PhotonX
Gentoo Enemy Territory Clan :: #gentoo.et @ freenode
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Thu Aug 19, 2004 10:57 am    Post subject: Reply with quote

well if you want to use a package.keywords file over ACCEPT_KEYWORDS="~x86" you will need more than just the headers. You need glibc/gcc/libstdc++v3 and gentoo-dev-sources is already x86.

as for emerge patch, as long as you do an emerge --oneshot --nodeps linux26-headers (nodeps) you do not need to emerge patch and it will get emerged durring bootstrap. --nodeps removes dependencies from the package and patch is a dependencie of linux26-headers.

and for the virtuals file where going to use bootstrap.sh over bootstrap-2.6.sh so changing the virtual file is not needed other than changing devfsd to udev if you want so you don't have to install it later.
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Fri Aug 20, 2004 1:31 am    Post subject: Reply with quote

ok if anyone really feels strongly against installing gentoo with ~x86 you can add:

sys-kernel/linux26-headers ~x86
sys-devel/gcc ~x86
sys-libs/libstdc++-v3 ~x86
sys-libs/glibc ~x86

to /etc/portage/package.keywords

I've done this on a test machine and have ssen no issue's as of yet, but why on earth you would want gcc-3.4.1 and glibc-2.3.4 and the rest stable is beyond me i'd figure you where in it for the bleeding edge :twisted:

also it should be added and maybe it will as long as you have bootstrapped and not just emerge gcc-3.4 you can emerge -C gcc-3.3.3-r6 i think it is thats in stage1 (libstdc++-v3) takes care of anything built with 3.3 and still on the system. but it won't hurt anything to get rid of it everything has been compiled with gcc-3.4
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
dhalsiim
Guru
Guru


Joined: 29 Jan 2003
Posts: 486

PostPosted: Mon Aug 30, 2004 11:59 pm    Post subject: Reply with quote

Why --oneshot, won't that stop the package from being updated later on?

Please elaborate.
Back to top
View user's profile Send private message
karllo
n00b
n00b


Joined: 30 Jan 2004
Posts: 7

PostPosted: Tue Aug 31, 2004 2:18 am    Post subject: Reply with quote

Do I need to modify ebuild of xorg-x11 also? Because I tested in two seperate machine, using xorg-x11 can not start any wm: for example, xfce4 just show desktop for one second and crash back to console, get fatal error signal 11, very limited info in log, start gnome-session and it will crash when close a window, click menu etc, using xfree instead is okay. Anybody ran into the same problem?
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Tue Aug 31, 2004 1:19 pm    Post subject: Reply with quote

Following the GCC3.4 thread --oneshot --nodeps was they way everyone wanted it done, and you can still update your headers when new one's become available they will be listed, and it's not wise to update them unless you plan on recompiling everything again or atleast glibc. and --nodeps is needed so you don't have to install patch before unmerging linux-headers and merging linux26-headers...

I have been using Xorg-X11 with no issues along with the nvidia modules 6111 i think it is along with gnome only issue's i have experienced is with gnome-vfs and samba, oh and mplayer, and xine random crashes.

you have to remember though this setup is for testing only not for a production system. if you want production follow my install for 2.6 and nptl support some where floting around in this furom it uses the stable branch of gentoo with udev, 2.6 kernel/headers and nptl support.
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
dhalsiim
Guru
Guru


Joined: 29 Jan 2003
Posts: 486

PostPosted: Tue Aug 31, 2004 3:25 pm    Post subject: Reply with quote

Thank you for your prompt answer.

But I had to go ahead and install and couldn't wait, therefore I didn't use "--oneshot" and things are going along pretty well. I used ACCEPT_KEYWORDS="~x86" right from the start :-p (in my make.conf) of course. Things seem to be working fine, 2.6 headers, nptl, gcc 3.4 :-D

I just hope the crashes aren't as much, because then this whole endeavour would be in vain :-(.

Thank you for your thread.
--dhalsiim
Back to top
View user's profile Send private message
Snooper
Apprentice
Apprentice


Joined: 02 May 2004
Posts: 182
Location: San Antonio, TX

PostPosted: Tue Aug 31, 2004 7:54 pm    Post subject: Reply with quote

I have been running it since i made this thread and have had no stability issues other than with the couple apps i said, and if your not trying to connect to a windows domain/workgroup then your don't need samba, i have no issues with nfs, and mplayer i could compile all the codecs i foget witch ones and xine would just freeze from time to time so if you don't use either of those apps you might be fine, and be aware openoffice does not compile on gcc-3.4 as of yet and xine/mplayer may have been fixed already i just found other methods of doing things. i have seen talk of kde not compiling but that might have been fixed also as i use gnome i am not sure and 3.3 what ever was stopped 3.2.3 from compiling might not be resident in 3.3:-)

but this setup is more for fun like i said your using the unstable branch of gentoo so mileage may vary...
_________________
ftp://lila-project.ath.cx
Back to top
View user's profile Send private message
robertmcm
n00b
n00b


Joined: 25 Oct 2003
Posts: 50

PostPosted: Wed Sep 01, 2004 9:57 pm    Post subject: Reply with quote

I have been running this way now since Aug 11, I had a few problems in KDE 3.2.3. Since I am still running ~x86 on this box, emerge world upgraded me to kde 3.3 and the system is stable as rock right now. Again, thanks for the howto.
Back to top
View user's profile Send private message
mikkelhoegh
n00b
n00b


Joined: 27 Aug 2004
Posts: 71
Location: Herning, Denmark

PostPosted: Fri Sep 03, 2004 3:52 pm    Post subject: Reply with quote

very nice guide!
Back to top
View user's profile Send private message
eXoCooLd
n00b
n00b


Joined: 31 Jul 2004
Posts: 13

PostPosted: Sat Sep 04, 2004 6:20 am    Post subject: Reply with quote

chimpsky wrote:
when I try bootstraping it fails at gettext, I have a pentium-m and I'm using that in the march flag of my CFLAGS. Has anyone else had this problem ???


I had the same problem. I used -march=pentium4 -O3 -pipe -fomit-frame-pointer for bootstrap, but i forgot the -pipe on the first run
so i made it again but now with -march=pentium-m -O3 -pipe -fomit-frame-pointer
and now gettext works with gcc 3.4.1

looks like some other thing has to be up to date to compile gettext with pentium-m as CFLAGS

EDIT: I set ACCEPT-KEYWORDS="~x86"
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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