From patchwork Mon Nov 14 11:43:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 19736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2097696wru; Mon, 14 Nov 2022 03:47:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Qtu3XtNFLpUzV0hyR+J8tKsDQ337S/tYptuwA7lGuZWI9XxM/Tlzox+PxZ2pFBrYJ4Vc9 X-Received: by 2002:a17:906:3c14:b0:7ae:c9d4:7073 with SMTP id h20-20020a1709063c1400b007aec9d47073mr9418049ejg.711.1668426474840; Mon, 14 Nov 2022 03:47:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668426474; cv=none; d=google.com; s=arc-20160816; b=V7AymUk8JMfUIeYzZVhifX2tG1P1/R6kOQqR8tvTvuK0YPt0KqP38gch/3HfCPmcvC UfCdXLpAmazBjlIoBfC/rHh+HKNve3zNlpTtsvSqXX8/WVMZxexc7IHPx57m95stPF5G Bdvhz/Y1MqKOQoH9sgONYso+kmiDhVQlNivMaCRmbzH4Vty3EUv7eOF3KtXJZ2IsBLdA JSePIr7p5U9G22Va6FkeY8yW44v8UbGNTfqunTfocoOKrmEzKQc7xipLv7hl3j1htKC1 k4BKH1jSthRc9KP9mSw8Hc7/VyoTBrOZZ6xMZoXpAKf3hot6Yi8uSRygHlUR6oBP525b fWkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WTDOweGU4aet5fsFYBmH+tq2jJgsZIj5FRrMM1R4Qnk=; b=0DBim3KzefARk3zVxKgUlvOKRjRCdj+YyzCTa6k2EpZ2UeEmVxreHIZWdwep798/JR vbCNqtOngxJ6DfgoKw6YjpMYbtm++SeLJoT3QbgcTLY5lONJEPRl76VKTJEw5sBxehY8 SB8edOLK4Z/4IxpF6s87DA2nG7jOhTr1I1Q/ulTt4T9cSQ/fNCZ1gcnQd+y+tASlQUsu at0RX4OlnNjXiLvADXzrprCKVh/Fmid85V1R1mbBGXNe2NeljugsyqJTjMRKh9+/+Zpm ATMzbkDhxiPRzMUdxXM7rZS8BNJkyvarbGtI2BC2s553npwrg8HnHOADigPkKbNSYiGn p8kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gcb0VhWK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a50ce4f000000b0045d5cf18d4bsi7488930edj.583.2022.11.14.03.47.31; Mon, 14 Nov 2022 03:47:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gcb0VhWK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236503AbiKNLoW (ORCPT + 99 others); Mon, 14 Nov 2022 06:44:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236464AbiKNLoH (ORCPT ); Mon, 14 Nov 2022 06:44:07 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9963C1570A for ; Mon, 14 Nov 2022 03:44:06 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 35E4461029 for ; Mon, 14 Nov 2022 11:44:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 891A3C433C1; Mon, 14 Nov 2022 11:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668426245; bh=/bPckjdOvaLL9aYvpMmz9nRldK/d5QG2/4Y6OavRec0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gcb0VhWKCt/rxScfhWiVX2zbIqOoDNuBGwnZITiBSXj3+tR6NlcaR/m4+URYXcqMJ s642tIz5alNfcOpJ0C/ELdyJEhT+nX64teeD/LtSyD7ePpsrExKkdt/YI9C3NfsBSc BzWk8i5kc31SotvFZZTIfE/VMK6URsbWVEgpSS06xhe1J4tVNywoOjRgEJhwprz/No m5CfY4XAm7qrakrw59iD+BRedBO3DWBHqibzakvPvRNzGj54WyuL9au6+vRgXAwUq6 c96wd6J89lijmExSkF7PHu4/33ZirEUQCGcR0/JD2qMjgEYFf4CRlg/XAoLCbpx1QM E5qhr5gmBhK5A== From: "Jiri Slaby (SUSE)" To: linux-kernel@vger.kernel.org Cc: Jiri Slaby , kernel test robot , Martin Liska Subject: [PATCH 04/46] compiler.h: introduce __visible_on_lto Date: Mon, 14 Nov 2022 12:43:02 +0100 Message-Id: <20221114114344.18650-5-jirislaby@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221114114344.18650-1-jirislaby@kernel.org> References: <20221114114344.18650-1-jirislaby@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749471959147823620?= X-GMAIL-MSGID: =?utf-8?q?1749471959147823620?= From: Jiri Slaby __visible_on_lto is defined as "__visible" when gcc LTO is turned on (see later patches), and "static" otherwise. It is needed for top-level symbols which are referenced in assembly. It is because the assembly and the symbol can each end up in a different file with gcc LTO. And that leads to linker errors. So the symbols have to be visible when gcc LTO is in charge. On the contrary, they have to be static on non-gcc-LTO builds. Otherwise a warning about missing declaration occurs. Reported-by: kernel test robot Cc: Martin Liska Signed-off-by: Jiri Slaby --- include/linux/compiler.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 973a1bfd7ef5..2305a3cbe99c 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -133,6 +133,12 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, #define __annotate_jump_table #endif /* CONFIG_OBJTOOL */ +#ifdef CONFIG_LTO_GCC +# define __visible_on_lto __visible +#else +# define __visible_on_lto static +#endif + #ifndef unreachable # define unreachable() do { \ annotate_unreachable(); \