| View previous topic :: View next topic |
| Author |
Message |
Evilguru Guru

Joined: 16 Aug 2005 Posts: 374 Location: England
|
Posted: Tue Jan 25, 2011 6:51 pm Post subject: GCC 4.6 Ebuild |
|
|
Hi all,
I wish to test the upcoming 4.6 release of GCC to see if it breaks any of the projects I maintain. However, I can not seem to find a pre-release ebuild for it. Does anyone know where I can find one?
I am not interested in switching my system GCC over to 4.6 -- that would be foolhardy -- just having it available locally would be sufficient.
Regards, Freddie. |
|
| Back to top |
|
 |
skellr l33t


Joined: 18 Jun 2005 Posts: 698 Location: The Village
|
Posted: Tue Jan 25, 2011 7:11 pm Post subject: |
|
|
Hi,
Sounds like fun.
There are some in the Toolchain Overlay.. |
|
| Back to top |
|
 |
Evilguru Guru

Joined: 16 Aug 2005 Posts: 374 Location: England
|
Posted: Tue Jan 25, 2011 8:27 pm Post subject: |
|
|
I've added the Toolchain Overlay and it definitely has GCC 4.6 alpha ebuilds, however I seem unable to merge them.
| Code: |
# emerge -av =sys-devel/gcc-4.6*
These are the packages that would be merged, in order:
Calculating dependencies... done!
emerge: there are no ebuilds to satisfy "=sys-devel/gcc-4.6*".
|
Looking at the ebuilds they do not appear to have any KEYWORDS. What is the correct way to merge such ebuilds?
Regards, Freddie. |
|
| Back to top |
|
 |
skellr l33t


Joined: 18 Jun 2005 Posts: 698 Location: The Village
|
Posted: Tue Jan 25, 2011 9:28 pm Post subject: |
|
|
For missing keywords they use ** in package.keywords.
| /etc/portage/package.keywords: | | =sys-devel/gcc-4.6* ** |
I think globbing works for the version in package.keywords but it's been a while. |
|
| Back to top |
|
 |
dirtyepic Developer


Joined: 22 Oct 2004 Posts: 1614 Location: sk.ca
|
Posted: Fri Jan 28, 2011 6:38 am Post subject: |
|
|
package.keywords
| Code: | | sys-devel/gcc:4.6-svn ** |
package.unmask
| Code: | | sys-devel/gcc:4.6-svn |
(If you want to use Go, you'll also need to unmask gcc-config-1.5.)
I recommend using the svn ebuild. I usually don't update the alphas much.
You're also going to need to add the gcc-porting overlay. Right now it contains a patch for sys-apps/gawk that prevents it from completely trashing your system. I haven't done much other testing; after I hit the gawk bug I decided to leave it alone for a while.
Good luck. _________________ by design, by neglect
for a fact or just for effect |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 736 Location: halmstad
|
Posted: Wed Feb 09, 2011 6:00 pm Post subject: |
|
|
Evilguru
and i think you need to set :
I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1
in make.conf to
dirtyepic
is this the SVN
sys-devel/gcc-4.6.0_pre9999 |
|
| Back to top |
|
 |
ssteinberg Apprentice

Joined: 09 Jul 2010 Posts: 206 Location: Israel
|
Posted: Wed Feb 09, 2011 6:43 pm Post subject: |
|
|
| And don't cross your fingers... |
|
| Back to top |
|
 |
dirtyepic Developer


Joined: 22 Oct 2004 Posts: 1614 Location: sk.ca
|
Posted: Thu Feb 10, 2011 5:09 am Post subject: |
|
|
| hedmo wrote: |
I_PROMISE_TO_SUPPLY_PATCHES_WITH_BUGS=1 |
oh yeah, that too.
| Quote: |
is this the SVN
sys-devel/gcc-4.6.0_pre9999 |
Yep.
I've been using it for about a week now and rebuilt most of @world. So far just a few easy bugs. _________________ by design, by neglect
for a fact or just for effect |
|
| Back to top |
|
 |
cruzki123 Apprentice

Joined: 16 May 2008 Posts: 194
|
Posted: Thu Feb 10, 2011 6:55 pm Post subject: |
|
|
| Are you testing -lto? |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 736 Location: halmstad
|
Posted: Thu Feb 10, 2011 7:19 pm Post subject: |
|
|
cruzki123 wrote:
Are you testing -lto?
jepp no problem so far |
|
| Back to top |
|
 |
wolf550e n00b

Joined: 20 May 2005 Posts: 17 Location: Israel
|
Posted: Sat Mar 19, 2011 4:53 am Post subject: |
|
|
On otherwise ~amd64 system, with this toolchain:
| Code: | GNU ld (Linux/GNU Binutils) 2.21.51.0.7.20110306
gcc (Gentoo SVN) 4.6.0-pre9999 20110319 (prerelease) rev. 171177
|
When rebuilding system, these packages didn't build with -O2 -flto:
=dev-libs/icu-4.6
=app-arch/unzip-6.0-r2
=sys-apps/pciutils-3.1.7
=dev-lang/perl-5.12.3
=app-shells/bash-4.2_p8
=net-misc/openssh-5.8_p1-r1
=media-libs/mesa-7.10.1
=dev-vcs/git-1.7.4.1
=dev-libs/glib-2.26.1-r1
=sys-libs/glibc-2.13-r2
So no, LTO doesn't yet work with many vital packages.
EDIT:
=dev-db/sqlite-3.7.5 built but was miscompiled. Firefox and Chromium both died with segmentation fault during their startup. Rebuilding sqlite without LTO solved that problem.
Apparently, a known problem: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44897
EDIT2:
=x11-libs/qt-script-4.7.2
failed compile with the same error as =dev-libs/icu-4.6
EDIT3:
chromium failed to compile with gcc-4.6 (without LTO) because of http://code.google.com/p/chromium/issues/detail?id=70746 which is in turn caused by http://code.google.com/p/google-perftools/issues/detail?id=301 which was fixed but the fix not included in chromium.
Last edited by wolf550e on Sun Mar 20, 2011 2:11 pm; edited 4 times in total |
|
| Back to top |
|
 |
hedmo l33t


Joined: 29 Aug 2009 Posts: 736 Location: halmstad
|
Posted: Sat Mar 19, 2011 10:26 am Post subject: |
|
|
| zen-sources did not work for me |
|
| Back to top |
|
 |
Ormaaj Guru

Joined: 28 Jan 2008 Posts: 312
|
Posted: Tue Mar 22, 2011 1:44 am Post subject: |
|
|
| Quote: | | Linker plugin is now enabled by default when the linker is detected to have plugin support. This is the case for GNU ld 2.21.51 or newer (on ELF and Cygwin targets) and the Gold linker on ELF targets. |
Is binutils being compiled with the necessary options? Is this testable? I notice the eclass makes only one reference to "plugins" and diff <(ld --verbose) <(ld --verbose=2) is empty.
| Quote: | | GCC can also cooperate with a GNU make job server by specifying the -flto=jobserver option and adding + to the beginning of the Makefile rule executing the linker. | Is this possible with portage? I take it they're implying you either have to use -j1, or make communicates over sockets and needs some reference to them otherwise by giving it a jobserver? |
|
| Back to top |
|
 |
wolf550e n00b

Joined: 20 May 2005 Posts: 17 Location: Israel
|
Posted: Wed Mar 23, 2011 4:37 pm Post subject: |
|
|
With binutils 2.21.51.0.7.20110306 (in portage, missing keywords), the plugin is built correctly.
libtool link tool removes flags, thus using LTO, when code is generated during link phase instead of compile phase, optimizations are not applied. Need to either patch libtool or define CC and CXX to include CFLAGS and CXXFLAGS.
pciutils miscompiles because it uses asm(".symver"). A workaround is to use -flto-partition=none which keeps those commands next to the relevant function. |
|
| Back to top |
|
 |
billydv l33t


Joined: 22 Dec 2006 Posts: 818 Location: Mount Vernon, NY
|
Posted: Sat Mar 26, 2011 12:51 pm Post subject: |
|
|
Sure would like to see this in portage since I have an I7, hopefully with a lot fewer bugs by then!!! _________________ Billy DeVincentis |
|
| Back to top |
|
 |
Dark Foo l33t

Joined: 21 Nov 2008 Posts: 921 Location: 127.0.0.1
|
Posted: Sat Mar 26, 2011 2:01 pm Post subject: |
|
|
gcc 4.6 is officially out now so i think it should turn up in the ~arch branches soon _________________ I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch. |
|
| Back to top |
|
 |
Ormaaj Guru

Joined: 28 Jan 2008 Posts: 312
|
Posted: Sat Mar 26, 2011 10:24 pm Post subject: |
|
|
| Ah so essentially LTO never works if GCC is called with -c and the build system handles linking separately? I'm not too familiar with libtool I'll have to read up a bit. |
|
| Back to top |
|
 |
wolf550e n00b

Joined: 20 May 2005 Posts: 17 Location: Israel
|
Posted: Wed Mar 30, 2011 5:39 pm Post subject: |
|
|
@Ormaaj: libtool just generates flags for gcc and calls gcc.
WARNING: This explanation is very simplified and inaccurate at places, but it serves to convey a point.
Suppose you have CFLAGS="-O2 -fPIC" LDFLAGS="-Wl,-O1" and file.c and you're building a shared library. Then these commands will be run:
gcc $(CFLAGS) -c -o file.o file.c
file is parsed, optimized, assembly generated, assembled into machine code and that saved in object file on per-function basis.
gcc $(LDFLAGS) -shared -o libfile.so file.o
all the code for all the functions in all the object files is concatenated into shared lib. compiler not used.
With LTO, you want to have: CFLAGS="-O2 -fPIC -flto" LDFLAGS="-Wl,-O1 -Wl,-flto"
so you get this:
gcc -O2 -fPIC -flto -c -o file.o file.c
-O2 is not used here. The file is parsed and some form of the tree is saved into the object file for later use.
gcc -Wl,-O1 -Wl,-flto -shared -o libfile.so file.o
Here all the parsed code is loaded and compiler optimizes it with the knowledge of function calls, able to inline across different c files and the like. better optimization is possible, in effect this is like first concatenating all the code into a single c file and compiling that (though, of course, different source files were compiled with different #defines, perhaps even from different languages).
This work can be divided into different processes to use multiple cores, but that makes the result less optimized and can lead to a bug like in pciutils.
The problem here is that this doesn't just call the linker to concatenate machine code. This calls the compiler to generate machine code. But where are the CFLAGS? They are not specified! So which -O level is used by the compiler? Why,-O0! Instead of better optimizations, you get no optimizations.
What you actually wanted the last command to be was:
gcc $(CFLAGS) $(LDFLAGS) -shared -o libfile.so file.o
This would have worked. This is what GCC thinks you should do. But that's not what libtool runs.
So you might think: "I know, I'll set LDFLAGS to include CFLAGS!" but libtool will strip the flags for the compiler from LDFLAGS and that doesn't work. Libtool manual says you can specify CFLAGS in the LDFLAGS if you use -Wc,-O2 but if you specify flags like that configure scripts choke on them.
What I have found to work is to specify CC. set CC="gcc -flto -O2" and libtool will do the right thing and you'll get LTO and fast binaries.
Of course, for C++ code replace CC with CXX and CFLAGS with CXXFLAGS. |
|
| Back to top |
|
 |
justXi n00b

Joined: 01 Aug 2007 Posts: 62
|
Posted: Mon Apr 04, 2011 6:54 am Post subject: |
|
|
I tried the gcc 4.6.0 ebuild which is available in portage now, but I got many errors "no space left on device" from tar.
I have 1.8 GByte space free on root. Other packages compile fine. Any ideas what I could check? |
|
| Back to top |
|
 |
XavierMiller Moderator


Joined: 23 Jul 2004 Posts: 4040 Location: ~Brussels - Belgique
|
Posted: Mon Apr 04, 2011 7:49 am Post subject: |
|
|
| justXi wrote: | I tried the gcc 4.6.0 ebuild which is available in portage now, but I got many errors "no space left on device" from tar.
I have 1.8 GByte space free on root. Other packages compile fine. Any ideas what I could check? |
Do you have enough space on /var/tmp and /usr/portage/distfiles ?
| Code: | | df -h /var/tmp/portage /usr/portage/distfiles |
_________________ Xavier Miller
(FR) Merci de respecter les règles du forum.
http://www.xaviermiller.be |
|
| Back to top |
|
 |
justXi n00b

Joined: 01 Aug 2007 Posts: 62
|
Posted: Mon Apr 04, 2011 8:48 am Post subject: |
|
|
I have all directories on the same partition, but I run out of inodes.
I removed some kernel-sources an now gcc 4.6 unpacks and is compiling. |
|
| Back to top |
|
 |
ecko n00b

Joined: 04 Jul 2010 Posts: 35
|
Posted: Mon Apr 04, 2011 12:16 pm Post subject: |
|
|
I just tried the gcc 4.6.0 ebuild now in portage, on amd64.
| Code: |
gcc/et-forest.o differs
gcc/fortran/trans.o differs
gcc/godump.o differs
libiberty/pic/cplus-dem.o differs
libiberty/cplus-dem.o differs
make[2]: *** [compare] Error 1
emake failed
* ERROR: sys-devel/gcc-4.6.0 failed (compile phase):
* emake failed with bootstrap-lean
|
I compile with gcc-4.5.2 and
| Code: |
CFLAGS="-O2 -pipe -mtune=native"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
|
I set USE="graphite go" for this compilation.
Any idea ? Thanks,
ecko. |
|
| Back to top |
|
 |
cruzki123 Apprentice

Joined: 16 May 2008 Posts: 194
|
Posted: Mon Apr 04, 2011 5:53 pm Post subject: |
|
|
| is lto enable in the 4.6 ebuild from portage? I'am currently rebuilding system to test 4.6 and my the next move I want to take is using lto globally. |
|
| Back to top |
|
 |
Ormaaj Guru

Joined: 28 Jan 2008 Posts: 312
|
Posted: Tue Apr 05, 2011 4:32 am Post subject: |
|
|
| @wolf550e Thank you for the informative post! |
|
| Back to top |
|
 |
justXi n00b

Joined: 01 Aug 2007 Posts: 62
|
Posted: Tue Apr 05, 2011 9:26 am Post subject: |
|
|
Hi,
While compiling gcc 4.6 on two computers I get the same following error:
| Quote: |
...
make[3]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.6.0/work/build/gcc'
mkdir -p -- i686-pc-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 3 in i686-pc-linux-gnu/libgcc
configure: creating cache ./config.cache
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-ar... /usr/i686-pc-linux-gnu/bin/ar
checking for i686-pc-linux-gnu-lipo... lipo
checking for i686-pc-linux-gnu-nm... /var/tmp/portage/sys-devel/gcc-4.6.0/work/build/./gcc/nm
checking for i686-pc-linux-gnu-ranlib... /usr/i686-pc-linux-gnu/bin/ranlib
checking for i686-pc-linux-gnu-strip... /usr/i686-pc-linux-gnu/bin/strip
checking whether ln -s works... yes
checking for i686-pc-linux-gnu-gcc... /var/tmp/portage/sys-devel/gcc-4.6.0/work/build/./gcc/xgcc -B/var/tmp/portage/sys-devel/gcc-4.6.0/work/build/./gcc/ -B/usr/i686-pc-linux-gnu/bin/ -B/usr/i686-pc-linux-gnu/lib/ -isystem /usr/i686-pc-linux-gnu/include -isystem /usr/i686-pc-linux-gnu/sys-include
checking for suffix of object files... configure: error: in `/var/tmp/portage/sys-devel/gcc-4.6.0/work/build/i686-pc-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage3-target-libgcc] Error 1
make[2]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.6.0/work/build'
make[1]: *** [stage3-bubble] Error 2
make[1]: Leaving directory `/var/tmp/portage/sys-devel/gcc-4.6.0/work/build'
make: *** [bootstrap-lean] Error 2
emake failed
|
Emerging gcc 4.5.2 works without problems.
Any ideas how to fix this? |
|
| Back to top |
|
 |
|