Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2175216pxu; Fri, 18 Dec 2020 07:13:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxwl80C0eK1skPHPy2o4w02q9Ro8QDk7BXyFStPpF3H3Eauzfd3CrjZdLUf+YNtl3LT4Fsl X-Received: by 2002:a17:907:417f:: with SMTP id oe23mr4314221ejb.259.1608304423216; Fri, 18 Dec 2020 07:13:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608304423; cv=none; d=google.com; s=arc-20160816; b=nrU2TmQmp4M2rbjpuBOhPg18kCbsZl7BD1JO2NtBajOJ4OVQSvHV1nqb/u1k5x+cgr w79IPHFDRFut6qohOLI9ohwGLWRwHqoMx4kZl3oVBfOAiawlPzzMDSdoy4PYpmta4+JX EQfrQ7JpYRtE80hI8ysNtswh3E1xxojlfCoSmP82t9Pp9O/4fnYRVOLEft1At03wdsQq /kRo7DQKyaIo9wCQIcTFXUK3zrC2nkydoZuWPIl7uICK0eWMjrkRbr5rebejpEIsQz7X pfxhoDisWTdHjQJjD0klxE8ApMaoWfhEr4S8w1GMX6ykhXBrwrx8/ce81AWCAh8+R5DV 8pqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lj0cgIiRp4EY/qLHe2VqR/w32Vw4lOgdGII4wOr5mm0=; b=E/kErJd6Kh9EWXaHppVqh9PKDoFjSdmsgzXNvH2q5cER3UggL3GIiuVl1nNvYW4evT QRClEviIn/640ZA3FQ2pMPzFJtimhzf5rYd5txjgK7/7QVC4L3ZsHw+OtcaHGD9vonT1 UnQB+7ClbP+568GW5rWkiNapqTsULDVmNVCEybFBHZHcansL17YRdx6odIfcAJIzzEGA QMxT8a8BJGAU8CO864FyTY7OYTc32BA/5CwHn3IfibsZGUajyJap801mwIJe6aW3mOIR klEAPjJb17RsP5ZYC2Bi7YbaTNms/D88QJK4kHnYOcf/uEK9VwoPXtyD4NQCqQ+ePrFM d/Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SY751HPe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu15si4720399ejb.667.2020.12.18.07.13.18; Fri, 18 Dec 2020 07:13:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=SY751HPe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727979AbgLRPNM (ORCPT + 99 others); Fri, 18 Dec 2020 10:13:12 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:1126 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbgLRPNM (ORCPT ); Fri, 18 Dec 2020 10:13:12 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Fri, 18 Dec 2020 07:12:31 -0800 Received: from [10.26.73.104] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 18 Dec 2020 15:12:25 +0000 Subject: Re: [PATCH] gcc-plugins: simplify GCC plugin-dev capability test To: Marek Szyprowski , Masahiro Yamada CC: Linux Kbuild mailing list , Kees Cook , Emese Revfy , , Linus Torvalds , Nathan Chancellor , Nick Desaulniers , clang-built-linux , "Linux Kernel Mailing List" , linux-tegra References: <20201203125700.161354-1-masahiroy@kernel.org> <9f959875-1a30-b1a1-b626-3805e24a6df3@samsung.com> <25030057-86b1-5619-25fd-acfa0728b850@samsung.com> From: Jon Hunter Message-ID: <4ab4f62f-8b37-01e1-f81c-270155b13a51@nvidia.com> Date: Fri, 18 Dec 2020 15:12:23 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <25030057-86b1-5619-25fd-acfa0728b850@samsung.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1608304351; bh=lj0cgIiRp4EY/qLHe2VqR/w32Vw4lOgdGII4wOr5mm0=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=SY751HPetqpEFnYv6rjJB+G9hI2s5RIauBk7Kiu8Ll/gUfPDvs8D4hgv4xLCI+Eup 1k/JODigLHcIxL/p1EC81mKpy3uiAeuBW6RGIuxj97CZO/pOc+CAxXbBRVfL3tZybK MesleiIkNRYdMSAIPf6FFG7b/IwI8bF78lBRzQZuPgNObwj5UaFo7WNp1e9dqCNU8X XjmcTrAuIfgLQRQvV7yCiWVhyTg1TXN+8KkuvgnraEeOZyaObvNhzJc0k1YCFLl7nm pSSfjttyZUOidg5GycXNbj1A8gLfWuoNb5uRT8QYYjts/wy0mI0jwPb0MGdIVwT8bT 1GuY4mqszT7tg== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/12/2020 15:09, Marek Szyprowski wrote: > > On 18.12.2020 16:03, Jon Hunter wrote: >> On 18/12/2020 10:05, Marek Szyprowski wrote: >>> On 18.12.2020 10:43, Masahiro Yamada wrote: >>>> On Fri, Dec 18, 2020 at 4:58 PM Marek Szyprowski >>>> wrote: >>>>> On 03.12.2020 13:57, Masahiro Yamada wrote: >>>>>> Linus pointed out a third of the time in the Kconfig parse stage comes >>>>>> from the single invocation of cc1plus in scripts/gcc-plugin.sh [1], >>>>>> and directly testing plugin-version.h for existence cuts down the >>>>>> overhead a lot. [2] >>>>>> >>>>>> This commit takes one step further to kill the build test entirely. >>>>>> >>>>>> The small piece of code was probably intended to test the C++ designated >>>>>> initializer, which was not supported until C++20. >>>>>> >>>>>> In fact, with -pedantic option given, both GCC and Clang emit a warning. >>>>>> >>>>>> $ echo 'class test { public: int test; } test = { .test = 1 };' | g++ -x c++ -pedantic - -fsyntax-only >>>>>> :1:43: warning: C++ designated initializers only available with '-std=c++2a' or '-std=gnu++2a' [-Wpedantic] >>>>>> $ echo 'class test { public: int test; } test = { .test = 1 };' | clang++ -x c++ -pedantic - -fsyntax-only >>>>>> :1:43: warning: designated initializers are a C++20 extension [-Wc++20-designator] >>>>>> class test { public: int test; } test = { .test = 1 }; >>>>>> ^ >>>>>> 1 warning generated. >>>>>> >>>>>> Otherwise, modern C++ compilers should be able to build the code, and >>>>>> hopefully skipping this test should not make any practical problem. >>>>>> >>>>>> Checking the existence of plugin-version.h is still needed to ensure >>>>>> the plugin-dev package is installed. The test code is now small enough >>>>>> to be embedded in scripts/gcc-plugins/Kconfig. >>>>>> >>>>>> [1] https://protect2.fireeye.com/v1/url?k=03db90e1-5c40a828-03da1bae-0cc47a336fae-4cc36f5830aeb78d&q=1&e=dfdc1cf9-82d6-4ca5-b35d-1782e918bde3&u=https%3A%2F%2Flore.kernel.org%2Flkml%2FCAHk-%3DwjU4DCuwQ4pXshRbwDCUQB31ScaeuDo1tjoZ0_PjhLHzQ%40mail.gmail.com%2F >>>>>> [2] https://protect2.fireeye.com/v1/url?k=965b670a-c9c05fc3-965aec45-0cc47a336fae-e34339513ff747c0&q=1&e=dfdc1cf9-82d6-4ca5-b35d-1782e918bde3&u=https%3A%2F%2Flore.kernel.org%2Flkml%2FCAHk-%3DwhK0aQxs6Q5ijJmYF1n2ch8cVFSUzU5yUM_HOjig%3D%2Bvnw%40mail.gmail.com%2F >>>>>> >>>>>> Reported-by: Linus Torvalds >>>>>> Signed-off-by: Masahiro Yamada >>>>> This patch landed in linux next-20201217 as commit 1e860048c53e >>>>> ("gcc-plugins: simplify GCC plugin-dev capability test"). >>>>> >>>>> It causes a build break with my tests setup, but I'm not sure weather it >>>>> is really an issue of this commit or a toolchain I use. However I've >>>>> checked various versions of the gcc cross-compilers released by Linaro >>>>> at https://protect2.fireeye.com/v1/url?k=053727b6-5aac1f7f-0536acf9-0cc47a336fae-5bd799e7ce6b1b9b&q=1&e=dfdc1cf9-82d6-4ca5-b35d-1782e918bde3&u=https%3A%2F%2Freleases.linaro.org%2Fcomponents%2Ftoolchain%2Fbinaries%2F and all >>>>> fails with the same error: >>>>> >>>>> $ make ARCH=arm >>>>> CROSS_COMPILE=../../cross/gcc-arm-10.2-2020.11-x86_64-arm-none-eabi/bin/arm-none-eabi- >>>>> zImage >>>>> HOSTCXX scripts/gcc-plugins/arm_ssp_per_task_plugin.so >>>>> In file included from >>>>> /home/mszyprow/dev/cross/gcc-arm-10.2-2020.11-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/10.2.1/plugin/include/gcc-plugin.h:28:0, >>>>> from scripts/gcc-plugins/gcc-common.h:7, >>>>> from scripts/gcc-plugins/arm_ssp_per_task_plugin.c:3: >>>>> /home/mszyprow/dev/cross/gcc-arm-10.2-2020.11-x86_64-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/10.2.1/plugin/include/system.h:687:10: >>>>> fatal error: gmp.h: No such file or directory >>>>> #include >>>>> ^~~~~~~ >>>>> compilation terminated. >>>>> scripts/gcc-plugins/Makefile:47: recipe for target >>>>> 'scripts/gcc-plugins/arm_ssp_per_task_plugin.so' failed >>>>> make[2]: *** [scripts/gcc-plugins/arm_ssp_per_task_plugin.so] Error 1 >>>>> scripts/Makefile.build:496: recipe for target 'scripts/gcc-plugins' failed >>>>> make[1]: *** [scripts/gcc-plugins] Error 2 >>>>> Makefile:1190: recipe for target 'scripts' failed >>>>> make: *** [scripts] Error 2 >>>>> >>>>> Compilation works if I use the cross-gcc provided by >>>>> gcc-7-arm-linux-gnueabi/gcc-arm-linux-gnueabi Ubuntu packages, which is: >>>>> >>>>> $ arm-linux-gnueabi-gcc --version >>>>> arm-linux-gnueabi-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0 >>>>> >>>> I can compile gcc-plugins with Linaro toolchians. >>>> >>>> The version of mine is this: >>>> >>>> masahiro@oscar:~/ref/linux-next$ >>>> ~/tools/arm-linaro-7.5/bin/arm-linux-gnueabihf-gcc --version >>>> arm-linux-gnueabihf-gcc (Linaro GCC 7.5-2019.12) 7.5.0 >>>> Copyright (C) 2017 Free Software Foundation, Inc. >>>> This is free software; see the source for copying conditions. There is NO >>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. >>>> >>>> >>>> >>>> >>>> Maybe, it depends on the host environment? >>>> >>>> >>>> Please try this: >>>> >>>> $ sudo apt install libgmp-dev >>> Indeed, it was missing on my setup. Sorry for the noise. >> >> So this change also breaks the build on our farm build machines and >> while we can request that packages are installed on these machines, it >> takes time. Is there anyway to avoid this? > > You can temporarily revert 1e860048c53e (this patch). Again that works locally, but these automated builders just pull the latest -next branch and build. Jon -- nvpublic