aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile2
-rw-r--r--README.md15
-rwxr-xr-xgcc-config12
-rwxr-xr-xtests/run_tests5
5 files changed, 23 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 44ddfac..c5579e7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,5 @@
/.c89
/.c99
/.gcc-config
+
+tests/TMP-*
diff --git a/Makefile b/Makefile
index 5d84b50..5b00d75 100644
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ install: all
$(INSTALL_EXE) .c99 $(DESTDIR)$(BINDIR)/c99 ; \
fi
$(INSTALL_DATA) gcc.eselect $(DESTDIR)$(ESELECTDIR)
- $(INSTALL_DATA) README $(DESTDIR)$(DOCDIR)
+ $(INSTALL_DATA) README.md $(DESTDIR)$(DOCDIR)
test check: .gcc-config
cd tests && ./run_tests
diff --git a/README.md b/README.md
index e4effa0..6af211e 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# What is gcc-config?
-`gcc-config` allows Gentoo users to switch active gcc safely
-and allows querying facts about installed toolchains.
+`gcc-config` allows Gentoo users to switch active gcc safely and allows
+querying facts about installed toolchains.
## Usage
@@ -12,10 +12,9 @@ To switch active `gcc` while system runs:
$ gcc-config x86_64-pc-linux-gnu-7.2.0
```
-Ideally changes should be visible instantly and atomically
-without shell restart.
+Ideally changes should be visible instantly and atomically without shell restart.
-To query where real `gcc` binaries are hiding:
+To query where the real `gcc` binaries are hiding:
```
$ gcc-config -B $(gcc-config -c)
@@ -82,11 +81,11 @@ Used by `env-update` to populate `$PATH` and more (TODO: remove `$PATH` populati
## TODOs
-- Write proper `gcc-config` manpage off this readme to be more discoverable.
+- Write proper `gcc-config` manpage based on this readme to be more discoverable.
-- Figure out symlink ownership story. Today symlinks don't belong to any package.
+- Figure out symlink ownership story. Right now, symlinks don't belong to any package.
- See [bug 626606](https://bugs.gentoo.org/626606)
+ See [bug 626606](https://bugs.gentoo.org/626606).
## Releasing
diff --git a/gcc-config b/gcc-config
index 404ab29..4e92445 100755
--- a/gcc-config
+++ b/gcc-config
@@ -318,7 +318,7 @@ update_wrappers() {
x=${x%:*}
if [[ ! -x ${ref} ]] ; then
- if is_cross_compiler ; then
+ if is_cross_compiler && [[ ${ref} != *-accel-* ]] ; then
ewarn "insanity with ${x} and ${ref}"
else
# For native targets, the ref might not be
@@ -332,6 +332,16 @@ update_wrappers() {
# Delete stale native symlink.
rm -f "${EROOT}usr/bin/${x}"
elif [[ -x ${ref} ]] ; then
+ # accel/offload compilers are named like 'x86_64-pc-linux-gnu-accel-nvptx-none-gcc'.
+ #
+ # When building the offload compiler, we'll have ${CHOST}-${CTARGET} where
+ # CHOST is the host and CTARGET is whatever the offload target is. gcc-config
+ # doesn't expect this 'double tuple'.
+ #
+ # e.g. when building nvptx-none, we'll have something like 'nvptx-none-x86_64-pc-linux-gnu-accel-nvptx-none-gcc'
+ # and we want to strip that to be just x86_64-pc-linux-gnu-accel-nvptx-none-gcc, as that's
+ # what we want symlinks to be made for in /usr/bin.
+ [[ ${x} == *-accel-* ]] && x="${x#${CTARGET}-}"
atomic_ln "${ref#${ROOT}}" "${EROOT}usr/bin" "${x}"
else
# Make sure we have no stale wrappers
diff --git a/tests/run_tests b/tests/run_tests
index ef38770..cf48620 100755
--- a/tests/run_tests
+++ b/tests/run_tests
@@ -23,7 +23,7 @@ source "${functions_script}" || {
die() { echo "$*" 1>&2; exit 1; }
-vars=( CHOST GCC_CONFIG ROOT TROOT NOCOLOR RC_NOCOLOR )
+vars=( CHOST GCC_CONFIG ROOT TROOT NO_COLOR )
unset ${vars[@]}
TROOT=${PWD}
@@ -33,8 +33,7 @@ if ! "${GCC_CONFIG}" --help >/dev/null ; then
fi
PATH="${TROOT}/..:${PATH}"
-NOCOLOR="true"
-RC_NOCOLOR="yes" # Older baselayout/openrc versions.
+NO_COLOR="true"
# This CHOST value doesn't matter. It could be anything.
# As long as all the configs we test are based on this being
# the CHOST value.