Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
remerging gcc
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
diejengent
n00b
n00b


Joined: 26 Sep 2012
Posts: 11

PostPosted: Mon Oct 01, 2012 11:45 pm    Post subject: remerging gcc Reply with quote

Hello,

I installed Gentoo succesfully.
Would it be of any benefit to remerge the same version of gcc (compile it from scratch)?
Would there be some kind of speed improvement if I recompile it with the optimized settings for my cpu?
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4683
Location: Saint Amant, Acadiana

PostPosted: Tue Oct 02, 2012 12:17 am    Post subject: Reply with quote

Too little information. If you just installed Gentoo and haven't done emerge -e world yet (with your CFLAGS) I'd do it. Or you could wait until package upgrades will take care of it for you.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
ippipp
n00b
n00b


Joined: 14 Oct 2009
Posts: 14

PostPosted: Tue Oct 02, 2012 7:35 am    Post subject: Reply with quote

Jaglover wrote:
Too little information. If you just installed Gentoo and haven't done emerge -e world yet (with your CFLAGS) I'd do it. Or you could wait until package upgrades will take care of it for you.


First do "emerge -e system"
And then "emerge -e world"

(This will rebuild gcc glibc libtool binutils linux-headers twice, but it is good)
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Tue Oct 02, 2012 8:44 am    Post subject: Reply with quote

ippipp wrote:

First do "emerge -e system"
And then "emerge -e world"

You might also consider that the marginal increase in performances this will provide is not worth rebuilding everything 2 times, 3 times and... even more, immediately.
If you stuck to stable arch for gcc, be aware that gcc-4.6 should go stable in a very near furture.
So, you might find wise to postpone all this work until then.
_________________
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Tue Oct 02, 2012 8:46 am    Post subject: Reply with quote

ippipp wrote:
Jaglover wrote:
Too little information. If you just installed Gentoo and haven't done emerge -e world yet (with your CFLAGS) I'd do it. Or you could wait until package upgrades will take care of it for you.


First do "emerge -e system"
And then "emerge -e world"

(This will rebuild gcc glibc libtool binutils linux-headers twice, but it is good)

This will not rebuild gcc only twice but... 6 times...
Each time you build gcc, gcc is compiled three times and it will be rebuilt for both system & world sets.
_________________


Last edited by aCOSwt on Tue Oct 02, 2012 8:48 am; edited 1 time in total
Back to top
View user's profile Send private message
diejengent
n00b
n00b


Joined: 26 Sep 2012
Posts: 11

PostPosted: Tue Oct 02, 2012 9:16 am    Post subject: Reply with quote

Forgive me for my 'newbie' questions but...

1. Why is it rebuild three times?

2. Has a compiled gcc from scratch any positive effect on the binaries it 'spits out' or will it only show an increase in compiling speed?
Back to top
View user's profile Send private message
ippipp
n00b
n00b


Joined: 14 Oct 2009
Posts: 14

PostPosted: Tue Oct 02, 2012 10:00 am    Post subject: Reply with quote

diejengent wrote:
Forgive me for my 'newbie' questions but...

1. Why is it rebuild three times?

2. Has a compiled gcc from scratch any positive effect on the binaries it 'spits out' or will it only show an increase in compiling speed?



1. During single gcc package compile-install it will compile gcc three times. (initial, stage1 and stage2 (or something like that))

2. Both. (But also there may be negative effect or decrease on compiling speed in certain circumstances)
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4296

PostPosted: Tue Oct 02, 2012 10:03 am    Post subject: Reply with quote

because gcc is father of tools, don't you think building it 2-3 times to make sure you will end with the tool that is use to produce binary actually work and produce valid binary. Not all distros have slots features to saved you from a dead gcc. The highest optimization can produce valid code that will produce invalid/unexpected results.

rebulding a gcc always have positive effect (stability or speed) when upgrading glibc, glibc (or you current libc version) is tied with gcc as gcc hack their header to add fix, optimizations or arch specific things. Just browse the forum to see how many users get lost by weird problem appears in their programs as they use a bork toolchain, generally after upgrading glibc.
As you have install gentoo, it's more than certain your glibc were update too in the process.
Back to top
View user's profile Send private message
Thistled
Guru
Guru


Joined: 06 Jan 2011
Posts: 478
Location: Scotland

PostPosted: Tue Oct 02, 2012 12:11 pm    Post subject: Reply with quote

Well, how come I can't build quite a few packages with the latest ~gcc-4.6.3?
_________________
Whatever you do, do it properly!
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Tue Oct 02, 2012 12:31 pm    Post subject: Reply with quote

Thistled wrote:
Well, how come I can't build quite a few packages with the latest ~gcc-4.6.3?

How comes ? Hmm... misfortune ?
From what I see here : https://bugs.gentoo.org/show_bug.cgi?id=gcc-4.6 and here https://bugs.gentoo.org/show_bug.cgi?id=418383 there should normally be less than a few.
_________________
Back to top
View user's profile Send private message
Thistled
Guru
Guru


Joined: 06 Jan 2011
Posts: 478
Location: Scotland

PostPosted: Tue Oct 02, 2012 12:38 pm    Post subject: Reply with quote

aCOSwt wrote:
Thistled wrote:
Well, how come I can't build quite a few packages with the latest ~gcc-4.6.3?

How comes ? Hmm... misfortune ?
From what I see here : https://bugs.gentoo.org/show_bug.cgi?id=gcc-4.6 and here https://bugs.gentoo.org/show_bug.cgi?id=418383 there should normally be less than a few.


Ahhhh, I see now. Thanks.
Funny though, I am encountering the same errors with some packages even with the stable 4.5.* series.
_________________
Whatever you do, do it properly!
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Tue Oct 02, 2012 12:46 pm    Post subject: Reply with quote

Thistled wrote:
Funny though, I am encountering the same errors with some packages even with the stable 4.5.* series.

Perhaps something in your toolchain (make, binutils...) , or glibc being a bit outdated ?
Any ricing CFLAGs ?

Post output of emerge --info.
_________________
Back to top
View user's profile Send private message
Thistled
Guru
Guru


Joined: 06 Jan 2011
Posts: 478
Location: Scotland

PostPosted: Tue Oct 02, 2012 12:48 pm    Post subject: Reply with quote

Yes re: toolchain.
I always rebuild binutils and libtool after a GCC upgade, and I also
Code:
. /etc/profile

Now I am wondering if I should rebuild glibc to see if that fixes the problem.

All CFLAGS are default, i.e. -march=native
Code:
emerge --info
Portage 2.1.11.9 (default/linux/x86/10.0/desktop/gnome, gcc-4.4.7, glibc-2.15-r2, 3.3.8-gentoo i686)
=================================================================
System uname: Linux-3.3.8-gentoo-i686-Pentium-R-_Dual-Core_CPU_E5400_@_2.70GHz-with-gentoo-2.2
Timestamp of tree: Fri, 08 Jun 2012 11:05:01 +0000
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.12
dev-lang/python:          2.6.8, 2.7.3-r2, 3.1.5, 3.2.3-r1
dev-util/cmake:           2.8.9
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.10.5
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.4.7, 4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.3 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo gamerlay-stable spring zugaina OVERLAY-pigs_overlay
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.3 dlj-1.1 Oracle-BCLA-JavaSE PUEL ut2003"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="${EPREFIX}/etc/gconf /etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/mnt/nfs_portage/distfiles"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles metadata-transfer news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS=""
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://gentoo.virginmedia.com/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB"
MAKEOPTS="-j3"
PKGDIR="/mnt/nfs_portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/mnt/nfs_portage"
PORTDIR_OVERLAY="/var/lib/layman/gamerlay /var/lib/layman/Spring /var/lib/layman/zugaina /usr/local/portage"
SYNC="rsync://pig2/gentoo-portage"
USE="X X509 a52 aac acl acpi additions alsa animation-rtl antialiasing apache2 applet archive artworkextra autoipd berkdb binary-drivers bluetooth bonobo branding bzip2 cairo caps cdaudio cdda cdio cdr cdrkit cdrom cdrtools cg cifs cleartype cli client clutter colord consolekit cracklib crypt cups curl curlwrappers cursors cxx dbase dbus dconf desktop-effects device-mapper dga dns dri dso dts dv dvb dvbpsi dvd dvdnav dvdr dvdread eds effects emboss encode equalizer evo exif extraicons extras fallback fam fat fat16 fbcondecor fbosd fbsplash ffmpeg fftw firefox fits flac flash fltk flv fontconfig foomaticdb fortran ftp fuse g3dvl games gcj gconf gd gdbm gdm gdu gedit geoloc gif git gjs glade glib glitz glx gmedia gnome gnome-dvb-daemon gnome-keyring gnome-online-accounts gnome-print gnome-shell gnomecanvas gnomecd gnutls gphoto2 gpib gpm gps graphviz grub gstreamer gtk gtk3 gtkhtml gtkstyle gudev h224 hardware hddtemp help-screen hibernate-script hidd howl-compat hpn htsp http httpd i2c icc icons iconv id3 id3tag idn ieee1394 imagemagick imap inotify introspection ipc iplayer iptables ipv6 ivman jack java java6 javascript jit jpeg jpeg2k json kdrive kerberos keymap lame laptop lastfm lastfmradio lcms ldap libburn libgda libmpeg2 libnotify libsamplerate libsexy libsoup libv4l2 libvisual lm_sensors logrotate lzo mad mailwrapper mbox mdnsresponder-compat metadata mime mms mmx mmxext mng modplug modules mono mozilla mp2 mp3 mp4 mpd mpeg mpg123 mplayer msn mudflap nautilus ncurses net network networking networkmanager new-login nfs nfsv3 nfsv4 nls nptl nsplugin nss ntfs ntp nvcontrol nvram objc offensive ogg openal opengl openstreetmap optimization osc oss outputs overlays pam pango parted pcre pdf perl pipechan pixmaps player playlist plugins pm-utils pmu png policykit ppds pppd previewer pvr pyqt4 python python-daap quicktime quvi raw readline rss rsync rtsp sasl scrobbler sctp sdl search-screen sendto server session sftp shaders sharedext sharedmem shm shmvideo shotwell showtabbar sid sip slideshow slp smi smp smtp sndfile snmp socialweb sockets sound spell splash sql sqlite sse sse2 sse3 ssh ssl ssse3 startup-notification svg swf symlink syslog sysvipc taglib tcpd tdb teletext terminal tetex themes theora tiff tk toolbar tools tordns totem tracker transcode truetype tvheadend twisted twolame type3 udev udev-acl udisks underscores unicode unsupported upnp upower usb userpriv v4l v4l2 v8 vaapi vala vdpau vfat vga vhook video videos virtualbox vnc vorbis wav wavpack weather webdav webgl win32codecs wma wmf wmp wxwidgets x264 x86 x86emu xattr xcb xcomposite xcursors xf86 xine xml xorg xosd xpm xrandr xrender xulrunner xv xvid xvmc youtube yv12 zlib" ALSA_CARDS="emu10k1 hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="auth_digest authn_file authz_groupfile authz_host dav dav_fs dir mime status" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CURL_SSL="openssl" DRACUT_MODULES="plymouth" DVB_CARDS="usb-dtt200u usb-wt220u" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

_________________
Whatever you do, do it properly!
Back to top
View user's profile Send private message
aCOSwt
Moderator
Moderator


Joined: 19 Oct 2007
Posts: 2537
Location: Hilbert space

PostPosted: Tue Oct 02, 2012 12:54 pm    Post subject: Reply with quote

Thistled wrote:
Funny though, I am encountering the same errors with some packages even with the stable 4.5.* series.

As far as I read from your emerge --info you do not get any gcc 4.5
Do you mean 4.4.7 ?
What is the latest gcc release you have used troublefree ?
_________________
Back to top
View user's profile Send private message
Thistled
Guru
Guru


Joined: 06 Jan 2011
Posts: 478
Location: Scotland

PostPosted: Tue Oct 02, 2012 1:00 pm    Post subject: Reply with quote

4.4.7 is the only version I can use.
Packages are failing with the latest stable 4.5.* and the latest unstable 4.6.* series.
I will see if the lack of "env-update" solves the problem.
Thanks for the tip to the GCC guide.
I always follow the guide to the letter (kind of lol)
it just looks like I missed out the env-update part.
_________________
Whatever you do, do it properly!
Back to top
View user's profile Send private message
diejengent
n00b
n00b


Joined: 26 Sep 2012
Posts: 11

PostPosted: Wed Oct 03, 2012 11:12 am    Post subject: Reply with quote

ippipp wrote:
2. Both. (But also there may be negative effect or decrease on compiling speed in certain circumstances)


I checked the system tree by running emerge -p -e system.
It's going to take forever to compile all that.

And if there is a risk it could also have a negative effect on compiling (binaries), then why bother?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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