From patchwork Sun Dec 6 06:12:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 1411684 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=edZMsZj+; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cpbj173QVz9sW1 for ; Sun, 6 Dec 2020 17:13:07 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F16AC388A43B; Sun, 6 Dec 2020 06:13:02 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 2218D384A02C for ; Sun, 6 Dec 2020 06:13:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2218D384A02C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kito.cheng@sifive.com Received: by mail-pf1-x431.google.com with SMTP id t7so6803227pfh.7 for ; Sat, 05 Dec 2020 22:13:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eprNkrVu4R/MLG0OJ/Y9WS7MFo+lN3TMhEWjswMcLfo=; b=edZMsZj+lMZe0iMCa4ofTSk3yv1V2WYt7GVyG/qmHyoNt6UBVv1qGhR8YNto/Gd1pC QcRqK9NBKVlUbiTt1XEMRAvz7uCVP+9o4XZy3r2v2/GmqUQ8Fdw9wzASKYHR57uEKTLz v9JAgxT0keMt+UXecb4SU9dQXRvuK3uX1lgkd/vpswvha5VThNdyoFGVgyUntoaAfEU3 lGZi9nIi83yFuxeqOdjO7RzyyOaERbF/6zDGBwC9joH+WwcQbHvrXoFD28V4/bs+llVu 2CyRT0XiuEQaOGXEul+X4gqdb8BHWsdjyJaGRhz5kHz5hQXiEBK5Sc+FcKnS9jm/XAvr 59hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eprNkrVu4R/MLG0OJ/Y9WS7MFo+lN3TMhEWjswMcLfo=; b=DTVIN77gGBOPxwqk5czRIHVUG5LJClzAPkv9Cw6ftT43ZV2TgyBYWIxVhUJC5ykjPp qN19FD1aWA3SKLhLIO5agOPuVSe0H5i27zEDPyNMp7/KmOzVVO1VaoCt99VAXV1C1FuB 8quCp85QT9fA7JY83dsQynQ8cFrpYN0P4XwzzPwVOgZ1KxeuGsw80NbGRR8bBITwaFsl MaCSX7GQiehvKctPAettJSWZWn8eLx0AOTTL1WJHOjPUZfHmyQPyfmgio9rOXTSelxv/ gCGRs/cmzd+occKo6cHlVnwxFIq3F/GlAu15yg7wGZJjdv/mf6fePo93tWUGzEf67LP1 xwrQ== X-Gm-Message-State: AOAM531mjlTqSDl4H0AXvcnv7jFr3SeJa4i0/Thzk1UuNxrDJM5c9GdX ZfwxAkI36DWutLHdQw+lgcCOSNlx8YUnyB2L X-Google-Smtp-Source: ABdhPJy+W2cb59pnkT1huLF2KvCKI8qAmyP5pV3jymzApUtRcvibMUCzhEVGIX9iysNUbET1etqHRg== X-Received: by 2002:a65:60d8:: with SMTP id r24mr13769892pgv.152.1607235178928; Sat, 05 Dec 2020 22:12:58 -0800 (PST) Received: from hsinchu02.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id w9sm7075281pjq.0.2020.12.05.22.12.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2020 22:12:58 -0800 (PST) From: Kito Cheng To: gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, jimw@sifive.com, marxin@gcc.gnu.org, schwab@linux-m68k.org, doko@ubuntu.com, jakub@redhat.com Subject: [PATCH] PR target/98152: Checking python is available before using Date: Sun, 6 Dec 2020 14:12:50 +0800 Message-Id: <20201206061250.114770-1-kito.cheng@sifive.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Spam-Status: No, score=-13.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kito Cheng Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" 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: * config.gcc (riscv*-*-*): Checking python, python3 or python2 is available, and skip doing with_arch canonicalize if no python available. --- gcc/config.gcc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 9c7604481f1..3650b46734a 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,