On 09/12/2020 14:57, Matthias Klose wrote:
> 
> that's again hard-coding 'python'.
> 

I believe this way of invoking python should be better than just
hardcoding python, instead using the interpreter that was called for the
first script.

--------------------------
>From 304afba63fb851fae461fcd89a7ecdba3e96c313 Mon Sep 17 00:00:00 2001
From: Simon Cook <simon.c...@embecosm.com>
Date: Wed, 9 Dec 2020 10:39:28 +0000
Subject: [PATCH] RISC-V: Explicitly call python when using multilib
generator

When building GCC for RISC-V with the --with-multilib-generator option,
it may not be possible to call arch-canonicalize as an executable when
building on Windows. Instead directly invoke the expected python
interpreter for this step.

gcc/ChangeLog:

        * config/riscv/multilib-generator (arch_canonicalize): Invoke
        python interpreter when calling arch-canonicalize script.
---
 gcc/config/riscv/multilib-generator | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/riscv/multilib-generator
b/gcc/config/riscv/multilib-generator
index 53c51dfa53f..ccfd9ea18ea 100755
--- a/gcc/config/riscv/multilib-generator
+++ b/gcc/config/riscv/multilib-generator
@@ -54,7 +54,8 @@ def arch_canonicalize(arch):
   this_file = os.path.abspath(os.path.join( __file__))
   arch_can_script = \
     os.path.join(os.path.dirname(this_file), "arch-canonicalize")
-  proc = subprocess.Popen([arch_can_script, arch], stdout=subprocess.PIPE)
+  proc = subprocess.Popen([sys.executable, arch_can_script, arch],
+                          stdout=subprocess.PIPE)
   out, err = proc.communicate()
   return out.strip()

-- 
2.24.3

Reply via email to