Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Anyone using GCC 4.6.x?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Fri Nov 04, 2011 1:54 pm    Post subject: Anyone using GCC 4.6.x? Reply with quote

Have most of the compile issues been resolved, or is it best to stick with GCC 4.5.3 for now? Server PC wouldn't be an issue to recompile everything, but the laptop would
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Fri Nov 04, 2011 4:11 pm    Post subject: Reply with quote

As was recently announced gcc-4.6 series is gonna be unmasked in coming days. Me using that compiler for 4 month now. There were some hurdles up to 8 weeks ago. Main reason was the abolishment of unconventional indirect includes. Which resulted in missing includes of some standard linux.h. Easy hacks though. I learned much of keeping a personal overlay.

gcc-4.6 seems to compile faster than the 4.5 series. And you have aditional features (google lang etc). gcc-4.6.2 had some bugs cleaned.


Last edited by ulenrich on Fri Nov 04, 2011 4:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Fri Nov 04, 2011 4:13 pm    Post subject: Reply with quote

Thanks :)
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
jathlon
Tux's lil' helper
Tux's lil' helper


Joined: 26 Sep 2006
Posts: 89
Location: Canada

PostPosted: Fri Nov 04, 2011 4:22 pm    Post subject: Reply with quote

Running it here on my desktop since Oct.18. I had a look through the various bugs related to gcc-4.6. Didn't see any that related to any of the software on my system so I went ahead and installed it. I've done a "emerge -e @world" with it installed and haven't run into any gcc related problems.

Code:

~ $ emerge --info
Portage 2.2.0_alpha72_p4 (default/linux/amd64/10.0/desktop, gcc-4.6.1, glibc-2.13-r4, 3.1.0 x86_64)
=================================================================
System uname: Linux-3.1.0-x86_64-AMD_Phenom-tm-_II_X6_1090T_Processor-with-gentoo-2.1
Timestamp of tree: Fri, 04 Nov 2011 15:30:01 +0000
app-shells/bash:          4.2_p10
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.2-r3, 3.2.2
dev-util/cmake:           2.8.6-r3
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1
sys-apps/openrc:          0.9.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.4_p6-r1, 1.9.6-r3, 1.10.3, 1.11.1-r1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r1, 4.6.1-r1
sys-devel/gcc-config:     1.4.1-r1
sys-devel/libtool:        2.4-r4
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 2.6.39 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo x11 multimedia sunrise kde local-blender-9999
Installed sets:
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --quiet-unmerge-warn"
FEATURES="assume-digests binpkg-logs distlocks ebuild-locks fixlafiles news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en"
MAKEOPTS="-j7"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/x11 /var/lib/layman/multimedia /var/lib/layman/sunrise /var/lib/layman/kde /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acpi alsa amd64 apng assistant berkdb bluetooth branding bzip2 cairo cdda cdr cleartype cli consolekit corefonts cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif extra fam ffmpeg fftw firefox flac fontconfig fortran gd gdbm gdu gif git gpm gtk hddtemp iconv ipv6 java jfs jpeg kde kpathsea lcms libnotify libsamplerate lm_sensors mad melt mercurial midi mikmod minizip mmx mmxext mng modules mp3 mp4 mpeg msn mudflap multilib ncurses nls nptl nptlonly nsplugin offensive ogg openal opengl openmp pam pango pcre pdf perl png policykit ppds python qt3support qt4 qthelp readline samba sdl secure-delete session smp spell sql sqlite sse sse2 ssl startup-notification subversion svg sysfs system-sqlite tcpd theora tiff timidity tk tools truetype udev unicode unlock-notify usb v4l v4l2 vdpau vlc vorbis vpx webkit x264 xcb xinerama xml xorg xulrunner xv xvid zlib" ALSA_CARDS="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="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DVB_CARDS="cx23885" ELIBC="glibc" FOO2ZJS_DEVICES="hpp1006" INPUT_DEVICES="evdev wacom" KERNEL="linux" LINGUAS="en" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" 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"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


emerge -epv @ world tells me that I have 1227 packages installed.

Hope that helps.

joe
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Fri Nov 04, 2011 4:24 pm    Post subject: Reply with quote

it will help :)
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
hwertz
n00b
n00b


Joined: 31 Oct 2011
Posts: 7

PostPosted: Sat Nov 05, 2011 4:10 am    Post subject: Reply with quote

Yes, I've been using gcc for quite a while now as well. The short of it is I'd recommend it, but not recommend -flto at this time.

I'm running on one machine
Code:
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -floop-block -floop-interchange -floop-strip-mine"

(a Sempron 2500+)
and
Code:
CFLAGS="-O2 -march=k8-sse3 -fomit-frame-pointer -floop-block -floop-interchange -floop-strip-mine"


on the other (Athlon 64 3800+)

I'm in process of rebuilding world w/ 4.6.2 now, I built emerge -e system on both boxes and that didn't have a single error. I've run previous 4.6 versions world, and had like 1 or 2 build failures. The serious problem I had was grub (as opposed to grub2...) failing to boot if rebuilt with 4.6 (bug #360513) but the ChangeLog shows that was fixed in September... I've had one or two odd packages fail to rebuild, but they proved to be stale dependencies anyway.

MySQL used to need "-fomit-frame-pointer" stripped from CFLAGS, but I think the ebuild does this now.

MythTV, I've had to build for athlon-xp on the k8 system (when built for k8-sse3, certain functions work like 10-20% of the time but crash the other 80-90%. A race condition on a single-threaded app? MythTV uses a lot of inline assembly, I would speculate Myth is running some of this inline assembly, then gets a signal in the middle, and gcc's signal handler code and the inline assembly interact poorly when built for K8. This was since gcc-4.5.x for me, so also not gcc-4.6 specific.


I tried -flto, and the apps that build seemed to work fine, but probably close to 10% of them just wouldn't build even in system, so I quit that pretty early. My recollection is the ones that did fail failed quite early, like in ./configure rather than while building.

Since Link Time Optimization optimizes a whole sack of code at a time, I won't be surprised if a few ebuilds are unbuildable on a 32-bit host with flto (gcc may need over 4GB of RAM).

Just FYI,without LTO, gcc optimizes each .c file as it generates it's .o file, then the linker links the .os together into a library or executable. With LTO, gcc shoots out these .o files that are just a intermediate format (which includes the gcc flags..), very few optimizations are done. Then when the program is *linked*, the linker passes the .o files off to gcc and it optimizes and spits out CPU-specific code for the whole enchilada at once.

I think I will try flto again on one box and see if it's better now.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Nov 05, 2011 7:29 am    Post subject: Reply with quote

i normally just use

CFLAGS="-march=native -mtune=native -O2 -pipe"
CXXFLAGS="${CFLAGS}"

and let gcc decide what is best to use depending on what the CPU supports
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
golagoda
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jun 2011
Posts: 105
Location: Australia

PostPosted: Sat Nov 05, 2011 9:02 am    Post subject: Reply with quote

I've been using it since 4.6.1, obviously not as long as others but I have honestly had less compile problems than I have had with 4.5 and 4.4 - done 'emerge -e system' twice when going from 4.5 -> 4.6 and on 4.6.2 and it's all worked flawlessly, compiling seems a lot faster when using 4.6 too. This is on a 64-bit multi-lib system if it matters to you at all.

Good luck.
Back to top
View user's profile Send private message
^marcs
Apprentice
Apprentice


Joined: 09 Mar 2005
Posts: 169

PostPosted: Sat Nov 05, 2011 9:32 am    Post subject: Reply with quote

Hello, i'm also using 4.6, even risked emerge -e world with it.
So far no compilation failed due to 4.6, also didn't noticed any strange runtime errors even with bleeding edge software like gnome3.

Using ~amd64 with rather standard CFLAGS.
Back to top
View user's profile Send private message
Polynomial-C
Retired Dev
Retired Dev


Joined: 01 Jun 2003
Posts: 1432
Location: Germany

PostPosted: Sat Nov 05, 2011 9:41 am    Post subject: Reply with quote

So how did you guys running full gcc-4.6 compiled systems manage to get around bug 360513? My system went into a boot-loop after having grub compiled with gcc-4.6.
Another problem I faced was that my X server wouldn't come up anymore because it for some reason couldn't dlopen the radeon driver (x11-drivers/xf86-video-ati) as well as AIGLX anymore.
I also experienced some trouble with packages failing to compile with strange undefined reference errors.
Oh and trying to use kgpg with gpg-agent failed for me as well. kgpg insisted that there's no gpg-agent running but it was definitely running.
To be honest this was the worst experience with a new gcc for years...
_________________
The manual said "Requires Windows10 or better" so I installed GNU/Linux...

my portage overlay

Need a stage1 tarball? (Unofficial builds)
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Nov 05, 2011 9:45 am    Post subject: Reply with quote

look at comment 20 on the link you posted, that has a good suggestion or you could try lilo or maybe even http://en.gentoo-wiki.com/wiki/Grub2
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Sat Nov 05, 2011 12:53 pm    Post subject: Reply with quote

Code:
 * app-office/libreoffice-9999-r1

        Emerged at: So Okt 16 00:23:13 2011
        Build time: 3 hours, 22 minutes, and 48 seconds

        Emerged at: Do Nov  3 22:15:00 2011
        Build time: 3 hours, 17 minutes, and 2 seconds

seems to be faster indeed by 5 minutes (4.5.3 vs. 4.6.2 build) :lol:

Whatever, no issues so far, but I of course didn't rebuild my whole system.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Nov 05, 2011 12:55 pm    Post subject: Reply with quote

seems fast here, i am rebuilding my whole system as its a fresh install and i changed a lot in make.conf
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Sat Nov 05, 2011 2:03 pm    Post subject: some questions Reply with quote

- Why concerning with grub1 - totally unsupported upstream
- Why using special compiler flags, why not just use: "-mtune=native -march=native -O2 -pipe"
- Why rebuild -e when just changing gcc-4.6.0 to gcc-4.6.2
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Nov 05, 2011 2:30 pm    Post subject: Re: some questions Reply with quote

ulenrich wrote:
- Why concerning with grub1 - totally unsupported upstream
- Why using special compiler flags, why not just use: "-mtune=native -march=native -O2 -pipe"
- Why rebuild -e when just changing gcc-4.6.0 to gcc-4.6.2


Havent got to grub yet

Flags I use i have stated above

as for 4.6.0 to 4.6.2 I have been told you don't have to recompile anything as its a point release, if you were going from 4.6 to 4.7 then i would do it.
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Sat Nov 05, 2011 2:37 pm    Post subject: Re: some questions Reply with quote

Dark Foo wrote:
Ever realized that if you play Windows CD backwards you'll hear satanic messages
Your footer implies there is a satan. As I am religously agnostic I can't hear :(

Last edited by ulenrich on Sat Nov 05, 2011 2:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Nov 05, 2011 2:38 pm    Post subject: Re: some questions Reply with quote

ulenrich wrote:
Dark Foo wrote:
Ever realized that if you play Windows CD backwards you'll hear satanic messages
Your footer implies there is a satan. As I am religously agnostic I can't here :(


Im an atheist, i just put it there because i found it funny
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Sat Nov 05, 2011 3:04 pm    Post subject: Re: some questions Reply with quote

Dark Foo wrote:
as for 4.6.0 to 4.6.2 I have been told you don't have to recompile anything as its a point release, if you were going from 4.6 to 4.7 then i would do it.

You never have to recompile everything. Read the upgrade guide.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Sat Nov 05, 2011 3:05 pm    Post subject: Reply with quote

thats changed since i last looked at it
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
hwertz
n00b
n00b


Joined: 31 Oct 2011
Posts: 7

PostPosted: Sat Nov 05, 2011 3:47 pm    Post subject: Reply with quote

So, FYI -flto still fails with weird link errors one for instance gettext.
Code:

...
libtool: link: i686-pc-linux-gnu-gcc -std=gnu99 -fopenmp -O2 -march=athlon-xp -f
omit-frame-pointer -floop-block -floop-interchange -floop-strip-mine -flto -Wl,-O1 -o .libs/msgmerge msgmerge-msgmerge.o msgmerge-msgl-fsearch.o msgmerge-lang-table.o msgmerge-plural-count.o -fopenmp  -Wl,--as-needed ./.libs/libgettextsrc.so -L/usr/lib /var/tmp/portage/sys-devel/gettext-0.18.1.1-r3/work/gettext-0.18.1.1/gettext-tools/gnulib-lib/.libs/libgettextlib.so -lacl -lxml2 -lncurses -lc 
msgmerge-msgmerge.o (symbol from plugin): warning: memset used with constant zero length parameter; this could be due to transposed parameters
msgmerge-msgmerge.o (symbol from plugin): warning: memset used with constant zero length parameter; this could be due to transposed parameters
/var/tmp/portage/sys-devel/gettext-0.18.1.1-r3/temp/ccLSnriO.ltrans2.ltrans.o: In function `match_domain._omp_fn.0.2128.2092':
ccLSnriO.ltrans2.o:(.text+0x3d): undefined reference to `GOMP_loop_dynamic_start'
ccLSnriO.ltrans2.o:(.text+0x218): undefined reference to `GOMP_loop_dynamic_next'
ccLSnriO.ltrans2.o:(.text+0x225): undefined reference to `GOMP_loop_end_nowait'
/var/tmp/portage/sys-devel/gettext-0.18.1.1-r3/temp/ccLSnriO.ltrans2.ltrans.o: In function `match_domain.isra.5.2289':
ccLSnriO.ltrans2.o:(.text+0x565): undefined reference to `GOMP_parallel_start'
ccLSnriO.ltrans2.o:(.text+0x572): undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status
make[4]: *** [msgmerge] Error 1
...


Thanks for pointing to that grub bug, apparently that September patch helped it build but it still doesn't run when built with gcc-4.6 8-)

Anyway... yeah, I don't *have* to rebuild world, but where's the fun in not doing it haha.
Back to top
View user's profile Send private message
ulenrich
Veteran
Veteran


Joined: 10 Oct 2010
Posts: 1480

PostPosted: Sat Nov 05, 2011 4:01 pm    Post subject: Re: some questions Reply with quote

genstorm wrote:
Dark Foo wrote:
as for 4.6.0 to 4.6.2 I have been told you don't have to recompile anything as its a point release, if you were going from 4.6 to 4.7 then i would do it.

You never have to recompile everything. Read the upgrade guide.

Reassuring:
NEVER - when point release ? OR:
Even no recompile 4.4 to 4.5 to 4.6 ?

As of cplusplus changes I would recompile those ...
Back to top
View user's profile Send private message
Martux
Veteran
Veteran


Joined: 04 Feb 2005
Posts: 1917

PostPosted: Sat Nov 05, 2011 4:30 pm    Post subject: Reply with quote

Polynomial-C wrote:
So how did you guys running full gcc-4.6 compiled systems manage to get around bug 360513?


Use sys-boot/grub-static, grub2 sucked for me, so I am a happy camper with grub-staic now.
Besides that, none of my 780 packets failed to compile with 4.6.2.
_________________
"Coincidence is God's way of remaining anonymous."
Albert Einstein
"The road to success is always under construction"
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 8933

PostPosted: Sat Nov 05, 2011 4:31 pm    Post subject: Reply with quote

@ulenrich: I've done several major upgrades in 5 years. Of course I haven't gone through all the way just with one system, but: I never saw a reason to re-emerge and also didn't encounter issues in not doing so.
Back to top
View user's profile Send private message
hwertz
n00b
n00b


Joined: 31 Oct 2011
Posts: 7

PostPosted: Sun Nov 06, 2011 6:44 am    Post subject: Reply with quote

I did (as the gcc guide says) have to rebuild my C++ stuff going from 4.1 to 4.2 (I don't know if the code would have been compatible otherwise or not, but they changed how they mangled C++ function names in 4.2, so a mix of 4.2 and 4.1 apps and libs resulted in C++ apps that would not link (at runtime or compile time) with "undefined reference to ..." errors.

4.2-4.6, smooth sailing.
Back to top
View user's profile Send private message
Odysseus
Apprentice
Apprentice


Joined: 23 Jun 2004
Posts: 250
Location: Miami, FL. I miss San Francisco!!!

PostPosted: Sun Nov 06, 2011 8:07 am    Post subject: Reply with quote

I've been using 4.6.x for the last 3 months on my ~amd64 Dell Precision M90 laptop. The only issues I have encountered related to the update was the Grub issue mentioned above, (I was one of the posters on that thread) and a bunch of errors with prelink, so I disabled and unistalled it. I was never able to resolve grub installing correctly, so I switched to grub-static and it's been smooth sailing for me.

I hope this helps.

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