Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1965764pxu; Fri, 18 Dec 2020 02:09:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQH4Gr+7UQaMW2n1hN0bYoakXNlsyLpnzwgNVbvaMXMpIEIr5trAKq1anKNPsFfPYpibfZ X-Received: by 2002:a7b:c259:: with SMTP id b25mr3557442wmj.40.1608286188567; Fri, 18 Dec 2020 02:09:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608286188; cv=none; d=google.com; s=arc-20160816; b=GKmEe8xsohDFemXO2w8wkH/vgqOb+U0m8ZxwpXPszrB8OaOcLKxynADNJVqSzTIMPl wQDZ2M2AEwAr93kybFirEia9T5jaCU4iXCuJtzidCi2YG2rsNJ4781pfqLNhOaRSWbFp PI+juJXBwKGWEGJkcL+x0aaP7smTuSRimjeNiBX2s78Jw7/RHB4FHlJoe12qq/6hVzgA OhUo25M01vOTN0P4XMhvjJkXz8ih9MsnN0bTFx8TdjPLi903HkixremEL7OJZgA8l9Mh XOiXTmDYn7bdrc3Nw7FlInDIOuJjPpMDJYtizzQKgeluc+qArxTxjFEqD1My5xC0s5T4 vbeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=S9pk/V38+14aiE6pntomV50spJ9B875dCSkKTkEeOP4=; b=D4Ov6xtJiEKhepVVZvA7jI6tzE+koTgUjOYt+No7Dk4POob2E9gi18I6K/VaukC6kn /sYaWXtos4AiffSf5WP991MrhQQE7Fp7frHVhiBMNpAzvCwBC4DswkKqSzojaDz2bL9U EDa0OCcuJo34a9gUeCBFZDZQR70AWNYvfTSvlRXDuz8L6TW/HXss0e6ahTw0Gkr3Bdjf WXFsWB2adGA3WvyVgdY4dw5uX4/hJuWcCv8ATRA7WL2Mk3KirgRsOFeGNhR9lOISzpM0 ozGdrQsZrUYGmmZAM2aUzEbjQZhX0YkpUZW/ZBEaf2qNd0yE1GCdTraAhY8xCaLp3bxI eZWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Af2xlqDN; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq3si5945558edb.72.2020.12.18.02.09.25; Fri, 18 Dec 2020 02:09:48 -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=@samsung.com header.s=mail20170921 header.b=Af2xlqDN; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725884AbgLRKGW (ORCPT + 99 others); Fri, 18 Dec 2020 05:06:22 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:42684 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbgLRKGV (ORCPT ); Fri, 18 Dec 2020 05:06:21 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201218100528euoutp01bb1778382829a494fedfaecd723fddde~Rx4fbq6C32679326793euoutp01u for ; Fri, 18 Dec 2020 10:05:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201218100528euoutp01bb1778382829a494fedfaecd723fddde~Rx4fbq6C32679326793euoutp01u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608285928; bh=S9pk/V38+14aiE6pntomV50spJ9B875dCSkKTkEeOP4=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Af2xlqDNZ71yf1UvkcozhN6XGPr2LTaGLVr1ayw1LMgvJOGWhTeKnNzn1tCE40lzo NAcKYcz6nJYGvkky+2FulioXY7tgnH3WcUKH9+ODZeAIYw6+Z2bkY7uprCm5hMzBBR Z2Oeggdj4LQV73sw4wOpK1lfRghG9W2rjqLuSe/s= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20201218100523eucas1p2a1005fc0e7eb87baaf906068f971e1bb~Rx4akRf0O3270732707eucas1p2a; Fri, 18 Dec 2020 10:05:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 54.96.45488.2EE7CDF5; Fri, 18 Dec 2020 10:05:22 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201218100522eucas1p1e27bcf5daf8c771afb098cb9583826bf~Rx4aJdk7b1143611436eucas1p1b; Fri, 18 Dec 2020 10:05:22 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201218100522eusmtrp29c131ba75e4d068edee7b1f9d2180f3d~Rx4aIuhDa2025320253eusmtrp2K; Fri, 18 Dec 2020 10:05:22 +0000 (GMT) X-AuditID: cbfec7f5-c5fff7000000b1b0-94-5fdc7ee24e5b Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E7.7E.16282.2EE7CDF5; Fri, 18 Dec 2020 10:05:22 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201218100521eusmtip1848e0a2add27f5dab494f89c90820836~Rx4ZgAbaU2048120481eusmtip1O; Fri, 18 Dec 2020 10:05:21 +0000 (GMT) Subject: Re: [PATCH] gcc-plugins: simplify GCC plugin-dev capability test To: Masahiro Yamada Cc: Linux Kbuild mailing list , Kees Cook , Emese Revfy , linux-hardening@vger.kernel.org, Linus Torvalds , Nathan Chancellor , Nick Desaulniers , clang-built-linux , Linux Kernel Mailing List From: Marek Szyprowski Message-ID: <9f959875-1a30-b1a1-b626-3805e24a6df3@samsung.com> Date: Fri, 18 Dec 2020 11:05:21 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKKsWRmVeSWpSXmKPExsWy7djP87qP6u7EG+x4aWnx4M1sNosz3bkW 89b/ZLT4s2sHk8XlXXPYLB4+uMFq8eFticWHCf+ZLN6dBoo/6nvL7sDlMbvhIovHzll32T0W bCr12DPxJJvHplWdbB4nZvxm8fi8SS6APYrLJiU1J7MstUjfLoEr4+DufsaC6+oVV56vZmxg PKLYxcjJISFgIjGvfzpLFyMXh5DACkaJ6183MYIkhAS+MErc75aBSHxmlJh8bCozTMeaj5uZ IBLLGSWa/jaxQjgfGSWW7FnHClIlLOApcerzSnYQW0RAS+LO0g6wImaBVcwSr0/uAUuwCRhK dL3tYgOxeQXsJJYtmQlmswioSizY+wdskKhAksT6rh9QNYISJ2c+YQGxOQUCJa6vfAUWZxaQ l9j+dg4zhC0ucevJfLDzJAT+c0gs/vSFHeJuF4k1rdOhfhCWeHV8C1RcRuL/TpiGZkaJh+fW skM4PYwSl5tmMEJUWUvcOfcLaB0H0ApNifW79CHCjhJLd85kAglLCPBJ3HgrCHEEn8SkbSC7 QMK8Eh1tQhDVahKzjq+DW3vwwiXmCYx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CQts5C0zELSsoCRZRWjSGppcW56brGRXnFibnFpXrpecn7uJkZgjG479nPLDsaVrz7q HWJk4mA8xCjBwawkwhv64Ha8EG9KYmVValF+fFFpTmrxIUZToHcmMkuJJucDk0ReSbyhmYGp oYmZpYGppZmxkjivyZE18UIC6YklqdmpqQWpRTB9TBycUg1M7CcPrWUReaDr+fqRy335gCuM NzbHicecV9ivrjJ/pvYbj1spHkul7xX7/Vr0bXfCapvnUav3rXp0Ourg/+27tP+IGXq7cHmc 5guwvnTLVzc/O+MGn5Hoc4Fqp4NKxUWJc3dNK7vy5f+U1490iw/ffPSy5HaVzHLmF/+NN3xa vLBkxqe8hft+BrNYCv+vPJNg5x7AmJcX0LKv6OTeHdfP+S0Uy95s7ZOYMLHlLfsEiV13yvps H/fNYBOWNS/IfvFb9bCX5gTVXrmZL7cw+mR8cj7XnHPP7/mTsAafx7OPWNQyXtaze/Tmq5hD n2L6SaH8Y9/E6j7sDNJs/pD2gesKA/OLK6Uv5njrXtHeJ2hcrcRSnJFoqMVcVJwIAG/xEzla AwAA X-CMS-MailID: 20201218100522eucas1p1e27bcf5daf8c771afb098cb9583826bf X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201218075758eucas1p1605768803a5c9edce4fbe54b3e3b859a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201218075758eucas1p1605768803a5c9edce4fbe54b3e3b859a References: <20201203125700.161354-1-masahiroy@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland