├── .gitattributes ├── .github ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── CONTRIBUTING_bs-Cyril.md ├── CONTRIBUTING_bs-Latn.md ├── CONTRIBUTING_hr.md ├── CONTRIBUTING_sr.md ├── PULL_REQUEST_TEMPLATE.md ├── README_bs-Cyril.md ├── README_bs-Latn.md ├── README_hr.md ├── README_sr.md └── workflows │ └── main.yml ├── .gitignore ├── LICENSE ├── README.md ├── app-portage └── lto-rebuild │ ├── files │ └── lto-rebuild │ ├── lto-rebuild-0.9.8-r1.ebuild │ └── metadata.xml ├── dev-lang └── python │ ├── Manifest │ ├── files │ ├── clearlinux-pkgs │ │ ├── python-3.7.5-0001-test_socket.py-remove-testPeek-test.test_socket.RDST.patch │ │ └── python-3.7.5-fix-regrtest-hang.patch │ ├── pydoc.conf │ ├── pydoc.init │ └── python-2.7.15-PGO-r1.patch │ ├── metadata.xml │ ├── profile.patch │ ├── python-2.7.18_p11-r100.ebuild │ ├── python-3.10.0_beta3-r1.ebuild │ ├── python-3.6.14-r1.ebuild │ ├── python-3.7.11-r1.ebuild │ ├── python-3.8.11-r1.ebuild │ └── python-3.9.6-r1.ebuild ├── metadata ├── layout.conf ├── news │ ├── 2021-01-24-modular │ │ ├── 2021-01-24-modular.txt │ │ └── 2021-01-24-modular.txt.asc │ ├── 2021-05-01-gcc11 │ │ ├── 2021-05-01-gcc11.en.txt │ │ └── 2021-05-01-gcc11.en.txt.asc │ └── 2023-10-28-portageq │ │ ├── 2023-10-28-portageq.en.txt │ │ └── 2023-10-28-portageq.en.txt.asc └── pkg_desc_index ├── profiles ├── categories └── repo_name ├── sys-config └── ltoize │ ├── files │ ├── bashrc.d │ │ ├── 41-lto-patch.sh │ │ ├── 42-lto-flag-o-matic.sh │ │ ├── 43-lto-no-common.sh │ │ └── 44-lto-clang-full.sh │ ├── make.conf.lto │ ├── make.conf.lto.defines │ ├── package.cflags │ │ ├── clang.conf │ │ ├── cmake-makefile.conf │ │ ├── devirtualize-at-ltrans.conf │ │ ├── flag-o-matic.conf │ │ ├── graphite.conf │ │ ├── ipa-pta.conf │ │ ├── lto.conf │ │ ├── no-common-libtool.conf │ │ ├── no-common.conf │ │ ├── no-plt.conf │ │ ├── no-semantic-interposition.conf │ │ ├── optimizations.conf │ │ ├── portage-bashrc-mv.conf │ │ ├── tls-dialect.conf │ │ └── use-ld.conf │ └── patches │ │ ├── dev-libs │ │ └── gmp │ │ │ └── arm64-lto.patch │ │ ├── dev-python │ │ └── grpcio-1.28.1 │ │ │ └── lto.patch │ │ ├── media-libs │ │ └── x264-0.0.20190903 │ │ │ └── lto.patch │ │ ├── media-video │ │ └── x264-encoder-0.0.20190903 │ │ │ └── lto.patch │ │ └── sys-devel │ │ └── prelink │ │ ├── experimental-glibc-231.patch │ │ └── noplt.patch │ ├── ltoize-0.9.10.ebuild │ ├── ltoize-0.9.11.ebuild │ ├── ltoize-0.9.12.ebuild │ ├── ltoize-0.9.7.ebuild │ ├── ltoize-0.9.8.ebuild │ ├── ltoize-0.9.9.ebuild │ └── metadata.xml └── testconfig └── mv.conf /.gitattributes: -------------------------------------------------------------------------------- 1 | *.ebuild linguist-language=Bash 2 | *.lto linguist-language=Bash 3 | *.conf linguist-language=Bash 4 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at lookatyouhacker@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributions 2 | 3 | Contributions are welcome. Due to the nature of Portage, merging changes could prove difficult, especially as users are expected to only take from this configuration what they find useful. USE flag changes, for example, are likely not to be accepted. New compiler flags however could be, particularly if they give the compiler more freedom to make decisions. Contributions must keep in the philosophy stated in [the README](/README.md). Contributions which override the compiler's better judgement will be rejected. 4 | 5 | ## Pull Request Guidelines 6 | 7 | When creating a PR, the title of the commit should be: 8 | 9 | ~~~ text 10 | /: 11 | ~~~ 12 | 13 | If the PR is to add something to `ltoworkarounds.conf`, make sure there is a comment next to the relevant lines that explains the encountered error. 14 | 15 | If the PR contains a patch that allows an LTO program to build, prefer to keep the patch as a user-patch in the `patches` directory, incrementing the revision of `sys-config/ltoize` as necessary. 16 | 17 | For all other PRs, it is recommended that you make an issue on the issue tracker first so we can discuss the problem being solved and the approach taken. This repo has been ultimately shaped by this principle, such that the best solution emerges. If you don't want to create an issue, you can also contact me directly through e-mail. 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING_bs-Cyril.md: -------------------------------------------------------------------------------- 1 | # Доприноси 2 | 3 | Доприноси су добродошли. Због природе Portage-а, спајање промијена би могло бити потешко, посебно пошто се очекује са корисници узму из ове конфигурације једино оно што они нађу корисним. Промјене у USE заставама, на примјер, вјероватно неће бити прихваћене, док би шромјене у заставама компајлера могле бити, посебно ако дају компајлеру више слободе да прави одлуке. Доприноси морају одржати филозофију наведену у [README-у](README_bs_Cyril.md). Доприноси који надјачавају компајлерову бољу просудбу ће бити одбијени. 4 | 5 | ## Смјернице за захтјеве за повлачење 6 | 7 | Код стварања захтјева, наслов би требао бити: 8 | 9 | ~~~ text 10 | <категорија>/<пакет>: <извршни сажетак> 11 | ~~~ 12 | 13 | Ако захтјев додаје нешто у `ltoworkarounds.conf`, побрините се да има коментар поред релевантних линија који објашњава проблем с којим сте се сусрели. 14 | 15 | Ако захтјев садржи закрпу која омогућава да се програм изгради са оптимизацијама из овог оверлеја, пожељно је да је закрпа корисничка закрпа и да се налази у `patches` директорији, постепено повећавајући број ревизије пакета `sys-config/lotize` по потреби. 16 | 17 | За све остале захтјеве је препоручено да прво направите картицу у пратиоцу грешака како бисмо могли разговарати о проблему који се ријешава и о приступу рјешавању проблема. Ово спремиште је, на крају крајева, обликовано овим принципом, тако да најбоље рјешење исплива на површину. Ако не желите да направите картицу, можете ми се такођер и изравно обратити е-поштом. 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING_bs-Latn.md: -------------------------------------------------------------------------------- 1 | # Doprinosi 2 | 3 | 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. 4 | 5 | ## Smjernice za zahtjeve za povlačenje 6 | 7 | Kod stvaranja zahtjeva, naslov bi trebao biti: 8 | 9 | ~~~ text 10 | /: 11 | ~~~ 12 | 13 | Ako zahtjev dodaje nešto u `ltoworkarounds.conf`, pobrinite se da ima komentar pored relevantnih linija koji objašnjava problem s kojim ste se susreli. 14 | 15 | Ako zahtjev sadrži zakrpu koja omogućava da se program izgradi sa optimizacijama iz ovog overleja, poželjno je da je zakrpa korisnička zakrpa i da se nalazi u `patches` direktoriji, postepeno povećavajući broj revizije paketa `sys-config/lotize` po potrebi. 16 | 17 | Za sve ostale zahtjeve je preporučeno da prvo napravite karticu u pratiocu grešaka kako bismo mogli razgovarati o problemu koji se riješava i o pristupu rješavanju problema. Ovo spremište je, na kraju krajeva, oblikovano ovim principom, tako da najbolje rješenje ispliva na površinu. Ako ne želite da napravite karticu, možete mi se također i izravno obratiti e-poštom. 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING_hr.md: -------------------------------------------------------------------------------- 1 | # Doprinosi 2 | 3 | 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. 4 | 5 | ## Smjernice za zahtjeve za povlačenje 6 | 7 | Kod stvaranja zahtjeva, naslov bi trebao biti: 8 | 9 | ~~~ text 10 | /: 11 | ~~~ 12 | 13 | Ako zahtjev dodaje nešto u `ltoworkarounds.conf`, pobrinite se da ima komentar pored relevantnih linija koji objašnjava problem s kojim ste se susreli. 14 | 15 | Ako zahtjev sadrži zakrpu koja omogućava da se program izgradi sa optimizacijama iz ovog overleja, poželjno je da je zakrpa korisnička zakrpa i da se nalazi u `patches` direktoriji, postepeno povećavajući broj revizije paketa `sys-config/lotize` po potrebi. 16 | 17 | Za sve ostale zahtjeve je preporučeno da prvo napravite karticu u pratiocu grešaka kako bismo mogli razgovarati o problemu koji se riješava i o pristupu rješavanju problema. Ovo spremište je, na kraju krajeva, oblikovano ovim principom, tako da najbolje rješenje ispliva na površinu. Ako ne želite da napravite karticu, može te mi također i izravno poslati e-poštu. 18 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING_sr.md: -------------------------------------------------------------------------------- 1 | # Доприноси 2 | 3 | Доприноси су добродошли. Због природе Portage-а, спајање промена би могло бити потешко, посебно пошто се очекује са корисници узму из ове конфигурације једино оно што они нађу корисним. Промене у USE заставама, на пример, вероватно неће бити прихваћене, док би шромене у заставама компајлера могле бити, посебно ако дају компајлеру више слободе да прави одлуке. Доприноси морају одржати филозофију наведену у [README-у](README_sr.md). Доприноси који надјачавају компајлерову бољу просудбу ће бити одбијени. 4 | 5 | ## Смернице за захтеве за повлачење 6 | 7 | Код стварања захтева, наслов би требао бити: 8 | 9 | ~~~ text 10 | <категорија>/<пакет>: <извршни сажетак> 11 | ~~~ 12 | 13 | Ако захтев додаје нешто у `ltoworkarounds.conf`, побрините се да има коментар поред релевантних линија који објашњава проблем с којим сте се сусрели. 14 | 15 | Ако захтев садржи закрпу која омогућава да се програм изгради са оптимизацијама из овог оверлеја, пожељно је да је закрпа корисничка закрпа и да се налази у `patches` директорији, постепено повећавајући број ревизије пакета `sys-config/lotize` по потреби. 16 | 17 | За све остале захтеве је препоручено да прво направите картицу у пратиоцу грешака како бисмо могли разговарати о проблему који се решава и о приступу решавању проблема. Ово спремиште је, на крају крајева, обликовано овим принципом, тако да најбоље решење исплива на површину. Ако не желите да направите картицу, можете ми се такођер и изравно обратити е-поштом. 18 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Title: /: 2 | 3 | Ensure that any added workarounds have a comment explaining the compilation error which requires it. 4 | Any removed workarounds should be moved to the fixed section. 5 | If an issue exists, please link it. 6 | See .github/CONTRIBUTING.md for more information. 7 | -------------------------------------------------------------------------------- /.github/README_bs-Cyril.md: -------------------------------------------------------------------------------- 1 | # GentooLTO оверлеј 2 | 3 | [![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO) 4 | [![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 5 | 6 | [Енглески (English)](/README.md) | [Bosanski (Bosnian, Latin)](README_bs-Latn.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyrl.md) | [Хрватски (Croatian)](README_hr.md) 7 | 8 | --- 9 | 10 | Ово је живи документ. Он ће бити држан у корак са пројектом како се пројекат буде развијао 11 | 12 | > Пажња: ова подешавања нису за оне слабога срца. Највјероватније није паметна идеја да користите ова подешавања на производним системима! Успркос мојој бољој процјени, ја их још увијек користим... 13 | 14 | Да ли вас занима кориштење Gentoo-а (теоретски) максималном брзином? Желите ли имати скоро у потпуности [LTO-изиран (енглески линк)](https://gcc.gnu.org/wiki/LinkTimeOptimization) систем? Наставите читати да видите како се то може постићи! 15 | 16 | --- 17 | 18 | **Oва документација се премијешта у [GentooLTO Wiki (енглески линк)](https://github.com/InBetweenNames/gentooLTO/wiki)** 19 | 20 | --- 21 | 22 | ## НОВО: извјештај покривености, 17. април 2019. године 23 | 24 | На основу броја поднесака из анкете која је била у току од 27. октобра 2018. године, дошли смо до сљедећих сазнања: 25 | 26 | * ~27,4% Gentoo-овог главног спремишта пакета је потврђено да ради са GentooLTO-овом заданом конфигурацијом 27 | * ~27% Gentoo-овог главног спремишта пакета је потврђено да ради са GentooLTO-овом заданом конфигурацијом без икакве потребе за заобилазним рјешењима од стране GentooLTO-а 28 | 29 | Остатак пакета није испробан, те је непознато колико су подржани! Они могу, а и не морају радити. Било би одлично на крају постићи потпуну покривеност! Како год било, по мени су ови резултати поприлично охрабрујући. 30 | 31 | Читав извјештај можете прегледати у пратећем [Gentoo чланку (енглески линк).](metadata/news/2019-04-17-results/2019-04-17-results.en.txt) Хвала свима који су допринијели! Заслуге су на крају чланка. 32 | 33 | Ако нисте имали прилику ишта поднијети, немојте се бринути, још увијек можете, али ће ваши резултати бити укључени тек у сљедећем извештају. Ја мислим да би имало смисла да се редовито (можда годишње) одржавају. 34 | 35 | ## Увод 36 | 37 | Овај оверлеј садржи низ конфигурацијских датотека које се темеље на мојој личној Gentoo Portage конфигурацији за омогућавање LTO-а широм система. Намијењен је за кориштење уз насилне оптимизације од стране компајлера да помогне у хватању грешака у програмима (буба/багова), укључијући у GCC-у. Ипак, може се такођер користити за обични LTO без икаквих насилних оптимизација од стране компајлера. Наставите читати да сазнате како га користити. 38 | 39 | ### Прошлост 40 | 41 | Раније током 2017. године сам одлучио извршити оглед, изградити Gentoo систем користећи `-O3` заставу GCC компајлера. Веома је добро документирано на Gentoo wiki-ју да ово није пожељна конфигурација, али сам хтио видјети до које мјере ће се систем срушити. Како се испоставило, већина пакета који се не могу изградити са `-O3` је већ присиљена у ebuild-овима да се изгради са `-O2`, тако да сам искусио поприлично мали број неуспијеха. Због успјеха којег сам имао користећи `-O3`, одлучио сам начинити ствари мало сложенијим, те сам додао [Graphite (графит; енгленски линк)](https://gcc.gnu.org/wiki/Graphite) оптимизације. Онда сам постао мало одважнији и још додао LTO. Након што сам радио ово отприлике осам мјесеци, осјећао сам се довољно добро у вези своје конфигурације, те сам одлучио ју објавити да ју могу видјети они које то занима. Овај оверлеј ће бити активно ажуриран и испитиван, пошто се темељи на мојој Portage конфигурацији. 42 | 43 | --- 44 | 45 | Моји изворни LTO и Graphite огледи су се темељили на [овом корисном блог чланку.](http://yuguangzhang.com/blog/enabling-gcc-graphite-and-lto-on-gentoo/) Шта овај оверлеј постиже јесте проширење садржаја из тог чланка са активном и ажурираном конфигурацијом. 46 | 47 | --- 48 | 49 | ## Филозофија овог оверлеја 50 | 51 | [To be translated] 52 | -------------------------------------------------------------------------------- /.github/README_bs-Latn.md: -------------------------------------------------------------------------------- 1 | # GentooLTO overlej 2 | 3 | [![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO) 4 | [![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 5 | 6 | [Engleski (English)](/README.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyril.md) | [Српски (Serbian)](README_sr.md) | [Hrvatski (Croatian)](README_hr.md) 7 | 8 | --- 9 | 10 | Ovo je živi dokument. On će biti držan u korak sa projektom kako se projekat bude razvijao. 11 | 12 | > Pažnja: ova podešavanja nisu za one slaboga srca. Najvjerovatnije nije pametna ideja da koristite ova podešavanja na proizvodnim sistemima! Usprkos mojoj boljoj procjeni, ja ih još uvijek koristim... 13 | 14 | Da li vas zanima korištenje Gentoo-a (teoretski) maksimalnom brzinom? Želite li imati skoro u potpunosti [LTO-iziran](https://gcc.gnu.org/wiki/LinkTimeOptimization) sistem (engleski link)? Nastavite čitati da vidite kako se to može postići! 15 | 16 | --- 17 | 18 | **Ova dokumentacija se premiješta u [GentooLTO Wiki](https://github.com/InBetweenNames/gentooLTO/wiki)** 19 | 20 | --- 21 | 22 | ## NOVO: Izvještaj pokrivenosti, 17. april 2019. godine 23 | 24 | Na osnovu broja podnesaka iz ankete koja je bila u toku od 27. oktobra 2018. godine, došli smo do sljedećih saznanja: 25 | 26 | * ~27,4% Gentoo-ovog glavnog spremišta paketa je potvrđeno da radi sa GentooLTO-ovom zadanom konfiguracijom 27 | * ~27% Gentoo-ovog glavnog spremišta paketa je potvrđeno da radi sa GentooLTO-ovom zadanom konfiguracijom bez ikakve potrebe za zaobilaznim rješenjima od strane GentooLTO-a 28 | 29 | Ostatak paketa nije isproban, te je nepoznato koliko su podržani! Oni mogu, a i ne moraju raditi. Bilo bi odlično na kraju postići potpunu pokrivenost! Kako god bilo, po meni su ovi rezultati poprilično ohrabrujući. 30 | 31 | Čitav izvještaj možete pogledati u pratećem [Gentoo članku (engleski link).](metadata/news/2019-04-17-results/2019-04-17-results.en.txt) Hvala svima koji su doprinijeli! Zasluge su na kraju članka. 32 | 33 | Ako niste imali priliku išta podnijeti, nemojte se brinuti, još uvijek možete, ali će vaši rezultati tek biti uključeni u sljedećem izvještaju. Ja mislim da bi imalo smisla da se redovito (možda godišnje) održavaju. 34 | 35 | ## Uvod 36 | 37 | Ovaj overlej sadrži niz konfiguracijskih datoteka koje se temelje na mojoj ličnoj Gentoo Portage konfiguraciji za omogućavanje LTO-a širom sistema. Namijenjen je za korištenje uz nasilne optimizacije od strane kompajlera da pomogne u hvatanju grešaka u programima (buba/bagova), uključujući u GCC-u. Ipak, može se također koristiti za obični LTO bez ikakvih nasilnih optimizacija od strane kompajlera. Nastavite čitati da saznate kako ga koristiti. 38 | 39 | ### Prošlost 40 | 41 | Ranije tokom 2017. godine sam odlučio izvršiti jedan ogled, izgraditi Gentoo sistem koristeći `-O3` zastavu GCC kompajlera. Veoma je dobro dokumentirano na Gentoo wiki-ju da ovo nije poželjna konfiguracija, ali sam htio vidjeti u kojoj mjeri će se sistem srušiti. Kako se ispstavilo, većina paketa koji se ne mogu izgraditi sa `-O3` je već prisiljena u ebuild-ovima da se izgradi sa `-O2`, tako da sam iskusio poprilično mali broj neuspjeha. Zbog uspjeha kojeg sam imao koristeći `-O3`, odlučio sam načiniti stvari malo složenijim, te sam dodao [Graphite](https://gcc.gnu.org/wiki/Graphite) optimizacije (grafit; engleski link). Onda sam postao malo odvažniji i još dodao LTO. Nakon što sam radio ovo otprilike osam mjeseci, osjećao sam se dovoljno dobro u vezi svoje konfiguracije, te sam odlučio da ju objavim da ju mogu vidjeti oni koje to zanima. Ovaj overlej će biti aktivno ažuriran i ispitivan, pošto se temelji na mojoj Portage konfiguraciji. 42 | 43 | --- 44 | 45 | Moji izvorni LTO i Graphite ogledi su se temeljili na [ovom korisnom blog članku.](http://yuguangzhang.com/blog/enabling-gcc-graphite-and-lto-on-gentoo/) Šta ovaj overlej postiže jeste proširenje sadržaja iz tog članka sa aktivnom i ažuriranom konfiguracijom. 46 | 47 | --- 48 | 49 | ## Filozofija ovog overleja 50 | 51 | [To be translated] 52 | -------------------------------------------------------------------------------- /.github/README_hr.md: -------------------------------------------------------------------------------- 1 | # GentooLTO overlej 2 | 3 | [![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO) 4 | [![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 5 | 6 | [Engleski (English)](/README.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyril.md) | [Српски (Serbian)](README_sr.md) | [Bosanski (Bosnian, Latin)](README_bs-Latn.md) 7 | 8 | --- 9 | 10 | Ovo je živi dokument. On će biti držan u korak sa projektom kako se projekat bude razvijao. 11 | 12 | > Pažnja: ova podešavanja nisu za one slaboga srca. Najvjerovatnije nije pametna ideja da koristite ova podešavanja na proizvodnim sistemima! Usprkos mojoj boljoj procjeni, ja ih još uvijek koristim... 13 | 14 | Da li vas zanima korištenje Gentoo-a (teoretski) maksimalnom brzinom? Želite li imati skoro u potpunosti [LTO-iziran](https://gcc.gnu.org/wiki/LinkTimeOptimization) sistem (engleski link)? Nastavite čitati da vidite kako se to može postići! 15 | 16 | --- 17 | 18 | **Ova dokumentacija se premiješta u [GentooLTO Wiki](https://github.com/InBetweenNames/gentooLTO/wiki)** 19 | 20 | --- 21 | 22 | ## NOVO: Izvještaj pokrivenosti, 17. travanj 2019. godine 23 | 24 | Na osnovu broja podnesaka iz ankete koja je bila u toku od 27. listopada 2018. godine, došli smo do sljedećih saznanja: 25 | 26 | * ~27,4% Gentoo-ovog glavnog spremišta paketa je potvrđeno da radi sa GentooLTO-ovom zadanom konfiguracijom 27 | * ~27% Gentoo-ovog glavnog spremišta paketa je potvrđeno da radi sa GentooLTO-ovom zadanom konfiguracijom bez ikakve potrebe za zaobilaznim rješenjima od strane GentooLTO-a 28 | 29 | Ostatak paketa nije isproban, te je nepoznato koliko su podržani! Oni mogu, a i ne moraju raditi. Bilo bi odlično na kraju postići potpunu pokrivenost! Kako god bilo, po meni su ovi rezultati poprilično ohrabrujući. 30 | 31 | Čitav izvještaj možete pogledati u pratećem [Gentoo članku (engleski link).](metadata/news/2019-04-17-results/2019-04-17-results.en.txt) Hvala svima koji su doprinijeli! Zasluge su na kraju članka. 32 | 33 | Ako niste imali priliku išta podnijeti, nemojte se brinuti, još uvijek možete, ali će vaši rezultati tek biti uključeni u sljedećem izvještaju. Ja mislim da bi imalo smisla da se redovito (možda godišnje) održavaju. 34 | 35 | ## Uvod 36 | 37 | Ovaj overlej sadrži niz konfiguracijskih datoteka koje se temelje na mojoj ličnoj Gentoo Portage konfiguraciji za omogućavanje LTO-a širom sistema. Namijenjen je za korištenje uz nasilne optimizacije od strane kompajlera da pomogne u hvatanju grešaka u programima (buba/bagova), uključujući u GCC-u. Ipak, može se također koristiti za obični LTO bez ikakvih nasilnih optimizacija od strane kompajlera. Nastavite čitati da saznate kako ga koristiti. 38 | 39 | ### Prošlost 40 | 41 | Ranije tokom 2017. godine sam odlučio izvršiti jedan ogled, izgraditi Gentoo sistem koristeći `-O3` zastavu GCC kompajlera. Veoma je dobro dokumentirano na Gentoo wiki-ju da ovo nije poželjna konfiguracija, ali sam htio vidjeti u kojoj mjeri će se sistem srušiti. Kako se ispstavilo, većina paketa koji se ne mogu izgraditi sa `-O3` je već prisiljena u ebuild-ovima da se izgradi sa `-O2`, tako da sam iskusio poprilično mali broj neuspjeha. Zbog uspjeha kojeg sam imao koristeći `-O3`, odlučio sam načiniti stvari malo složenijim, te sam dodao [Graphite](https://gcc.gnu.org/wiki/Graphite) optimizacije (grafit; engleski link). Onda sam postao malo odvažniji i još dodao LTO. Nakon što sam radio ovo otprilike osam mjeseci, osjećao sam se dovoljno dobro u vezi svoje konfiguracije, te sam odlučio da ju objavim da ju mogu vidjeti oni koje to zanima. Ovaj overlej će biti aktivno ažuriran i ispitivan, pošto se temelji na mojoj Portage konfiguraciji. 42 | 43 | --- 44 | 45 | Moji izvorni LTO i Graphite ogledi su se temeljili na [ovom korisnom blog članku.](http://yuguangzhang.com/blog/enabling-gcc-graphite-and-lto-on-gentoo/) Šta ovaj overlej postiže jeste proširenje sadržaja iz tog članka sa aktivnom i ažuriranom konfiguracijom. 46 | 47 | --- 48 | 49 | ## Filozofija ovog overleja 50 | 51 | [To be translated] 52 | -------------------------------------------------------------------------------- /.github/README_sr.md: -------------------------------------------------------------------------------- 1 | # GentooLTO оверлеј 2 | 3 | [![Build Status](https://travis-ci.org/InBetweenNames/gentooLTO.svg?branch=master)](https://travis-ci.org/InBetweenNames/gentooLTO) 4 | [![Gitter](https://badges.gitter.im/gentooLTO/community.svg)](https://gitter.im/gentooLTO/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) 5 | 6 | [Енглески (English)](/README.md) | [Bosanski (Bosnian, Latin)](README_bs-Latn.md) | [Босански (Bosnian, Cyrillic)](README_bs-Cyrl.md) | [Хрватски (Croatian)](README_hr.md) 7 | 8 | --- 9 | 10 | Ово је живи документ. Он ће бити држан у корак са пројектом како се пројекат буде развијао 11 | 12 | > Пажња: ова подешавања нису за оне слабога срца. Највероватније није паметна идеја да користите ова подешавања на производним системима! Успркос мојој бољој процени, ја их још увек користим... 13 | 14 | Да ли вас занима кориштење Gentoo-а (теоретски) максималном брзином? Желите ли имати скоро у потпуности [LTO-изиран](https://gcc.gnu.org/wiki/LinkTimeOptimization) систем (енглески линк)? Наставите читати да видите како се то може постићи! 15 | 16 | --- 17 | 18 | **Oва документација се премешта у [GentooLTO Wiki](https://github.com/InBetweenNames/gentooLTO/wiki)** 19 | 20 | --- 21 | 22 | ## НОВО: извештај покривености, 17. април 2019. године 23 | 24 | На основу броја поднесака из анкете која је била у току од 27. октобра 2018. године, дошли смо до следећих сазнања: 25 | 26 | * ~27,4% Gentoo-овог главног спремишта пакета је потврђено да ради са GentooLTO-овом заданом конфигурацијом 27 | * ~27% Gentoo-овог главног спремишта пакета је потврђено да ради са GentooLTO-овом заданом конфигурацијом без икакве потребе за заобилазним решењима од стране GentooLTO-а 28 | 29 | Остатак пакета није испробан, те је непознато колико су подржани! Они могу, а и не морају радити. Било би одлично на крају постићи потпуну покривеност! Како год било, по мени су ови резултати поприлично охрабрујући. 30 | 31 | Читав извештај можете прегледати у пратећем [Gentoo чланку (енглески линк).](metadata/news/2019-04-17-results/2019-04-17-results.en.txt) Хвала свима који су допринели! Заслуге су на крају чланка. 32 | 33 | Ако нисте имали прилику ишта поднети, немојте се бринути, још увек можете, али ће ваши резултати бити укључени тек у следећем извештају. Ја мислим да би имало смисла да се редовито (можда годишње) одржавају. 34 | 35 | ## Увод 36 | 37 | Овај оверлеј садржи низ конфигурацијских датотека које се темеље на мојој личној Gentoo Portage конфигурацији за омогућавање LTO-а широм система. Намењен је за кориштење уз насилне оптимизације од стране компајлера да помогне у хватању грешака у програмима (буба/багова), укључијући у GCC-у. Ипак, може се такођер користити за обични LTO без икаквих насилних оптимизација од стране компајлера. Наставите читати да сазнате како га користити. 38 | 39 | ### Прошлост 40 | 41 | Раније током 2017. године сам одлучио извршити оглед, изградити Gentoo систем користећи `-O3` заставу GCC компајлера. Веома је добро документирано на Gentoo wiki-ју да ово није пожељна конфигурација, али сам хтео видети до које мере ће се систем срушити. Како се испоставило, већина пакета који се не могу изградити са `-O3` је већ присиљена у ebuild-овима да се изгради са `-O2`, тако да сам искусио поприлично мали број неуспеха. Због успеха којег сам имао користећи `-O3`, одлучио сам начинити ствари мало сложенијим, те сам додао [Graphite](https://gcc.gnu.org/wiki/Graphite) оптимизације (графит; енглески линк). Онда сам постао мало одважнији и још додао LTO. Након што сам радио ово отприлике осам месеци, осећао сам се довољно добро у вези своје конфигурације, те сам одлучио ју објавити да ју могу видети они које то занима. Овај оверлеј ће бити активно ажуриран и испитиван, пошто се темељи на мојој Portage конфигурацији. 42 | 43 | --- 44 | 45 | Моји изворни LTO и Graphite огледи су се темељили на [овом корисном блог чланку.](http://yuguangzhang.com/blog/enabling-gcc-graphite-and-lto-on-gentoo/) Шта овај оверлеј постиже јесте проширење садржаја из тог чланка са активном и ажурираном конфигурацијом. 46 | 47 | --- 48 | 49 | ## Филозофија овог оверлеја 50 | 51 | [To be translated] 52 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: GentooLTO 2 | 3 | # Controls when the action will run. Triggers the workflow on push or pull request 4 | on: [push, pull_request] 5 | 6 | env: 7 | PORTAGE_VER: "3.0.6" 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 15 | - uses: actions/checkout@v2 16 | 17 | - name: Install packages 18 | run: | 19 | sudo apt-get install python3-setuptools 20 | pip3 install wheel 21 | pip3 install lxml pyyaml 22 | 23 | - name: Setup runner 24 | run: | 25 | shopt -s extglob 26 | sudo mkdir -p /var/db/repos/gentoo /var/cache/distfiles /etc/portage/repos.conf 27 | sudo chmod a+rwX /etc/passwd /etc/group /etc /usr /usr/local /var/db/repos/gentoo /var/cache/distfiles 28 | mkdir overlay; mv !(overlay) overlay/; mv .git overlay/ 29 | 30 | wget -qO - "https://github.com/gentoo/portage/archive/portage-${PORTAGE_VER}.tar.gz" | tar xz 31 | wget -qO - "https://github.com/gentoo-mirror/gentoo/archive/master.tar.gz" | tar xz -C /var/db/repos/gentoo --strip-components=1 32 | wget "https://www.gentoo.org/dtd/metadata.dtd" -O /var/cache/distfiles/metadata.dtd 33 | 34 | sudo echo "portage:x:250:250:portage:/var/tmp/portage:/bin/false" >> /etc/passwd 35 | sudo echo "portage::250:portage,travis" >> /etc/group 36 | 37 | sudo ln -s $GITHUB_WORKSPACE/portage-portage-${PORTAGE_VER}/cnf/repos.conf /etc/portage/repos.conf/gentoo.conf 38 | sudo ln -s $GITHUB_WORKSPACE/overlay/testconfig/mv.conf /etc/portage/repos.conf/mv.conf 39 | sudo ln -s /usr/portage/profiles/default/linux/amd64/17.1 /etc/portage/make.profile 40 | 41 | cd /usr/local 42 | git clone --depth 1 https://github.com/vaeth/mv-overlay mv; chmod a+rwX mv 43 | 44 | - name: Verify GentooLTO 45 | run: | 46 | cd $GITHUB_WORKSPACE/overlay 47 | shellcheck app-portage/lto-rebuild/files/lto-rebuild 48 | python3 ../portage-portage-${PORTAGE_VER}/repoman/bin/repoman full -dx 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ChangeLog 2 | profiles/use.local.desc 3 | metadata/md5-cache 4 | .vscode 5 | -------------------------------------------------------------------------------- /app-portage/lto-rebuild/files/lto-rebuild: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | display_help() 4 | { 5 | echo -e " 6 | Usage: lto-rebuild [OPTION] 7 | 8 | lto-rebuild can be used to avoid a full system rebuild after upgrading GCC 9 | when using GentooLTO. It searches in /usr/lib, /usr/lib32, and /usr/lib64 10 | on your system for all installed static archives that were built using 11 | a different GCC than the current one. 12 | 13 | Note: make sure your system is as up to date as possible before doing this. 14 | If an installed package does not have a corresponding ebuild available, 15 | this command will fail. You can use -l to manually intervene. 16 | 17 | Options: 18 | 19 | -h Display this help 20 | -a Only list the archives that were built with other GCC versions 21 | -l Only list the packages that would be rebuilt (and their slots) 22 | -r Rebuild the packages using emerge (will ask for confirmation) 23 | " 24 | } 25 | 26 | perform_action() 27 | { 28 | local prefix="${EROOT%/}/usr/lib" 29 | local suffix="\.a" 30 | local archives=() 31 | local packages=() 32 | local GCC_VER="" 33 | 34 | GCC_VER=$(gcc -dumpversion) 35 | 36 | echo -e "Searching in 37 | ${prefix} 38 | ${prefix}64 39 | ${prefix}32 40 | for static archives that were built using a different GCC...\n" >&2 41 | 42 | # Exclude /usr/lib/gcc/ because these are internal 43 | # to the [cross-]compilers on the system 44 | mapfile -t archives < <( 45 | find "${prefix}"{,64,32} -type f -name "*${suffix}" \ 46 | -exec readelf -p .comment {} + \ 47 | -o -path "${prefix}64/gcc" -prune \ 48 | -o -path "${prefix}32/gcc" -prune \ 49 | -o -path "${prefix}/gcc" -prune 2> /dev/null | \ 50 | grep -v "${GCC_VER}" | grep -B3 "GCC:" | \ 51 | grep -o "${prefix}.*${suffix}" | uniq 52 | ) 53 | 54 | if [[ ${#archives[@]} -eq 0 ]] 55 | then 56 | echo "No problems found!" >&2 57 | exit 0 58 | fi 59 | 60 | if [[ "${1}" != "-a" ]] 61 | then 62 | mapfile -t packages < <(qfile -qS "${archives[@]}" | sort -u) 63 | fi 64 | 65 | case "${1}" in 66 | "-a") 67 | echo "The following static archives were built" >&2 68 | echo -e "using a different GCC:\n" >&2 69 | printf "%s\n" "${archives[@]}" 70 | ;; 71 | "-l") 72 | echo "The following packages installed static archives" >&2 73 | echo -e "that were built using a different GCC:\n" >&2 74 | printf "%s\n" "${packages[@]}" 75 | ;; 76 | "-r") 77 | emerge -1a "${packages[@]}" 78 | ;; 79 | *) 80 | exit 1 81 | ;; 82 | esac 83 | } 84 | 85 | case "${1}" in 86 | "" | "-h") 87 | display_help 88 | ;; 89 | "-l" | "-a" | "-r") 90 | perform_action "${1}" 91 | ;; 92 | *) 93 | exit 1 94 | ;; 95 | esac 96 | 97 | -------------------------------------------------------------------------------- /app-portage/lto-rebuild/lto-rebuild-0.9.8-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2020 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | DESCRIPTION="Avoid a full system rebuild when using GentooLTO" 7 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 8 | 9 | LICENSE="GPL-2+" 10 | SLOT="0" 11 | KEYWORDS="~amd64 ~arm64 ~x86" 12 | 13 | RDEPEND="app-portage/portage-utils" 14 | 15 | S="${WORKDIR}" 16 | 17 | src_install() { 18 | dobin "${FILESDIR}/lto-rebuild" 19 | } 20 | -------------------------------------------------------------------------------- /app-portage/lto-rebuild/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | lookatyouhacker@gmail.com 6 | Shane Peelar 7 | 8 | 9 | lto-rebuild eases transitions to newer GCC versions when using GentooLTO. It rebuilds any packages built using different GCCs that have installed static libraries, preventing linker errors later on. 10 | 11 | 12 | -------------------------------------------------------------------------------- /dev-lang/python/Manifest: -------------------------------------------------------------------------------- 1 | DIST Python-2.7.18.tar.xz 12854736 BLAKE2B 060a621c91dd8e3d321aec99d44c17aa67381998256a1a002d316b38288349884d5960de35c49352d03129ed0bae599e641ec2225898158ebce50a7a2fd74d2c SHA512 a7bb62b51f48ff0b6df0b18f5b0312a523e3110f49c3237936bfe56ed0e26838c0274ff5401bda6fc21bf24337477ccac49e8026c5d651e4b4cafb5eb5086f6c 2 | DIST Python-2.7.18.tar.xz.asc 833 BLAKE2B 1d98770e46171971fb99994508d238c01d2755281d2f94353314014d9e83e0ec5f0b3e3950ea1fdf5fce9ba6b8f55312355845c2a3fc4291c27ee56fe6215448 SHA512 c2a5f5a52f47dec52460ad3275758d4e5de6e7075c3def4353c988d74d563a39b42cae2d5eb24e2a23a6247cef69100f91620b11a49c2359fbf99b203c9cbda8 3 | DIST Python-3.10.0b3.tar.xz 18640292 BLAKE2B 29af2d0e042714d6cfed08f6ecc5846dded1bec9a3efce01cca740e7dbfb036c06389ba638cd984410613067021bdd4291cb8f1fda353ed21444ee4dc4404a89 SHA512 ef0dc5eddb5f9702ab88faa2827455347caa81ab6c03192d6e37c968a40c53ab485d5c923905c511d19bc35e10129aa302f6733e0a7d296da8f725367dd1b258 4 | DIST Python-3.10.0b3.tar.xz.asc 833 BLAKE2B 8978db8f2443e4a9d8f8997b64a731f7d8d5cdc9028dfc8812c3363298777aa227d9dd896a518e08f2793fbcc93a71bac4b422277b3ecd2ee4210b03e665385f SHA512 6b8d2caf753f0d92019e18d1441e323a44aff06ee8bdc272572a67359dc4bece833db56b9318c91962d39ee4d09bf701b548d71ae02c4b64f3c21f1c23ed1d36 5 | DIST Python-3.6.14.tar.xz 17218148 BLAKE2B efe655cb907ffa678ca135f88ba9d867e523969ad82dbc09ffb6d8d383824a4b43c525e156a3c35484a526b4b3ea755109e5ef15d17852d44e3351c307fc5e91 SHA512 15b82b7285db97cb27a6fcd57ce9e258fdf8dbdb2f00e22e4331161b8557c8244342546c4143e84c72730759e0276770396b6ca5bb7cf87310cca8e175423006 6 | DIST Python-3.6.14.tar.xz.asc 833 BLAKE2B 81c79dca5728b21b8c2badcaa1242836f1cf13984bb755463cfe9e4fd96a02ebf31f1a9239759a937c6d6a04c18bfc682a82cb0ab2e5a473de153423a7248c9c SHA512 600bf504f2c0d3ce7d1e8e953b4f27a7a7c996b7b9cd70efb876178fa5424130bff5414d5ac7deb8b45103ed417fd40d830613db39750d35a0c967c8fdfea50d 7 | DIST Python-3.7.11.tar.xz 17393380 BLAKE2B 6394d69935950366da7c4cecd4816d76254170d5313adeb4de9edddae13bda7dea373308517c2abe00cb7eeea8eb428619124feed8df858f9bb904bd423e96d6 SHA512 b8d8c6958444ee9bdd59f0804f7e61d9657c0805c7c58c3352d1c1efb33ba2be8d3485cd2656a2b2b99618a439879687a918f57dfdd125e989af637043600a59 8 | DIST Python-3.7.11.tar.xz.asc 833 BLAKE2B 8af6b3e58b607a34c91f57af2fbe9c3f3c7cb6fa5e435e963edd7edcf7649e70c3a76bd346ff8ef1b3c890d8a92d3b2fed27ee01b512c579ff8ce80be61274fb SHA512 f19db95e88c9269174a2b4ac4d8c68fa7ed666b6698af26d2da202e30d145686e8679be763eecba9f8a0c34a207639724094463cffce659c3855ed4b133b0a59 9 | DIST Python-3.8.11.tar.xz 18437648 BLAKE2B 957c553ced3387d19c1d1baf2eea7d41e9abfbf398c4514f475eadae29336dc02dbd2cdf7b90ab5fee1e49c083a366c113dcd73149445b663fcdf81a3b2b04f6 SHA512 c8c17491b05d83a9f8940474019034780a6b1ff4148654cd62c8f708c539718a0312cf0665efa2b8c42ed773f4306080bd105701a211ed56e6cab40837d5b2df 10 | DIST Python-3.8.11.tar.xz.asc 833 BLAKE2B 52239149331a6529351714db10b5f6b2a37e9a9ce13470e0ab8ae4bf439544878df095995bdc28a534d55039a539c400f532aec8fb7d9b9ce7132167f0e39529 SHA512 40381e83a1bef996333d5044a361ce441c4631725457f8382588e9a86f586a9539ee139b8398aff3d988a317041fa87476f29cf6fcd2b31fe0e9b4cd21ede68a 11 | DIST Python-3.9.6.tar.xz 19051972 BLAKE2B 0d8586b2935088eeab7138cf2210c1a74f1bf7359359d25750af5f69de55eb39c92f518b887a8b749c772ed7d33e85b912928ae6d878514eb58d85ef210f54f0 SHA512 01c529e3207738d8771caeb5ed6217e10745c21aa39832fe3185e1c87fdb6aedead97ce38dbb11e02d873654028bd8071c3f345c18452769520723284efe9dc1 12 | DIST Python-3.9.6.tar.xz.asc 833 BLAKE2B 41901bfb80a901f2f14e86769e6d08ded8f75656d347201345183162e180e61442da871a1067572a54da579551166a19bf5436e51581bb10cb78afc4d28773fc SHA512 0673c8833f302c829bfde97453c52744f6aa99b4a72520f4cc384d4aa9d6ffd28a1407ceafb0a1ec4462b3aa74b656bf39c67872c4e6a131429ea58c47ad0ecc 13 | DIST python-gentoo-patches-2.7.18_p11.tar.xz 31340 BLAKE2B bdc097b971ab8ec0b60f944002af34f3fff6b681c43515a4fec2fcac1a2c731bf4fcfae2178463103911e2f8cd6bc84d3b56cd0ad61da5c8276278ec9b85a242 SHA512 2a2388c4543267bfb0167f963a22f5141442c9347d9a8806ad6917843e6958d47c8f1933244651c870101b21408c920408fe056efb7a148117c24ab391151d88 14 | DIST python-gentoo-patches-3.10.0b3.tar.xz 8112 BLAKE2B c6a0517323c5c0d8af998915ccb675a51df19893b9252f9ad195b62f8988fa65ca73894fc8089c37a44f22976f57c49c24c0bf9469b1edb6c3422c4a7be832d8 SHA512 fbc770430259ff482c0a4b89859e2a747fde0f34037829f9cc5a2972345d0b073612db7ef84f382248902e0f9e203f8d8dc07165942356b01f48b23dd4412f64 15 | DIST python-gentoo-patches-3.6.14.tar.xz 14744 BLAKE2B b9482f9d2b7ada60eff9a5672ed21556c00b473a7cfdb543dce8253fb0ff1539e635a35569478c496012ecde4eef78a257da28f7a80bff99da10249708262229 SHA512 246f83911c8e52ea83a9bf453faa0bc0ea0c29bbf3b666a938e3790c6147f71e617ff9cb27501c5f0b89172eb9e7819e3f2ef0a5bae271cc938d2c0c2b93f7ae 16 | DIST python-gentoo-patches-3.7.11.tar.xz 16708 BLAKE2B 4f74b38f400c20b4112f080447021e7140704b282d6369a1479886740d12a17e7818b52a382a4b115238847bb08df0260b092b6ead491623b869c3d3a56f4cc2 SHA512 b96d7af8c9f7fb4b246a8b66e6440336a7d123678d990dd259d7ffb87d79ce74295ff350e220fee38d1b12f1ca94533899c2d2ce700391b3eac907722a79bba6 17 | DIST python-gentoo-patches-3.8.11.tar.xz 16932 BLAKE2B aaa1df33997f4077916fb7cca2ec3a2b2ac1c0ead3db7c638a5152a82cfaaf5fc2768a10ac7235c417e25b2b735c53628ec096878f08eef0d211b03f4747103c SHA512 d2639b95c5a32f7145f92e52a94aec7c63f3ed4a66036ff73f052ff6836742d1e1dd7180f8634b65b4a44a10bf336092695bcc2230a7fd8be35bae870ed64b08 18 | DIST python-gentoo-patches-3.9.6.tar.xz 12432 BLAKE2B f63f39b4667eeb214312aa22142c728a1123e88f49c6de09d15e88434e9d630c5e0e588112d77c5cf1f5f25d0224e4fbf0c370488a908e9015f168d9f85e9eb5 SHA512 3e842fcd8574a7f026e401d725febb2815b2b7ac0a89b952a340c7974b911e81286b542d3de56fe5750296f2ab680415b54b8c35f219975af10354cddb1f257a 19 | -------------------------------------------------------------------------------- /dev-lang/python/files/clearlinux-pkgs/python-3.7.5-0001-test_socket.py-remove-testPeek-test.test_socket.RDST.patch: -------------------------------------------------------------------------------- 1 | From 4ccbba674472dcca104fe660c0cd3dd23b6dd66d Mon Sep 17 00:00:00 2001 2 | From: Juro Bystricky 3 | Date: Thu, 3 Oct 2019 10:46:00 -0700 4 | Subject: [PATCH] test_socket.py: remove testPeek (test.test_socket.RDSTest) 5 | 6 | This test suffers from a race condition and hangs frequently. 7 | https://bugs.python.org/issue35247 8 | 9 | Signed-off-by: Juro Bystricky 10 | --- 11 | Lib/test/test_socket.py | 10 ---------- 12 | 1 file changed, 10 deletions(-) 13 | 14 | diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py 15 | index 43929b355e..bcf8be854b 100644 16 | --- a/Lib/test/test_socket.py 17 | +++ b/Lib/test/test_socket.py 18 | @@ -2011,16 +2011,6 @@ class RDSTest(ThreadedRDSSocketTest): 19 | self.data = b'spam' 20 | self.cli.sendto(self.data, 0, (HOST, self.port)) 21 | 22 | - def testPeek(self): 23 | - data, addr = self.serv.recvfrom(self.bufsize, socket.MSG_PEEK) 24 | - self.assertEqual(self.data, data) 25 | - data, addr = self.serv.recvfrom(self.bufsize) 26 | - self.assertEqual(self.data, data) 27 | - 28 | - def _testPeek(self): 29 | - self.data = b'spam' 30 | - self.cli.sendto(self.data, 0, (HOST, self.port)) 31 | - 32 | @requireAttrs(socket.socket, 'recvmsg') 33 | def testSendAndRecvMsg(self): 34 | data, ancdata, msg_flags, addr = self.serv.recvmsg(self.bufsize) 35 | -- 36 | 2.23.0 37 | 38 | -------------------------------------------------------------------------------- /dev-lang/python/files/clearlinux-pkgs/python-3.7.5-fix-regrtest-hang.patch: -------------------------------------------------------------------------------- 1 | Patch pulled from the `3.7` branch, which will be incorporated into a 2 | future 3.7.6 release: 3 | https://github.com/python/cpython/commit/598bfa4d45 4 | 5 | An equivalent change already landed for 3.8.0, so drop it when moving to 6 | the 3.8 series. 7 | https://github.com/python/cpython/commit/359a1975cb 8 | 9 | 10 | From 598bfa4d457d61431142ad99ecbb9bd10cf314e6 Mon Sep 17 00:00:00 2001 11 | From: "Miss Islington (bot)" 12 | <31488909+miss-islington@users.noreply.github.com> 13 | Date: Wed, 9 Oct 2019 06:52:34 -0700 14 | Subject: [PATCH] bpo-37531: regrtest ignores output on timeout (GH-16659) 15 | 16 | bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call 17 | `popen.communicate() again: it can hang until all child processes 18 | using stdout and stderr pipes completes. Kill the worker process and 19 | ignores its output. 20 | 21 | Reenable test_regrtest.test_multiprocessing_timeout(). 22 | 23 | bpo-37531: Change also the faulthandler timeout of the main process 24 | from 1 minute to 5 minutes, for Python slowest buildbots. 25 | (cherry picked from commit 0ec618af98ac250a91ee9c91f8569e6df6772758) 26 | 27 | Co-authored-by: Victor Stinner 28 | --- 29 | Lib/test/libregrtest/runtest_mp.py | 64 +++++++++++-------- 30 | .../2019-10-08-16-42-05.bpo-37531.7v-_Ca.rst | 5 ++ 31 | 2 files changed, 42 insertions(+), 27 deletions(-) 32 | create mode 100644 Misc/NEWS.d/next/Tests/2019-10-08-16-42-05.bpo-37531.7v-_Ca.rst 33 | 34 | diff --git a/Lib/test/libregrtest/runtest_mp.py b/Lib/test/libregrtest/runtest_mp.py 35 | index 9d5a699852b9c..2770cf93bd7d8 100644 36 | --- a/Lib/test/libregrtest/runtest_mp.py 37 | +++ b/Lib/test/libregrtest/runtest_mp.py 38 | @@ -22,6 +22,12 @@ 39 | PROGRESS_UPDATE = 30.0 # seconds 40 | assert PROGRESS_UPDATE >= PROGRESS_MIN_TIME 41 | 42 | +# Kill the main process after 5 minutes. It is supposed to write an update 43 | +# every PROGRESS_UPDATE seconds. Tolerate 5 minutes for Python slowest 44 | +# buildbot workers. 45 | +MAIN_PROCESS_TIMEOUT = 5 * 60.0 46 | +assert MAIN_PROCESS_TIMEOUT >= PROGRESS_UPDATE 47 | + 48 | # Time to wait until a worker completes: should be immediate 49 | JOIN_TIMEOUT = 30.0 # seconds 50 | 51 | @@ -159,20 +165,6 @@ def mp_result_error(self, test_name, error_type, stdout='', stderr='', 52 | result = TestResult(test_name, error_type, test_time, None) 53 | return MultiprocessResult(result, stdout, stderr, err_msg) 54 | 55 | - def _timedout(self, test_name): 56 | - self._kill() 57 | - 58 | - stdout = stderr = '' 59 | - popen = self._popen 60 | - try: 61 | - stdout, stderr = popen.communicate(timeout=JOIN_TIMEOUT) 62 | - except (subprocess.TimeoutExpired, OSError) as exc: 63 | - print_warning(f"Failed to read {self} output " 64 | - f"(timeout={format_duration(JOIN_TIMEOUT)}): " 65 | - f"{exc!r}") 66 | - 67 | - return self.mp_result_error(test_name, TIMEOUT, stdout, stderr) 68 | - 69 | def _run_process(self, test_name): 70 | self.start_time = time.monotonic() 71 | 72 | @@ -195,23 +187,32 @@ def _run_process(self, test_name): 73 | 74 | try: 75 | stdout, stderr = popen.communicate(timeout=self.timeout) 76 | + retcode = popen.returncode 77 | + assert retcode is not None 78 | except subprocess.TimeoutExpired: 79 | if self._stopped: 80 | # kill() has been called: communicate() fails 81 | # on reading closed stdout/stderr 82 | raise ExitThread 83 | 84 | - return self._timedout(test_name) 85 | + # On timeout, kill the process 86 | + self._kill() 87 | + 88 | + # None means TIMEOUT for the caller 89 | + retcode = None 90 | + # bpo-38207: Don't attempt to call communicate() again: on it 91 | + # can hang until all child processes using stdout and stderr 92 | + # pipes completes. 93 | + stdout = stderr = '' 94 | except OSError: 95 | if self._stopped: 96 | # kill() has been called: communicate() fails 97 | # on reading closed stdout/stderr 98 | raise ExitThread 99 | raise 100 | - 101 | - retcode = popen.returncode 102 | - stdout = stdout.strip() 103 | - stderr = stderr.rstrip() 104 | + else: 105 | + stdout = stdout.strip() 106 | + stderr = stderr.rstrip() 107 | 108 | return (retcode, stdout, stderr) 109 | except: 110 | @@ -223,13 +224,10 @@ def _run_process(self, test_name): 111 | self.current_test_name = None 112 | 113 | def _runtest(self, test_name): 114 | - result = self._run_process(test_name) 115 | - 116 | - if isinstance(result, MultiprocessResult): 117 | - # _timedout() case 118 | - return result 119 | + retcode, stdout, stderr = self._run_process(test_name) 120 | 121 | - retcode, stdout, stderr = result 122 | + if retcode is None: 123 | + return self.mp_result_error(test_name, TIMEOUT, stdout, stderr) 124 | 125 | err_msg = None 126 | if retcode != 0: 127 | @@ -248,7 +246,8 @@ def _runtest(self, test_name): 128 | err_msg = "Failed to parse worker JSON: %s" % exc 129 | 130 | if err_msg is not None: 131 | - return self.mp_result_error(test_name, CHILD_ERROR, stdout, stderr, err_msg) 132 | + return self.mp_result_error(test_name, CHILD_ERROR, 133 | + stdout, stderr, err_msg) 134 | 135 | return MultiprocessResult(result, stdout, stderr, err_msg) 136 | 137 | @@ -287,6 +286,16 @@ def _wait_completed(self): 138 | f"{exc!r}") 139 | 140 | def wait_stopped(self, start_time): 141 | + # bpo-38207: MultiprocessTestRunner.stop_workers() called self.stop() 142 | + # which killed the process. Sometimes, killing the process from the 143 | + # main thread does not interrupt popen.communicate() in 144 | + # TestWorkerProcess thread. This loop with a timeout is a workaround 145 | + # for that. 146 | + # 147 | + # Moreover, if this method fails to join the thread, it is likely 148 | + # that Python will hang at exit while calling threading._shutdown() 149 | + # which tries again to join the blocked thread. Regrtest.main() 150 | + # uses EXIT_TIMEOUT to workaround this second bug. 151 | while True: 152 | # Write a message every second 153 | self.join(1.0) 154 | @@ -353,7 +362,8 @@ def _get_result(self): 155 | timeout = PROGRESS_UPDATE 156 | while True: 157 | if use_faulthandler: 158 | - faulthandler.dump_traceback_later(timeout * 2.0, exit=True) 159 | + faulthandler.dump_traceback_later(MAIN_PROCESS_TIMEOUT, 160 | + exit=True) 161 | 162 | # wait for a thread 163 | try: 164 | diff --git a/Misc/NEWS.d/next/Tests/2019-10-08-16-42-05.bpo-37531.7v-_Ca.rst b/Misc/NEWS.d/next/Tests/2019-10-08-16-42-05.bpo-37531.7v-_Ca.rst 165 | new file mode 100644 166 | index 0000000000000..78ab636516514 167 | --- /dev/null 168 | +++ b/Misc/NEWS.d/next/Tests/2019-10-08-16-42-05.bpo-37531.7v-_Ca.rst 169 | @@ -0,0 +1,5 @@ 170 | +On timeout, regrtest no longer attempts to call ``popen.communicate()`` 171 | +again: it can hang until all child processes using stdout and stderr pipes 172 | +completes. Kill the worker process and ignores its output. Change also the 173 | +faulthandler timeout of the main process from 1 minute to 5 minutes, for Python 174 | +slowest buildbots. 175 | -------------------------------------------------------------------------------- /dev-lang/python/files/pydoc.conf: -------------------------------------------------------------------------------- 1 | # /etc/init.d/pydoc.conf 2 | 3 | # This file contains the configuration for pydoc's internal webserver. 4 | 5 | # Default port for Python's pydoc server. 6 | @PYDOC_PORT_VARIABLE@="7464" 7 | -------------------------------------------------------------------------------- /dev-lang/python/files/pydoc.init: -------------------------------------------------------------------------------- 1 | #!/sbin/openrc-run 2 | # Copyright 1999-2016 Gentoo Foundation 3 | # Distributed under the terms of the GNU General Public Licence v2 4 | 5 | start() { 6 | local pydoc_port="${@PYDOC_PORT_VARIABLE@-${PYDOC_PORT}}" 7 | 8 | if [ -z "${pydoc_port}" ]; then 9 | eerror "Port not set" 10 | return 1 11 | fi 12 | 13 | ebegin "Starting pydoc server on port ${pydoc_port}" 14 | start-stop-daemon --start --background --make-pidfile \ 15 | --pidfile /var/run/@PYDOC@.pid \ 16 | --exec /usr/bin/@PYDOC@ -- -p "${pydoc_port}" 17 | eend $? 18 | } 19 | 20 | stop() { 21 | ebegin "Stopping pydoc server" 22 | start-stop-daemon --stop --quiet --pidfile /var/run/@PYDOC@.pid 23 | eend $? 24 | } 25 | -------------------------------------------------------------------------------- /dev-lang/python/files/python-2.7.15-PGO-r1.patch: -------------------------------------------------------------------------------- 1 | diff -ur Python-2.7.16.orig/Lib/distutils/ccompiler.py Python-2.7.16/Lib/distutils/ccompiler.py 2 | --- Python-2.7.16.orig/Lib/distutils/ccompiler.py 2019-03-02 19:17:42.000000000 +0100 3 | +++ Python-2.7.16/Lib/distutils/ccompiler.py 2019-03-09 16:30:09.036803900 +0100 4 | @@ -14,7 +14,7 @@ 5 | from distutils.spawn import spawn 6 | from distutils.file_util import move_file 7 | from distutils.dir_util import mkpath 8 | -from distutils.dep_util import newer_group 9 | +from distutils.dep_util import newer_group, newer 10 | from distutils.util import split_quoted, execute 11 | from distutils import log 12 | # following import is for backward compatibility 13 | @@ -571,7 +571,9 @@ 14 | src, ext = build[obj] 15 | except KeyError: 16 | continue 17 | - self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) 18 | + if newer(src, obj): 19 | + # some extensions share source files so we need to avoid compiling the same source multiple times 20 | + self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts) 21 | 22 | # Return *all* object filenames, not just the ones we just built. 23 | return objects 24 | diff -ur Python-2.7.16.orig/Lib/distutils/dep_util.py Python-2.7.16/Lib/distutils/dep_util.py 25 | --- Python-2.7.16.orig/Lib/distutils/dep_util.py 2019-03-02 19:17:42.000000000 +0100 26 | +++ Python-2.7.16/Lib/distutils/dep_util.py 2019-03-09 16:30:09.036803900 +0100 27 | @@ -11,7 +11,7 @@ 28 | from distutils.errors import DistutilsFileError 29 | 30 | def newer(source, target): 31 | - """Tells if the target is newer than the source. 32 | + """Tells if the source is newer than the target. 33 | 34 | Return true if 'source' exists and is more recently modified than 35 | 'target', or if 'source' exists and 'target' doesn't. 36 | diff -ur Python-2.7.16.orig/Makefile.pre.in Python-2.7.16/Makefile.pre.in 37 | --- Python-2.7.16.orig/Makefile.pre.in 2019-03-09 16:29:29.004188933 +0100 38 | +++ Python-2.7.16/Makefile.pre.in 2019-03-09 16:33:30.788823762 +0100 39 | @@ -209,9 +209,9 @@ 40 | TCLTK_LIBS= @TCLTK_LIBS@ 41 | 42 | # The task to run while instrument when building the profile-opt target 43 | -# We exclude unittests with -x that take a rediculious amount of time to 44 | -# run in the instrumented training build or do not provide much value. 45 | -PROFILE_TASK=-m test.regrtest --pgo -x test_asyncore test_gdb test_multiprocessing test_subprocess 46 | +# We exclude unittests with -x that take a ridiculous amount of time to 47 | +# run in the instrumented training build or do not provide much value 48 | +PROFILE_TASK=-m test.regrtest --pgo $(EXTRATESTOPTS) -x test_asyncore test_gdb test_multiprocessing test_subprocess test_xpickle 49 | 50 | # report files for gcov / lcov coverage report 51 | COVERAGE_INFO= $(abs_builddir)/coverage.info 52 | @@ -437,7 +437,7 @@ 53 | 54 | run_profile_task: 55 | : # FIXME: can't run for a cross build 56 | - $(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true 57 | + $(LLVM_PROF_FILE) _PYTHONNOSITEPACKAGES=1 $(RUNSHARED) ./$(BUILDPYTHON) -E $(PROFILE_TASK) || true # allow failures here 58 | 59 | build_all_merge_profile: 60 | $(LLVM_PROF_MERGER) 61 | diff -ur Python-2.7.16.orig/setup.py Python-2.7.16/setup.py 62 | --- Python-2.7.16.orig/setup.py 2019-03-09 16:29:29.028188103 +0100 63 | +++ Python-2.7.16/setup.py 2019-03-09 16:30:09.037803866 +0100 64 | @@ -269,11 +269,13 @@ 65 | # those environment variables passed into the setup.py phase. Here's 66 | # a small set of useful ones. 67 | compiler = os.environ.get('CC') 68 | + # it's important to get CFLAGS from the environment for proper extension PGO support 69 | + cflags = os.environ.get('CFLAGS', sysconfig.get_config_vars('CFLAGS')[0]) 70 | args = {} 71 | # unfortunately, distutils doesn't let us provide separate C and C++ 72 | # compilers 73 | if compiler is not None: 74 | - (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') 75 | + (ccshared,) = sysconfig.get_config_vars('CCSHARED') 76 | args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags 77 | self.compiler.set_executables(**args) 78 | 79 | -------------------------------------------------------------------------------- /dev-lang/python/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | python@gentoo.org 6 | Python 7 | 8 | 9 | Build with link-time optimizations (LTO) 10 | Build with profile guided optimizations (PGO) 11 | Enable threading support. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING) 12 | Enable wide Unicode implementation which uses 4-byte Unicode characters. Switching of this USE flag changes ABI of Python and requires reinstallation of many Python modules. (DON'T DISABLE THIS UNLESS YOU KNOW WHAT YOU'RE DOING) 13 | Install Windows executables required to create an executable installer for MS Windows. 14 | 15 | 16 | -------------------------------------------------------------------------------- /dev-lang/python/profile.patch: -------------------------------------------------------------------------------- 1 | diff --git a/dev-lang/python/python-2.7.14.ebuild b/dev-lang/python/python-2.7.14.ebuild 2 | index f44a2137ff3..a1270aeb55b 100644 3 | --- a/dev-lang/python/python-2.7.14.ebuild 4 | +++ b/dev-lang/python/python-2.7.14.ebuild 5 | @@ -213,7 +213,7 @@ src_compile() { 6 | touch Include/graminit.h Python/graminit.c 7 | 8 | cd "${BUILD_DIR}" || die 9 | - emake 10 | + emake profile-opt PROFILE_TASK="-m test.regrtest -w -uall,-audio -x test_gdb test_multiprocessing" 11 | 12 | # Work around bug 329499. See also bug 413751 and 457194. 13 | if has_version dev-libs/libffi[pax_kernel]; then 14 | diff --git a/dev-lang/python/python-3.5.4.ebuild b/dev-lang/python/python-3.5.4.ebuild 15 | index f4ff5b8cc75..a3dca3b6e86 100644 16 | --- a/dev-lang/python/python-3.5.4.ebuild 17 | +++ b/dev-lang/python/python-3.5.4.ebuild 18 | @@ -175,7 +175,7 @@ src_compile() { 19 | 20 | cd "${BUILD_DIR}" || die 21 | 22 | - emake CPPFLAGS= CFLAGS= LDFLAGS= 23 | + emake profile-opt PROFILE_TASK="-m test.regrtest -w -uall,-audio -x test_gdb test_multiprocessing test_subprocess test_tokenize test_signal test_faulthandler" 24 | 25 | # Work around bug 329499. See also bug 413751 and 457194. 26 | if has_version dev-libs/libffi[pax_kernel]; then 27 | diff --git a/dev-lang/python/python-3.6.3.ebuild b/dev-lang/python/python-3.6.3.ebuild 28 | index 4cf258819ee..4ae90dcf92c 100644 29 | --- a/dev-lang/python/python-3.6.3.ebuild 30 | +++ b/dev-lang/python/python-3.6.3.ebuild 31 | @@ -159,7 +159,7 @@ src_compile() { 32 | # https://bugs.gentoo.org/594768 33 | local -x LC_ALL=C 34 | 35 | - emake CPPFLAGS= CFLAGS= LDFLAGS= 36 | + emake profile-opt PROFILE_TASK="-m test.regrtest -w -uall,-audio -x test_gdb test_multiprocessing test_subprocess test_tokenize test_signal test_faulthandler" 37 | 38 | # Work around bug 329499. See also bug 413751 and 457194. 39 | if has_version dev-libs/libffi[pax_kernel]; then 40 | -------------------------------------------------------------------------------- /dev-lang/python/python-2.7.18_p11-r100.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI="7" 5 | WANT_LIBTOOL="none" 6 | 7 | inherit autotools flag-o-matic pax-utils \ 8 | python-utils-r1 toolchain-funcs verify-sig 9 | 10 | MY_P="Python-${PV%_p*}" 11 | PYVER=$(ver_cut 1-2) 12 | PATCHSET="python-gentoo-patches-${PV}" 13 | 14 | DESCRIPTION="An interpreted, interactive, object-oriented programming language" 15 | HOMEPAGE="https://www.python.org/" 16 | SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz 17 | https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz 18 | verify-sig? ( 19 | https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc 20 | )" 21 | S="${WORKDIR}/${MY_P}" 22 | 23 | LICENSE="PSF-2" 24 | SLOT="${PYVER}" 25 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 26 | IUSE="berkdb bluetooth build elibc_uclibc examples gdbm hardened ipv6 +lto +ncurses +pgo +readline +sqlite +ssl +threads tk +wide-unicode wininst +xml" 27 | 28 | # Do not add a dependency on dev-lang/python to this ebuild. 29 | # If you need to apply a patch which requires python for bootstrapping, please 30 | # run the bootstrap code on your dev box and include the results in the 31 | # patchset. See bug 447752. 32 | 33 | RDEPEND="app-arch/bzip2:= 34 | dev-libs/libffi:= 35 | >=sys-libs/zlib-1.1.3:= 36 | virtual/libcrypt:= 37 | virtual/libintl 38 | berkdb? ( || ( 39 | sys-libs/db:5.3 40 | sys-libs/db:5.1 41 | sys-libs/db:4.8 42 | sys-libs/db:4.7 43 | sys-libs/db:4.6 44 | sys-libs/db:4.5 45 | sys-libs/db:4.4 46 | sys-libs/db:4.3 47 | sys-libs/db:4.2 48 | ) ) 49 | gdbm? ( sys-libs/gdbm:=[berkdb] ) 50 | ncurses? ( >=sys-libs/ncurses-5.2:= ) 51 | readline? ( >=sys-libs/readline-4.1:= ) 52 | sqlite? ( >=dev-db/sqlite-3.3.8:3= ) 53 | ssl? ( dev-libs/openssl:= ) 54 | tk? ( 55 | >=dev-lang/tcl-8.0:= 56 | >=dev-lang/tk-8.0:= 57 | dev-tcltk/blt:= 58 | dev-tcltk/tix 59 | ) 60 | xml? ( >=dev-libs/expat-2.1:= )" 61 | # bluetooth requires headers from bluez 62 | DEPEND="${RDEPEND} 63 | bluetooth? ( net-wireless/bluez )" 64 | BDEPEND=" 65 | virtual/pkgconfig 66 | verify-sig? ( app-crypt/openpgp-keys-python ) 67 | !sys-devel/gcc[libffi(-)]" 68 | PDEPEND="app-eselect/eselect-python" 69 | RDEPEND+=" 70 | !build? ( app-misc/mime-types ) 71 | !<=dev-lang/python-exec-2.4.6-r1" 72 | 73 | VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc 74 | 75 | pkg_setup() { 76 | if use berkdb; then 77 | ewarn "'bsddb' module is out-of-date and no longer maintained inside" 78 | ewarn "dev-lang/python. 'bsddb' and 'dbhash' modules have been additionally" 79 | ewarn "removed in Python 3. A maintained alternative of 'bsddb3' module" 80 | ewarn "is provided by dev-python/bsddb3." 81 | else 82 | if has_version "=${CATEGORY}/${PN}-${PV%%.*}*[berkdb]"; then 83 | ewarn "You are migrating from =${CATEGORY}/${PN}-${PV%%.*}*[berkdb]" 84 | ewarn "to =${CATEGORY}/${PN}-${PV%%.*}*[-berkdb]." 85 | ewarn "You might need to migrate your databases." 86 | fi 87 | fi 88 | } 89 | 90 | src_unpack() { 91 | if use verify-sig; then 92 | verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} 93 | fi 94 | default 95 | } 96 | 97 | src_prepare() { 98 | # Ensure that internal copies of expat, libffi and zlib are not used. 99 | rm -fr Modules/expat || die 100 | rm -fr Modules/_ctypes/libffi* || die 101 | rm -fr Modules/zlib || die 102 | 103 | local PATCHES=( 104 | "${WORKDIR}/${PATCHSET}" 105 | ) 106 | 107 | default 108 | 109 | sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ 110 | Lib/distutils/command/install.py \ 111 | Lib/distutils/sysconfig.py \ 112 | Lib/site.py \ 113 | Lib/sysconfig.py \ 114 | Lib/test/test_site.py \ 115 | Makefile.pre.in \ 116 | Modules/Setup.dist \ 117 | Modules/getpath.c \ 118 | setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" 119 | 120 | sed -i 's/test_subprocess$/test_subprocess test_distutils/' Makefile.pre.in || die 121 | 122 | eautoreconf 123 | } 124 | 125 | src_configure() { 126 | # dbm module can be linked against berkdb or gdbm. 127 | # Defaults to gdbm when both are enabled, #204343. 128 | local disable 129 | use berkdb || use gdbm || disable+=" dbm" 130 | use berkdb || disable+=" _bsddb" 131 | # disable automagic bluetooth headers detection 132 | use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no 133 | use gdbm || disable+=" gdbm" 134 | use ncurses || disable+=" _curses _curses_panel" 135 | use readline || disable+=" readline" 136 | use sqlite || disable+=" _sqlite3" 137 | use ssl || export PYTHON_DISABLE_SSL="1" 138 | use tk || disable+=" _tkinter" 139 | use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. 140 | export PYTHON_DISABLE_MODULES="${disable}" 141 | 142 | if ! use xml; then 143 | ewarn "You have configured Python without XML support." 144 | ewarn "This is NOT a recommended configuration as you" 145 | ewarn "may face problems parsing any XML documents." 146 | fi 147 | 148 | if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then 149 | einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" 150 | fi 151 | 152 | if [[ "$(gcc-major-version)" -ge 4 ]]; then 153 | append-flags -fwrapv 154 | fi 155 | 156 | filter-flags -malign-double 157 | 158 | # https://bugs.gentoo.org/show_bug.cgi?id=50309 159 | if is-flagq -O3; then 160 | is-flagq -fstack-protector-all && replace-flags -O3 -O2 161 | use hardened && replace-flags -O3 -O2 162 | fi 163 | 164 | if tc-is-cross-compiler; then 165 | # Force some tests that try to poke fs paths. 166 | export ac_cv_file__dev_ptc=no 167 | export ac_cv_file__dev_ptmx=yes 168 | fi 169 | 170 | # Export CXX so it ends up in /usr/lib/python2.X/config/Makefile. 171 | tc-export CXX 172 | # The configure script fails to use pkg-config correctly. 173 | # http://bugs.python.org/issue15506 174 | export ac_cv_path_PKG_CONFIG=$(tc-getPKG_CONFIG) 175 | 176 | local dbmliborder 177 | if use gdbm; then 178 | dbmliborder+="${dbmliborder:+:}gdbm" 179 | fi 180 | if use berkdb; then 181 | dbmliborder+="${dbmliborder:+:}bdb" 182 | fi 183 | 184 | local myeconfargs=( 185 | # The check is broken on clang, and gives false positive: 186 | # https://bugs.gentoo.org/596798 187 | # (upstream dropped this flag in 3.2a4 anyway) 188 | ac_cv_opt_olimit_ok=no 189 | # glibc-2.30 removes it; since we can't cleanly force-rebuild 190 | # Python on glibc upgrade, remove it proactively to give 191 | # a chance for users rebuilding python before glibc 192 | ac_cv_header_stropts_h=no 193 | 194 | --with-fpectl 195 | --enable-shared 196 | $(use_enable ipv6) 197 | $(use_with threads) 198 | $(use wide-unicode && echo "--enable-unicode=ucs4" || echo "--enable-unicode=ucs2") 199 | $(use_enable pgo optimizations) 200 | $(use_with lto) 201 | --infodir='${prefix}/share/info' 202 | --mandir='${prefix}/share/man' 203 | --with-computed-gotos 204 | --with-dbmliborder="${dbmliborder}" 205 | --with-libc= 206 | --enable-loadable-sqlite-extensions 207 | --with-system-expat 208 | --with-system-ffi 209 | --without-ensurepip 210 | ) 211 | 212 | OPT="" econf "${myeconfargs[@]}" 213 | 214 | if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then 215 | eerror "configure has detected that the sem_open function is broken." 216 | eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." 217 | die "Broken sem_open function (bug 496328)" 218 | fi 219 | } 220 | 221 | src_compile() { 222 | # Ensure sed works as expected 223 | # https://bugs.gentoo.org/594768 224 | local -x LC_ALL=C 225 | 226 | if use pgo; then 227 | # disable distcc and ccache 228 | export DISTCC_HOSTS="" 229 | export CCACHE_DISABLE=1 230 | fi 231 | 232 | # Avoid invoking pgen for cross-compiles. 233 | touch Include/graminit.h Python/graminit.c 234 | 235 | # extract the number of parallel jobs in MAKEOPTS 236 | echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null 237 | if [ $? -eq 0 ]; then 238 | par_arg="-j$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')" 239 | else 240 | par_arg="" 241 | fi 242 | export par_arg 243 | 244 | emake EXTRATESTOPTS="${par_arg} -uall,-audio -x test_distutils" 245 | 246 | # Work around bug 329499. See also bug 413751 and 457194. 247 | if has_version dev-libs/libffi[pax_kernel]; then 248 | pax-mark E python 249 | else 250 | pax-mark m python 251 | fi 252 | } 253 | 254 | src_test() { 255 | # Tests will not work when cross compiling. 256 | if tc-is-cross-compiler; then 257 | elog "Disabling tests due to crosscompiling." 258 | return 259 | fi 260 | 261 | # Skip failing tests. 262 | local skipped_tests="distutils gdb curses xpickle bdb runpy test_support" 263 | 264 | for test in ${skipped_tests}; do 265 | mv "${S}"/Lib/test/test_${test}.py "${T}" 266 | done 267 | 268 | # bug 660358 269 | local -x COLUMNS=80 270 | 271 | # Daylight saving time problem 272 | # https://bugs.python.org/issue22067 273 | # https://bugs.gentoo.org/610628 274 | local -x TZ=UTC 275 | 276 | # Rerun failed tests in verbose mode (regrtest -w). 277 | emake test EXTRATESTOPTS="-w -uall,-audio ${par_arg}" < /dev/tty 278 | local result="$?" 279 | 280 | for test in ${skipped_tests}; do 281 | mv "${T}/test_${test}.py" "${S}"/Lib/test 282 | done 283 | 284 | elog "The following tests have been skipped:" 285 | for test in ${skipped_tests}; do 286 | elog "test_${test}.py" 287 | done 288 | 289 | elog "If you would like to run them, you may:" 290 | elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'" 291 | elog "and run the tests separately." 292 | 293 | if [[ ${result} -ne 0 ]]; then 294 | die "emake test failed" 295 | fi 296 | } 297 | 298 | src_install() { 299 | local libdir=${ED}/usr/$(get_libdir)/python${PYVER} 300 | 301 | emake DESTDIR="${D}" altinstall 302 | 303 | sed -e "s/\(LDFLAGS=\).*/\1/" -i "${libdir}/config/Makefile" || die 304 | 305 | # Fix collisions between different slots of Python. 306 | mv "${ED}/usr/bin/2to3" "${ED}/usr/bin/2to3-${PYVER}" || die 307 | mv "${ED}/usr/bin/pydoc" "${ED}/usr/bin/pydoc${PYVER}" || die 308 | mv "${ED}/usr/bin/idle" "${ED}/usr/bin/idle${PYVER}" || die 309 | rm "${ED}/usr/bin/smtpd.py" || die 310 | 311 | use berkdb || rm -r "${libdir}/"{bsddb,dbhash.py*,test/test_bsddb*} || die 312 | use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die 313 | use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,lib-tk} || die 314 | use elibc_uclibc && rm -fr "${libdir}/"{bsddb/test,test} 315 | 316 | use threads || rm -r "${libdir}/multiprocessing" || die 317 | use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die 318 | 319 | dodoc Misc/{ACKS,HISTORY,NEWS} 320 | 321 | if use examples; then 322 | docinto examples 323 | dodoc -r Tools 324 | fi 325 | insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 326 | local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ 327 | emake --no-print-directory -s -f - 2>/dev/null) 328 | newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py 329 | 330 | newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} 331 | newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} 332 | sed \ 333 | -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ 334 | -e "s:@PYDOC@:pydoc${PYVER}:" \ 335 | -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ 336 | "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" 337 | 338 | local -x EPYTHON=python${PYVER} 339 | # if not using a cross-compiler, use the fresh binary 340 | if ! tc-is-cross-compiler; then 341 | local -x PYTHON=./python 342 | local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} 343 | else 344 | local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} 345 | fi 346 | 347 | echo "EPYTHON='${EPYTHON}'" > epython.py || die 348 | python_domodule epython.py 349 | 350 | # python-exec wrapping support 351 | local scriptdir=${D}$(python_get_scriptdir) 352 | mkdir -p "${scriptdir}" || die 353 | # python 354 | ln -s "../../../bin/python${PYVER}" \ 355 | "${scriptdir}/python" || die 356 | # python-config 357 | ln -s "../../../bin/python${PYVER}-config" \ 358 | "${scriptdir}/python-config" || die 359 | # 2to3, pydoc, pyvenv 360 | ln -s "../../../bin/2to3-${PYVER}" \ 361 | "${scriptdir}/2to3" || die 362 | ln -s "../../../bin/pydoc${PYVER}" \ 363 | "${scriptdir}/pydoc" || die 364 | # idle 365 | if use tk; then 366 | ln -s "../../../bin/idle${PYVER}" \ 367 | "${scriptdir}/idle" || die 368 | fi 369 | 370 | # python2* is no longer wrapped, so just symlink it 371 | local pymajor=${PYVER%.*} 372 | dosym "python${PYVER}" "/usr/bin/python${pymajor}" 373 | dosym "python${PYVER}-config" "/usr/bin/python${pymajor}-config" 374 | } 375 | -------------------------------------------------------------------------------- /dev-lang/python/python-3.10.0_beta3-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI="7" 5 | WANT_LIBTOOL="none" 6 | 7 | inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \ 8 | python-utils-r1 toolchain-funcs verify-sig 9 | 10 | MY_PV=${PV/_beta/b} 11 | MY_P="Python-${MY_PV%_p*}" 12 | PYVER=$(ver_cut 1-2) 13 | PATCHSET="python-gentoo-patches-${MY_PV}" 14 | 15 | DESCRIPTION="An interpreted, interactive, object-oriented programming language" 16 | HOMEPAGE="https://www.python.org/" 17 | SRC_URI="https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz 18 | https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz 19 | verify-sig? ( 20 | https://www.python.org/ftp/python/${PV%%_*}/${MY_P}.tar.xz.asc 21 | )" 22 | S="${WORKDIR}/${MY_P}" 23 | 24 | LICENSE="PSF-2" 25 | SLOT="${PYVER}" 26 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" 27 | IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml pgo" 28 | RESTRICT="!test? ( test )" 29 | 30 | # Do not add a dependency on dev-lang/python to this ebuild. 31 | # If you need to apply a patch which requires python for bootstrapping, please 32 | # run the bootstrap code on your dev box and include the results in the 33 | # patchset. See bug 447752. 34 | 35 | RDEPEND="app-arch/bzip2:= 36 | app-arch/xz-utils:= 37 | dev-libs/libffi:= 38 | sys-apps/util-linux:= 39 | >=sys-libs/zlib-1.1.3:= 40 | virtual/libcrypt:= 41 | virtual/libintl 42 | gdbm? ( sys-libs/gdbm:=[berkdb] ) 43 | ncurses? ( >=sys-libs/ncurses-5.2:= ) 44 | readline? ( >=sys-libs/readline-4.1:= ) 45 | sqlite? ( >=dev-db/sqlite-3.3.8:3= ) 46 | ssl? ( dev-libs/openssl:= ) 47 | tk? ( 48 | >=dev-lang/tcl-8.0:= 49 | >=dev-lang/tk-8.0:= 50 | dev-tcltk/blt:= 51 | dev-tcltk/tix 52 | ) 53 | xml? ( >=dev-libs/expat-2.1:= ) 54 | !! /dev/null 201 | if [ $? -eq 0 ]; then 202 | par_arg="-j$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')" 203 | else 204 | par_arg="" 205 | fi 206 | export par_arg 207 | 208 | if use pgo; then 209 | emake profile-opt PROFILE_TASK="-m test -x test_gdb test_compileall test_ctypes test_distutils -j $(nproc) --pgo-extended" 210 | else 211 | emake CPPFLAGS= CFLAGS= LDFLAGS= 212 | fi 213 | 214 | # Work around bug 329499. See also bug 413751 and 457194. 215 | if has_version dev-libs/libffi[pax_kernel]; then 216 | pax-mark E python 217 | else 218 | pax-mark m python 219 | fi 220 | } 221 | 222 | src_test() { 223 | # Tests will not work when cross compiling. 224 | if tc-is-cross-compiler; then 225 | elog "Disabling tests due to crosscompiling." 226 | return 227 | fi 228 | 229 | # Skip failing tests. 230 | local skipped_tests="gdb" 231 | 232 | for test in ${skipped_tests}; do 233 | mv "${S}"/Lib/test/test_${test}.py "${T}" 234 | done 235 | 236 | # bug 660358 237 | local -x COLUMNS=80 238 | local -x PYTHONDONTWRITEBYTECODE= 239 | # workaround https://bugs.gentoo.org/775416 240 | addwrite /usr/lib/python3.10/site-packages 241 | 242 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 243 | 244 | emake test EXTRATESTOPTS="-u-network -j${jobs}" \ 245 | CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty 246 | local result=$? 247 | 248 | for test in ${skipped_tests}; do 249 | mv "${T}/test_${test}.py" "${S}"/Lib/test 250 | done 251 | 252 | elog "The following tests have been skipped:" 253 | for test in ${skipped_tests}; do 254 | elog "test_${test}.py" 255 | done 256 | 257 | elog "If you would like to run them, you may:" 258 | elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" 259 | elog "and run the tests separately." 260 | 261 | if [[ ${result} -ne 0 ]]; then 262 | die "emake test failed" 263 | fi 264 | } 265 | 266 | src_install() { 267 | local libdir=${ED}/usr/lib/python${PYVER} 268 | 269 | emake DESTDIR="${D}" altinstall 270 | 271 | sed \ 272 | -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ 273 | -e "s/\(PY_LDFLAGS=\).*/\1/" \ 274 | -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" 275 | 276 | # Fix collisions between different slots of Python. 277 | rm "${ED}/usr/$(get_libdir)/libpython3.so" || die 278 | 279 | # Cheap hack to get version with ABIFLAGS 280 | local abiver=$(cd "${ED}/usr/include"; echo python*) 281 | if [[ ${abiver} != python${PYVER} ]]; then 282 | # Replace python3.X with a symlink to python3.Xm 283 | rm "${ED}/usr/bin/python${PYVER}" || die 284 | dosym "${abiver}" "/usr/bin/python${PYVER}" 285 | # Create python3.X-config symlink 286 | dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" 287 | # Create python-3.5m.pc symlink 288 | dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" 289 | fi 290 | 291 | # python seems to get rebuilt in src_install (bug 569908) 292 | # Work around it for now. 293 | if has_version dev-libs/libffi[pax_kernel]; then 294 | pax-mark E "${ED}/usr/bin/${abiver}" 295 | else 296 | pax-mark m "${ED}/usr/bin/${abiver}" 297 | fi 298 | 299 | use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die 300 | use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die 301 | 302 | dodoc Misc/{ACKS,HISTORY,NEWS} 303 | 304 | if use examples; then 305 | docinto examples 306 | find Tools -name __pycache__ -exec rm -fr {} + || die 307 | dodoc -r Tools 308 | fi 309 | insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 310 | local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ 311 | emake --no-print-directory -s -f - 2>/dev/null) 312 | newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py 313 | 314 | newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} 315 | newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} 316 | sed \ 317 | -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ 318 | -e "s:@PYDOC@:pydoc${PYVER}:" \ 319 | -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ 320 | "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" 321 | 322 | local -x EPYTHON=python${PYVER} 323 | # if not using a cross-compiler, use the fresh binary 324 | if ! tc-is-cross-compiler; then 325 | local -x PYTHON=./python 326 | local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} 327 | else 328 | local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} 329 | fi 330 | 331 | echo "EPYTHON='${EPYTHON}'" > epython.py || die 332 | python_domodule epython.py 333 | 334 | # python-exec wrapping support 335 | local pymajor=${PYVER%.*} 336 | local scriptdir=${D}$(python_get_scriptdir) 337 | mkdir -p "${scriptdir}" || die 338 | # python and pythonX 339 | ln -s "../../../bin/${abiver}" \ 340 | "${scriptdir}/python${pymajor}" || die 341 | ln -s "python${pymajor}" "${scriptdir}/python" || die 342 | # python-config and pythonX-config 343 | # note: we need to create a wrapper rather than symlinking it due 344 | # to some random dirname(argv[0]) magic performed by python-config 345 | cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die 346 | #!/bin/sh 347 | exec "${abiver}-config" "\${@}" 348 | EOF 349 | chmod +x "${scriptdir}/python${pymajor}-config" || die 350 | ln -s "python${pymajor}-config" \ 351 | "${scriptdir}/python-config" || die 352 | # 2to3, pydoc 353 | ln -s "../../../bin/2to3-${PYVER}" \ 354 | "${scriptdir}/2to3" || die 355 | ln -s "../../../bin/pydoc${PYVER}" \ 356 | "${scriptdir}/pydoc" || die 357 | # idle 358 | if use tk; then 359 | ln -s "../../../bin/idle${PYVER}" \ 360 | "${scriptdir}/idle" || die 361 | fi 362 | } 363 | -------------------------------------------------------------------------------- /dev-lang/python/python-3.6.14-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI="7" 5 | WANT_LIBTOOL="none" 6 | 7 | inherit autotools flag-o-matic multiprocessing pax-utils \ 8 | python-utils-r1 toolchain-funcs verify-sig 9 | 10 | MY_P="Python-${PV%_p*}" 11 | PYVER=$(ver_cut 1-2) 12 | PATCHSET="python-gentoo-patches-${PV}" 13 | 14 | DESCRIPTION="An interpreted, interactive, object-oriented programming language" 15 | HOMEPAGE="https://www.python.org/" 16 | SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz 17 | https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz 18 | verify-sig? ( 19 | https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc 20 | )" 21 | S="${WORKDIR}/${MY_P}" 22 | 23 | LICENSE="PSF-2" 24 | SLOT="${PYVER}/${PYVER}m" 25 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 26 | IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test +threads tk wininst +xml pgo" 27 | RESTRICT="!test? ( test )" 28 | 29 | # Do not add a dependency on dev-lang/python to this ebuild. 30 | # If you need to apply a patch which requires python for bootstrapping, please 31 | # run the bootstrap code on your dev box and include the results in the 32 | # patchset. See bug 447752. 33 | 34 | RDEPEND="app-arch/bzip2:= 35 | app-arch/xz-utils:= 36 | dev-libs/libffi:= 37 | >=sys-libs/zlib-1.1.3:= 38 | virtual/libcrypt:= 39 | virtual/libintl 40 | gdbm? ( sys-libs/gdbm:=[berkdb] ) 41 | ncurses? ( >=sys-libs/ncurses-5.2:= ) 42 | readline? ( >=sys-libs/readline-4.1:= ) 43 | sqlite? ( >=dev-db/sqlite-3.3.8:3= ) 44 | ssl? ( dev-libs/openssl:= ) 45 | tk? ( 46 | >=dev-lang/tcl-8.0:= 47 | >=dev-lang/tk-8.0:= 48 | dev-tcltk/blt:= 49 | dev-tcltk/tix 50 | ) 51 | xml? ( >=dev-libs/expat-2.1:= )" 52 | # bluetooth requires headers from bluez 53 | DEPEND="${RDEPEND} 54 | bluetooth? ( net-wireless/bluez ) 55 | test? ( app-arch/xz-utils[extra-filters(+)] )" 56 | BDEPEND=" 57 | virtual/pkgconfig 58 | verify-sig? ( app-crypt/openpgp-keys-python ) 59 | !sys-devel/gcc[libffi(-)]" 60 | PDEPEND="app-eselect/eselect-python" 61 | RDEPEND+=" !build? ( app-misc/mime-types )" 62 | 63 | VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc 64 | 65 | src_unpack() { 66 | if use verify-sig; then 67 | verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} 68 | fi 69 | default 70 | } 71 | 72 | src_prepare() { 73 | # Ensure that internal copies of expat, libffi and zlib are not used. 74 | rm -fr Modules/expat || die 75 | rm -fr Modules/_ctypes/libffi* || die 76 | rm -fr Modules/zlib || die 77 | 78 | local PATCHES=( 79 | "${WORKDIR}/${PATCHSET}" 80 | ) 81 | 82 | default 83 | 84 | sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ 85 | Lib/distutils/command/install.py \ 86 | Lib/distutils/sysconfig.py \ 87 | Lib/site.py \ 88 | Lib/sysconfig.py \ 89 | Lib/test/test_site.py \ 90 | Makefile.pre.in \ 91 | Modules/Setup.dist \ 92 | Modules/getpath.c \ 93 | configure.ac \ 94 | setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" 95 | 96 | # force correct number of jobs 97 | # https://bugs.gentoo.org/737660 98 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 99 | sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die 100 | 101 | eautoreconf 102 | } 103 | 104 | src_configure() { 105 | local disable 106 | # disable automagic bluetooth headers detection 107 | use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no 108 | use gdbm || disable+=" gdbm" 109 | use ncurses || disable+=" _curses _curses_panel" 110 | use readline || disable+=" readline" 111 | use sqlite || disable+=" _sqlite3" 112 | use ssl || export PYTHON_DISABLE_SSL="1" 113 | use tk || disable+=" _tkinter" 114 | use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. 115 | export PYTHON_DISABLE_MODULES="${disable}" 116 | 117 | if ! use xml; then 118 | ewarn "You have configured Python without XML support." 119 | ewarn "This is NOT a recommended configuration as you" 120 | ewarn "may face problems parsing any XML documents." 121 | fi 122 | 123 | if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then 124 | einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" 125 | fi 126 | 127 | if [[ "$(gcc-major-version)" -ge 4 ]]; then 128 | append-flags -fwrapv 129 | fi 130 | 131 | filter-flags -malign-double 132 | 133 | # https://bugs.gentoo.org/show_bug.cgi?id=50309 134 | if is-flagq -O3; then 135 | is-flagq -fstack-protector-all && replace-flags -O3 -O2 136 | use hardened && replace-flags -O3 -O2 137 | fi 138 | 139 | # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. 140 | tc-export CXX 141 | 142 | local dbmliborder 143 | if use gdbm; then 144 | dbmliborder+="${dbmliborder:+:}gdbm" 145 | fi 146 | 147 | local myeconfargs=( 148 | # glibc-2.30 removes it; since we can't cleanly force-rebuild 149 | # Python on glibc upgrade, remove it proactively to give 150 | # a chance for users rebuilding python before glibc 151 | ac_cv_header_stropts_h=no 152 | 153 | --with-fpectl 154 | --enable-shared 155 | $(use_enable ipv6) 156 | $(use_with threads) 157 | --infodir='${prefix}/share/info' 158 | --mandir='${prefix}/share/man' 159 | --with-computed-gotos 160 | --with-dbmliborder="${dbmliborder}" 161 | --with-libc= 162 | --enable-loadable-sqlite-extensions 163 | --without-ensurepip 164 | --with-system-expat 165 | --with-system-ffi 166 | ) 167 | 168 | OPT="" econf "${myeconfargs[@]}" 169 | 170 | if use threads && grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then 171 | eerror "configure has detected that the sem_open function is broken." 172 | eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." 173 | die "Broken sem_open function (bug 496328)" 174 | fi 175 | } 176 | 177 | src_compile() { 178 | # Ensure sed works as expected 179 | # https://bugs.gentoo.org/594768 180 | local -x LC_ALL=C 181 | 182 | #The following code borrowed from https://github.com/stefantalpalaru/gentoo-overlay 183 | 184 | # extract the number of parallel jobs in MAKEOPTS 185 | echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null 186 | if [ $? -eq 0 ]; then 187 | par_arg="-j$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')" 188 | else 189 | par_arg="" 190 | fi 191 | export par_arg 192 | 193 | if use pgo; then 194 | emake profile-opt PROFILE_TASK="-m test.regrtest ${par_arg} -w -uall,-audio -x test_distutils test_gdb test_multiprocessing test_subprocess test_tokenize test_signal test_faulthandler test_asyncio test_ctypes test_compileall test_pyexpat test_runpy test_support test_threaded_import test_xmlrpc_net" 195 | else 196 | emake CPPFLAGS= CFLAGS= LDFLAGS= 197 | fi 198 | 199 | # Work around bug 329499. See also bug 413751 and 457194. 200 | if has_version dev-libs/libffi[pax_kernel]; then 201 | pax-mark E python 202 | else 203 | pax-mark m python 204 | fi 205 | } 206 | 207 | src_test() { 208 | # Tests will not work when cross compiling. 209 | if tc-is-cross-compiler; then 210 | elog "Disabling tests due to crosscompiling." 211 | return 212 | fi 213 | 214 | # Skip failing tests. 215 | local skipped_tests="gdb faulthandler" 216 | 217 | for test in ${skipped_tests}; do 218 | mv "${S}"/Lib/test/test_${test}.py "${T}" 219 | done 220 | 221 | # bug 660358 222 | local -x COLUMNS=80 223 | local -x PYTHONDONTWRITEBYTECODE= 224 | 225 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 226 | 227 | emake test EXTRATESTOPTS="-u-network -j${jobs}" \ 228 | CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty 229 | local result=$? 230 | 231 | for test in ${skipped_tests}; do 232 | mv "${T}/test_${test}.py" "${S}"/Lib/test 233 | done 234 | 235 | elog "The following tests have been skipped:" 236 | for test in ${skipped_tests}; do 237 | elog "test_${test}.py" 238 | done 239 | 240 | elog "If you would like to run them, you may:" 241 | elog "cd '${EPREFIX}/usr/$(get_libdir)/python${PYVER}/test'" 242 | elog "and run the tests separately." 243 | 244 | if [[ ${result} -ne 0 ]]; then 245 | die "emake test failed" 246 | fi 247 | } 248 | 249 | src_install() { 250 | local libdir=${ED}/usr/$(get_libdir)/python${PYVER} 251 | 252 | emake DESTDIR="${D}" altinstall 253 | 254 | # Remove static library 255 | rm "${ED}"/usr/$(get_libdir)/libpython*.a || die 256 | 257 | sed \ 258 | -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ 259 | -e "s/\(PY_LDFLAGS=\).*/\1/" \ 260 | -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" 261 | 262 | # Fix collisions between different slots of Python. 263 | rm "${ED}/usr/$(get_libdir)/libpython3.so" || die 264 | 265 | # Cheap hack to get version with ABIFLAGS 266 | local abiver=$(cd "${ED}/usr/include"; echo python*) 267 | if [[ ${abiver} != python${PYVER} ]]; then 268 | # Replace python3.X with a symlink to python3.Xm 269 | rm "${ED}/usr/bin/python${PYVER}" || die 270 | dosym "${abiver}" "/usr/bin/python${PYVER}" 271 | # Create python3.X-config symlink 272 | dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" 273 | # Create python-3.5m.pc symlink 274 | dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" 275 | fi 276 | 277 | # python seems to get rebuilt in src_install (bug 569908) 278 | # Work around it for now. 279 | if has_version dev-libs/libffi[pax_kernel]; then 280 | pax-mark E "${ED}/usr/bin/${abiver}" 281 | else 282 | pax-mark m "${ED}/usr/bin/${abiver}" 283 | fi 284 | 285 | use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die 286 | use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die 287 | 288 | use threads || rm -r "${libdir}/multiprocessing" || die 289 | use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die 290 | 291 | dodoc Misc/{ACKS,HISTORY,NEWS} 292 | 293 | if use examples; then 294 | docinto examples 295 | find Tools -name __pycache__ -exec rm -fr {} + || die 296 | dodoc -r Tools 297 | fi 298 | insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 299 | local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ 300 | emake --no-print-directory -s -f - 2>/dev/null) 301 | newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py 302 | 303 | newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} 304 | newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} 305 | sed \ 306 | -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ 307 | -e "s:@PYDOC@:pydoc${PYVER}:" \ 308 | -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ 309 | "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" 310 | 311 | local -x EPYTHON=python${PYVER} 312 | # if not using a cross-compiler, use the fresh binary 313 | if ! tc-is-cross-compiler; then 314 | local -x PYTHON=./python 315 | local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} 316 | else 317 | local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} 318 | fi 319 | 320 | echo "EPYTHON='${EPYTHON}'" > epython.py || die 321 | python_domodule epython.py 322 | 323 | # python-exec wrapping support 324 | local pymajor=${PYVER%.*} 325 | local scriptdir=${D}$(python_get_scriptdir) 326 | mkdir -p "${scriptdir}" || die 327 | # python and pythonX 328 | ln -s "../../../bin/${abiver}" \ 329 | "${scriptdir}/python${pymajor}" || die 330 | ln -s "python${pymajor}" "${scriptdir}/python" || die 331 | # python-config and pythonX-config 332 | # note: we need to create a wrapper rather than symlinking it due 333 | # to some random dirname(argv[0]) magic performed by python-config 334 | cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die 335 | #!/bin/sh 336 | exec "${abiver}-config" "\${@}" 337 | EOF 338 | chmod +x "${scriptdir}/python${pymajor}-config" || die 339 | ln -s "python${pymajor}-config" \ 340 | "${scriptdir}/python-config" || die 341 | # 2to3, pydoc, pyvenv 342 | ln -s "../../../bin/2to3-${PYVER}" \ 343 | "${scriptdir}/2to3" || die 344 | ln -s "../../../bin/pydoc${PYVER}" \ 345 | "${scriptdir}/pydoc" || die 346 | ln -s "../../../bin/pyvenv-${PYVER}" \ 347 | "${scriptdir}/pyvenv" || die 348 | # idle 349 | if use tk; then 350 | ln -s "../../../bin/idle${PYVER}" \ 351 | "${scriptdir}/idle" || die 352 | fi 353 | } 354 | -------------------------------------------------------------------------------- /dev-lang/python/python-3.7.11-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI="7" 5 | WANT_LIBTOOL="none" 6 | 7 | inherit autotools flag-o-matic multiprocessing pax-utils \ 8 | python-utils-r1 toolchain-funcs verify-sig 9 | 10 | MY_P="Python-${PV%_p*}" 11 | PYVER=$(ver_cut 1-2) 12 | PATCHSET="python-gentoo-patches-${PV}" 13 | 14 | DESCRIPTION="An interpreted, interactive, object-oriented programming language" 15 | HOMEPAGE="https://www.python.org/" 16 | SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz 17 | https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz 18 | verify-sig? ( 19 | https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc 20 | )" 21 | S="${WORKDIR}/${MY_P}" 22 | 23 | LICENSE="PSF-2" 24 | SLOT="${PYVER}/${PYVER}m" 25 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" 26 | IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml pgo" 27 | RESTRICT="!test? ( test )" 28 | 29 | # Do not add a dependency on dev-lang/python to this ebuild. 30 | # If you need to apply a patch which requires python for bootstrapping, please 31 | # run the bootstrap code on your dev box and include the results in the 32 | # patchset. See bug 447752. 33 | 34 | RDEPEND="app-arch/bzip2:= 35 | app-arch/xz-utils:= 36 | dev-libs/libffi:= 37 | sys-apps/util-linux:= 38 | >=sys-libs/zlib-1.1.3:= 39 | virtual/libcrypt:= 40 | virtual/libintl 41 | gdbm? ( sys-libs/gdbm:=[berkdb] ) 42 | ncurses? ( >=sys-libs/ncurses-5.2:= ) 43 | readline? ( >=sys-libs/readline-4.1:= ) 44 | sqlite? ( >=dev-db/sqlite-3.3.8:3= ) 45 | ssl? ( dev-libs/openssl:= ) 46 | tk? ( 47 | >=dev-lang/tcl-8.0:= 48 | >=dev-lang/tk-8.0:= 49 | dev-tcltk/blt:= 50 | dev-tcltk/tix 51 | ) 52 | xml? ( >=dev-libs/expat-2.1:= )" 53 | # bluetooth requires headers from bluez 54 | DEPEND="${RDEPEND} 55 | bluetooth? ( net-wireless/bluez ) 56 | test? ( app-arch/xz-utils[extra-filters(+)] )" 57 | BDEPEND=" 58 | virtual/pkgconfig 59 | verify-sig? ( app-crypt/openpgp-keys-python ) 60 | !sys-devel/gcc[libffi(-)]" 61 | PDEPEND="app-eselect/eselect-python" 62 | RDEPEND+=" !build? ( app-misc/mime-types )" 63 | 64 | VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc 65 | 66 | src_unpack() { 67 | if use verify-sig; then 68 | verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} 69 | fi 70 | default 71 | } 72 | 73 | src_prepare() { 74 | # Ensure that internal copies of expat, libffi and zlib are not used. 75 | rm -fr Modules/expat || die 76 | rm -fr Modules/_ctypes/libffi* || die 77 | rm -fr Modules/zlib || die 78 | 79 | local PATCHES=( 80 | "${WORKDIR}/${PATCHSET}" 81 | ) 82 | 83 | default 84 | 85 | sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ 86 | setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" 87 | 88 | # force correct number of jobs 89 | # https://bugs.gentoo.org/737660 90 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 91 | sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die 92 | 93 | eautoreconf 94 | } 95 | 96 | src_configure() { 97 | local disable 98 | # disable automagic bluetooth headers detection 99 | use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no 100 | use gdbm || disable+=" gdbm" 101 | use ncurses || disable+=" _curses _curses_panel" 102 | use readline || disable+=" readline" 103 | use sqlite || disable+=" _sqlite3" 104 | use ssl || export PYTHON_DISABLE_SSL="1" 105 | use tk || disable+=" _tkinter" 106 | use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. 107 | export PYTHON_DISABLE_MODULES="${disable}" 108 | 109 | if ! use xml; then 110 | ewarn "You have configured Python without XML support." 111 | ewarn "This is NOT a recommended configuration as you" 112 | ewarn "may face problems parsing any XML documents." 113 | fi 114 | 115 | if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then 116 | einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" 117 | fi 118 | 119 | if [[ "$(gcc-major-version)" -ge 4 ]]; then 120 | append-flags -fwrapv 121 | fi 122 | 123 | filter-flags -malign-double 124 | 125 | # https://bugs.gentoo.org/show_bug.cgi?id=50309 126 | if is-flagq -O3; then 127 | is-flagq -fstack-protector-all && replace-flags -O3 -O2 128 | use hardened && replace-flags -O3 -O2 129 | fi 130 | 131 | # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. 132 | tc-export CXX 133 | 134 | # Fix implicit declarations on cross and prefix builds. Bug #674070. 135 | use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw 136 | 137 | local dbmliborder 138 | if use gdbm; then 139 | dbmliborder+="${dbmliborder:+:}gdbm" 140 | fi 141 | 142 | local myeconfargs=( 143 | # glibc-2.30 removes it; since we can't cleanly force-rebuild 144 | # Python on glibc upgrade, remove it proactively to give 145 | # a chance for users rebuilding python before glibc 146 | ac_cv_header_stropts_h=no 147 | 148 | --enable-shared 149 | $(use_enable ipv6) 150 | --infodir='${prefix}/share/info' 151 | --mandir='${prefix}/share/man' 152 | --with-computed-gotos 153 | --with-dbmliborder="${dbmliborder}" 154 | --with-libc= 155 | --enable-loadable-sqlite-extensions 156 | --without-ensurepip 157 | --with-system-expat 158 | --with-system-ffi 159 | ) 160 | 161 | OPT="" econf "${myeconfargs[@]}" 162 | 163 | if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then 164 | eerror "configure has detected that the sem_open function is broken." 165 | eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." 166 | die "Broken sem_open function (bug 496328)" 167 | fi 168 | } 169 | 170 | src_compile() { 171 | # Ensure sed works as expected 172 | # https://bugs.gentoo.org/594768 173 | local -x LC_ALL=C 174 | 175 | #The following code borrowed from https://github.com/stefantalpalaru/gentoo-overlay 176 | 177 | # extract the number of parallel jobs in MAKEOPTS 178 | echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null 179 | if [ $? -eq 0 ]; then 180 | par_arg="-j$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')" 181 | else 182 | par_arg="" 183 | fi 184 | export par_arg 185 | 186 | if use pgo; then 187 | emake profile-opt PROFILE_TASK="-m test -x test_gdb test_compileall test_distutils test_multiprocessing_spawn 188 | test_regrtest -j $(nproc) --pgo-extended" 189 | else 190 | emake CPPFLAGS= CFLAGS= LDFLAGS= 191 | fi 192 | 193 | # Work around bug 329499. See also bug 413751 and 457194. 194 | if has_version dev-libs/libffi[pax_kernel]; then 195 | pax-mark E python 196 | else 197 | pax-mark m python 198 | fi 199 | } 200 | 201 | src_test() { 202 | # Tests will not work when cross compiling. 203 | if tc-is-cross-compiler; then 204 | elog "Disabling tests due to crosscompiling." 205 | return 206 | fi 207 | 208 | # Skip failing tests. 209 | local skipped_tests="gdb" 210 | 211 | for test in ${skipped_tests}; do 212 | mv "${S}"/Lib/test/test_${test}.py "${T}" 213 | done 214 | 215 | # bug 660358 216 | local -x COLUMNS=80 217 | local -x PYTHONDONTWRITEBYTECODE= 218 | 219 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 220 | 221 | emake test EXTRATESTOPTS="-u-network -j${jobs}" \ 222 | CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty 223 | local result=$? 224 | 225 | for test in ${skipped_tests}; do 226 | mv "${T}/test_${test}.py" "${S}"/Lib/test 227 | done 228 | 229 | elog "The following tests have been skipped:" 230 | for test in ${skipped_tests}; do 231 | elog "test_${test}.py" 232 | done 233 | 234 | elog "If you would like to run them, you may:" 235 | elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" 236 | elog "and run the tests separately." 237 | 238 | if [[ ${result} -ne 0 ]]; then 239 | die "emake test failed" 240 | fi 241 | } 242 | 243 | src_install() { 244 | local libdir=${ED}/usr/lib/python${PYVER} 245 | 246 | emake DESTDIR="${D}" altinstall 247 | 248 | # Remove static library 249 | rm "${ED}"/usr/$(get_libdir)/libpython*.a || die 250 | 251 | sed \ 252 | -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ 253 | -e "s/\(PY_LDFLAGS=\).*/\1/" \ 254 | -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" 255 | 256 | # Fix collisions between different slots of Python. 257 | rm "${ED}/usr/$(get_libdir)/libpython3.so" || die 258 | 259 | # Cheap hack to get version with ABIFLAGS 260 | local abiver=$(cd "${ED}/usr/include"; echo python*) 261 | if [[ ${abiver} != python${PYVER} ]]; then 262 | # Replace python3.X with a symlink to python3.Xm 263 | rm "${ED}/usr/bin/python${PYVER}" || die 264 | dosym "${abiver}" "/usr/bin/python${PYVER}" 265 | # Create python3.X-config symlink 266 | dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" 267 | # Create python-3.5m.pc symlink 268 | dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" 269 | fi 270 | 271 | # python seems to get rebuilt in src_install (bug 569908) 272 | # Work around it for now. 273 | if has_version dev-libs/libffi[pax_kernel]; then 274 | pax-mark E "${ED}/usr/bin/${abiver}" 275 | else 276 | pax-mark m "${ED}/usr/bin/${abiver}" 277 | fi 278 | 279 | use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die 280 | use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die 281 | 282 | use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die 283 | 284 | dodoc Misc/{ACKS,HISTORY,NEWS} 285 | 286 | if use examples; then 287 | docinto examples 288 | find Tools -name __pycache__ -exec rm -fr {} + || die 289 | dodoc -r Tools 290 | fi 291 | insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 292 | local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ 293 | emake --no-print-directory -s -f - 2>/dev/null) 294 | newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py 295 | 296 | newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} 297 | newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} 298 | sed \ 299 | -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ 300 | -e "s:@PYDOC@:pydoc${PYVER}:" \ 301 | -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ 302 | "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" 303 | 304 | local -x EPYTHON=python${PYVER} 305 | # if not using a cross-compiler, use the fresh binary 306 | if ! tc-is-cross-compiler; then 307 | local -x PYTHON=./python 308 | local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} 309 | else 310 | local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} 311 | fi 312 | 313 | echo "EPYTHON='${EPYTHON}'" > epython.py || die 314 | python_domodule epython.py 315 | 316 | # python-exec wrapping support 317 | local pymajor=${PYVER%.*} 318 | local scriptdir=${D}$(python_get_scriptdir) 319 | mkdir -p "${scriptdir}" || die 320 | # python and pythonX 321 | ln -s "../../../bin/${abiver}" \ 322 | "${scriptdir}/python${pymajor}" || die 323 | ln -s "python${pymajor}" "${scriptdir}/python" || die 324 | # python-config and pythonX-config 325 | # note: we need to create a wrapper rather than symlinking it due 326 | # to some random dirname(argv[0]) magic performed by python-config 327 | cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die 328 | #!/bin/sh 329 | exec "${abiver}-config" "\${@}" 330 | EOF 331 | chmod +x "${scriptdir}/python${pymajor}-config" || die 332 | ln -s "python${pymajor}-config" \ 333 | "${scriptdir}/python-config" || die 334 | # 2to3, pydoc, pyvenv 335 | ln -s "../../../bin/2to3-${PYVER}" \ 336 | "${scriptdir}/2to3" || die 337 | ln -s "../../../bin/pydoc${PYVER}" \ 338 | "${scriptdir}/pydoc" || die 339 | ln -s "../../../bin/pyvenv-${PYVER}" \ 340 | "${scriptdir}/pyvenv" || die 341 | # idle 342 | if use tk; then 343 | ln -s "../../../bin/idle${PYVER}" \ 344 | "${scriptdir}/idle" || die 345 | fi 346 | } 347 | -------------------------------------------------------------------------------- /dev-lang/python/python-3.8.11-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI="7" 5 | WANT_LIBTOOL="none" 6 | 7 | inherit autotools flag-o-matic multiprocessing pax-utils \ 8 | python-utils-r1 toolchain-funcs verify-sig 9 | 10 | MY_PV=${PV/_rc/rc} 11 | MY_P="Python-${MY_PV%_p*}" 12 | PYVER=$(ver_cut 1-2) 13 | PATCHSET="python-gentoo-patches-${MY_PV}" 14 | 15 | DESCRIPTION="An interpreted, interactive, object-oriented programming language" 16 | HOMEPAGE="https://www.python.org/" 17 | SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz 18 | https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz 19 | verify-sig? ( 20 | https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc 21 | )" 22 | S="${WORKDIR}/${MY_P}" 23 | 24 | LICENSE="PSF-2" 25 | SLOT="${PYVER}" 26 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" 27 | IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml pgo" 28 | RESTRICT="!test? ( test )" 29 | 30 | # Do not add a dependency on dev-lang/python to this ebuild. 31 | # If you need to apply a patch which requires python for bootstrapping, please 32 | # run the bootstrap code on your dev box and include the results in the 33 | # patchset. See bug 447752. 34 | 35 | RDEPEND="app-arch/bzip2:= 36 | app-arch/xz-utils:= 37 | dev-libs/libffi:= 38 | sys-apps/util-linux:= 39 | >=sys-libs/zlib-1.1.3:= 40 | virtual/libcrypt:= 41 | virtual/libintl 42 | gdbm? ( sys-libs/gdbm:=[berkdb] ) 43 | ncurses? ( >=sys-libs/ncurses-5.2:= ) 44 | readline? ( >=sys-libs/readline-4.1:= ) 45 | sqlite? ( >=dev-db/sqlite-3.3.8:3= ) 46 | ssl? ( dev-libs/openssl:= ) 47 | tk? ( 48 | >=dev-lang/tcl-8.0:= 49 | >=dev-lang/tk-8.0:= 50 | dev-tcltk/blt:= 51 | dev-tcltk/tix 52 | ) 53 | xml? ( >=dev-libs/expat-2.1:= )" 54 | # bluetooth requires headers from bluez 55 | DEPEND="${RDEPEND} 56 | bluetooth? ( net-wireless/bluez ) 57 | test? ( app-arch/xz-utils[extra-filters(+)] )" 58 | BDEPEND=" 59 | virtual/pkgconfig 60 | sys-devel/autoconf-archive 61 | verify-sig? ( app-crypt/openpgp-keys-python ) 62 | !sys-devel/gcc[libffi(-)]" 63 | PDEPEND="app-eselect/eselect-python" 64 | RDEPEND+=" !build? ( app-misc/mime-types )" 65 | 66 | VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc 67 | 68 | src_unpack() { 69 | if use verify-sig; then 70 | verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} 71 | fi 72 | default 73 | } 74 | 75 | src_prepare() { 76 | # Ensure that internal copies of expat, libffi and zlib are not used. 77 | rm -fr Modules/expat || die 78 | rm -fr Modules/_ctypes/libffi* || die 79 | rm -fr Modules/zlib || die 80 | 81 | local PATCHES=( 82 | "${WORKDIR}/${PATCHSET}" 83 | ) 84 | 85 | default 86 | 87 | sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ 88 | setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" 89 | 90 | # force correct number of jobs 91 | # https://bugs.gentoo.org/737660 92 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 93 | sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die 94 | sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die 95 | 96 | eautoreconf 97 | } 98 | 99 | src_configure() { 100 | local disable 101 | # disable automagic bluetooth headers detection 102 | use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no 103 | use gdbm || disable+=" gdbm" 104 | use ncurses || disable+=" _curses _curses_panel" 105 | use readline || disable+=" readline" 106 | use sqlite || disable+=" _sqlite3" 107 | use ssl || export PYTHON_DISABLE_SSL="1" 108 | use tk || disable+=" _tkinter" 109 | use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. 110 | export PYTHON_DISABLE_MODULES="${disable}" 111 | 112 | if ! use xml; then 113 | ewarn "You have configured Python without XML support." 114 | ewarn "This is NOT a recommended configuration as you" 115 | ewarn "may face problems parsing any XML documents." 116 | fi 117 | 118 | if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then 119 | einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" 120 | fi 121 | 122 | if [[ "$(gcc-major-version)" -ge 4 ]]; then 123 | append-flags -fwrapv 124 | fi 125 | 126 | filter-flags -malign-double 127 | 128 | # https://bugs.gentoo.org/show_bug.cgi?id=50309 129 | if is-flagq -O3; then 130 | is-flagq -fstack-protector-all && replace-flags -O3 -O2 131 | use hardened && replace-flags -O3 -O2 132 | fi 133 | 134 | # https://bugs.gentoo.org/700012 135 | if is-flagq -flto || is-flagq '-flto=*'; then 136 | append-cflags $(test-flags-CC -ffat-lto-objects) 137 | fi 138 | 139 | # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. 140 | tc-export CXX 141 | 142 | # Fix implicit declarations on cross and prefix builds. Bug #674070. 143 | use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw 144 | 145 | local dbmliborder 146 | if use gdbm; then 147 | dbmliborder+="${dbmliborder:+:}gdbm" 148 | fi 149 | 150 | local myeconfargs=( 151 | # glibc-2.30 removes it; since we can't cleanly force-rebuild 152 | # Python on glibc upgrade, remove it proactively to give 153 | # a chance for users rebuilding python before glibc 154 | ac_cv_header_stropts_h=no 155 | 156 | --enable-shared 157 | $(use_enable ipv6) 158 | --infodir='${prefix}/share/info' 159 | --mandir='${prefix}/share/man' 160 | --with-computed-gotos 161 | --with-dbmliborder="${dbmliborder}" 162 | --with-libc= 163 | --enable-loadable-sqlite-extensions 164 | --without-ensurepip 165 | --with-system-expat 166 | --with-system-ffi 167 | ) 168 | 169 | OPT="" econf "${myeconfargs[@]}" 170 | 171 | if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then 172 | eerror "configure has detected that the sem_open function is broken." 173 | eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." 174 | die "Broken sem_open function (bug 496328)" 175 | fi 176 | } 177 | 178 | src_compile() { 179 | # Ensure sed works as expected 180 | # https://bugs.gentoo.org/594768 181 | local -x LC_ALL=C 182 | 183 | #The following code borrowed from https://github.com/stefantalpalaru/gentoo-overlay 184 | 185 | # extract the number of parallel jobs in MAKEOPTS 186 | echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null 187 | if [ $? -eq 0 ]; then 188 | par_arg="-j$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')" 189 | else 190 | par_arg="" 191 | fi 192 | export par_arg 193 | 194 | if use pgo; then 195 | emake profile-opt PROFILE_TASK="-m test -x test_gdb test_compileall test_distutils -j $(nproc) --pgo-extended" 196 | else 197 | emake CPPFLAGS= CFLAGS= LDFLAGS= 198 | fi 199 | 200 | # Work around bug 329499. See also bug 413751 and 457194. 201 | if has_version dev-libs/libffi[pax_kernel]; then 202 | pax-mark E python 203 | else 204 | pax-mark m python 205 | fi 206 | } 207 | 208 | src_test() { 209 | # Tests will not work when cross compiling. 210 | if tc-is-cross-compiler; then 211 | elog "Disabling tests due to crosscompiling." 212 | return 213 | fi 214 | 215 | # Skip failing tests. 216 | local skipped_tests="gdb" 217 | 218 | for test in ${skipped_tests}; do 219 | mv "${S}"/Lib/test/test_${test}.py "${T}" 220 | done 221 | 222 | # bug 660358 223 | local -x COLUMNS=80 224 | local -x PYTHONDONTWRITEBYTECODE= 225 | 226 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 227 | 228 | emake test EXTRATESTOPTS="-u-network -j${jobs}" \ 229 | CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty 230 | local result=$? 231 | 232 | for test in ${skipped_tests}; do 233 | mv "${T}/test_${test}.py" "${S}"/Lib/test 234 | done 235 | 236 | elog "The following tests have been skipped:" 237 | for test in ${skipped_tests}; do 238 | elog "test_${test}.py" 239 | done 240 | 241 | elog "If you would like to run them, you may:" 242 | elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" 243 | elog "and run the tests separately." 244 | 245 | if [[ ${result} -ne 0 ]]; then 246 | die "emake test failed" 247 | fi 248 | } 249 | 250 | src_install() { 251 | local libdir=${ED}/usr/lib/python${PYVER} 252 | 253 | emake DESTDIR="${D}" altinstall 254 | 255 | # Remove static library 256 | rm "${ED}"/usr/$(get_libdir)/libpython*.a || die 257 | 258 | sed \ 259 | -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ 260 | -e "s/\(PY_LDFLAGS=\).*/\1/" \ 261 | -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" 262 | 263 | # Fix collisions between different slots of Python. 264 | rm "${ED}/usr/$(get_libdir)/libpython3.so" || die 265 | 266 | # Cheap hack to get version with ABIFLAGS 267 | local abiver=$(cd "${ED}/usr/include"; echo python*) 268 | if [[ ${abiver} != python${PYVER} ]]; then 269 | # Replace python3.X with a symlink to python3.Xm 270 | rm "${ED}/usr/bin/python${PYVER}" || die 271 | dosym "${abiver}" "/usr/bin/python${PYVER}" 272 | # Create python3.X-config symlink 273 | dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" 274 | # Create python-3.5m.pc symlink 275 | dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" 276 | fi 277 | 278 | # python seems to get rebuilt in src_install (bug 569908) 279 | # Work around it for now. 280 | if has_version dev-libs/libffi[pax_kernel]; then 281 | pax-mark E "${ED}/usr/bin/${abiver}" 282 | else 283 | pax-mark m "${ED}/usr/bin/${abiver}" 284 | fi 285 | 286 | use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die 287 | use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die 288 | 289 | use wininst || rm "${libdir}/distutils/command/"wininst-*.exe || die 290 | 291 | dodoc Misc/{ACKS,HISTORY,NEWS} 292 | 293 | if use examples; then 294 | docinto examples 295 | find Tools -name __pycache__ -exec rm -fr {} + || die 296 | dodoc -r Tools 297 | fi 298 | insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 299 | local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ 300 | emake --no-print-directory -s -f - 2>/dev/null) 301 | newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py 302 | 303 | newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} 304 | newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} 305 | sed \ 306 | -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ 307 | -e "s:@PYDOC@:pydoc${PYVER}:" \ 308 | -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ 309 | "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" 310 | 311 | local -x EPYTHON=python${PYVER} 312 | # if not using a cross-compiler, use the fresh binary 313 | if ! tc-is-cross-compiler; then 314 | local -x PYTHON=./python 315 | local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} 316 | else 317 | local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} 318 | fi 319 | 320 | echo "EPYTHON='${EPYTHON}'" > epython.py || die 321 | python_domodule epython.py 322 | 323 | # python-exec wrapping support 324 | local pymajor=${PYVER%.*} 325 | local scriptdir=${D}$(python_get_scriptdir) 326 | mkdir -p "${scriptdir}" || die 327 | # python and pythonX 328 | ln -s "../../../bin/${abiver}" \ 329 | "${scriptdir}/python${pymajor}" || die 330 | ln -s "python${pymajor}" "${scriptdir}/python" || die 331 | # python-config and pythonX-config 332 | # note: we need to create a wrapper rather than symlinking it due 333 | # to some random dirname(argv[0]) magic performed by python-config 334 | cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die 335 | #!/bin/sh 336 | exec "${abiver}-config" "\${@}" 337 | EOF 338 | chmod +x "${scriptdir}/python${pymajor}-config" || die 339 | ln -s "python${pymajor}-config" \ 340 | "${scriptdir}/python-config" || die 341 | # 2to3, pydoc 342 | ln -s "../../../bin/2to3-${PYVER}" \ 343 | "${scriptdir}/2to3" || die 344 | ln -s "../../../bin/pydoc${PYVER}" \ 345 | "${scriptdir}/pydoc" || die 346 | # idle 347 | if use tk; then 348 | ln -s "../../../bin/idle${PYVER}" \ 349 | "${scriptdir}/idle" || die 350 | fi 351 | } 352 | -------------------------------------------------------------------------------- /dev-lang/python/python-3.9.6-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI="7" 5 | WANT_LIBTOOL="none" 6 | 7 | inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \ 8 | python-utils-r1 toolchain-funcs verify-sig 9 | 10 | MY_PV=${PV/_rc/rc} 11 | MY_P="Python-${MY_PV%_p*}" 12 | PYVER=$(ver_cut 1-2) 13 | PATCHSET="python-gentoo-patches-${MY_PV}" 14 | 15 | DESCRIPTION="An interpreted, interactive, object-oriented programming language" 16 | HOMEPAGE="https://www.python.org/" 17 | SRC_URI="https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz 18 | https://dev.gentoo.org/~mgorny/dist/python/${PATCHSET}.tar.xz 19 | verify-sig? ( 20 | https://www.python.org/ftp/python/${PV%_*}/${MY_P}.tar.xz.asc 21 | )" 22 | S="${WORKDIR}/${MY_P}" 23 | 24 | LICENSE="PSF-2" 25 | SLOT="${PYVER}" 26 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" 27 | IUSE="bluetooth build examples gdbm hardened ipv6 +ncurses +readline +sqlite +ssl test tk wininst +xml pgo" 28 | RESTRICT="!test? ( test )" 29 | 30 | # Do not add a dependency on dev-lang/python to this ebuild. 31 | # If you need to apply a patch which requires python for bootstrapping, please 32 | # run the bootstrap code on your dev box and include the results in the 33 | # patchset. See bug 447752. 34 | 35 | RDEPEND="app-arch/bzip2:= 36 | app-arch/xz-utils:= 37 | dev-libs/libffi:= 38 | sys-apps/util-linux:= 39 | >=sys-libs/zlib-1.1.3:= 40 | virtual/libcrypt:= 41 | virtual/libintl 42 | gdbm? ( sys-libs/gdbm:=[berkdb] ) 43 | ncurses? ( >=sys-libs/ncurses-5.2:= ) 44 | readline? ( >=sys-libs/readline-4.1:= ) 45 | sqlite? ( >=dev-db/sqlite-3.3.8:3= ) 46 | ssl? ( dev-libs/openssl:= ) 47 | tk? ( 48 | >=dev-lang/tcl-8.0:= 49 | >=dev-lang/tk-8.0:= 50 | dev-tcltk/blt:= 51 | dev-tcltk/tix 52 | ) 53 | xml? ( >=dev-libs/expat-2.1:= )" 54 | # bluetooth requires headers from bluez 55 | DEPEND="${RDEPEND} 56 | bluetooth? ( net-wireless/bluez ) 57 | test? ( app-arch/xz-utils[extra-filters(+)] )" 58 | BDEPEND=" 59 | virtual/pkgconfig 60 | sys-devel/autoconf-archive 61 | verify-sig? ( app-crypt/openpgp-keys-python ) 62 | !sys-devel/gcc[libffi(-)]" 63 | RDEPEND+=" !build? ( app-misc/mime-types )" 64 | PDEPEND="app-eselect/eselect-python" 65 | 66 | VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/python.org.asc 67 | 68 | # large file tests involve a 2.5G file being copied (duplicated) 69 | CHECKREQS_DISK_BUILD=5500M 70 | 71 | pkg_pretend() { 72 | use test && check-reqs_pkg_pretend 73 | } 74 | 75 | pkg_setup() { 76 | use test && check-reqs_pkg_setup 77 | } 78 | 79 | src_unpack() { 80 | if use verify-sig; then 81 | verify-sig_verify_detached "${DISTDIR}"/${MY_P}.tar.xz{,.asc} 82 | fi 83 | default 84 | } 85 | 86 | src_prepare() { 87 | # Ensure that internal copies of expat, libffi and zlib are not used. 88 | rm -fr Modules/expat || die 89 | rm -fr Modules/_ctypes/libffi* || die 90 | rm -fr Modules/zlib || die 91 | 92 | local PATCHES=( 93 | "${WORKDIR}/${PATCHSET}" 94 | ) 95 | 96 | default 97 | 98 | sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ 99 | setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" 100 | 101 | # force correct number of jobs 102 | # https://bugs.gentoo.org/737660 103 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 104 | sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die 105 | sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die 106 | 107 | eautoreconf 108 | } 109 | 110 | src_configure() { 111 | local disable 112 | # disable automagic bluetooth headers detection 113 | use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no 114 | use gdbm || disable+=" gdbm" 115 | use ncurses || disable+=" _curses _curses_panel" 116 | use readline || disable+=" readline" 117 | use sqlite || disable+=" _sqlite3" 118 | use ssl || export PYTHON_DISABLE_SSL="1" 119 | use tk || disable+=" _tkinter" 120 | use xml || disable+=" _elementtree pyexpat" # _elementtree uses pyexpat. 121 | export PYTHON_DISABLE_MODULES="${disable}" 122 | 123 | if ! use xml; then 124 | ewarn "You have configured Python without XML support." 125 | ewarn "This is NOT a recommended configuration as you" 126 | ewarn "may face problems parsing any XML documents." 127 | fi 128 | 129 | if [[ -n "${PYTHON_DISABLE_MODULES}" ]]; then 130 | einfo "Disabled modules: ${PYTHON_DISABLE_MODULES}" 131 | fi 132 | 133 | if [[ "$(gcc-major-version)" -ge 4 ]]; then 134 | append-flags -fwrapv 135 | fi 136 | 137 | filter-flags -malign-double 138 | 139 | # https://bugs.gentoo.org/show_bug.cgi?id=50309 140 | if is-flagq -O3; then 141 | is-flagq -fstack-protector-all && replace-flags -O3 -O2 142 | use hardened && replace-flags -O3 -O2 143 | fi 144 | 145 | # https://bugs.gentoo.org/700012 146 | if is-flagq -flto || is-flagq '-flto=*'; then 147 | append-cflags $(test-flags-CC -ffat-lto-objects) 148 | fi 149 | 150 | # Export CXX so it ends up in /usr/lib/python3.X/config/Makefile. 151 | tc-export CXX 152 | 153 | # Fix implicit declarations on cross and prefix builds. Bug #674070. 154 | use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw 155 | 156 | local dbmliborder 157 | if use gdbm; then 158 | dbmliborder+="${dbmliborder:+:}gdbm" 159 | fi 160 | 161 | local myeconfargs=( 162 | # glibc-2.30 removes it; since we can't cleanly force-rebuild 163 | # Python on glibc upgrade, remove it proactively to give 164 | # a chance for users rebuilding python before glibc 165 | ac_cv_header_stropts_h=no 166 | 167 | --enable-shared 168 | $(use_enable ipv6) 169 | --infodir='${prefix}/share/info' 170 | --mandir='${prefix}/share/man' 171 | --with-computed-gotos 172 | --with-dbmliborder="${dbmliborder}" 173 | --with-libc= 174 | --enable-loadable-sqlite-extensions 175 | --without-ensurepip 176 | --with-system-expat 177 | --with-system-ffi 178 | ) 179 | 180 | OPT="" econf "${myeconfargs[@]}" 181 | 182 | if grep -q "#define POSIX_SEMAPHORES_NOT_ENABLED 1" pyconfig.h; then 183 | eerror "configure has detected that the sem_open function is broken." 184 | eerror "Please ensure that /dev/shm is mounted as a tmpfs with mode 1777." 185 | die "Broken sem_open function (bug 496328)" 186 | fi 187 | } 188 | 189 | src_compile() { 190 | # Ensure sed works as expected 191 | # https://bugs.gentoo.org/594768 192 | local -x LC_ALL=C 193 | 194 | #The following code borrowed from https://github.com/stefantalpalaru/gentoo-overlay 195 | 196 | # extract the number of parallel jobs in MAKEOPTS 197 | echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' > /dev/null 198 | if [ $? -eq 0 ]; then 199 | par_arg="-j$(echo ${MAKEOPTS} | egrep -o '(\-j|\-\-jobs)(=?|[[:space:]]*)[[:digit:]]+' | tail -n1 | egrep -o '[[:digit:]]+')" 200 | else 201 | par_arg="" 202 | fi 203 | export par_arg 204 | 205 | if use pgo; then 206 | emake profile-opt PROFILE_TASK="-m test -x test_gdb test_compileall test_distutils -j $(nproc) --pgo-extended" 207 | else 208 | emake CPPFLAGS= CFLAGS= LDFLAGS= 209 | fi 210 | 211 | # Work around bug 329499. See also bug 413751 and 457194. 212 | if has_version dev-libs/libffi[pax_kernel]; then 213 | pax-mark E python 214 | else 215 | pax-mark m python 216 | fi 217 | } 218 | 219 | src_test() { 220 | # Tests will not work when cross compiling. 221 | if tc-is-cross-compiler; then 222 | elog "Disabling tests due to crosscompiling." 223 | return 224 | fi 225 | 226 | # Skip failing tests. 227 | local skipped_tests="gdb" 228 | 229 | for test in ${skipped_tests}; do 230 | mv "${S}"/Lib/test/test_${test}.py "${T}" 231 | done 232 | 233 | # bug 660358 234 | local -x COLUMNS=80 235 | local -x PYTHONDONTWRITEBYTECODE= 236 | 237 | local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") 238 | 239 | emake test EXTRATESTOPTS="-u-network -j${jobs}" \ 240 | CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty 241 | local result=$? 242 | 243 | for test in ${skipped_tests}; do 244 | mv "${T}/test_${test}.py" "${S}"/Lib/test 245 | done 246 | 247 | elog "The following tests have been skipped:" 248 | for test in ${skipped_tests}; do 249 | elog "test_${test}.py" 250 | done 251 | 252 | elog "If you would like to run them, you may:" 253 | elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'" 254 | elog "and run the tests separately." 255 | 256 | if [[ ${result} -ne 0 ]]; then 257 | die "emake test failed" 258 | fi 259 | } 260 | 261 | src_install() { 262 | local libdir=${ED}/usr/lib/python${PYVER} 263 | 264 | emake DESTDIR="${D}" altinstall 265 | 266 | # Remove static library 267 | rm "${ED}"/usr/$(get_libdir)/libpython*.a || die 268 | 269 | sed \ 270 | -e "s/\(CONFIGURE_LDFLAGS=\).*/\1/" \ 271 | -e "s/\(PY_LDFLAGS=\).*/\1/" \ 272 | -i "${libdir}/config-${PYVER}"*/Makefile || die "sed failed" 273 | 274 | # Fix collisions between different slots of Python. 275 | rm "${ED}/usr/$(get_libdir)/libpython3.so" || die 276 | 277 | # Cheap hack to get version with ABIFLAGS 278 | local abiver=$(cd "${ED}/usr/include"; echo python*) 279 | if [[ ${abiver} != python${PYVER} ]]; then 280 | # Replace python3.X with a symlink to python3.Xm 281 | rm "${ED}/usr/bin/python${PYVER}" || die 282 | dosym "${abiver}" "/usr/bin/python${PYVER}" 283 | # Create python3.X-config symlink 284 | dosym "${abiver}-config" "/usr/bin/python${PYVER}-config" 285 | # Create python-3.5m.pc symlink 286 | dosym "python-${PYVER}.pc" "/usr/$(get_libdir)/pkgconfig/${abiver/${PYVER}/-${PYVER}}.pc" 287 | fi 288 | 289 | # python seems to get rebuilt in src_install (bug 569908) 290 | # Work around it for now. 291 | if has_version dev-libs/libffi[pax_kernel]; then 292 | pax-mark E "${ED}/usr/bin/${abiver}" 293 | else 294 | pax-mark m "${ED}/usr/bin/${abiver}" 295 | fi 296 | 297 | use sqlite || rm -r "${libdir}/"{sqlite3,test/test_sqlite*} || die 298 | use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die 299 | 300 | dodoc Misc/{ACKS,HISTORY,NEWS} 301 | 302 | if use examples; then 303 | docinto examples 304 | find Tools -name __pycache__ -exec rm -fr {} + || die 305 | dodoc -r Tools 306 | fi 307 | insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510 308 | local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \ 309 | emake --no-print-directory -s -f - 2>/dev/null) 310 | newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py 311 | 312 | newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER} 313 | newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER} 314 | sed \ 315 | -e "s:@PYDOC_PORT_VARIABLE@:PYDOC${PYVER/./_}_PORT:" \ 316 | -e "s:@PYDOC@:pydoc${PYVER}:" \ 317 | -i "${ED}/etc/conf.d/pydoc-${PYVER}" \ 318 | "${ED}/etc/init.d/pydoc-${PYVER}" || die "sed failed" 319 | 320 | local -x EPYTHON=python${PYVER} 321 | # if not using a cross-compiler, use the fresh binary 322 | if ! tc-is-cross-compiler; then 323 | local -x PYTHON=./python 324 | local -x LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${PWD} 325 | else 326 | local -x PYTHON=${EPREFIX}/usr/bin/${EPYTHON} 327 | fi 328 | 329 | echo "EPYTHON='${EPYTHON}'" > epython.py || die 330 | python_domodule epython.py 331 | 332 | # python-exec wrapping support 333 | local pymajor=${PYVER%.*} 334 | local scriptdir=${D}$(python_get_scriptdir) 335 | mkdir -p "${scriptdir}" || die 336 | # python and pythonX 337 | ln -s "../../../bin/${abiver}" \ 338 | "${scriptdir}/python${pymajor}" || die 339 | ln -s "python${pymajor}" "${scriptdir}/python" || die 340 | # python-config and pythonX-config 341 | # note: we need to create a wrapper rather than symlinking it due 342 | # to some random dirname(argv[0]) magic performed by python-config 343 | cat > "${scriptdir}/python${pymajor}-config" <<-EOF || die 344 | #!/bin/sh 345 | exec "${abiver}-config" "\${@}" 346 | EOF 347 | chmod +x "${scriptdir}/python${pymajor}-config" || die 348 | ln -s "python${pymajor}-config" \ 349 | "${scriptdir}/python-config" || die 350 | # 2to3, pydoc 351 | ln -s "../../../bin/2to3-${PYVER}" \ 352 | "${scriptdir}/2to3" || die 353 | ln -s "../../../bin/pydoc${PYVER}" \ 354 | "${scriptdir}/pydoc" || die 355 | # idle 356 | if use tk; then 357 | ln -s "../../../bin/idle${PYVER}" \ 358 | "${scriptdir}/idle" || die 359 | fi 360 | } 361 | -------------------------------------------------------------------------------- /metadata/layout.conf: -------------------------------------------------------------------------------- 1 | masters = gentoo mv 2 | cache-formats = md5-dict 3 | thin-manifests = true 4 | -------------------------------------------------------------------------------- /metadata/news/2021-01-24-modular/2021-01-24-modular.txt: -------------------------------------------------------------------------------- 1 | Title: GentooLTO layout change 2 | Author: Shane Peelar 3 | Content-Type: text/plain 4 | Posted: 2021-01-24 5 | Revision: 1 6 | News-Item-Format: 1.0 7 | 8 | Greetings and happy new year! 9 | 10 | GentooLTO is undergoing some changes to become more modular and suitable for a wider range of systems. 11 | As of today, the `ltoworkarounds.conf` file has been split across multiple separate files that 12 | are installed in package.cflags instead with the latest `sys-config/ltoize`. 13 | They are named after their corresponding section from the previous `ltoworkarounds.conf` file. 14 | Eventually, these files will disappear entirely and be managed similar to the LTO patching functionality 15 | within GentooLTO with the aim of preventing files from being installed into /etc/portage entirely. 16 | 17 | Users upgrading may experience some breaking changes under certain scenarios: 18 | * You have a .conf within package.cflags whose name conflicts with one of the GentooLTO .conf files 19 | * You have changes to ltoworkarounds.conf that have not been upstreamed 20 | 21 | In these cases, you will need to run etc-update to resolve the conflicts. 22 | 23 | For backwards compatibility, I am keeping the original ltoworkarounds.conf present for a week 24 | so that users not ready to migrate to the new system can stay at ltoize-0.9.7. No PRs will be 25 | accepted to the original ltoworkarounds.conf, however, and it will disappear after this. 26 | 27 | More to come soon! 28 | 29 | -Shane 30 | -------------------------------------------------------------------------------- /metadata/news/2021-01-24-modular/2021-01-24-modular.txt.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iHUEABYIAB0WIQRQKz0hsEWJZFu2CI4PbWnCixM/0QUCYA3y4wAKCRAPbWnCixM/ 4 | 0UCgAQDE5ScB4c7wNaK6fFBiSDtR6UZpin5mjydQqJdVsvOKnAEAu2fVc4uyUOZo 5 | xgYdlBkdzEldD1lg2Qec5G7qzRp7mgU= 6 | =cDrV 7 | -----END PGP SIGNATURE----- 8 | -------------------------------------------------------------------------------- /metadata/news/2021-05-01-gcc11/2021-05-01-gcc11.en.txt: -------------------------------------------------------------------------------- 1 | Title: GentooLTO GCC 11 2 | Author: Shane Peelar 3 | Content-Type: text/plain 4 | Posted: 2021-05-01 5 | Revision: 1 6 | News-Item-Format: 1.0 7 | 8 | Greetings GentooLTO community, 9 | 10 | As you may have heard, GCC 11.1 has been released! And we, of course, must move with it. 11 | As of May 15th 2021, barring any unexpected issues, GentooLTO will be officially moved over to GCC 11. 12 | There shouldn't be any major breaking changes in this release, so I expect things to go pretty smoothly. 13 | 14 | One important point to bring up: the GCC 11 ebuild in Gentoo now supports `custom-cflags`. If you have 15 | this enabled system-wide, as I'm sure many do, that means that your CFLAGS won't get stripped from the GCC 16 | build process. This can create problems when trying to build it. Historically, we have always honoured `strip-flags` 17 | for GCC as we get LTO and PGO through the USE flags provided in the ebuild anyway. If you do want to enable 18 | `custom-cflags` for GCC, you must filter out `-flto*` manually from it with a workaround. I'm omitting putting 19 | a workaround in the overlay for this as I believe this should be your choice - however, personally, I recommend 20 | disabling `custom-cflags` with your GCC to retain the original behaviour as it's much safer. 21 | 22 | GCC 11 brings improvements on both the LTO and the PGO front, which of course are always 23 | welcome :) I encourage everyone to start testing out GCC 11 themselves before then -- just don't forget to `lto-rebuild`! 24 | And of course, if you encounter any showstoppers with GCC 11, please let us know in the issue tracker. 25 | 26 | All the best, 27 | -Shane 28 | 29 | 30 | -------------------------------------------------------------------------------- /metadata/news/2021-05-01-gcc11/2021-05-01-gcc11.en.txt.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iHUEABYIAB0WIQRQKz0hsEWJZFu2CI4PbWnCixM/0QUCYI4ZngAKCRAPbWnCixM/ 4 | 0R2AAP9ULd+TBW1N36uEeiT4WmNw7jrtFiiBX+FXcMi7p3/dHwD/bsbSBTO6FvY8 5 | x/b63dMcxUa03c4Wcz6szQSYpTes0gg= 6 | =cO2z 7 | -----END PGP SIGNATURE----- 8 | -------------------------------------------------------------------------------- /metadata/news/2023-10-28-portageq/2023-10-28-portageq.en.txt: -------------------------------------------------------------------------------- 1 | Title: GentooLTO portageq changes 2 | Author: Shane Peelar 3 | Content-Type: text/plain 4 | Posted: 2023-10-28 5 | Revision: 1 6 | News-Item-Format: 1.0 7 | 8 | Greetings GentooLTO community, 9 | 10 | As a result of the portageq removal from ebuilds, I've had to change the configuration of GentooLTO a bit. 11 | In make.conf, if you are using the override-flagomatic option, you must now specify the path to lto-overlay 12 | in the variable LTO_OVERLAY_PATH. If you're not using this GentooLTO flag, this probably wouldn't affect you. 13 | Both ltoize and 41-lto-patch.sh have been updated for the change and will issue an error if the flag isn't set. 14 | Hopefully this migration isn't too inconvenient for you. 15 | 16 | On another note, as you probably already know, I don't maintain GentooLTO very often anymore. 17 | There's a number of reasons for this, but the biggest is probably that the project has kind of accomplished 18 | its goals, more or less. There just aren't very many workarounds required anymore for getting a working LTO system. 19 | Larger Linux distributions even support building with LTO now, which is fantastic! I don't know if it's our 20 | community that normalized LTO necessarily, but I like to imagine that we've had some impact here at least. 21 | 22 | If you're looking for a more stable alternative to GentooLTO for your system, I encourage you to use the upstream 23 | support provided by the Gentoo community. Upstream now supports LTO and will accept bugs with packages that 24 | don't build with LTO cleanly. So, if you're running a vanilla LTO system now without the other flags supported 25 | in this repo, you might consider just using the upstream Gentoo support, as they have your back. 26 | 27 | If you're using the other flags in GentooLTO that aren't supported upstream, rest assured, this repository 28 | isn't going away. However, my time is pretty limited now and I can't verify workarounds like I once could. 29 | So, if it's not a straightforward verification, it might take a while for me (read: months?) to get around to confirming 30 | the need for your workaround. 31 | 32 | As for future GentooLTO plans, consider the project on maintenance mode now with no major work planned other 33 | than keeping the lights on. For anything seriously urgent (like the portageq stuff) I'll definitely intervene. 34 | Otherwise, you can continue enjoying your LTO system. BTW, Even if you use LTO without sys-config/ltoize, you might 35 | consider using lto-rebuild here to help you deal with static archives. Not sure if that's an upstream thing yet. 36 | 37 | One last thing. I've received some calls for adding another maintainer to the project. I have considered this 38 | but consider it far too risky to do. GentooLTO installs itself directly into your package manager and basically 39 | has root access, and I simply can't pay enough attention to maintainer activity to ensure no funny business is going 40 | on. So, while I appreciate the genuine offers for help from various members of the community, 41 | I can't accept any requests for maintainer access to the project. If you truly want to do this, 42 | I recommend forking the project and direct users to your fork. Who knows, I may even use it myself :) 43 | 44 | Anyway, sad as it is to say, it's been a slice, GentooLTO'ers. 45 | Thank you so much for your dedication and support over the years. 46 | As a community I like to think we've accomplished a lot together, even if it is a rather niche topic. 47 | Keep on doing great things and being awesome people. 48 | 49 | -Shane 50 | 51 | -------------------------------------------------------------------------------- /metadata/news/2023-10-28-portageq/2023-10-28-portageq.en.txt.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iHUEABYKAB0WIQRQKz0hsEWJZFu2CI4PbWnCixM/0QUCZT1rVQAKCRAPbWnCixM/ 4 | 0fC7AQDXQ0OwCbrO/H4HU93hy43v0wcDRzE1mDkPLpEyqJ3pCgEAm9Hl2SSgtUqp 5 | L0W28QKzyR1h5HWnAx4CPwL57neBOQE= 6 | =xcao 7 | -----END PGP SIGNATURE----- 8 | -------------------------------------------------------------------------------- /metadata/pkg_desc_index: -------------------------------------------------------------------------------- 1 | dev-lang/python 2.7.15-r1 3.4.8-r2 3.5.5-r2 3.6.6-r1 3.7.0-r1: An interpreted, interactive, object-oriented programming language 2 | media-libs/x264 0.0.20170701-r1: A free library for encoding X264/AVC streams 3 | media-video/x264-encoder 0.0.20170701-r1: A free commandline encoder for X264/AVC streams 4 | sys-config/ltoize 0.8.1 0.8.2 0.9.0: A configuration for portage to make building with LTO easy. 5 | -------------------------------------------------------------------------------- /profiles/categories: -------------------------------------------------------------------------------- 1 | sys-config 2 | -------------------------------------------------------------------------------- /profiles/repo_name: -------------------------------------------------------------------------------- 1 | lto-overlay 2 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/bashrc.d/41-lto-patch.sh: -------------------------------------------------------------------------------- 1 | LTOPatch() { 2 | if [ -z "${LTO_OVERLAY_PATH}" ]; then 3 | eerror "You must set LTO_OVERLAY_PATH in your make.conf to point to where lto-overlay lives." 4 | eerror "You can use: 'portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay' to obtain it if you're not sure." 5 | die 6 | fi 7 | 8 | # Lifted straight from the Portage sources 9 | # Working directory is set to ${HOME} by default 10 | # Set it properly for patch application 11 | 12 | if [[ -d $S ]] ; then 13 | cd "${S}" 14 | elif ___eapi_has_S_WORKDIR_fallback; then 15 | cd "${WORKDIR}" 16 | elif [[ -z ${A} ]] && ! __has_phase_defined_up_to prepare; then 17 | cd "${WORKDIR}" 18 | else 19 | die "The source directory '${S}' doesn't exist" 20 | fi 21 | 22 | # keep path in __dyn_prepare in sync! 23 | local tagfile=${T}/.portage_lto_patches_applied 24 | [[ -f ${tagfile} ]] && return 25 | >> "${tagfile}" 26 | 27 | local lto_overlay_dir="${LTO_OVERLAY_PATH:-/var/db/repos/lto-overlay}" 28 | local basedir="${lto_overlay_dir%/}/sys-config/ltoize/files/patches" 29 | 30 | local applied d f 31 | local -A _eapply_lto_patches 32 | local prev_shopt=$(shopt -p nullglob) 33 | shopt -s nullglob 34 | 35 | # Patches from all matched directories are combined into a 36 | # sorted (POSIX order) list of the patch basenames. Patches 37 | # in more-specific directories override patches of the same 38 | # basename found in less-specific directories. An empty patch 39 | # (or /dev/null symlink) negates a patch with the same 40 | # basename found in a less-specific directory. 41 | # 42 | # order of specificity: 43 | # 1. ${CATEGORY}/${P}-${PR} (note: -r0 desired to avoid applying 44 | # ${P} twice) 45 | # 2. ${CATEGORY}/${P} 46 | # 3. ${CATEGORY}/${PN} 47 | # all of the above may be optionally followed by a slot 48 | for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{:${SLOT%/*},}; do 49 | for f in "${d}"/*; do 50 | if [[ ( ${f} == *.diff || ${f} == *.patch ) && 51 | -z ${_eapply_lto_patches[${f##*/}]} ]]; then 52 | _eapply_lto_patches[${f##*/}]=${f} 53 | fi 54 | done 55 | done 56 | 57 | local lto_patch_cmd 58 | if [[ "${EAPI}" -ge 6 ]]; then 59 | lto_patch_cmd=eapply 60 | else 61 | lto_patch_cmd=epatch 62 | fi 63 | 64 | if [[ ${#_eapply_lto_patches[@]} -gt 0 ]]; then 65 | while read -r -d '' f; do 66 | f=${_eapply_lto_patches[${f}]} 67 | if [[ -s ${f} ]]; then 68 | ${lto_patch_cmd} "${f}" 69 | applied=1 70 | fi 71 | done < <(printf -- '%s\0' "${!_eapply_lto_patches[@]}" | 72 | LC_ALL=C sort -z) 73 | fi 74 | 75 | ${prev_shopt} 76 | 77 | [[ -n ${applied} ]] && ewarn "lto-overlay: LTO patches applied." 78 | 79 | } 80 | 81 | BashrcdPhase configure LTOPatch 82 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/bashrc.d/42-lto-flag-o-matic.sh: -------------------------------------------------------------------------------- 1 | LTOOverrideFlagOMatic() 2 | { 3 | if [[ "${LTO_ENABLE_FLAGOMATIC}" != "yes" ]]; then 4 | strip-flags() 5 | { 6 | ewarn "lto-overlay: strip-flags OVERRIDDEN" 7 | } 8 | 9 | replace-flags() 10 | { 11 | ewarn "lto-overlay: replace-flags OVERRIDDEN" 12 | } 13 | 14 | append-flags() 15 | { 16 | ewarn "lto-overlay: append-flags OVERRIDDEN" 17 | } 18 | 19 | filter-flags() 20 | { 21 | ewarn "lto-overlay: filter-flags OVERRIDDEN" 22 | } 23 | fi 24 | } 25 | 26 | 27 | BashrcdPhase all LTOOverrideFlagOMatic 28 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/bashrc.d/43-lto-no-common.sh: -------------------------------------------------------------------------------- 1 | #From #484, contributed by nivedita76 and pchome, needed for some packages that have a weird libtool setup. 2 | #Essentially, these two variables don't get set properly when `-flto` and `-fno-common` are used together. 3 | #This is a hack to set them ourselves. Define NOCOMMON_OVERRIDE_LIBTOOL=yes to activate it per-package or globally 4 | #via make.conf. 5 | 6 | nocommon_configure() { 7 | if [[ "${NOCOMMON_OVERRIDE_LIBTOOL}" == "yes" ]]; then 8 | ewarn "lto-overlay: libtool global_symbol_pipe and global_symbol_to_cdecl OVERRIDDEN" 9 | lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'" 10 | export lt_cv_sys_global_symbol_pipe 11 | lt_cv_sys_global_symbol_to_cdecl="" 12 | export lt_cv_sys_global_symbol_to_cdecl 13 | fi 14 | } 15 | 16 | BashrcdPhase configure nocommon_configure 17 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/bashrc.d/44-lto-clang-full.sh: -------------------------------------------------------------------------------- 1 | LTO_CLANG_FULL() { 2 | if [[ ${LTO_FULL} -eq 1 ]]; then 3 | export CFLAGS="${CFLAGS//=thin}" 4 | export CXXFLAGS="${CXXFLAGS//=thin}" 5 | export LDFLAGS="${LDFLAGS//=thin}" 6 | fi 7 | } 8 | 9 | BashrcdPhase configure LTO_CLANG_FULL 10 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/make.conf.lto: -------------------------------------------------------------------------------- 1 | #This file contains the optimization defaults that GentooLTO uses 2 | #More will be added in the future. 3 | #Sourcing this file will enable you to transparently receive these new settings 4 | #without intervention. If this is not desirable, see the file make.conf.lto.defines for custom configurations. 5 | 6 | #To use this file, first define NTHREADS to the number of threads you want the LTO 7 | #processes to use on your system at the top of your make.conf: 8 | 9 | #NTHREADS="12" 10 | 11 | #A good number is the number of hardware threads you have available on your system. 12 | #You may also set this to "auto" to have gcc determine optimal number of cores (GCC 10+) 13 | #After this, but before any other variables are defined, source this file directly: 14 | 15 | #source /etc/portage/make.conf.lto 16 | 17 | #Then, afterwards, define your CFLAGS with your own options: 18 | 19 | #CFLAGS="-march=native ${CFLAGS} -pipe" 20 | 21 | #This enables your CFLAGS to inherit the default flags that GentooLTO uses. 22 | #Note that you may want to enable -falign-functions=32 if you use an Intel processor (Sandy Bridge or later). 23 | #See issue #164 for details. 24 | 25 | #Next, set your CXXFLAGS to CFLAGS: 26 | 27 | #CXXFLAGS="${CFLAGS}" 28 | 29 | #Your CXXFLAGS should be a superset of your CFLAGS. Most people will never need to add anything extra to their CXXFLAGS. 30 | 31 | #Your LDFLAGS should contain *ALL* of your CFLAGS for LTO to work. It must receieve all optimization options, march, etc. 32 | #Fortunately, package.cflags takes care of this for you--no need to manually add your {C,CXX}FLAGS here or anywhere else. 33 | #If you modify LDFLAGS, ensure that your profile's LDFLAGS are respected by including them first: 34 | 35 | #LDFLAGS="${LDFLAGS} -Wl,--your-modifications=here" 36 | 37 | #NOTE: your profile likely contains -Wl,--as-needed and -Wl,-O1. 38 | #The -Wl,-01 here is a separate option sent to the linker that optimizes shared object binary sizes 39 | #It is NOT related to the -O option given to gcc and has no bearing on that option. 40 | #For example, compiling using: -fuse-linker-plugin -flto -O3 -Wl,-O1: 41 | #This will produce an LTO binary with -O3 42 | #level optimization and also pass -O1 to the linker to reduce the shared object size. 43 | 44 | #!!!Consider also using cpuid2cpuflags to set your CPU_FLAGS_* variable in your make.conf for packages that rely on explicit optimizations such as intrinsics!!! 45 | 46 | #Some quality of life things: 47 | 48 | #You may want to lower Portage's niceness level, seeing as your emerges will take longer. 49 | #The effectiveness of this depends on what CPU scheduler you use. 50 | 51 | #PORTAGE_NICENESS=15 52 | 53 | #LTO takes a lot more memory than non-LTO processes. You will likely not be able to emerge many packages 54 | #in parallel unless you have a lot of memory available. As an alternative, consider setting MAKEOPTS 55 | #to parallelize according to NTHREADS, which should avoid that problem. You may consider balancing between 56 | #emerging in parallel with parallizing make as a compromise. 57 | 58 | #MAKEOPTS="-j${NTHREADS}" 59 | 60 | #Lastly, for cmake packages, you may want to set the default generator to Ninja. 61 | #It is considerably faster than GNU make and can help build times. 62 | 63 | #CMAKE_MAKEFILE_GENERATOR=ninja 64 | 65 | #Only one package, kde-plasma/kinfocenter, needs CMAKE_MAKEFILE_GENERATOR=emake. It can be overridden 66 | #in your own package.cflags/kinfocenter.conf file like so: 67 | 68 | #kde-plasma/kinfocenter CMAKE_MAKEFILE_GENERATOR=emake 69 | 70 | #This concludes setup for GentooLTO using the default settings. 71 | #If you want to cherry pick these settings, source make.conf.lto.defines directly 72 | #and read the comments in that file. 73 | 74 | source /etc/portage/make.conf.lto.defines 75 | 76 | #Thanks to issue #49, no action necessary for preventing stripping of static libraries 77 | 78 | CFLAGS="-O3 ${GRAPHITE} ${DEVIRTLTO} ${IPAPTA} ${SEMINTERPOS} ${FLTO} -fuse-linker-plugin" 79 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/make.conf.lto.defines: -------------------------------------------------------------------------------- 1 | #This file contains the definitions for the optimization settings used by GentooLTO. 2 | #source this file directly in your make.conf if you want to cherry-pick settings 3 | #and don't want to use the make.conf.lto default configuration, defining the number of threads 4 | #to use during the LTO process beforehand: 5 | 6 | #NTHREADS="12" 7 | 8 | #source make.conf.lto.defines 9 | 10 | #Guidelines: 11 | #* Your CFLAGS should contain ${FLTO} 12 | #* If you want Graphite, include "${GRAPHITE}" in your CFLAGS 13 | #* If you want -fipa-pta, include "${IPAPTA}" in your CFLAGS 14 | #* Anything else is up to you, such as -march, -pipe, -O{3,2,s,1}, etc... 15 | #* CXXFLAGS should be set to CFLAGS 16 | #* Optionally, set other *FLAGS for languages compiled with GCC as well 17 | #* LDFLAGS of your Gentoo profile should be respected. 18 | # See make.conf.lto for more details. 19 | 20 | FLTO="-flto=${NTHREADS}" 21 | 22 | #FLTO is of the form -flto[=n] where n is the number of threads to use during linking. 23 | #It's usually a good idea to set this to the number of hardware threads in your system 24 | #You may also set this to "auto" to have gcc determine optimal number of cores (GCC 10+) 25 | 26 | GRAPHITE="-fgraphite-identity -floop-nest-optimize" 27 | 28 | #GRAPHITE contains Graphite specific optimizations and other optimizations that are disabled at O3 but don't influence the compiler's judgement. 29 | #Since GCC 8.1.0, -ftree-loop-distribution is enabled by default at -O3 30 | #NOTE: To use graphite, make sure you have gcc compiled with graphite support (add graphite to your USE). Otherwise GCC will complain! 31 | 32 | IPAPTA="-fipa-pta" 33 | 34 | #IPAPTA contains -fipa* opts that are disabled by default in GCC. These are interprocedural optimizations. For now this is only -fipa-pta. 35 | #This option increases compile times, but can potentially produce better binaries, especially with LTO. 36 | #Essentially, it allows the compiler to look into called function bodies when performing alias analysis 37 | 38 | SEMINTERPOS="-fno-semantic-interposition" 39 | 40 | #With -fno-semantic-interposition the compiler assumes that if interposition happens for functions 41 | #the overwriting function will have precisely the same semantics (and side effects). 42 | #Similarly if interposition happens for variables, the constructor of the variable will be the same. 43 | #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. 44 | 45 | NOCOMMON="-fno-common" 46 | 47 | # This option only affects C code. Only non-conformant C code needs -fcommon, which is enabled by default. Clear Linux leaves this flag off by default. 48 | # This is enabled by default with GCC 10 and is kept here only for documentation purposes. Use `-fcommon` to restore 49 | # GCC 9.x behaviour and below. 50 | 51 | SAFEST_FAST_MATH="-fno-math-errno -fno-trapping-math" 52 | SAFER_UNSAFE_MATH_OPTS="-fno-signed-zeros -fno-trapping-math -fassociative-math -freciprocal-math" 53 | SAFER_FAST_MATH="${SAFER_UNSAFE_MATH_OPTS} -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fcx-limited-range -fexcess-precision=fast" 54 | 55 | #These are flags left off by default that we're planning to start using. Clear Linux uses these in lieu of full -ffast-math optimizations 56 | #They DO break compliance with ISO C++, so we'll be careful about introducing these. 57 | #Relevant discussion: https://gcc.gnu.org/ml/gcc/2017-09/msg00079.html 58 | #We may end up just going full -Ofast, with exceptions done in the usual way. 59 | 60 | DEVIRTLTO="-fdevirtualize-at-ltrans" 61 | 62 | #This allows GCC to perform devirtualization across object file boundaries using LTO. 63 | 64 | NOPLT="-fno-plt" 65 | 66 | #This option omits the PLT from the executable, making calls go through the GOT directly. 67 | #It inhibits lazy binding, so this is not enabled by default. If you use prelink, this is 68 | #strictly better than lazy binding. 69 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/clang.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: Workarounds for LTO with Clang 2 | dev-lang/python *FLAGS-=-flto* # https://bugs.gentoo.org/700012 : No -ffat-lto-objects on clang 3 | dev-libs/libffi *FLAGS-=-flto* # error: changed section flags for .eh_frame https://github.com/libffi/libffi/issues/626 (abi_x86_32) 4 | dev-util/colm *FLAGS-=-flto* # ld: libcolm.a: error adding symbols: file format not recognized 5 | media-libs/dav1d *FLAGS-=-flto* # general protection fault https://code.videolan.org/videolan/dav1d/-/issues/362 6 | >=app-office/libreoffice-7.1.2.2 "has clang ${IUSE//+} && use clang && NOLDADD=1" "has clang ${IUSE//+} && use clang && has custom-cflags ${IUSE//+} && use custom-cflags && FlagSubAllFlags ${GRAPHITE} ${DEVIRTLTO} ${IPAPTA} ${FLTO} -fuse-linker-plugin" # fails to configure, see issue #734 7 | # END: Workarounds for LTO with Clang 8 | 9 | # BEGIN: Packages which require Full LTO 10 | media-libs/libglvnd LTO_FULL=1 # ld.lld: error: undefined symbol: entrypointFunctions 11 | # END: Packages which require Full LTO 12 | 13 | # BEGIN: Packages which require libstdc++ 14 | media-libs/exempi CXXFLAGS+=-stdlib=libstdc++ # fatal error: 'tr1/memory' file not found 15 | net-libs/webkit-gtk CXXFLAGS+=-stdlib=libstdc++ # error: use of undeclared identifier 'LC_ALL' 16 | # END: Packages which require libstdc++ 17 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/cmake-makefile.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: Will not build with ninja 2 | app-doc/doxygen CMAKE_MAKEFILE_GENERATOR=emake 3 | dev-lang/swi-prolog CMAKE_MAKEFILE_GENERATOR=emake 4 | games-arcade/supertux CMAKE_MAKEFILE_GENERATOR=emake 5 | media-libs/musicbrainz CMAKE_MAKEFILE_GENERATOR=emake 6 | x11-misc/polybar CMAKE_MAKEFILE_GENERATOR=emake 7 | # END: Will not build with ninja 8 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/devirtualize-at-ltrans.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: -fdevirtualize-at-ltrans workarounds 2 | app-text/lcdf-typetools *FLAGS-="-fdevirtualize-at-ltrans" # ICE on static-var pass 3 | # END: -fdevirtualize-at-ltrans workarounds 4 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/flag-o-matic.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: override-flagomatic workarounds 2 | app-crypt/johntheripper-jumbo LTO_ENABLE_FLAGOMATIC=yes 3 | app-crypt/johntheripper LTO_ENABLE_FLAGOMATIC=yes 4 | app-emulation/hercules LTO_ENABLE_FLAGOMATIC=yes 5 | app-emulation/wine-any LTO_ENABLE_FLAGOMATIC=yes 6 | app-emulation/wine-d3d9 LTO_ENABLE_FLAGOMATIC=yes 7 | app-emulation/wine-staging LTO_ENABLE_FLAGOMATIC=yes 8 | app-emulation/wine-vanilla LTO_ENABLE_FLAGOMATIC=yes 9 | app-emulation/xen LTO_ENABLE_FLAGOMATIC=yes 10 | app-emulation/xen-pvgrub LTO_ENABLE_FLAGOMATIC=yes 11 | app-emulation/xen-tools LTO_ENABLE_FLAGOMATIC=yes 12 | dev-lang/ghc LTO_ENABLE_FLAGOMATIC=yes 13 | dev-lang/gnat-gpl LTO_ENABLE_FLAGOMATIC=yes 14 | dev-libs/klibc LTO_ENABLE_FLAGOMATIC=yes 15 | dev-libs/openssl LTO_ENABLE_FLAGOMATIC=yes 16 | dev-util/electron LTO_ENABLE_FLAGOMATIC=yes 17 | games-emulation/zsnes LTO_ENABLE_FLAGOMATIC=yes 18 | media-libs/libsdl LTO_ENABLE_FLAGOMATIC=yes 19 | media-video/libav LTO_ENABLE_FLAGOMATIC=yes 20 | media-video/x264-encoder LTO_ENABLE_FLAGOMATIC=yes 21 | sci-biology/shrimp LTO_ENABLE_FLAGOMATIC=yes 22 | sci-biology/unafold LTO_ENABLE_FLAGOMATIC=yes 23 | sci-chemistry/tm-align LTO_ENABLE_FLAGOMATIC=yes 24 | sys-boot/refind LTO_ENABLE_FLAGOMATIC=yes # USE='custom-cflags' currently masked by profile 25 | sys-boot/syslinux LTO_ENABLE_FLAGOMATIC=yes 26 | sys-boot/tboot LTO_ENABLE_FLAGOMATIC=yes 27 | sys-devel/gcc LTO_ENABLE_FLAGOMATIC=yes # Build system requires special attention, use BOOT_CFLAGS to inject flags. Do not inject -flto, use the USE flag to do this. 28 | sys-fs/zfs-kmod LTO_ENABLE_FLAGOMATIC=yes 29 | sys-fs/zfs LTO_ENABLE_FLAGOMATIC=yes 30 | sys-kernel/spl LTO_ENABLE_FLAGOMATIC=yes 31 | www-client/chromium LTO_ENABLE_FLAGOMATIC=yes 32 | www-client/firefox LTO_ENABLE_FLAGOMATIC=yes # The ebuild does respect your CFLAGS, it just does some messing around for enabling -flto and -O3. 33 | www-client/torbrowser LTO_ENABLE_FLAGOMATIC=yes 34 | # END: override-flagomatic workarounds 35 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/graphite.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: Graphite ICE (Internal Compiler Error) 2 | # Report them to the GCC team 3 | sci-visualization/paraview *FLAGS-="${GRAPHITE}" # Removing Graphite optimizations allows build to complete with sane memory usage for --jobs > 1 4 | # END: Graphite ICE (Internal Compiler Error) 5 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/ipa-pta.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: -fipa-pta workarounds 2 | www-client/firefox *FLAGS-="${IPAPTA}" #ICE on -fipa-pta 3 | www-client/torbrowser *FLAGS-="${IPAPTA}" #ICE on -fipa-pta 4 | =sys-apps/gawk-4.1.4 *FLAGS-="${IPAPTA}" # during IPA pass: pta lto1: internal compiler error: Segmentation fault 5 | dev-qt/qtwebkit *FLAGS-="${IPAPTA}" 6 | dev-lang/R *FLAGS-="${IPAPTA}" # during IPA pass: pta lto1: internal compiler error: Segmentation fault 7 | sys-devel/gcc *FLAGS-="${IPAPTA}" 8 | dev-lang/duktape *FLAGS-="${IPAPTA}" # fixes polkit from musl overlay not starting 9 | dev-lang/gnat-gpl *FLAGS-="${IPAPTA}" 10 | dev-lang/php *FLAGS-="${IPAPTA}" # Segfaults when compiled with -fipa-pta 11 | dev-lisp/sbcl *FLAGS-="${IPAPTA}" #ICE on -fipa-pta 12 | x11-wm/bspwm *FLAGS-="${IPAPTA}" # needed for version 0.9.7 on 17.0 profile running the testing branch everywhere with GCC 8.3.0 13 | media-libs/libwebp *FLAGS-="${IPAPTA}" # no compilation issues, but -fipa-pta causes webp images to be displayed incorrectly 14 | dev-qt/qtgui *FLAGS-="${IPAPTA}" # Same problem as above 15 | dev-db/mongodb *FLAGS-="${IPAPTA}" # ICE with -fipa-pta 16 | dev-lang/ocaml *FLAGS-="${IPAPTA}" # ICE during IPA pass: pta in lto1: Segmentation fault 17 | app-emulation/libvirt *FLAGS-="${IPAPTA}" # Segmentation fault when starting libvirtd 18 | dev-python/libvirt-python *FLAGS-="${IPAPTA}" # Test failure 19 | dev-db/postgresql *FLAGS-="${IPAPTA}" # Test failure 20 | dev-libs/protobuf *FLAGS-="${IPAPTA}" # Test failure 21 | media-video/ffmpeg *FLAGS-="${IPAPTA}" # Test failure 22 | sys-devel/clang *FLAGS-="${IPAPTA}" # Test failure 23 | net-p2p/monero *FLAGS-="${IPAPTA}" # ICE with -fipa-pta 24 | mail-client/thunderbird *FLAGS-="${IPAPTA}" # ICE with GCC 10.2.0 (seen with thunderbird 68.12.0) 25 | >=dev-lang/spidermonkey-78.3.1 *FLAGS-="${IPAPTA}" # Segfault during build with GCC 10.2.0 26 | >=media-libs/mesa-21.1.0 *FLAGS-="${IPAPTA}" # Segfault with vulkan 27 | x11-base/xwayland *FLAGS-="${IPAPTA}" # SIGABRT when querying for GLX information 28 | >=dev-vcs/git-2.32.0 *FLAGS-="${IPAPTA}" # Segfault in git fetch with GCC < 11.3.0 29 | # END: -fipa-pta workarounds 30 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/no-common-libtool.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: -fno-common libtool hack workarounds (#484) 2 | app-crypt/libsecret NOCOMMON_OVERRIDE_LIBTOOL=yes 3 | app-crypt/p11-kit NOCOMMON_OVERRIDE_LIBTOOL=yes 4 | app-text/enchant NOCOMMON_OVERRIDE_LIBTOOL=yes 5 | app-text/evince NOCOMMON_OVERRIDE_LIBTOOL=yes 6 | dev-libs/dbus-glib NOCOMMON_OVERRIDE_LIBTOOL=yes 7 | dev-libs/ffcall NOCOMMON_OVERRIDE_LIBTOOL=yes 8 | dev-libs/fribidi NOCOMMON_OVERRIDE_LIBTOOL=yes 9 | dev-libs/jansson NOCOMMON_OVERRIDE_LIBTOOL=yes 10 | dev-libs/libappindicator NOCOMMON_OVERRIDE_LIBTOOL=yes 11 | dev-libs/libatasmart NOCOMMON_OVERRIDE_LIBTOOL=yes 12 | dev-libs/libdbusmenu NOCOMMON_OVERRIDE_LIBTOOL=yes 13 | dev-libs/libindicator NOCOMMON_OVERRIDE_LIBTOOL=yes 14 | dev-libs/libmspack NOCOMMON_OVERRIDE_LIBTOOL=yes 15 | dev-libs/libpipeline NOCOMMON_OVERRIDE_LIBTOOL=yes 16 | dev-python/dbus-python NOCOMMON_OVERRIDE_LIBTOOL=yes 17 | dev-python/notify-python NOCOMMON_OVERRIDE_LIBTOOL=yes 18 | dev-util/umockdev NOCOMMON_OVERRIDE_LIBTOOL=yes 19 | gnome-base/gconf NOCOMMON_OVERRIDE_LIBTOOL=yes 20 | gnome-base/libglade NOCOMMON_OVERRIDE_LIBTOOL=yes 21 | gnome-base/libgnome-keyring NOCOMMON_OVERRIDE_LIBTOOL=yes 22 | gnome-base/librsvg NOCOMMON_OVERRIDE_LIBTOOL=yes 23 | lxde-base/menu-cache NOCOMMON_OVERRIDE_LIBTOOL=yes 24 | media-gfx/imagemagick NOCOMMON_OVERRIDE_LIBTOOL=yes 25 | media-gfx/ttfautohint NOCOMMON_OVERRIDE_LIBTOOL=yes 26 | media-libs/glu NOCOMMON_OVERRIDE_LIBTOOL=yes 27 | media-libs/libdvdnav NOCOMMON_OVERRIDE_LIBTOOL=yes 28 | media-libs/libdvdread NOCOMMON_OVERRIDE_LIBTOOL=yes 29 | media-plugins/gst-plugins-libav NOCOMMON_OVERRIDE_LIBTOOL=yes 30 | media-plugins/gst-plugins-vaapi NOCOMMON_OVERRIDE_LIBTOOL=yes 31 | media-sound/mpg123 NOCOMMON_OVERRIDE_LIBTOOL=yes 32 | media-sound/sox NOCOMMON_OVERRIDE_LIBTOOL=yes 33 | media-sound/wavpack NOCOMMON_OVERRIDE_LIBTOOL=yes 34 | media-video/vlc NOCOMMON_OVERRIDE_LIBTOOL=yes 35 | net-libs/libmbim NOCOMMON_OVERRIDE_LIBTOOL=yes 36 | net-misc/curl NOCOMMON_OVERRIDE_LIBTOOL=yes 37 | net-misc/modemmanager NOCOMMON_OVERRIDE_LIBTOOL=yes 38 | sys-apps/accountsservice NOCOMMON_OVERRIDE_LIBTOOL=yes 39 | sys-apps/usbredir NOCOMMON_OVERRIDE_LIBTOOL=yes 40 | sys-auth/polkit NOCOMMON_OVERRIDE_LIBTOOL=yes 41 | sys-boot/plymouth NOCOMMON_OVERRIDE_LIBTOOL=yes 42 | sys-devel/gettext NOCOMMON_OVERRIDE_LIBTOOL=yes 43 | sys-fs/udisks NOCOMMON_OVERRIDE_LIBTOOL=yes 44 | sys-power/upower NOCOMMON_OVERRIDE_LIBTOOL=yes 45 | x11-libs/libfm NOCOMMON_OVERRIDE_LIBTOOL=yes 46 | x11-libs/libfm-extra NOCOMMON_OVERRIDE_LIBTOOL=yes 47 | x11-libs/pango NOCOMMON_OVERRIDE_LIBTOOL=yes 48 | x11-libs/xcb-util-cursor NOCOMMON_OVERRIDE_LIBTOOL=yes 49 | x11-libs/xcb-util-xrm NOCOMMON_OVERRIDE_LIBTOOL=yes 50 | # END: -fno-common libtool hack workarounds (#484) NOCOMMON_OVERRIDE_LIBTOOL=yes 51 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/no-common.conf: -------------------------------------------------------------------------------- 1 | # These workarounds apply to GCC 9.x and below. `-fno-common` is default on GCC 10 now 2 | # and many ebuilds have already been patched, with Gentoo upstream leading the charge. 3 | # If you are having trouble with a package in this list, try explicitly setting it to -fcommon. 4 | # If that works, please file an issue at the GentooLTO GitHub. 5 | 6 | # BEGIN: -fno-common workarounds 7 | app-accessibility/at-spi2-atk *FLAGS-="${NOCOMMON}" 8 | app-admin/logrotate *FLAGS-="${NOCOMMON}" 9 | app-admin/syslog-ng *FLAGS-="${NOCOMMON}" 10 | app-arch/cpio *FLAGS-="${NOCOMMON}" 11 | app-arch/file-roller *FLAGS-="${NOCOMMON}" 12 | app-crypt/gnupg *FLAGS-="${NOCOMMON}" 13 | app-crypt/p11-kit *FLAGS-="${NOCOMMON}" 14 | app-crypt/staticgpg *FLAGS-="${NOCOMMON}" 15 | app-editors/neovim *FLAGS-="${NOCOMMON}" 16 | app-text/mupdf *FLAGS-="${NOCOMMON}" 17 | app-text/texlive-core *FLAGS-="${NOCOMMON}" 18 | app-text/ttf2pk2 *FLAGS-="${NOCOMMON}" 19 | dev-db/redis *FLAGS-="${NOCOMMON}" 20 | dev-java/icedtea *FLAGS-="${NOCOMMON}" 21 | dev-lang/erlang *FLAGS-="${NOCOMMON}" 22 | dev-lang/orc *FLAGS-="${NOCOMMON}" 23 | dev-lang/R *FLAGS-="${NOCOMMON}" 24 | dev-libs/bemenu *FLAGS-="${NOCOMMON}" 25 | dev-libs/dbus-glib *FLAGS-="${NOCOMMON}" 26 | dev-libs/ffcall *FLAGS-="${NOCOMMON}" 27 | dev-libs/fribidi *FLAGS-="${NOCOMMON}" 28 | dev-libs/gobject-introspection *FLAGS-="${NOCOMMON}" 29 | dev-libs/libltdl *FLAGS-="${NOCOMMON}" # builds but causes symbol lookup errors 30 | dev-libs/libmspack *FLAGS-="${NOCOMMON}" 31 | dev-libs/libpipeline *FLAGS-="${NOCOMMON}" 32 | dev-libs/libx86emu *FLAGS-="${NOCOMMON}" 33 | dev-python/dbus-python *FLAGS-="${NOCOMMON}" 34 | dev-python/nautilus-python *FLAGS-="${NOCOMMON}" 35 | dev-util/android-tools *FLAGS-="${NOCOMMON}" 36 | dev-util/pkgconf *FLAGS-="${NOCOMMON}" 37 | gnome-base/gnome-control-center *FLAGS-="${NOCOMMON}" 38 | gnome-base/librsvg *FLAGS-="${NOCOMMON}" 39 | gui-apps/wl-clipboard *FLAGS-="${NOCOMMON}" 40 | gui-libs/wlroots *FLAGS-="${NOCOMMON}" 41 | gui-wm/sway *FLAGS-="${NOCOMMON}" 42 | media-gfx/imagemagick *FLAGS-="${NOCOMMON}" 43 | media-libs/freeglut *FLAGS-="${NOCOMMON}" 44 | media-libs/gegl *FLAGS-="${NOCOMMON}" 45 | media-libs/glu *FLAGS-="${NOCOMMON}" 46 | media-libs/gstreamer *FLAGS-="${NOCOMMON}" 47 | media-libs/libv4l *FLAGS-="${NOCOMMON}" 48 | media-libs/mesa *FLAGS-="${NOCOMMON}" 49 | media-libs/openal *FLAGS-="${NOCOMMON}" 50 | media-sound/bluez-alsa *FLAGS-="${NOCOMMON}" 51 | media-sound/mpg123 *FLAGS-="${NOCOMMON}" 52 | media-sound/musepack-tools *FLAGS-="${NOCOMMON}" 53 | media-sound/sox *FLAGS-="${NOCOMMON}" 54 | media-sound/wavpack *FLAGS-="${NOCOMMON}" 55 | net-analyzer/iftop *FLAGS-="${NOCOMMON}" 56 | net-analyzer/openvas-manager *FLAGS-="${NOCOMMON}" 57 | net-fs/nfs-utils *FLAGS-="${NOCOMMON}" 58 | net-libs/libmbim *FLAGS-="${NOCOMMON}" 59 | net-libs/libqmi *FLAGS-="${NOCOMMON}" 60 | net-libs/libtirpc *FLAGS-="${NOCOMMON}" 61 | net-misc/curl *FLAGS-="${NOCOMMON}" 62 | net-misc/dhcp *FLAGS-="${NOCOMMON}" 63 | net-misc/iputils *FLAGS-="${NOCOMMON}" 64 | net-misc/modemmanager *FLAGS-="${NOCOMMON}" 65 | net-misc/networkmanager *FLAGS-="${NOCOMMON}" 66 | net-misc/ntpsec *FLAGS-="${NOCOMMON}" 67 | net-misc/socat *FLAGS-="${NOCOMMON}" 68 | net-misc/vinagre *FLAGS-="${NOCOMMON}" 69 | net-print/cups-filters *FLAGS-="${NOCOMMON}" 70 | net-vpn/libreswan *FLAGS-="${NOCOMMON}" 71 | sys-apps/dtc *FLAGS-="${NOCOMMON}" 72 | sys-apps/iproute2 *FLAGS-="${NOCOMMON}" 73 | sys-apps/kbd *FLAGS-="${NOCOMMON}" 74 | sys-apps/memtester *FLAGS-="${NOCOMMON}" 75 | sys-apps/the_silver_searcher *FLAGS-="${NOCOMMON}" 76 | sys-apps/usbredir *FLAGS-="${NOCOMMON}" 77 | sys-boot/syslinux *FLAGS-="${NOCOMMON}" 78 | sys-devel/bmake *FLAGS-="${NOCOMMON}" 79 | sys-devel/distcc *FLAGS-="${NOCOMMON}" 80 | sys-fs/squashfs-tools *FLAGS-="${NOCOMMON}" 81 | >=sys-fs/xfsprogs-5.2.0 *FLAGS-="${NOCOMMON}" 82 | sys-libs/gdbm *FLAGS-="${NOCOMMON}" 83 | sys-libs/gpm *FLAGS-="${NOCOMMON}" 84 | sys-libs/libunwind *FLAGS-="${NOCOMMON}" 85 | sys-power/cpupower *FLAGS-="${NOCOMMON}" 86 | sys-power/iasl *FLAGS-="${NOCOMMON}" 87 | sys-power/upower *FLAGS-="${NOCOMMON}" 88 | sys-process/audit *FLAGS-="${NOCOMMON}" 89 | sys-process/htop *FLAGS-="${NOCOMMON}" 90 | x11-base/xorg-server *FLAGS-="${NOCOMMON}" 91 | x11-drivers/xf86-video-amdgpu *FLAGS-="${NOCOMMON}" 92 | x11-drivers/xf86-video-ati *FLAGS-="${NOCOMMON}" 93 | x11-drivers/xf86-video-intel *FLAGS-="${NOCOMMON}" 94 | =sys-apps/coreutils-8.31 *FLAGS+='-fno-finite-math-only' # causes multiple definition of `minus_zero` error during linking 28 | >=sys-apps/groff-1.22.4 *FLAGS+='-fsigned-zeros' # causes conflicting declaration of `signbit` compilation error 29 | >=sys-devel/llvm-10.0.0 *FLAGS+='-fno-finite-math-only' # compiles fine but causes clang to fail to emerge with ``undefined reference to `__log10_finite'`` 30 | >=sys-libs/glibc-2.30 /-Ofast/'-O3 ${SAFEST_FAST_MATH}' /-ffast-math/'${SAFEST_FAST_MATH}' # preprocessor in the source throws an error if ffast-math is enabled 31 | www-client/firefox /-Ofast/'-O3 ${SAFEST_FAST_MATH}' /-ffast-math/'${SAFEST_FAST_MATH}' # won't build with flags activated by -ffast-math on Clang, requires investigation 32 | x11-misc/redshift *FLAGS+='-fno-finite-math-only' # compiles fine but -ffinite-math-only causes a runtime error where the brightness values are interpreted incorrectly 33 | # END: -Ofast workarounds 34 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/portage-bashrc-mv.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: portage-bashrc-mv remove-la workarounds 2 | dev-util/colm NOLAFILEREMOVE=true # See issue 690 and https://bugs.gentoo.org/766210 3 | # END: portage-bashrc-mv remove-la workarounds 4 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/tls-dialect.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: TLS dialect workarounds 2 | www-client/firefox *FLAGS-="-mtls-dialect=gnu2" 3 | www-client/torbrowser *FLAGS-="-mtls-dialect=gnu2" 4 | sys-fs/eudev *FLAGS-="-mtls-dialect=gnu2" 5 | sys-libs/glibc *FLAGS-="-mtls-dialect=gnu2" 6 | dev-lang/mono *FLAGS-="-mtls-dialect=gnu2" 7 | dev-lang/python *FLAGS-="-mtls-dialect=gnu2" 8 | dev-util/lldb *FLAGS-="-mtls-dialect=gnu2" 9 | dev-db/firebird *FLAGS-="-mtls-dialect=gnu2" 10 | dev-lang/spidermonkey *FLAGS-="-mtls-dialect=gnu2" 11 | sys-fs/btrfs-progs *FLAGS-="-mtls-dialect=gnu2" 12 | sys-boot/systemd-boot *FLAGS-="-mtls-dialect=gnu2" 13 | net-libs/libtorrent-rasterbar *FLAGS-="-mtls-dialect=gnu2" # causes memory corruption at runtime 14 | # END: TLS dialect workarounds 15 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/package.cflags/use-ld.conf: -------------------------------------------------------------------------------- 1 | # BEGIN: GOLD linker workarounds 2 | dev-util/kbuild *FLAGS+="-fuse-ld=bfd" 3 | games-emulation/pcsx2 *FLAGS+="-fuse-ld=bfd" 4 | media-libs/libcaca *FLAGS+="-fuse-ld=bfd" 5 | net-misc/curl *FLAGS+="-fuse-ld=bfd" 6 | >=sys-libs/libcap-2.28 *FLAGS+="-fuse-ld=bfd" # Issue #453 7 | # END: GOLD linker workarounds 8 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/patches/dev-libs/gmp/arm64-lto.patch: -------------------------------------------------------------------------------- 1 | diff -r 575ff753614f mpn/arm64/bdiv_q_1.asm 2 | --- a/mpn/arm64/bdiv_q_1.asm Fri Jan 01 14:46:22 2021 +0100 3 | +++ b/mpn/arm64/bdiv_q_1.asm Fri Jan 01 17:13:01 2021 +0100 4 | @@ -61,9 +61,15 @@ 5 | clz cnt, x6 6 | lsr d, d, cnt 7 | 8 | - LEA_HI( x7, binvert_limb_table) 9 | +ifdef(`PIC',` 10 | + adrp x7, :got:__gmp_binvert_limb_table 11 | ubfx x6, d, 1, 7 12 | - LEA_LO( x7, binvert_limb_table) 13 | + ldr x7, [x7, #:got_lo12:__gmp_binvert_limb_table] 14 | +',` 15 | + adrp x7, __gmp_binvert_limb_table 16 | + ubfx x6, d, 1, 7 17 | + add x7, x7, :lo12:__gmp_binvert_limb_table 18 | +') 19 | ldrb w6, [x7, x6] 20 | ubfiz x7, x6, 1, 8 21 | umull x6, w6, w6 22 | @@ -75,7 +81,7 @@ 23 | mul x6, x6, x6 24 | msub di, x6, d, x7 25 | 26 | - b GSYM_PREFIX`'mpn_pi1_bdiv_q_1 27 | + b mpn_pi1_bdiv_q_1 28 | EPILOGUE() 29 | 30 | PROLOGUE(mpn_pi1_bdiv_q_1) 31 | diff -r 575ff753614f mpn/arm64/invert_limb.asm 32 | --- a/mpn/arm64/invert_limb.asm Fri Jan 01 14:46:22 2021 +0100 33 | +++ b/mpn/arm64/invert_limb.asm Fri Jan 01 17:13:01 2021 +0100 34 | @@ -41,9 +41,9 @@ 35 | ASM_START() 36 | PROLOGUE(mpn_invert_limb) 37 | lsr x2, x0, #54 38 | - LEA_HI( x1, approx_tab) 39 | + adrp x1, approx_tab 40 | and x2, x2, #0x1fe 41 | - LEA_LO( x1, approx_tab) 42 | + add x1, x1, :lo12:approx_tab 43 | ldrh w3, [x1,x2] 44 | lsr x4, x0, #24 45 | add x4, x4, #1 46 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/patches/dev-python/grpcio-1.28.1/lto.patch: -------------------------------------------------------------------------------- 1 | --- a/Makefile 2 | +++ b/Makefile 3 | @@ -8089,15 +8089,15 @@ 4 | $(LIBDIR)/$(CONFIG)/grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP): $(LIBGRPC_CSHARP_EXT_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(UPB_DEP) $(GRPC_ABSEIL_DEP) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_DEP) 5 | $(E) "[LD] Linking $@" 6 | $(Q) mkdir -p `dirname $@` 7 | - $(Q) $(LDXX) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc_csharp_ext$(SHARED_VERSION_CSHARP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) 8 | + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=$(LIBDIR)/$(CONFIG)/grpc_csharp_ext$(SHARED_VERSION_CSHARP).def -Wl,--out-implib=$(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP)-dll.a -o $(LIBDIR)/$(CONFIG)/grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) 9 | else 10 | $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP): $(LIBGRPC_CSHARP_EXT_OBJS) $(ZLIB_DEP) $(CARES_DEP) $(ADDRESS_SORTING_DEP) $(UPB_DEP) $(GRPC_ABSEIL_DEP) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(OPENSSL_DEP) 11 | $(E) "[LD] Linking $@" 12 | $(Q) mkdir -p `dirname $@` 13 | ifeq ($(SYSTEM),Darwin) 14 | - $(Q) $(LDXX) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) 15 | + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -install_name $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) -dynamiclib -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) 16 | else 17 | - $(Q) $(LDXX) $(LDFLAGS) $(if $(subst Linux,,$(SYSTEM)),,-Wl$(comma)-wrap$(comma)memcpy) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) 18 | + $(Q) $(LDXX) $(LDFLAGS) -L$(LIBDIR)/$(CONFIG) -shared -Wl,-soname,libgrpc_csharp_ext.so.2 -o $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBGRPC_CSHARP_EXT_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(ZLIB_MERGE_LIBS) $(CARES_MERGE_LIBS) $(ADDRESS_SORTING_MERGE_LIBS) $(UPB_MERGE_LIBS) $(GRPC_ABSEIL_MERGE_LIBS) $(LDLIBS) 19 | $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so.2 20 | $(Q) ln -sf $(SHARED_PREFIX)grpc_csharp_ext$(SHARED_VERSION_CSHARP).$(SHARED_EXT_CSHARP) $(LIBDIR)/$(CONFIG)/libgrpc_csharp_ext$(SHARED_VERSION_CSHARP).so 21 | endif 22 | --- a/setup.py 23 | +++ b/setup.py 24 | @@ -196,7 +196,7 @@ 25 | ' -static-libgcc -static-libstdc++ -mcrtdll={msvcr}' 26 | ' -static -lshlwapi'.format(msvcr=msvcr)) 27 | if "linux" in sys.platform: 28 | - EXTRA_ENV_LINK_ARGS += ' -Wl,-wrap,memcpy -static-libgcc' 29 | + EXTRA_ENV_LINK_ARGS += ' -static-libgcc' 30 | 31 | EXTRA_COMPILE_ARGS = shlex.split(EXTRA_ENV_COMPILE_ARGS) 32 | EXTRA_LINK_ARGS = shlex.split(EXTRA_ENV_LINK_ARGS) 33 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/patches/media-libs/x264-0.0.20190903/lto.patch: -------------------------------------------------------------------------------- 1 | --- a/configure 2020-07-07 20:37:00.103200843 -0400 2 | +++ b/configure 2020-07-07 20:36:38.819867863 -0400 3 | @@ -1017,7 +1017,7 @@ 4 | CPU_ENDIAN="little-endian" 5 | if [ $compiler = GNU ]; then 6 | echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c 7 | - $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed" 8 | + $CC $CFLAGS conftest.c -o conftest.o -shared 2>/dev/null || die "endian test failed" 9 | if (${STRINGS} -a conftest.o | grep -q BIGE) && (${STRINGS} -a conftest.o | grep -q FPendian) ; then 10 | define WORDS_BIGENDIAN 11 | CPU_ENDIAN="big-endian" 12 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/patches/media-video/x264-encoder-0.0.20190903/lto.patch: -------------------------------------------------------------------------------- 1 | --- a/configure 2020-07-07 20:37:00.103200843 -0400 2 | +++ b/configure 2020-07-07 20:36:38.819867863 -0400 3 | @@ -1017,7 +1017,7 @@ 4 | CPU_ENDIAN="little-endian" 5 | if [ $compiler = GNU ]; then 6 | echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c 7 | - $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed" 8 | + $CC $CFLAGS conftest.c -o conftest.o -shared 2>/dev/null || die "endian test failed" 9 | if (${STRINGS} -a conftest.o | grep -q BIGE) && (${STRINGS} -a conftest.o | grep -q FPendian) ; then 10 | define WORDS_BIGENDIAN 11 | CPU_ENDIAN="big-endian" 12 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/patches/sys-devel/prelink/experimental-glibc-231.patch: -------------------------------------------------------------------------------- 1 | diff --git a/src/gather.c b/src/gather.c 2 | index 277f1b5..3cdc7fd 100644 3 | --- a/src/gather.c 4 | +++ b/src/gather.c 5 | @@ -189,6 +189,11 @@ gather_deps (DSO *dso, struct prelink_entry *ent) 6 | if (line[n - 1] == '\n') 7 | line[n - 1] = '\0'; 8 | 9 | + if (strncmp (line, "lookup", sizeof ("lookup") - 1) == 0) 10 | + { 11 | + continue; 12 | + } 13 | + 14 | p = strstr (line, " => "); 15 | if (p) 16 | { 17 | -------------------------------------------------------------------------------- /sys-config/ltoize/files/patches/sys-devel/prelink/noplt.patch: -------------------------------------------------------------------------------- 1 | From 2cc1d58caaba994855516b50d5af057854c94fe8 Mon Sep 17 00:00:00 2001 2 | From: Shane Peelar 3 | Date: Sat, 25 May 2019 08:45:45 -0400 4 | Subject: [PATCH] arch-x86_64.c: Make assert conditional 5 | 6 | Make the assert in arch_prelink a condition instead of an assert, 7 | keeping things consistent with the other arches. This makes 8 | prelink not bail out on `-fno-plt` executables. 9 | 10 | Signed-off-by: Shane Peelar 11 | --- 12 | src/arch-x86_64.c | 3 ++- 13 | 1 file changed, 2 insertions(+), 1 deletion(-) 14 | 15 | diff --git a/src/arch-x86_64.c b/src/arch-x86_64.c 16 | index 2f6c551..aa739e6 100644 17 | --- a/src/arch-x86_64.c 18 | +++ b/src/arch-x86_64.c 19 | @@ -418,7 +418,8 @@ x86_64_arch_prelink (struct prelink_info *info) 20 | ".plt")) 21 | break; 22 | 23 | - assert (i < dso->ehdr.e_shnum); 24 | + if (i == dso->ehdr.e_shnum) 25 | + return 0; 26 | data = dso->shdr[i].sh_addr + 0x16; 27 | write_le64 (dso, dso->info[DT_PLTGOT] + 8, data); 28 | } 29 | -- 30 | 2.21.0 31 | 32 | -------------------------------------------------------------------------------- /sys-config/ltoize/ltoize-0.9.10.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | inherit toolchain-funcs 7 | 8 | DESCRIPTION="A configuration for portage to make building with LTO easy" 9 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 10 | 11 | #Note: there's nothing preventing this from working on stable, but the dependencies of ltoize aren't keyworded for 12 | #stable, so we only can do testing 13 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 14 | 15 | SRC_URI="" 16 | 17 | LICENSE="GPL-2+" 18 | SLOT="0" 19 | IUSE="clang keep-nocommon override-flagomatic" 20 | 21 | #portage-bashrc-mv can be obtained from mv overlay 22 | DEPEND=" 23 | app-portage/portage-bashrc-mv[cflags] 24 | sys-apps/portage 25 | sys-devel/gcc-config 26 | " 27 | RDEPEND="${DEPEND}" 28 | 29 | #Test binutils and gcc version 30 | pkg_setup() { 31 | 32 | ACTIVE_GCC=$(gcc-fullversion) 33 | 34 | if ver_test "${ACTIVE_GCC}" -lt 10.2.0; then 35 | ewarn "Warning: Active GCC version '$ACTIVE_GCC' is lower then the expected version '10.2.0', it is recommended that you use the newest GCC if you want LTO." 36 | if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then 37 | eerror "Aborting LTOize installation due to older GCC version '$ACTIVE_GCC' -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour." 38 | die 39 | else 40 | ewarn "I_KNOW_WHAT_I_AM_DOING=y -- continuing anyway" 41 | fi 42 | fi 43 | 44 | if [ -f "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags" ]; then 45 | eerror "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags is a file not a directory. Please convert package.cflags to a directory with the current contents of package.cflags being moved to a file inside it." 46 | die 47 | fi 48 | 49 | } 50 | 51 | pkg_preinst() { 52 | ACTIVE_GCC=$(gcc-fullversion) 53 | GENTOOLTO_PORTDIR=$(portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay) 54 | LTO_PORTAGE_DIR="${GENTOOLTO_PORTDIR}/${CATEGORY}/${PN}/files" 55 | 56 | COMMON_WORKAROUNDS=( 57 | cmake-makefile.conf 58 | devirtualize-at-ltrans.conf 59 | graphite.conf 60 | ipa-pta.conf 61 | lto.conf 62 | no-common-libtool.conf 63 | no-plt.conf 64 | no-semantic-interposition.conf 65 | optimizations.conf 66 | portage-bashrc-mv.conf 67 | tls-dialect.conf 68 | use-ld.conf 69 | ) 70 | 71 | #Install make.conf settings 72 | elog "Installing make.conf.lto.defines definitions for optimizations used in this overlay" 73 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto.defines" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto.defines" 74 | 75 | elog "Installing make.conf.lto default full optimization config for make.conf" 76 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto" 77 | 78 | #Install main workarounds files 79 | for i in "${COMMON_WORKAROUNDS[@]}"; do 80 | elog "Installing package.cflags ${i} override" 81 | dosym "${LTO_PORTAGE_DIR}/package.cflags/${i}" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/${i}" 82 | done 83 | 84 | #Install -fno-common workarounds file 85 | use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/no-common.conf" \ 86 | "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/no-common.conf" 87 | 88 | # Install Clang LTO workarounds 89 | use clang && dosym "${LTO_PORTAGE_DIR}/package.cflags/clang.conf" \ 90 | "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/clang.conf" 91 | 92 | #Install patch framework 93 | elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay" 94 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/41-lto-patch.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/41-lto-patch.sh" 95 | 96 | #Optional: install flag-o-matic overrides 97 | if use override-flagomatic; then 98 | ewarn "Installing bashrc.d hook to override strip-flags and replace-flags functions in flag-o-matic. This is an experimental feature!" 99 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/42-lto-flag-o-matic.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/42-lto-flag-o-matic.sh" 100 | dosym "${LTO_PORTAGE_DIR}/package.cflags/flag-o-matic.conf" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/flag-o-matic.conf" 101 | fi 102 | 103 | elog "Installing bashrc.d hook symlink to override package libtool lt_cv_sys_global_symbol_pipe and lt_cv_sys_global_symbol_to_cdecl" 104 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/43-lto-no-common.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/43-lto-no-common.sh" 105 | } 106 | 107 | pkg_postinst() 108 | { 109 | elog "If you have not done so, you will need to modify your make.conf settings to enable LTO building on your system." 110 | elog "A symlink has been placed in ${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto that can be used as a basis for these modifications." 111 | elog "See README.md for more details." 112 | elog "lto-overlay and ltoize are part of a project to help find undefined behaviour in C and C++ programs through the use of aggressive compiler optimizations." 113 | elog "One of the aims of this project is also to improve the performance of linux distributions through these mechanisms as well." 114 | elog "Occasionally, you will experience breakage due to LTO problems. These are documented in the README.md of this repository." 115 | elog "If you add an override for a particular package, please consider sending a pull request upstream so that other users of this repository can benefit." 116 | ewarn "You will require a complete system rebuild in order to gain the benefits of LTO system-wide." 117 | echo 118 | elog "Please consider reading the README.md at the root of this repository before attempting to rebuild your system to familiarize yourself with the goals of this project and potential pitfalls you could run into." 119 | echo 120 | ewarn "This is an experimental project and should not be used on a stable system in its current state." 121 | 122 | BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//") 123 | 124 | if ver_test "${BINUTILS_VER}" -lt 2.34; then 125 | ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO." 126 | fi 127 | } 128 | -------------------------------------------------------------------------------- /sys-config/ltoize/ltoize-0.9.11.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | inherit toolchain-funcs 7 | 8 | DESCRIPTION="A configuration for portage to make building with LTO easy" 9 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 10 | 11 | #Note: there's nothing preventing this from working on stable, but the dependencies of ltoize aren't keyworded for 12 | #stable, so we only can do testing 13 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 14 | 15 | SRC_URI="" 16 | 17 | LICENSE="GPL-2+" 18 | SLOT="0" 19 | IUSE="clang keep-nocommon override-flagomatic" 20 | 21 | #portage-bashrc-mv can be obtained from mv overlay 22 | DEPEND=" 23 | app-portage/portage-bashrc-mv[cflags] 24 | sys-apps/portage 25 | sys-devel/gcc-config 26 | " 27 | RDEPEND="${DEPEND}" 28 | 29 | #Test binutils and gcc version 30 | pkg_setup() { 31 | 32 | ACTIVE_GCC=$(gcc-fullversion) 33 | 34 | if ver_test "${ACTIVE_GCC}" -lt 10.2.0; then 35 | ewarn "Warning: Active GCC version '$ACTIVE_GCC' is lower then the expected version '10.2.0', it is recommended that you use the newest GCC if you want LTO." 36 | if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then 37 | eerror "Aborting LTOize installation due to older GCC version '$ACTIVE_GCC' -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour." 38 | die 39 | else 40 | ewarn "I_KNOW_WHAT_I_AM_DOING=y -- continuing anyway" 41 | fi 42 | fi 43 | 44 | if [ -f "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags" ]; then 45 | eerror "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags is a file not a directory. Please convert package.cflags to a directory with the current contents of package.cflags being moved to a file inside it." 46 | die 47 | fi 48 | 49 | } 50 | 51 | pkg_preinst() { 52 | ACTIVE_GCC=$(gcc-fullversion) 53 | GENTOOLTO_PORTDIR=$(portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay) 54 | LTO_PORTAGE_DIR="${GENTOOLTO_PORTDIR}/${CATEGORY}/${PN}/files" 55 | 56 | COMMON_WORKAROUNDS=( 57 | cmake-makefile.conf 58 | devirtualize-at-ltrans.conf 59 | graphite.conf 60 | ipa-pta.conf 61 | lto.conf 62 | no-common-libtool.conf 63 | no-plt.conf 64 | no-semantic-interposition.conf 65 | optimizations.conf 66 | portage-bashrc-mv.conf 67 | tls-dialect.conf 68 | use-ld.conf 69 | ) 70 | 71 | #Install make.conf settings 72 | elog "Installing make.conf.lto.defines definitions for optimizations used in this overlay" 73 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto.defines" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/make.conf.lto.defines" 74 | 75 | elog "Installing make.conf.lto default full optimization config for make.conf" 76 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/make.conf.lto" 77 | 78 | #Install main workarounds files 79 | for i in "${COMMON_WORKAROUNDS[@]}"; do 80 | elog "Installing package.cflags ${i} override" 81 | dosym "${LTO_PORTAGE_DIR}/package.cflags/${i}" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/package.cflags/${i}" 82 | done 83 | 84 | #Install -fno-common workarounds file 85 | use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/no-common.conf" \ 86 | "${PORTAGE_CONFIGROOT#${EPREFIX}%/}/etc/portage/package.cflags/no-common.conf" 87 | 88 | # Install Clang LTO workarounds 89 | use clang && dosym "${LTO_PORTAGE_DIR}/package.cflags/clang.conf" \ 90 | "${PORTAGE_CONFIGROOT#${EPREFIX}%/}/etc/portage/package.cflags/clang.conf" 91 | 92 | #Install patch framework 93 | elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay" 94 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/41-lto-patch.sh" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/bashrc.d/41-lto-patch.sh" 95 | 96 | #Optional: install flag-o-matic overrides 97 | if use override-flagomatic; then 98 | ewarn "Installing bashrc.d hook to override strip-flags and replace-flags functions in flag-o-matic. This is an experimental feature!" 99 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/42-lto-flag-o-matic.sh" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/bashrc.d/42-lto-flag-o-matic.sh" 100 | dosym "${LTO_PORTAGE_DIR}/package.cflags/flag-o-matic.conf" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/package.cflags/flag-o-matic.conf" 101 | fi 102 | 103 | elog "Installing bashrc.d hook symlink to override package libtool lt_cv_sys_global_symbol_pipe and lt_cv_sys_global_symbol_to_cdecl" 104 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/43-lto-no-common.sh" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/bashrc.d/43-lto-no-common.sh" 105 | } 106 | 107 | pkg_postinst() 108 | { 109 | elog "If you have not done so, you will need to modify your make.conf settings to enable LTO building on your system." 110 | elog "A symlink has been placed in ${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto that can be used as a basis for these modifications." 111 | elog "See README.md for more details." 112 | elog "lto-overlay and ltoize are part of a project to help find undefined behaviour in C and C++ programs through the use of aggressive compiler optimizations." 113 | elog "One of the aims of this project is also to improve the performance of linux distributions through these mechanisms as well." 114 | elog "Occasionally, you will experience breakage due to LTO problems. These are documented in the README.md of this repository." 115 | elog "If you add an override for a particular package, please consider sending a pull request upstream so that other users of this repository can benefit." 116 | ewarn "You will require a complete system rebuild in order to gain the benefits of LTO system-wide." 117 | echo 118 | elog "Please consider reading the README.md at the root of this repository before attempting to rebuild your system to familiarize yourself with the goals of this project and potential pitfalls you could run into." 119 | echo 120 | ewarn "This is an experimental project and should not be used on a stable system in its current state." 121 | 122 | BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//") 123 | 124 | if ver_test "${BINUTILS_VER}" -lt 2.34; then 125 | ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO." 126 | fi 127 | } 128 | -------------------------------------------------------------------------------- /sys-config/ltoize/ltoize-0.9.12.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | inherit toolchain-funcs 7 | 8 | DESCRIPTION="A configuration for portage to make building with LTO easy" 9 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 10 | 11 | #Note: there's nothing preventing this from working on stable, but the dependencies of ltoize aren't keyworded for 12 | #stable, so we only can do testing 13 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 14 | 15 | SRC_URI="" 16 | 17 | LICENSE="GPL-2+" 18 | SLOT="0" 19 | IUSE="clang keep-nocommon override-flagomatic" 20 | 21 | #portage-bashrc-mv can be obtained from mv overlay 22 | DEPEND=" 23 | app-portage/portage-bashrc-mv[cflags] 24 | sys-apps/portage 25 | sys-devel/gcc-config 26 | " 27 | RDEPEND="${DEPEND}" 28 | 29 | #Test binutils and gcc version 30 | pkg_setup() { 31 | 32 | ACTIVE_GCC=$(gcc-fullversion) 33 | 34 | if ver_test "${ACTIVE_GCC}" -lt 10.2.0; then 35 | ewarn "Warning: Active GCC version '$ACTIVE_GCC' is lower then the expected version '10.2.0', it is recommended that you use the newest GCC if you want LTO." 36 | if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then 37 | eerror "Aborting LTOize installation due to older GCC version '$ACTIVE_GCC' -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour." 38 | die 39 | else 40 | ewarn "I_KNOW_WHAT_I_AM_DOING=y -- continuing anyway" 41 | fi 42 | fi 43 | 44 | if [ -f "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags" ]; then 45 | eerror "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags is a file not a directory. Please convert package.cflags to a directory with the current contents of package.cflags being moved to a file inside it." 46 | die 47 | fi 48 | 49 | } 50 | 51 | pkg_preinst() { 52 | ACTIVE_GCC=$(gcc-fullversion) 53 | if use override-flagomatic; then 54 | if [ -z "${LTO_OVERLAY_PATH}" ]; then 55 | eerror "It seems you're using the override-flagomatic feature of GentooLTO. You must set LTO_OVERLAY_PATH in your make.conf to point to where lto-overlay lives." 56 | eerror "You can use: 'portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay' to obtain it if you're not sure." 57 | die 58 | fi 59 | fi 60 | 61 | GENTOOLTO_PORTDIR="${LTO_OVERLAY_PATH}" 62 | LTO_PORTAGE_DIR="${GENTOOLTO_PORTDIR}/${CATEGORY}/${PN}/files" 63 | 64 | COMMON_WORKAROUNDS=( 65 | cmake-makefile.conf 66 | devirtualize-at-ltrans.conf 67 | graphite.conf 68 | ipa-pta.conf 69 | lto.conf 70 | no-common-libtool.conf 71 | no-plt.conf 72 | no-semantic-interposition.conf 73 | optimizations.conf 74 | portage-bashrc-mv.conf 75 | tls-dialect.conf 76 | use-ld.conf 77 | ) 78 | 79 | #Install make.conf settings 80 | elog "Installing make.conf.lto.defines definitions for optimizations used in this overlay" 81 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto.defines" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/make.conf.lto.defines" 82 | 83 | elog "Installing make.conf.lto default full optimization config for make.conf" 84 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/make.conf.lto" 85 | 86 | #Install main workarounds files 87 | for i in "${COMMON_WORKAROUNDS[@]}"; do 88 | elog "Installing package.cflags ${i} override" 89 | dosym "${LTO_PORTAGE_DIR}/package.cflags/${i}" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/package.cflags/${i}" 90 | done 91 | 92 | #Install -fno-common workarounds file 93 | use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/no-common.conf" \ 94 | "${PORTAGE_CONFIGROOT#${EPREFIX}%/}/etc/portage/package.cflags/no-common.conf" 95 | 96 | # Install Clang LTO workarounds 97 | use clang && dosym "${LTO_PORTAGE_DIR}/package.cflags/clang.conf" \ 98 | "${PORTAGE_CONFIGROOT#${EPREFIX}%/}/etc/portage/package.cflags/clang.conf" 99 | 100 | #Install patch framework 101 | elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay" 102 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/41-lto-patch.sh" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/bashrc.d/41-lto-patch.sh" 103 | 104 | #Optional: install flag-o-matic overrides 105 | if use override-flagomatic; then 106 | ewarn "Installing bashrc.d hook to override strip-flags and replace-flags functions in flag-o-matic. This is an experimental feature!" 107 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/42-lto-flag-o-matic.sh" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/bashrc.d/42-lto-flag-o-matic.sh" 108 | dosym "${LTO_PORTAGE_DIR}/package.cflags/flag-o-matic.conf" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/package.cflags/flag-o-matic.conf" 109 | fi 110 | 111 | elog "Installing bashrc.d hook symlink to override package libtool lt_cv_sys_global_symbol_pipe and lt_cv_sys_global_symbol_to_cdecl" 112 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/43-lto-no-common.sh" "${PORTAGE_CONFIGROOT#${EPREFIX}}/etc/portage/bashrc.d/43-lto-no-common.sh" 113 | } 114 | 115 | pkg_postinst() 116 | { 117 | elog "If you have not done so, you will need to modify your make.conf settings to enable LTO building on your system." 118 | elog "A symlink has been placed in ${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto that can be used as a basis for these modifications." 119 | elog "See README.md for more details." 120 | elog "lto-overlay and ltoize are part of a project to help find undefined behaviour in C and C++ programs through the use of aggressive compiler optimizations." 121 | elog "One of the aims of this project is also to improve the performance of linux distributions through these mechanisms as well." 122 | elog "Occasionally, you will experience breakage due to LTO problems. These are documented in the README.md of this repository." 123 | elog "If you add an override for a particular package, please consider sending a pull request upstream so that other users of this repository can benefit." 124 | ewarn "You will require a complete system rebuild in order to gain the benefits of LTO system-wide." 125 | echo 126 | elog "Please consider reading the README.md at the root of this repository before attempting to rebuild your system to familiarize yourself with the goals of this project and potential pitfalls you could run into." 127 | echo 128 | ewarn "This is an experimental project and should not be used on a stable system in its current state." 129 | 130 | BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//") 131 | 132 | if ver_test "${BINUTILS_VER}" -lt 2.34; then 133 | ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO." 134 | fi 135 | } 136 | -------------------------------------------------------------------------------- /sys-config/ltoize/ltoize-0.9.7.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | inherit toolchain-funcs 7 | 8 | DESCRIPTION="A configuration for portage to make building with LTO easy." 9 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 10 | 11 | #Note: there's nothing preventing this from working on stable, but the dependencies of ltoize aren't keyworded for 12 | #stable, so we only can do testing 13 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 14 | 15 | SRC_URI="" 16 | 17 | LICENSE="GPL-2+" 18 | SLOT="0" 19 | IUSE="override-flagomatic keep-nocommon" 20 | 21 | #portage-bashrc-mv can be obtained from mv overlay 22 | DEPEND=" 23 | >=sys-devel/binutils-2.32:* 24 | >=sys-devel/gcc-config-1.9.1 25 | >=sys-apps/portage-2.3.52 26 | app-portage/portage-bashrc-mv[cflags] 27 | " 28 | 29 | RDEPEND="${DEPEND}" 30 | 31 | #Test binutils and gcc version 32 | 33 | pkg_setup() { 34 | 35 | ACTIVE_GCC=$(gcc-fullversion) 36 | 37 | if ver_test "${ACTIVE_GCC}" -lt 10.2.0; then 38 | ewarn "Warning: Active GCC version '$ACTIVE_GCC' is lower then the expected version '10.2.0', it is recommended that you use the newest GCC if you want LTO." 39 | if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then 40 | eerror "Aborting LTOize installation due to older GCC version '$ACTIVE_GCC' -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour." 41 | die 42 | else 43 | ewarn "I_KNOW_WHAT_I_AM_DOING=y -- continuing anyway" 44 | fi 45 | fi 46 | 47 | if [ -f "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags" ]; then 48 | eerror "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags is a file not a directory. Please convert package.cflags to a directory with the current contents of package.cflags being moved to a file inside it." 49 | die 50 | fi 51 | 52 | } 53 | 54 | pkg_preinst() { 55 | 56 | GENTOOLTO_PORTDIR=$(portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay) 57 | LTO_PORTAGE_DIR="${GENTOOLTO_PORTDIR}/${CATEGORY}/${PN}/files" 58 | 59 | ACTIVE_GCC=$(gcc-fullversion) 60 | 61 | #Install make.conf settings 62 | 63 | elog "Installing make.conf.lto.defines definitions for optimizations used in this overlay" 64 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto.defines" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto.defines" 65 | 66 | elog "Installing make.conf.lto default full optimization config for make.conf" 67 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto" 68 | 69 | #Install main workarounds file 70 | 71 | elog "Installing ltoworkarounds.conf package.cflags overrides" 72 | dosym "${LTO_PORTAGE_DIR}/package.cflags/ltoworkarounds.conf" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/ltoworkarounds.conf" 73 | 74 | #Install -fno-common workarounds file 75 | use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/nocommon.conf" \ 76 | "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/nocommon.conf" 77 | 78 | #Install patch framework 79 | 80 | elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay" 81 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/41-lto-patch.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/41-lto-patch.sh" 82 | 83 | #Optional: install flag-o-matic overrides 84 | if use override-flagomatic; then 85 | ewarn "Installing bashrc.d hook to override strip-flags and replace-flags functions in flag-o-matic. This is an experimental feature!" 86 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/42-lto-flag-o-matic.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/42-lto-flag-o-matic.sh" 87 | fi 88 | 89 | elog "Installing bashrc.d hook symlink to override package libtool lt_cv_sys_global_symbol_pipe and lt_cv_sys_global_symbol_to_cdecl" 90 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/43-lto-no-common.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/43-lto-no-common.sh" 91 | 92 | } 93 | 94 | pkg_postinst() 95 | { 96 | elog "If you have not done so, you will need to modify your make.conf settings to enable LTO building on your system." 97 | elog "A symlink has been placed in ${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto that can be used as a basis for these modifications." 98 | elog "See README.md for more details." 99 | elog "lto-overlay and ltoize are part of a project to help find undefined behaviour in C and C++ programs through the use of aggressive compiler optimizations." 100 | elog "One of the aims of this project is also to improve the performance of linux distributions through these mechanisms as well." 101 | elog "Occasionally, you will experience breakage due to LTO problems. These are documented in the README.md of this repository." 102 | elog "If you add an override for a particular package, please consider sending a pull request upstream so that other users of this repository can benefit." 103 | ewarn "You will require a complete system rebuild in order to gain the benefits of LTO system-wide." 104 | echo 105 | elog "Please consider reading the README.md at the root of this repository before attempting to rebuild your system to familiarize yourself with the goals of this project and potential pitfalls you could run into." 106 | echo 107 | ewarn "This is an experimental project and should not be used on a stable system in its current state." 108 | 109 | BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//") 110 | 111 | if ver_test "${BINUTILS_VER}" -lt 2.34; then 112 | ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO." 113 | fi 114 | } 115 | -------------------------------------------------------------------------------- /sys-config/ltoize/ltoize-0.9.8.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | inherit toolchain-funcs 7 | 8 | DESCRIPTION="A configuration for portage to make building with LTO easy." 9 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 10 | 11 | #Note: there's nothing preventing this from working on stable, but the dependencies of ltoize aren't keyworded for 12 | #stable, so we only can do testing 13 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 14 | 15 | SRC_URI="" 16 | 17 | LICENSE="GPL-2+" 18 | SLOT="0" 19 | IUSE="override-flagomatic keep-nocommon" 20 | 21 | #portage-bashrc-mv can be obtained from mv overlay 22 | DEPEND=" 23 | >=sys-devel/binutils-2.32:* 24 | >=sys-devel/gcc-config-1.9.1 25 | >=sys-apps/portage-2.3.52 26 | app-portage/portage-bashrc-mv[cflags] 27 | " 28 | 29 | RDEPEND="${DEPEND}" 30 | 31 | #Test binutils and gcc version 32 | 33 | pkg_setup() { 34 | 35 | ACTIVE_GCC=$(gcc-fullversion) 36 | 37 | if ver_test "${ACTIVE_GCC}" -lt 10.2.0; then 38 | ewarn "Warning: Active GCC version '$ACTIVE_GCC' is lower then the expected version '10.2.0', it is recommended that you use the newest GCC if you want LTO." 39 | if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then 40 | eerror "Aborting LTOize installation due to older GCC version '$ACTIVE_GCC' -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour." 41 | die 42 | else 43 | ewarn "I_KNOW_WHAT_I_AM_DOING=y -- continuing anyway" 44 | fi 45 | fi 46 | 47 | if [ -f "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags" ]; then 48 | eerror "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags is a file not a directory. Please convert package.cflags to a directory with the current contents of package.cflags being moved to a file inside it." 49 | die 50 | fi 51 | 52 | } 53 | 54 | pkg_preinst() { 55 | GENTOOLTO_PORTDIR=$(portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay) 56 | LTO_PORTAGE_DIR="${GENTOOLTO_PORTDIR}/${CATEGORY}/${PN}/files" 57 | COMMON_WORKAROUNDS=( 58 | cmake-makefile.conf 59 | devirtualize-at-ltrans.conf 60 | graphite.conf 61 | ipa-pta.conf 62 | lto.conf 63 | no-common-libtool.conf 64 | no-plt.conf 65 | no-semantic-interposition.conf 66 | optimizations.conf 67 | tls-dialect.conf 68 | use-ld.conf 69 | ) 70 | 71 | ACTIVE_GCC=$(gcc-fullversion) 72 | 73 | #Install make.conf settings 74 | 75 | elog "Installing make.conf.lto.defines definitions for optimizations used in this overlay" 76 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto.defines" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto.defines" 77 | 78 | elog "Installing make.conf.lto default full optimization config for make.conf" 79 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto" 80 | 81 | #Install main workarounds files 82 | for i in "${COMMON_WORKAROUNDS[@]}"; do 83 | elog "Installing package.cflags ${i} override" 84 | dosym "${LTO_PORTAGE_DIR}/package.cflags/${i}" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/${i}" 85 | done 86 | 87 | #Install -fno-common workarounds file 88 | use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/no-common.conf" \ 89 | "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/no-common.conf" 90 | 91 | #Install patch framework 92 | elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay" 93 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/41-lto-patch.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/41-lto-patch.sh" 94 | 95 | #Optional: install flag-o-matic overrides 96 | if use override-flagomatic; then 97 | ewarn "Installing bashrc.d hook to override strip-flags and replace-flags functions in flag-o-matic. This is an experimental feature!" 98 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/42-lto-flag-o-matic.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/42-lto-flag-o-matic.sh" 99 | dosym "${LTO_PORTAGE_DIR}/package.cflags/flag-o-matic.conf" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/flag-o-matic.conf" 100 | fi 101 | 102 | elog "Installing bashrc.d hook symlink to override package libtool lt_cv_sys_global_symbol_pipe and lt_cv_sys_global_symbol_to_cdecl" 103 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/43-lto-no-common.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/43-lto-no-common.sh" 104 | 105 | } 106 | 107 | pkg_postinst() 108 | { 109 | elog "If you have not done so, you will need to modify your make.conf settings to enable LTO building on your system." 110 | elog "A symlink has been placed in ${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto that can be used as a basis for these modifications." 111 | elog "See README.md for more details." 112 | elog "lto-overlay and ltoize are part of a project to help find undefined behaviour in C and C++ programs through the use of aggressive compiler optimizations." 113 | elog "One of the aims of this project is also to improve the performance of linux distributions through these mechanisms as well." 114 | elog "Occasionally, you will experience breakage due to LTO problems. These are documented in the README.md of this repository." 115 | elog "If you add an override for a particular package, please consider sending a pull request upstream so that other users of this repository can benefit." 116 | ewarn "You will require a complete system rebuild in order to gain the benefits of LTO system-wide." 117 | echo 118 | elog "Please consider reading the README.md at the root of this repository before attempting to rebuild your system to familiarize yourself with the goals of this project and potential pitfalls you could run into." 119 | echo 120 | ewarn "This is an experimental project and should not be used on a stable system in its current state." 121 | 122 | BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//") 123 | 124 | if ver_test "${BINUTILS_VER}" -lt 2.34; then 125 | ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO." 126 | fi 127 | } 128 | -------------------------------------------------------------------------------- /sys-config/ltoize/ltoize-0.9.9.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2021 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | EAPI=7 5 | 6 | inherit toolchain-funcs 7 | 8 | DESCRIPTION="A configuration for portage to make building with LTO easy" 9 | HOMEPAGE="https://github.com/InBetweenNames/gentooLTO" 10 | 11 | #Note: there's nothing preventing this from working on stable, but the dependencies of ltoize aren't keyworded for 12 | #stable, so we only can do testing 13 | KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" 14 | 15 | SRC_URI="" 16 | 17 | LICENSE="GPL-2+" 18 | SLOT="0" 19 | IUSE="clang keep-nocommon override-flagomatic" 20 | 21 | #portage-bashrc-mv can be obtained from mv overlay 22 | DEPEND=" 23 | app-portage/portage-bashrc-mv[cflags] 24 | sys-apps/portage 25 | sys-devel/gcc-config 26 | " 27 | RDEPEND="${DEPEND}" 28 | 29 | #Test binutils and gcc version 30 | pkg_setup() { 31 | 32 | ACTIVE_GCC=$(gcc-fullversion) 33 | 34 | if ver_test "${ACTIVE_GCC}" -lt 10.2.0; then 35 | ewarn "Warning: Active GCC version '$ACTIVE_GCC' is lower then the expected version '10.2.0', it is recommended that you use the newest GCC if you want LTO." 36 | if [ "${I_KNOW_WHAT_I_AM_DOING}" != "y" ]; then 37 | eerror "Aborting LTOize installation due to older GCC version '$ACTIVE_GCC' -- set I_KNOW_WHAT_I_AM_DOING=y if you want to override this behaviour." 38 | die 39 | else 40 | ewarn "I_KNOW_WHAT_I_AM_DOING=y -- continuing anyway" 41 | fi 42 | fi 43 | 44 | if [ -f "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags" ]; then 45 | eerror "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags is a file not a directory. Please convert package.cflags to a directory with the current contents of package.cflags being moved to a file inside it." 46 | die 47 | fi 48 | 49 | } 50 | 51 | pkg_preinst() { 52 | ACTIVE_GCC=$(gcc-fullversion) 53 | GENTOOLTO_PORTDIR=$(portageq get_repo_path ${PORTAGE_CONFIGROOT} lto-overlay) 54 | LTO_PORTAGE_DIR="${GENTOOLTO_PORTDIR}/${CATEGORY}/${PN}/files" 55 | 56 | COMMON_WORKAROUNDS=( 57 | cmake-makefile.conf 58 | devirtualize-at-ltrans.conf 59 | graphite.conf 60 | ipa-pta.conf 61 | lto.conf 62 | no-common-libtool.conf 63 | no-plt.conf 64 | no-semantic-interposition.conf 65 | optimizations.conf 66 | tls-dialect.conf 67 | use-ld.conf 68 | ) 69 | 70 | #Install make.conf settings 71 | elog "Installing make.conf.lto.defines definitions for optimizations used in this overlay" 72 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto.defines" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto.defines" 73 | 74 | elog "Installing make.conf.lto default full optimization config for make.conf" 75 | dosym "${LTO_PORTAGE_DIR}/make.conf.lto" "${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto" 76 | 77 | #Install main workarounds files 78 | for i in "${COMMON_WORKAROUNDS[@]}"; do 79 | elog "Installing package.cflags ${i} override" 80 | dosym "${LTO_PORTAGE_DIR}/package.cflags/${i}" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/${i}" 81 | done 82 | 83 | #Install -fno-common workarounds file 84 | use keep-nocommon && dosym "${LTO_PORTAGE_DIR}/package.cflags/no-common.conf" \ 85 | "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/no-common.conf" 86 | 87 | # Install Clang LTO workarounds 88 | use clang && dosym "${LTO_PORTAGE_DIR}/package.cflags/clang.conf" \ 89 | "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/clang.conf" 90 | 91 | #Install patch framework 92 | elog "Installing bashrc.d hook symlink to apply LTO patches directly from lto-overlay" 93 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/41-lto-patch.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/41-lto-patch.sh" 94 | 95 | #Optional: install flag-o-matic overrides 96 | if use override-flagomatic; then 97 | ewarn "Installing bashrc.d hook to override strip-flags and replace-flags functions in flag-o-matic. This is an experimental feature!" 98 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/42-lto-flag-o-matic.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/42-lto-flag-o-matic.sh" 99 | dosym "${LTO_PORTAGE_DIR}/package.cflags/flag-o-matic.conf" "${PORTAGE_CONFIGROOT%/}/etc/portage/package.cflags/flag-o-matic.conf" 100 | fi 101 | 102 | elog "Installing bashrc.d hook symlink to override package libtool lt_cv_sys_global_symbol_pipe and lt_cv_sys_global_symbol_to_cdecl" 103 | dosym "${LTO_PORTAGE_DIR}/bashrc.d/43-lto-no-common.sh" "${PORTAGE_CONFIGROOT%/}/etc/portage/bashrc.d/43-lto-no-common.sh" 104 | } 105 | 106 | pkg_postinst() 107 | { 108 | elog "If you have not done so, you will need to modify your make.conf settings to enable LTO building on your system." 109 | elog "A symlink has been placed in ${PORTAGE_CONFIGROOT%/}/etc/portage/make.conf.lto that can be used as a basis for these modifications." 110 | elog "See README.md for more details." 111 | elog "lto-overlay and ltoize are part of a project to help find undefined behaviour in C and C++ programs through the use of aggressive compiler optimizations." 112 | elog "One of the aims of this project is also to improve the performance of linux distributions through these mechanisms as well." 113 | elog "Occasionally, you will experience breakage due to LTO problems. These are documented in the README.md of this repository." 114 | elog "If you add an override for a particular package, please consider sending a pull request upstream so that other users of this repository can benefit." 115 | ewarn "You will require a complete system rebuild in order to gain the benefits of LTO system-wide." 116 | echo 117 | elog "Please consider reading the README.md at the root of this repository before attempting to rebuild your system to familiarize yourself with the goals of this project and potential pitfalls you could run into." 118 | echo 119 | ewarn "This is an experimental project and should not be used on a stable system in its current state." 120 | 121 | BINUTILS_VER=$(binutils-config ${CHOST} -c | sed -e "s/.*-//") 122 | 123 | if ver_test "${BINUTILS_VER}" -lt 2.34; then 124 | ewarn "Warning: active binutils version < 2.34, it is recommended that you use the newest binutils for LTO." 125 | fi 126 | } 127 | -------------------------------------------------------------------------------- /sys-config/ltoize/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | lookatyouhacker@gmail.com 6 | Shane Peelar 7 | 8 | 9 | LTOize is a set of configuration files and overrides to make building your system Link Time Optimization easy. 10 | This is part of a bigger initiative to find errors in C and C++ programs that are caused by undefined behaviour. 11 | Users are strongly encouraged to contribute their configuration changes upstream. 12 | For more information, see the gentooLTO project on GitHub. 13 | 14 | 15 | Install clang.conf overrides where LTO on Clang creates issues 16 | Override strip-flags and replace-flags in flag-o-matic.eclass (EXPERIMENTAL) 17 | Keep old -fno-common overrides for older GCCs (not recommended) 18 | 19 | 20 | -------------------------------------------------------------------------------- /testconfig/mv.conf: -------------------------------------------------------------------------------- 1 | [mv] 2 | location = /usr/local/mv 3 | masters = gentoo 4 | auto-sync = no 5 | 6 | --------------------------------------------------------------------------------