diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2020-12-06 11:39:22 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2020-12-08 15:38:02 +0800 |
commit | 4aaf33718f09daf1cd2864b3db07faa2e44642ff (patch) | |
tree | 48727807cadd81d912d54fcd85b73c49451b2e96 | |
parent | 9121f8084162ff6193a5e941cab1429e4180997a (diff) | |
download | gcc-4aaf33718f09daf1cd2864b3db07faa2e44642ff.zip gcc-4aaf33718f09daf1cd2864b3db07faa2e44642ff.tar.gz gcc-4aaf33718f09daf1cd2864b3db07faa2e44642ff.tar.bz2 |
PR target/98152: Checking python is available before using
We'll try to canonicalize the arch string for --with-arch,
and the script is written in python, however it will turns out
GCC require python to build for RISC-V port, it's not expect as
the GCC requirement.
So this patch is made this as optional, detect python and only use it
when it available, it won't break any functionality with out doing
canonicalization, just might build one more redundant multi-lib.
gcc/ChangeLog:
PR target/98152
* config.gcc (riscv*-*-*): Checking python, python3 or python2
is available, and skip doing with_arch canonicalize if no python
available.
-rw-r--r-- | gcc/config.gcc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index 9c76044..3650b46 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4623,7 +4623,10 @@ case "${target}" in exit 1 ;; esac - with_arch=`${srcdir}/config/riscv/arch-canonicalize ${with_arch}` + PYTHON=`which python || which python3 || which python2` + if test "x${PYTHON}" != x; then + with_arch=`${PYTHON} ${srcdir}/config/riscv/arch-canonicalize ${with_arch}` + fi tm_defines="${tm_defines} TARGET_RISCV_DEFAULT_ARCH=${with_arch}" # Make sure --with-abi is valid. If it was not specified, |