From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 266E7C05027 for ; Mon, 23 Jan 2023 15:15:37 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4P0tvq2xj1z3fBD for ; Tue, 24 Jan 2023 02:15:35 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.crashing.org (client-ip=63.228.1.57; helo=gate.crashing.org; envelope-from=segher@kernel.crashing.org; receiver=) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lists.ozlabs.org (Postfix) with ESMTP id 4P0tv808Wmz3bgv for ; Tue, 24 Jan 2023 02:14:59 +1100 (AEDT) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 30NF7JXS005826; Mon, 23 Jan 2023 09:07:19 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 30NF7GUt005822; Mon, 23 Jan 2023 09:07:16 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 23 Jan 2023 09:07:16 -0600 From: Segher Boessenkool To: Nathan Chancellor Subject: Re: [PATCH v2 07/14] powerpc/vdso: Improve linker flags Message-ID: <20230123150716.GJ25951@gate.crashing.org> References: <20221228-drop-qunused-arguments-v2-0-9adbddd20d86@kernel.org> <20221228-drop-qunused-arguments-v2-7-9adbddd20d86@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221228-drop-qunused-arguments-v2-7-9adbddd20d86@kernel.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas@fjasle.eu, linux-kbuild@vger.kernel.org, trix@redhat.com, masahiroy@kernel.org, llvm@lists.linux.dev, ndesaulniers@google.com, npiggin@gmail.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi! On Wed, Jan 11, 2023 at 08:05:04PM -0700, Nathan Chancellor wrote: > When clang's -Qunused-arguments is dropped from KBUILD_CPPFLAGS, there > are several warnings in the PowerPC vDSO: > > clang-16: error: -Wl,-soname=linux-vdso32.so.1: 'linker' input unused [-Werror,-Wunused-command-line-argument] > clang-16: error: -Wl,--hash-style=both: 'linker' input unused [-Werror,-Wunused-command-line-argument] > clang-16: error: argument unused during compilation: '-shared' [-Werror,-Wunused-command-line-argument] > > clang-16: error: argument unused during compilation: '-nostdinc' [-Werror,-Wunused-command-line-argument] > clang-16: error: argument unused during compilation: '-Wa,-maltivec' [-Werror,-Wunused-command-line-argument] There is nothing wrong with the warnings, but as usual, -Werror is very counterproductive. > The first group of warnings point out that linker flags were being added > to all invocations of $(CC), even though they will only be used during > the final vDSO link. Move those flags to ldflags-y. Which is explicitly allowed, and won't do anything, so nothing harmful either. It is not a bad idea to avoid this if that is trivial to do, of course. > The second group of warnings are compiler or assembler flags that will > be unused during linking. Filter them out from KBUILD_CFLAGS so that > they are not used during linking. And here it is even more obviously fine. If you need obfuscation like in your patch, it is better not to do this imo. The warning text "linker input unused" is misleading btw. It would be good to warn about that, if it was true: very likely the user didn't intend what he wrote. But a linker input is an object file, or perhaps a linker script. These things are just compiler flags. Segher