summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* gcc-config: maintain ABI ordering for LDPATHv2.3.2Sergei Trofimovich2020-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Before the change we ordered paths in reverse order for both gcc versions and ABI lists: $ cat /etc/ld.so.conf.d/05gcc-x86_64-pc-linux-gnu.conf /usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/32 /usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/32 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0 After the change we preserved ABI ordering and use reverse gcc version ordering: $ cat /etc/ld.so.conf.d/05gcc-x86_64-pc-linux-gnu.conf /usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0 /usr/lib/gcc/x86_64-pc-linux-gnu/11.0.0/32 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0 /usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/32 In theory both should work. I practice some systems (like riscv today) do not distinct between some ABIs. Let's list valid ABI first to keep such systems running. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: make USE_CC_WRAPPERS=yes to install cc/f77 linksManoj Gupta2020-06-242-2/+10
| | | | | | | | Add USE_CC_WRAPPERS option to control installation of cc/f77 symlinks. This will let packages other than GCC to install 'cc'. Signed-off-by: Manoj Gupta <manojgupta@google.com> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: add 'Releasing' sectionv2.3.1Sergei Trofimovich2020-06-211-0/+6
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: document c89/c99 wrapper presenceSergei Trofimovich2020-06-211-0/+3
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* tests: fix 'insanity' testsSergei Trofimovich2020-06-201-4/+1
| | | | | | | | commit 8a4854aec042f ("gcc-config: make USE_NATIVE_LINKS=no to clean stale symlinks") dropped warnings around 'insanity' checks. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: install /usr/bin/c{89,99}, take over from toolchain.eclassSergei Trofimovich2020-06-209-4/+91
| | | | | | Reported-by: Kent Fredric Bug: https://bugs.gentoo.org/728722 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: finish comment linesSergei Trofimovich2020-05-231-2/+2
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: make USE_NATIVE_LINKS=no to clean /lib/cppv2.3Sergei Trofimovich2020-05-221-1/+5
| | | | | Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: make USE_NATIVE_LINKS=no to clean stale symlinksSergei Trofimovich2020-05-221-7/+6
| | | | | | | | Before the change symlinks like /usr/bin/cc were untouched. After the change they are explicitly removed. Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: clarify comments on how aliases are expandedSergei Trofimovich2020-05-221-2/+5
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: add facts around tool namesSergei Trofimovich2020-05-221-0/+23
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: link /lib/cpp to qualified 'cpp'Sergei Trofimovich2020-05-221-1/+1
| | | | | | | | | | Change link /lib/cpp from /usr/bin/cpp to /usr/bin/${CTARGET}-cpp. When USE_NATIVE_LINKS=no starts skipping unqualified links we might want to delete /lib/cpp, or keep it. Depends on how many tools depend on it's presence. Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: add build-time and runtime switches to disable native symlinksSergei Trofimovich2020-05-222-2/+14
| | | | | | | | | | | We have two knobs here: 1. Build-time knob USE_NATIVE_LINKS to set a default, defaults to 'yes' (existing behaviour) 2. Run-time --enable-native-links / --disable-native-links knobs. These are not persistent across gcc-config runs and are meant for manual testing. Undocumented for now. Reported-by: Kent Fredric Bug: https://bugs.gentoo.org/724454 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: add a TODO to use 'sort -V'Sergei Trofimovich2020-04-101-1/+2
| | | | | | Was suggested by Jason A. Donenfeld and jthill. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* tests: add a test for bug #706318v2.2.1Sergei Trofimovich2020-01-269-0/+15
| | | | | Bug: https://bugs.gentoo.org/706318 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: distinguish errors between bad profile and bad compilerSergei Trofimovich2020-01-261-5/+8
| | | | | | | The distinction is useful when making tests: compiler is often missing when config is present. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: fix numbered access to toolchainsSergei Trofimovich2020-01-261-1/+1
| | | | | | | | | | | | | In commit bc80e12ab1 ("gcc-config: add basic version sorting support") i've missed the case of accessing toolchain by number: $ gcc-config -L 1 The change adds version sorting to numbered access as well. Reported-by: lekto@o2.pl Bug: https://bugs.gentoo.org/706318 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: add basic version sorting supportv2.2Sergei Trofimovich2020-01-124-3/+42
| | | | | | | | | | | | | | | | Before the change gcc version orderig was relying on bash sorting in flob matches, like: cat /etc/env.d/gcc/${CHOST}-* | fgrep LDPATH | tail -n 1 This stopped working with gcc-10, which lexicographically goes before gcc-9. The workaround for now is to normalizeversions to fixed-width and order them lexicographically: gcc-0009 gcc-0010 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: consolidate profiles sourcing logic in a single functionv2.1Sergei Trofimovich2019-09-081-18/+11
| | | | | Bug: https://bugs.gentoo.org/174422 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: Ignore PATH set in profile files.Arfrever Frehtes Taifersar Arahesis2019-09-081-0/+18
| | | | | | | | | | | Profile files created by toolchain.eclass before gentoo commit 534e0f7d5e8a02264b7b7fc97c3ef11441e35c5c contain assignment of PATH variable (e.g. PATH="/usr/x86_64-pc-linux-gnu/gcc-bin/9.2.0"). Sourcing them without restoring previous PATH value breaks gcc-config. Fixes: 231bc60d6fa6b8eb309ac2ca308f7c60213f81a3 Bug: https://bugs.gentoo.org/174422 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Revert "gcc-config: store gcc backup into /lib/gcc-backup, not /lib"Sergei Trofimovich2019-09-074-80/+4
| | | | | | | | | | | | | This reverts commit 44570a44be60a8fc33bd05089047c1f2980b3047. Unfortunately ld.so does has static set of fallback paths when it fails to lookup shared library from ld.so.cache: those are /lib64 and /usr/lib64 on amd64. Let's revert the change and jkeep relying on /lib64 for now. Bug: https://bugs.gentoo.org/667020 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: add einfo logging around library backupSergei Trofimovich2019-09-071-0/+3
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: store gcc backup into /lib/gcc-backup, not /libSergei Trofimovich2019-09-074-4/+79
| | | | | | | | | | | | | | | Writing (and removing) libraries to /lib outside package manager was a surprise to users in bug #667020# where libunwind.so was clobbered by gcc-config runs. This change isolates all logic that handles file copies outside package manager into /lib/gcc-backup directory. To make new library still resolveable we install env.d entry with contents of LDPATH="/lib/gcc-backup" Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Makefile: drop C*FLAGS from Makefile as gcc-wrapper is no moreSergei Trofimovich2019-09-071-4/+0
| | | | | | gcc-config doec not contain C code nowadays. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Makefile: install READMESergei Trofimovich2019-09-071-1/+4
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: add examples of querying facts about toolchainsSergei Trofimovich2019-09-071-3/+12
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: drop empty /etc/env.d/05gcc-${CTARGET} filesSergei Trofimovich2019-09-072-12/+10
| | | | | | | Thesse files are generated for cross-gcc only. Were empty since Aug 2018. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: don't recreate unused '.NATIVE' symlink.Sergei Trofimovich2019-09-072-9/+4
| | | | | | As gcc-wrapper is gone nothing should use it anymore. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: avoid false-positive detection of 'sed' useSergei Trofimovich2019-09-071-1/+1
| | | | | | | Noticed when ran 'make check': * Running source/test.sed ... due to log difference; see tests/source/test.sed.log [ !! ] Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: drop /etc/env.d/gcc/config migration codeSergei Trofimovich2019-09-061-14/+0
| | | | | | | /etc/env.d/gcc/config migraion was enabled 7 years ago. Let's assume everyone migrated by now. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: clarify status of /etc/env.d/gcc/.NATIVESergei Trofimovich2019-09-061-2/+7
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: linewrap long commentSergei Trofimovich2019-09-061-1/+2
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: Use findmnt for mountpoint check when available.Arfrever Frehtes Taifersar Arahesis2019-09-061-4/+33
| | | | | | Closes: https://bugs.gentoo.org/693588 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: change comment to clarify why env-udate is still usefulSergei Trofimovich2019-09-051-1/+1
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: drop GCC_PATH reconstruction in /etc/env.d/gccSergei Trofimovich2019-09-051-24/+0
| | | | | | | | | | | | | toolchain.eclass constructs correct GCC_PATH since 2007: commit 7d9f89700a2ee50674c0d871ec6d21b468ac6206 ("start moving to GCC_PATH for env.d #174422 and cleanup " "gcc-config logic so that it doesnt matter what the ROOT value is") We don't need to rewrite /etc/env.d/gcc/<TARGET>-<VER> files anymore (owned by gcc ebuilds). Bug: https://bugs.gentoo.org/174422 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: update comment about env.d formatSergei Trofimovich2019-09-051-3/+3
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: tweak comment around 'gsed' use.Sergei Trofimovich2019-09-051-3/+1
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: During initial clean-up, delete only libunwind.so.7*, but not ↵Arfrever Frehtes Taifersar Arahesis2019-09-051-7/+10
| | | | | | | | | | | | other files matching libunwind.so*. libunwind.so belongs to sys-libs/libunwind. libunwind.so.7* is copied by gcc-config (only on ia64) from active version of sys-devel/gcc. libunwind.so.8* belong to sys-libs/libunwind since 1.0.1 version released on 2011-09-11. [slyfox@: sumplified 'return' statement] Bug: https://bugs.gentoo.org/667020 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
* gcc-config: clarify why libunwind.so* is needed at allSergei Trofimovich2019-09-041-0/+5
| | | | | | Bug: https://bugs.gentoo.org/667020 Bug: https://bugs.gentoo.org/693252 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: don't perform a cleanup for prefix systemsSergei Trofimovich2019-09-041-4/+4
| | | | | | | | Patch by [Arfrever]. No changes in actual handling of /lib*/ file on non-prefix systems yet. Bug: https://bugs.gentoo.org/667020 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Convert binary wrapper to a symlink wrapper.v2.0Sergei Trofimovich2018-08-248-414/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before the change: /usr/bin/gcc and friends were a copy of /usr/$(libexecdir)/misc/gcc-config After the change: /usr/bin/gcc is a symlink to a real compiler binary. Examples: /usr/${CTARGET}/gcc-bin/${GCC_VER}/gcc (native) /usr/${CHOST}/${CTARGET}/gcc-bin/${GCC_VER}/gcc (cross) gcc-config is a binary wrapper that does (or did) a few things: - [removed in 2011] injects additional CFLAGS_${ABI} Removed in commit 7ac40f3eb8434961f70485247d883f5b3009dcf2 "Stop auto appending CFLAGS_<abi> from the env." - traverses PATH for real compiler binary and reexecutes it. - reads /etc/env.d/05gcc-${CTARGET} as a fallback if PATH is empty. Today binary wrapper does only PATH resolution and re-execution. This change has a few minor benefits: - PATH will not contain explicit /usr/${CHOST}/${CTARGET}/gcc-bin/${GCC_VER} entry. This will make PATH shorter for those who have mavy cross-compilers installed. - compiler switch will not require sourcing '. /etc/profile' as changes are applied as soon an symlink is switched. - ccache will see gcc binary changes directly and react accordingly. Previously in default configuration ccache cache depended on state of /usr/$(libexecdir)/misc/gcc-config See bug #640958 where ccache did not notice USE=-pie -> USE=pie switch. - Reasoning about PATH ordering is straightforward: all available binaries (as symlinks) are in /usr/bin. See bug #255695 where PATH ordering changed and bug #626606 where people get confused on what is in /usr/bin/gcc binary. Bug: https://bugs.gentoo.org/626606 Bug: https://bugs.gentoo.org/255695 Bug: https://bugs.gentoo.org/640958 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: document /etc/env.d/04gcc-${CTARGET}Sergei Trofimovich2018-08-241-2/+15
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: fix typos s/Practially/Practically and s/tolchain/toolchain/Sergei Trofimovich2018-08-241-2/+2
| | | | | | Noticed by [Arfrever]. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* README: add basic description of how gcc-config worksSergei Trofimovich2018-08-241-0/+103
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* tests: follow rename of 'gcc-config' -> 'wrapper'Sergei Trofimovich2018-08-131-0/+0
| | | | | | | Fix tests to follow commit 39af3214ed29d9a3ca867988f7f2f3b995cafd66 ("rename installed binary wrapper from 'gcc-config' to 'wrapper'") Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* rename installed binary wrapper from 'gcc-config' to 'wrapper'Sergei Trofimovich2018-08-132-5/+5
| | | | | | | | | | | | | Before the change installed directory was: /usr/$(libexecdir)/misc/gcc-config /usr/bin/gcc-config After the change: /usr/$(libexecdir)/gcc-config/wrapper /usr/bin/gcc-config Should decrease confusion between a script and wrapper binary. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* gcc-config: fix tests (drop einfo for LTO plugin)Sergei Trofimovich2018-08-132-3/+0
| | | | | | | | | | Before the change 3 tests failed due to extra output about switching to LTO plugin: * Running rw-multi-native-configs/test.use-old ... due to log difference; see .../TMP-test.use-old-rw-multi-native-configs/test.use-old.log [ !! ] * Running rw-multi-native-configs/test.select-insane ... due to log difference; see .../TMP-test.select-insane-rw-multi-native-configs/test.select-insane.log [ !! ] * Running rw-multi-native-configs/test.select ... due to log difference; see .../TMP-test.select-rw-multi-native-configs/test.select.log [ !! ] Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* tests/run_tests: switch to /lib/gentoo/functions.shSergei Trofimovich2018-08-131-2/+2
| | | | Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* wrapper.c: inhibit "unused argc" warningSergei Trofimovich2018-08-131-0/+1
| | | | | | | | | | Before the change the warning was: wrapper.c: In function 'main': wrapper.c:281:14: warning: unused parameter 'argc' [-Wunused-parameter] int main(int argc, char *argv[]) ~~~~^~~~ Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Inform, not warn, about LTO symlinksAndreas K. Hüttel2017-12-161-1/+1
|