Skip to content

Commit

Permalink
readme / make.conf.lto touchups (#549)
Browse files Browse the repository at this point in the history
* move docs to .github

* update readme/make.conf.lto.defines
  • Loading branch information
telans authored Sep 11, 2020
1 parent 54489e5 commit 54d5313
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 24 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Доприноси

Доприноси су добродошли. Због природе Portage-а, спајање промијена би могло бити потешко, посебно пошто се очекује са корисници узму из ове конфигурације једино оно што они нађу корисним. Промјене у USE заставама, на примјер, вјероватно неће бити прихваћене, док би шромјене у заставама компајлера могле бити, посебно ако дају компајлеру више слободе да прави одлуке. Доприноси морају одржати филозофију наведену у [README-у](/README_bs_Cyril.md). Доприноси који надјачавају компајлерову бољу просудбу ће бити одбијени.
Доприноси су добродошли. Због природе Portage-а, спајање промијена би могло бити потешко, посебно пошто се очекује са корисници узму из ове конфигурације једино оно што они нађу корисним. Промјене у USE заставама, на примјер, вјероватно неће бити прихваћене, док би шромјене у заставама компајлера могле бити, посебно ако дају компајлеру више слободе да прави одлуке. Доприноси морају одржати филозофију наведену у [README-у](README_bs_Cyril.md). Доприноси који надјачавају компајлерову бољу просудбу ће бити одбијени.

## Смјернице за захтјеве за повлачење

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Doprinosi

Doprinosi su dobrodošli. Zbog prirode Portage-a, spajanje promijena bi moglo biti poteško, posebno pošto se očekuje da korisnici uzmu od ove konfiguracije jedino ono što oni nađu korisnim. Promjene u USE zastavama, na primjer, vjerovatno neće biti prihvaćene, dok bi promjene u zastavama kompajlera mogle biti, posebno ako daju kompajleru više slobode da pravi odluke. Doprinosi moraju održati filozofiju navedenu u [README-u](/README_bs_Lat.md). Doprinosi koji nadjačavaju kompajlerovu bolju prosudbu će biti odbijeni.
Doprinosi su dobrodošli. Zbog prirode Portage-a, spajanje promijena bi moglo biti poteško, posebno pošto se očekuje da korisnici uzmu od ove konfiguracije jedino ono što oni nađu korisnim. Promjene u USE zastavama, na primjer, vjerovatno neće biti prihvaćene, dok bi promjene u zastavama kompajlera mogle biti, posebno ako daju kompajleru više slobode da pravi odluke. Doprinosi moraju održati filozofiju navedenu u [README-u](README_bs_Lat.md). Doprinosi koji nadjačavaju kompajlerovu bolju prosudbu će biti odbijeni.

## Smjernice za zahtjeve za povlačenje

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_hr.md → .github/CONTRIBUTING_hr.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Doprinosi

Doprinosi su dobrodošli. Zbog prirode Portage-a, spajanje promijena bi moglo biti poteško, posebno pošto se očekuje da korisnici uzmu od ove konfiguracije jedino ono što oni nađu korisnim. Promjene u USE zastavama, na primjer, vjerovatno neće biti prihvaćene, dok bi promjene u zastavama kompajlera mogle biti, posebno ako daju kompajleru više slobode da pravi odluke. Doprinosi moraju održati filozofiju navedenu u [README-u](/README_bs_Lat.md). Doprinosi koji nadjačavaju kompajlerovu bolju prosudbu će biti odbijeni.
Doprinosi su dobrodošli. Zbog prirode Portage-a, spajanje promijena bi moglo biti poteško, posebno pošto se očekuje da korisnici uzmu od ove konfiguracije jedino ono što oni nađu korisnim. Promjene u USE zastavama, na primjer, vjerovatno neće biti prihvaćene, dok bi promjene u zastavama kompajlera mogle biti, posebno ako daju kompajleru više slobode da pravi odluke. Doprinosi moraju održati filozofiju navedenu u [README-u](README_bs_Lat.md). Doprinosi koji nadjačavaju kompajlerovu bolju prosudbu će biti odbijeni.

## Smjernice za zahtjeve za povlačenje

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_sr.md → .github/CONTRIBUTING_sr.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Доприноси

Доприноси су добродошли. Због природе Portage-а, спајање промена би могло бити потешко, посебно пошто се очекује са корисници узму из ове конфигурације једино оно што они нађу корисним. Промене у USE заставама, на пример, вероватно неће бити прихваћене, док би шромене у заставама компајлера могле бити, посебно ако дају компајлеру више слободе да прави одлуке. Доприноси морају одржати филозофију наведену у [README-у](/README_sr.md). Доприноси који надјачавају компајлерову бољу просудбу ће бити одбијени.
Доприноси су добродошли. Због природе Portage-а, спајање промена би могло бити потешко, посебно пошто се очекује са корисници узму из ове конфигурације једино оно што они нађу корисним. Промене у USE заставама, на пример, вероватно неће бити прихваћене, док би шромене у заставама компајлера могле бити, посебно ако дају компајлеру више слободе да прави одлуке. Доприноси морају одржати филозофију наведену у [README-у](README_sr.md). Доприноси који надјачавају компајлерову бољу просудбу ће бити одбијени.

## Смернице за захтеве за повлачење

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Title: <category>/<package>: <description>
Ensure that any added workarounds have a comment explaining the compilation error which requires it.
Any removed workarounds should be moved to the fixed section.
If an issue exists, please link it.
See CONTRIBUTING.md for more information.
See .github/CONTRIBUTING.md for more information.
2 changes: 1 addition & 1 deletion README_bs-Cyril.md → .github/README_bs-Cyril.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO)
[![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[Енглески (English)](/README.md) | [Bosanski (Bosnian, Latin)](/README_bs-Latn.md) | [Босански (Bosnian, Cyrillic)](/README_bs-Cyrl.md) | [Хрватски (Croatian)](/README_hr.md)
[Енглески (English)](/README.md) | [Bosanski (Bosnian, Latin)](README_bs-Latn.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyrl.md) | [Хрватски (Croatian)](README_hr.md)

---

Expand Down
2 changes: 1 addition & 1 deletion README_bs-Latn.md → .github/README_bs-Latn.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO)
[![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[Engleski (English)](/README.md) | [Босански (Bosnian, Cyrillic)](/README_bs-Cyril.md) | [Српски (Serbian)](/README_sr.md) | [Hrvatski (Croatian)](/README_hr.md)
[Engleski (English)](/README.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyril.md) | [Српски (Serbian)](README_sr.md) | [Hrvatski (Croatian)](README_hr.md)

---

Expand Down
2 changes: 1 addition & 1 deletion README_hr.md → .github/README_hr.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO)
[![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[Engleski (English)](/README.md) | [Босански (Bosnian, Cyrillic)](/README_bs-Cyril.md) | [Српски (Serbian)](/README_sr.md) | [Bosanski (Bosnian, Latin)](/README_bs-Latn.md)
[Engleski (English)](/README.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyril.md) | [Српски (Serbian)](README_sr.md) | [Bosanski (Bosnian, Latin)](README_bs-Latn.md)

---

Expand Down
2 changes: 1 addition & 1 deletion README_sr.md → .github/README_sr.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO)
[![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[Енглески (English)](/README.md) | [Bosanski (Bosnian, Latin)](/README_bs-Latn.md) | [Босански (Bosnian, Cyrillic)](/README_bs-Cyrl.md) | [Хрватски (Croatian)](/README_hr.md)
[Енглески (English)](/README.md) | [Bosanski (Bosnian, Latin)](README_bs-Latn.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyrl.md) | [Хрватски (Croatian)](README_hr.md)

---

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO)
[![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

[Bosnian, Cyrillic (Босански)](/README_bs-Cyril.md) | [Bosnian, Latin (Bosanski)](/README_bs-Latn.md) | [Serbian (Српски)](/README_sr.md) | [Croatian (Hrvatski)](/README_hr.md)
[Bosnian, Cyrillic (Босански)](.github/README_bs-Cyril.md) | [Bosnian, Latin (Bosanski)](.github/README_bs-Latn.md) | [Serbian (Српски)](.github/README_sr.md) | [Croatian (Hrvatski)](.github/README_hr.md)

---

Expand Down Expand Up @@ -56,7 +56,9 @@ The biggest gotcha with `-O3` is that it does not play nice at all with Undefine

## How to use this configuration

Add the `mv` overlay (`layman -a mv`) and then add this overlay (`layman -a lto-overlay`) to your system and run `emerge sys-config/ltoize`. Add the package to your `/etc/portage/package.accept_keywords` if necessary. This will add the necessary overrides to `/etc/portage/`, but it won't modify your `make.conf`. It will create a `make.conf.lto` symlink in `/etc/portage` with the default GentooLTO configuration. To use the default configuration, define a variable `NTHREADS` with the number of threads you want to use for LTO. Then, source the file in your own `make.conf` like in this example:
Add the `mv` and `lto-overlay` overlays to your system with either `layman` or `eselect repository` and run `emerge sys-config/ltoize`. Add the `ltoize` package to your `/etc/portage/package.accept_keywords` if necessary.

This will add the necessary overrides to `/etc/portage/`, but it won't modify your `make.conf`. It will create a `make.conf.lto` symlink in `/etc/portage` with the default GentooLTO configuration. To use the default configuration, define a variable `NTHREADS` with the number of threads you want to use for LTO. Then, source the file in your own `make.conf` like in this example:

~~~ bash
#Set this to "auto" to have gcc determine optimal number of cores (GCC 10+)
Expand All @@ -81,7 +83,7 @@ As shown, your own `CFLAGS` inherit the `CFLAGS` defined by GentooLTO in `make.c
The default configuration of GentooLTO enables the following:

* O3
* Graphite
* Graphite ( requires gcc to be built with the `graphite` use flag )
* -fno-semantic-interposition
* -fipa-pta
* -fdevirtualize-at-ltrans
Expand Down Expand Up @@ -127,7 +129,7 @@ When you find a problem, whether it's a package not playing nice with `-O3`, Gra

---

**After you've set everything up, run an `emerge -e @world` to rebuild your system with LTO and any optimizations you have chosen, or alternatively use [lto-rebuild](https://github.com/InBetweenNames/gentooLTO/wiki/lto-rebuild) to gradually convert your system over to GentooLTO.**
**After you've set everything up, run an `emerge -e --keep-going @world` to rebuild your system with LTO and any optimizations you have chosen, or alternatively use [lto-rebuild](https://github.com/InBetweenNames/gentooLTO/wiki/lto-rebuild) to gradually convert your system over to GentooLTO.**

---

Expand Down
24 changes: 13 additions & 11 deletions sys-config/ltoize/files/make.conf.lto.defines
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@
#source make.conf.lto.defines

#Guidelines:
#* Your CFLAGS should contain ${FLTO} and, depending on your gcc, -fuse-linker-plugin
#* Newer GCCs enable -fuse-linker-plugin by default.
#* Your CFLAGS should contain ${FLTO}
#* If you want Graphite, include "${GRAPHITE}" in your CFLAGS
#* If you want -fipa-pta, include "${IPAPTA}" in your CFLAGS (undefined for now, issue #257)
#* If you want -fipa-pta, include "${IPAPTA}" in your CFLAGS
#* Anything else is up to you, such as -march, -pipe, -O{3,2,s,1}, etc...
#* CXXFLAGS should be set to CFLAGS
#* Optionally, set other *FLAGS for languages compiled with GCC as well (See make.conf.lto)
#* Optionally, set other *FLAGS for languages compiled with GCC as well
#* LDFLAGS of your Gentoo profile should be respected.
# See make.conf.lto for more details.

FLTO="-flto=${NTHREADS}"

#FLTO is of the form -flto[=n] where n is the number of threads to use during linking.
#It's usually a good idea to set this to the number of hardware threads in your system
#You may also set this to "auto" to have gcc determine optimal number of cores (GCC 10+)
FLTO="-flto=${NTHREADS}"

#GRAPHITE contains Graphite specific optimizations and other optimizations that are disabled at O3
#but don't influence the compiler's judgement.
#With GCC 8.1.0, -ftree-loop-distribution is enabled by default at -O3
GRAPHITE="-fgraphite-identity -floop-nest-optimize"

#GRAPHITE contains Graphite specific optimizations and other optimizations that are disabled at O3 but don't influence the compiler's judgement.
#Since GCC 8.1.0, -ftree-loop-distribution is enabled by default at -O3
#NOTE: To use graphite, make sure you have gcc compiled with graphite support (add graphite to your USE). Otherwise GCC will complain!

IPAPTA="-fipa-pta"
Expand All @@ -37,7 +37,10 @@ IPAPTA="-fipa-pta"

SEMINTERPOS="-fno-semantic-interposition"

# With -fno-semantic-interposition the compiler assumes that if interposition happens for functions the overwriting function will have precisely the same semantics (and side effects). Similarly if interposition happens for variables, the constructor of the variable will be the same. The flag has no effect for functions explicitly declared inline (where it is never allowed for interposition to change semantics) and for symbols explicitly declared weak.
#With -fno-semantic-interposition the compiler assumes that if interposition happens for functions
#the overwriting function will have precisely the same semantics (and side effects).
#Similarly if interposition happens for variables, the constructor of the variable will be the same.
#The flag has no effect for functions explicitly declared inline (where it is never allowed for interposition to change semantics) and for symbols explicitly declared weak.

NOCOMMON="-fno-common"

Expand All @@ -56,8 +59,7 @@ SAFER_FAST_MATH="${SAFER_UNSAFE_MATH_OPTS} -fno-math-errno -ffinite-math-only -f

DEVIRTLTO="-fdevirtualize-at-ltrans"

#This allows GCC to perform devirtualization across object file boundaries using LTO. It's off by default because it
#increases compilation time.
#This allows GCC to perform devirtualization across object file boundaries using LTO.

NOPLT="-fno-plt"

Expand Down

0 comments on commit 54d5313

Please sign in to comment.