View previous topic :: View next topic |
Author |
Message |
painteru Tux's lil' helper


Joined: 23 Aug 2007 Posts: 103
|
Posted: Wed Jul 23, 2014 11:21 am Post subject: Enabling GCC Graphite and LTO ? |
|
|
Hi,
Surfing the Internet, I found something about graphite and lto gcc optimizations.
I really don't know what good for are these but ... aren't they called OPTIMIZATIONS ? .... so I can't stay away from them and I decided to compile my system using them.
I used this how to :
http://yuguangzhang.com/blog/enabling-gcc-graphite-and-lto-on-gentoo/
Then, searching for the right "n" in -flto=n, I found this article, too:
http://realnc.blogspot.com/2012/06/building-gentoo-linux-with-gcc-47-and.html
The question is:
Are all those CFLAGS needed
or it's just enough USE="...graphite lto..." ?
And also , is there any visible benefit using these optimizations?
Thiose howtos are for gcc 4.7
and now, there is gcc4.8.3 ~ in portage (not to mention 4.9 hardmasked) _________________ My art at www.danielchiriac.com |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 55498 Location: 56N 3W
|
Posted: Wed Jul 23, 2014 5:26 pm Post subject: |
|
|
painteru,
LTO is known to be broken with gcc-4.8.x
Its better with gcc-4.9. Also, it needs huge amounts of RAM. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
freke Veteran

Joined: 23 Jan 2003 Posts: 1098 Location: Somewhere in Denmark
|
Posted: Wed Jul 23, 2014 7:53 pm Post subject: |
|
|
NeddySeagoon wrote: | painteru,
LTO is known to be broken with gcc-4.8.x
Its better with gcc-4.9. Also, it needs huge amounts of RAM. |
Huge as in??
I just re-compiled my Raspberry Pi with LTO - 512MB RAM and 1GB swap and my x86 mail-server (4GB RAM and 2GB swap)
GCC 4.7.3-r1
Haven't done any real benchmarking - but I feel like my Raspberry-system grew from 4.4GB to 4.5GB used space though
Got a few packages that doesn't compile nicely with LTO enabled:
# System
dev-lang/perl no-lto.conf
dev-libs/elfutils no-lto.conf
dev-libs/glib no-lto.conf - compiles, but can't then can't compile GCC afterwards
# World
dev-libs/libbsd no-lto.conf
=sys-apps/pciutils-3.2.0 no-lto.conf
=app-antivirus/clamav-0.98.4 no-lto.conf
=dev-db/mariadb-5.2.14 no-lto.conf - not really sure, can't remember if it was really because of LTO or I had another problem with this (:me: blames beer)
edit:
Actually - now that I had a chance to reflect , I had some problems with the arm-system, I added 2GB extra swap - dunno if it was ever used though. |
|
Back to top |
|
 |
ulenrich Veteran

Joined: 10 Oct 2010 Posts: 1483
|
Posted: Sat Jul 26, 2014 10:27 pm Post subject: |
|
|
NeddySeagoon wrote: | painteru,
LTO is known to be broken with gcc-4.8.x
Its better with gcc-4.9. Also, it needs huge amounts of RAM. |
Some people of Debian downgrade to gcc-4.8 because of
Linus wrote: | Ok, so I'm looking at the code generation and your compiler is pure
and utter *shit*. | at
https://lkml.org/lkml/2014/7/24/584 |
|
Back to top |
|
 |
mackal Tux's lil' helper

Joined: 04 Aug 2011 Posts: 92
|
Posted: Sat Jul 26, 2014 10:43 pm Post subject: |
|
|
ulenrich wrote: | Some people of Debian downgrade to gcc-4.8 because of |
That's a little silly, the bug is present in 4.8, it just doesn't manifest compiling the kernel with -Os. |
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6920
|
Posted: Mon Jul 28, 2014 10:49 pm Post subject: |
|
|
mackal wrote: | ulenrich wrote: | Some people of Debian downgrade to gcc-4.8 because of |
That's a little silly, the bug is present in 4.8, it just doesn't manifest compiling the kernel with -Os. |
The bug is actually present in 4.5.0-4.8.3, 4.9.0 and possibly 4.9.1. |
|
Back to top |
|
 |
ulenrich Veteran

Joined: 10 Oct 2010 Posts: 1483
|
Posted: Tue Jul 29, 2014 6:33 am Post subject: |
|
|
Ant P. wrote: | mackal wrote: | ulenrich wrote: | Some people of Debian downgrade to gcc-4.8 because of |
That's a little silly, the bug is present in 4.8, it just doesn't manifest compiling the kernel with -Os. |
The bug is actually present in 4.5.0-4.8.3, 4.9.0 and possibly 4.9.1. |
Debian already has the fix. And maybe as soon as gcc-4.9.x got keyworded we will have them also. Many of the opensource software projects sell their .null releases as stable but they really are beta, including gcc and the kernel.
Greg KH pointed that out some time ago about the kernel ... In essence he said about Linus what Linus said about the gcc project now. |
|
Back to top |
|
 |
Randy Andy Veteran


Joined: 19 Jun 2007 Posts: 1152 Location: /dev/koelsch
|
|
Back to top |
|
 |
HerrSchafer Tux's lil' helper


Joined: 18 May 2011 Posts: 139
|
Posted: Mon Sep 21, 2015 7:09 pm Post subject: |
|
|
This thread is little old, but I'm having hard times dealing with GRAPHITE and LTO since a long time.
I have followed that links at first post; my idea was to enable the "Holy Combo" at the Gentoo's installation. The installation was going fine, until the point I emerged the DE (lxde). I had about 30 broken packages, but then, things like libcanberra and pulseaudio start to fail, even when I linked them to no-lto.conf.
The GRAPHITE flags, never worked; I've commented that line and the whole thing could start. Any linker (bfd and gold) fails.
I swear, I'm not a ricer, but, as I'm not a dev-guy, somethings sound complicated to me.
I've read that GRAPHITE should be applied in a "per package" base; ok! What packages should I compile with it?
My goal? Overall performance in a daily use notebook, but far beyond that, to understand how the stuff works and how to properly set it, so I can get a better performance from old machines.
About LTO, should I use it globaly or per package?
My installation is now broken and I will begin from scratch (again).
Any help will be welcome. Thanks guys! _________________ “Long is the way, and hard, that out of hell leads up to light.”
― John Milton |
|
Back to top |
|
 |
ct85711 Veteran

Joined: 27 Sep 2005 Posts: 1791
|
Posted: Mon Sep 21, 2015 7:50 pm Post subject: |
|
|
Well I can say, you shouldn't need to start over to get your computer working. The best way to get your computer working, is first start with the safe settings and get everything setup with that; then work on optimizing everything afterwards. Now if you need help getting your computer working, we'll help you get everything sorted out. I'd start a separate thread on getting your computer working with the safe settings; do provide output emerge --info and any/all build.log (full output please, if needed, provide a link to a pastebin with the output). As long as the system is kept up to date, it should be too difficult to get everything working. https://wiki.gentoo.org/wiki/CFLAGS
Now optimizing your system, I like starting from a stable foundation and tweak everything one at a time from there. Last time I read, there was several packages that does not like graphite/LTO. How many that does work with it, I have no clue. Best way to start with, is per package, and do one package/set at a time and test the software to see if it works (it would be a good idea to test one package/set at a time for a couple days to ensure no unforeseen issues pop up). |
|
Back to top |
|
 |
HerrSchafer Tux's lil' helper


Joined: 18 May 2011 Posts: 139
|
Posted: Mon Sep 21, 2015 8:35 pm Post subject: |
|
|
Thanks, for helping!
ct85711 wrote: | Well I can say, you shouldn't need to start over to get your computer working. The best way to get your computer working, is first start with the safe settings and get everything setup with that; |
I have modified my make.conf to the safe flags:
Code: | "march=corei7 -O2 -pipe" | and them emerged XFCE, but packages still breaking; both installed versions of GCC (4.8 and 4.9) fail; since it was a fresh install, I don't mind to do it again, because I can't remember all the steps I took, trying to fix it.
ct85711 wrote: | Now optimizing your system, I like starting from a stable foundation and tweak everything one at a time from there. Last time I read, there was several packages that does not like graphite/LTO. How many that does work with it, I have no clue. Best way to start with, is per package, and do one package/set at a time and test the software to see if it works (it would be a good idea to test one package/set at a time for a couple days to ensure no unforeseen issues pop up). |
Yep! Let's do it!
Quote: | ...a stable foundation... |
By this, I understand stable branch instead testing (~), gentoo-sources instead ck and, of course, safe flags; what else can I do to get a stable foundation? _________________ “Long is the way, and hard, that out of hell leads up to light.”
― John Milton |
|
Back to top |
|
 |
ct85711 Veteran

Joined: 27 Sep 2005 Posts: 1791
|
Posted: Mon Sep 21, 2015 11:08 pm Post subject: |
|
|
by stable foundation, I meant with the cflags, you can easily have a stable system running stable branch or unstable branch. For me, I've been running straight unstable branch, and my system has been stable since I've started using Gentoo. I've only encountered 2 packages that crashed during run time, both of them didn't matter that it is stable branch or not (one, was actually in the stable branch, the other is firefox (issue with gstreamer-1). The point I am getting at, is that it doesn't matter which branch you use and still get a stable system (that doesn't crash).
Now as for your crashes, I'd suspect it's because one of a dependency is failing. The best way to do it, is do a emerge -e system then do emerge -e world so that you rebuild the entire system rather then any packages after the change. In effect you are rebuilding the system (but you don't have to do all the steps all over again). The first should rebuild the system's toolchain (that that is setup correctly), then the other rebuilds everything afterwards. Last I read, the graphite and LTO USE flags does not actually affect the system, unless you change the packages to use graphite and LTO. However, if you applied any disable-LTO or stuff, you may want to disable them till after you recompiled the system. |
|
Back to top |
|
 |
HerrSchafer Tux's lil' helper


Joined: 18 May 2011 Posts: 139
|
Posted: Thu Sep 24, 2015 6:06 pm Post subject: |
|
|
ct85711 wrote: | I'd start a separate thread on getting your computer working with the safe settings; |
Here it is: https://forums.gentoo.org/viewtopic-p-7819138.html#7819138
Thanks! _________________ “Long is the way, and hard, that out of hell leads up to light.”
― John Milton |
|
Back to top |
|
 |
|
|
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
|
|