From patchwork Fri Aug 6 20:52:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 12423819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1219C4320A for ; Fri, 6 Aug 2021 20:52:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 93E9461078 for ; Fri, 6 Aug 2021 20:52:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235749AbhHFUxA (ORCPT ); Fri, 6 Aug 2021 16:53:00 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:59374 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231472AbhHFUw7 (ORCPT ); Fri, 6 Aug 2021 16:52:59 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id A1378143B5E; Fri, 6 Aug 2021 16:52:43 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=sasl; bh=PFVVRp9Za1vp K7QRO4upgx2xpdN2uVvomRFaL5YuZhI=; b=p3A2IyAwiDavhPJD/GOa8MJdTsrv NXJ1eXnc2DWTamepsJazEOcnxW492+FpHzns+W2YWUcdBBUAVdfi5lTX2TnqrpED SWDlhf2I1mph6QlITkMk4s5iRNmOoFAgU+HN2iRbQUJTAO2z8j2r/U2xPGz//RbV 7vKcCXhNaHeWYTY= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 91486143B5D; Fri, 6 Aug 2021 16:52:43 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [35.196.71.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id DCEC2143B5A; Fri, 6 Aug 2021 16:52:40 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= Subject: [PATCH v2 1/3] build: update detect-compiler for newer Xcode version Date: Fri, 6 Aug 2021 13:52:33 -0700 Message-Id: <20210806205235.988761-2-gitster@pobox.com> X-Mailer: git-send-email 2.33.0-rc1-159-gdd7297d7fa In-Reply-To: <20210806205235.988761-1-gitster@pobox.com> References: <20210806205235.988761-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 3D822E80-F6F8-11EB-B3C2-D5C30F5B5667-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Carlo Marcelo Arenas Belón 1da1580e4c (Makefile: detect compiler and enable more warnings in DEVELOPER=1, 2018-04-14) uses the output of the compiler banner to detect the compiler family. Apple had since changed the wording used to refer to its compiler as clang instead of LLVM as shown by: $ cc --version Apple clang version 12.0.5 (clang-1205.0.22.9) Target: x86_64-apple-darwin20.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin so update the script to match, and allow DEVELOPER=1 to work as expected again in macOS. Signed-off-by: Carlo Marcelo Arenas Belón Signed-off-by: Junio C Hamano --- detect-compiler | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect-compiler b/detect-compiler index 70b754481c..c85be83c64 100755 --- a/detect-compiler +++ b/detect-compiler @@ -44,7 +44,7 @@ clang) "FreeBSD clang") print_flags clang ;; -"Apple LLVM") +"Apple LLVM"|"Apple clang") print_flags clang ;; *) From patchwork Fri Aug 6 20:52:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 12423821 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F217CC4320E for ; Fri, 6 Aug 2021 20:52:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D6045611BF for ; Fri, 6 Aug 2021 20:52:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237522AbhHFUxE (ORCPT ); Fri, 6 Aug 2021 16:53:04 -0400 Received: from pb-smtp21.pobox.com ([173.228.157.53]:65302 "EHLO pb-smtp21.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237026AbhHFUxD (ORCPT ); Fri, 6 Aug 2021 16:53:03 -0400 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 09C58149FFD; Fri, 6 Aug 2021 16:52:47 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=P23OOUhCYA3v2pXp0XLNiZEl9 v9h5Q/bTsmg/F//I8s=; b=sGhkgRb9eNQycV2m24Gpdk2vZC2aFmD9iYh2GC6Aa tVmOJjDpG+TWBZhPg9heJ/Lxl7w4Je/wdN4vidJ4C21mj+pebFAHnXEXRx2OaQtg uE3BCXnGg7xlbfWTJSGZRwItnQzgSlg5FOi/w2vjI2EWOJZ/evX73nuiuSlA3bh6 8k= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 02542149FFC; Fri, 6 Aug 2021 16:52:47 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [35.196.71.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 4B2A3149FFB; Fri, 6 Aug 2021 16:52:44 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Cc: Jeff King Subject: [PATCH v2 2/3] build: clang version may not be followed by extra words Date: Fri, 6 Aug 2021 13:52:34 -0700 Message-Id: <20210806205235.988761-3-gitster@pobox.com> X-Mailer: git-send-email 2.33.0-rc1-159-gdd7297d7fa In-Reply-To: <20210806205235.988761-1-gitster@pobox.com> References: <20210806205235.988761-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 3F89CA1C-F6F8-11EB-BAB9-FA9E2DDBB1FC-77302942!pb-smtp21.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Jeff King The get_family and get_version helpers of detect-compiler assume that the line to identify the version from the compilers have a token "version", followed by the version number, followed by some other string, e.g. $ CC=gcc get_version_line gcc version 10.2.1 20210110 (Debian 10.2.1-6) But that is not necessarily true, e.g. $ CC=clang get_version_line Debian clang version 11.0.1-2 Tweak the script not to require extra string after the version. Signed-off-by: Junio C Hamano --- detect-compiler | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detect-compiler b/detect-compiler index c85be83c64..955be1c906 100755 --- a/detect-compiler +++ b/detect-compiler @@ -13,11 +13,11 @@ get_version_line() { } get_family() { - get_version_line | sed 's/^\(.*\) version [0-9][^ ]* .*/\1/' + get_version_line | sed 's/^\(.*\) version [0-9].*/\1/' } get_version() { - get_version_line | sed 's/^.* version \([0-9][^ ]*\) .*/\1/' + get_version_line | sed 's/^.* version \([0-9][^ ]*\).*/\1/' } print_flags() { From patchwork Fri Aug 6 20:52:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 12423823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93EB6C4338F for ; Fri, 6 Aug 2021 20:52:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A53661078 for ; Fri, 6 Aug 2021 20:52:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237716AbhHFUxF (ORCPT ); Fri, 6 Aug 2021 16:53:05 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:58670 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237371AbhHFUxE (ORCPT ); Fri, 6 Aug 2021 16:53:04 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 8F51CEF577; Fri, 6 Aug 2021 16:52:47 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=9XjKMr+wvb4JncvE5sY8BY37I NzqQ2Aa6ZPtLVLiLqo=; b=K+pwBuKqRk5/Theim2+e5P+Ksa9wv4idTp2cFrOsd C91cTk4jGdYsONPvzWN9KRwrODH0sqSsWC5vE4NTcJU3N8gm6wJP4XclLP+AA97l lP4EJfe+DE/tF1Q98QEYqnNoIX3fSNKQ0Ged/HuasMoCDUsOcFD1+eijJehjGjCY j8= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 6C19CEF576; Fri, 6 Aug 2021 16:52:47 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [35.196.71.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id D65DDEF575; Fri, 6 Aug 2021 16:52:46 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Subject: [PATCH v2 3/3] build: catch clang that identifies itself as "$VENDOR clang" Date: Fri, 6 Aug 2021 13:52:35 -0700 Message-Id: <20210806205235.988761-4-gitster@pobox.com> X-Mailer: git-send-email 2.33.0-rc1-159-gdd7297d7fa In-Reply-To: <20210806205235.988761-1-gitster@pobox.com> References: <20210806205235.988761-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 411176DC-F6F8-11EB-AFBF-8B3BC6D8090B-77302942!pb-smtp1.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The case statement in detect-compiler notices 'clang', 'FreeBSD clang' and 'Apple clang', but there are other platforms that follow the '$VENDOR clang' pattern (e.g. Debian). Generalize the pattern to catch them. Signed-off-by: Junio C Hamano --- detect-compiler | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/detect-compiler b/detect-compiler index 955be1c906..11d60da5b7 100755 --- a/detect-compiler +++ b/detect-compiler @@ -38,13 +38,10 @@ case "$(get_family)" in gcc) print_flags gcc ;; -clang) +clang | *" clang") print_flags clang ;; -"FreeBSD clang") - print_flags clang - ;; -"Apple LLVM"|"Apple clang") +"Apple LLVM") print_flags clang ;; *)