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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBF86C433FE for ; Thu, 17 Nov 2022 08:24:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239337AbiKQIYd (ORCPT ); Thu, 17 Nov 2022 03:24:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234051AbiKQIY3 (ORCPT ); Thu, 17 Nov 2022 03:24:29 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDD5B27FCE for ; Thu, 17 Nov 2022 00:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=24lQ+vB2A9HKyuZWwcPYI0llW6cx4tLwTs8kPnawQG0=; b=KJLYsWFxNDxSqACXhkvA0ynOpL J43a0H0SWNiDhsCqhpXIcKphHTLcibi61SUpuwtu3pbq0SUeEBwYDNXa2RKIeWhU/Z6eDu0d1b69r l1xSK8NY18iHb5EK1gl2T7nv5lCBwksuT0KawAmm1a5y3PZ/0DMKXmZRtLItNuXIAMyvvdGVjq3jn DWiIa4p7uiincVinbDRx/jLvl32wAz85AWuptfkYTwMg4aPjxQ5Jt+4yOn+K79W4ooCZHj3n7wqJ8 oZOmcAx5O3NIybmkLOB5FPf26OHUfMpZFTTgicv/+oa2AFEHtpN2hxvjcT+9IX3q2s7v1x9FQTnky +ov91RZw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ovaC2-000ngc-Ue; Thu, 17 Nov 2022 08:24:19 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DE6E1300137; Thu, 17 Nov 2022 09:24:11 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8C4EE200FC693; Thu, 17 Nov 2022 09:24:11 +0100 (CET) Date: Thu, 17 Nov 2022 09:24:11 +0100 From: Peter Zijlstra To: Andi Kleen Cc: "Jiri Slaby (SUSE)" , linux-kernel@vger.kernel.org, Josh Poimboeuf , Jason Baron , Steven Rostedt , Ard Biesheuvel , Martin Liska , Jiri Slaby Subject: Re: [PATCH 08/46] static_call, lto: Mark static keys as __visible Message-ID: References: <20221114114344.18650-1-jirislaby@kernel.org> <20221114114344.18650-9-jirislaby@kernel.org> <20221114203433.2pskttlyqjo3gua7@two.firstfloor.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221114203433.2pskttlyqjo3gua7@two.firstfloor.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 14, 2022 at 12:34:33PM -0800, Andi Kleen wrote: > On Mon, Nov 14, 2022 at 04:51:07PM +0100, Peter Zijlstra wrote: > > On Mon, Nov 14, 2022 at 12:43:06PM +0100, Jiri Slaby (SUSE) wrote: > > > From: Andi Kleen > > > > > > Symbols referenced from assembler (either directly or e.f. from > > > DEFINE_STATIC_KEY()) need to be global and visible in gcc LTO because > > > they could end up in a different object file than the assembler. This > > > can lead to linker errors without this patch. > > > > > > So mark static call functions as __visible, namely static keys here. > > > > Why doesn't llvm-lto need this? > > It has an integrated assembler that can feed this information to the LTO > symbol table, while gas cannot do that. > > There was some discussion to extend the gcc top level asm syntax to > express external symbols, but so far it doesn't exist. Urgh, that's ugly too. Why does GCC insist on ugly solutions; clang has shown it can be done sanely, follow.