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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 135CDC19F28 for ; Sat, 30 Jul 2022 21:58:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A01C18458E; Sat, 30 Jul 2022 23:54:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="M036KIpB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DDFF6841CD; Sat, 30 Jul 2022 23:53:51 +0200 (CEST) Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5549D844AC for ; Sat, 30 Jul 2022 23:53:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-10bd4812c29so9559143fac.11 for ; Sat, 30 Jul 2022 14:53:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=gCp6oxoHIBNEjBTpKIDodAF9ZgPo1EZnCDBEn5ib4Lw=; b=M036KIpBFkj2V5Ubnbg5KC2d1D+QsNA14Cw09AAD2lLVmmitLYK28VPYcPg5EYlGfo 80Gg8YTVsvmzWJgVCTMfIo4A/gNbFawHYdXgKoo4TZQAh5qJgxt1x1u4ftZ3FKCKNH6e RHmSCD4BmOoR9suJb2RJNDHPow2QZgfl5Cw+4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=gCp6oxoHIBNEjBTpKIDodAF9ZgPo1EZnCDBEn5ib4Lw=; b=6Pz2EwLNEse2V9ppQjWtryfmUhtvKG9sFbH9Muw8EPf58bXDAN4dWnd7zwOMPSKuj7 0UEClsESY1bOnxOTkbA+IJ7JaInsy/NlAK8XjbuO+54rMks+UKpu4U2LFxx3r76MiwjH ADOjLv8WL6+4PWHVM6WFwAOsuHNWjsLGRNRMDZCNvbJvDavMwNshdsraW0lSvtHTQwrC LCzgQAgwKesmwJmgc+ia6Mv847kTWgMY+1MiP3rW0MffQ9gu88TojlQGn2MOLihaDYqi VyAhHL8t91xgVJHEAT2+ljICi3qJamI3rRNGR5Zsifz8NUah4nUzHQNwa7Yb/LozTmBv PFTw== X-Gm-Message-State: AJIora8W010rtulxIvILkLFPVvGVv+PhI9l7+j9TvU/hRUhU201Gn4Ly EGeUqjOmtE7L6SDM9bpJ0akwqQlxGB4K5ZIY X-Google-Smtp-Source: AGRyM1vVBVvxkPXTr6kDLSO37wrVC4QV2TToIbJ180LEo9uiZDXdpsOxBL2r+mZC5a7C+CLgxo66rA== X-Received: by 2002:a05:6870:f70f:b0:10d:6d1c:2d92 with SMTP id ej15-20020a056870f70f00b0010d6d1c2d92mr5189129oab.231.1659218015583; Sat, 30 Jul 2022 14:53:35 -0700 (PDT) Received: from sjg1.lan (c-67-190-102-125.hsd1.co.comcast.net. [67.190.102.125]) by smtp.gmail.com with ESMTPSA id 19-20020a544193000000b0032f75714af1sm1699656oiy.18.2022.07.30.14.53.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jul 2022 14:53:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Bin Meng , Simon Glass Subject: [PATCH v2 28/35] event: Change EVENT_SPY to global Date: Sat, 30 Jul 2022 15:52:30 -0600 Message-Id: <20220730215237.818368-24-sjg@chromium.org> X-Mailer: git-send-email 2.37.1.455.g008518b4e5-goog In-Reply-To: <20220730215237.818368-1-sjg@chromium.org> References: <20220730215237.818368-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This creates static records at present, but it causes a problem with clang and LTO: the linker list records are sometimes dropped from the image. Fix this by making the records global. Update to use __used while we are here. Signed-off-by: Simon Glass --- (no changes since v1) include/event.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/event.h b/include/event.h index c00c4fb68dc..fb0734ed4e1 100644 --- a/include/event.h +++ b/include/event.h @@ -123,10 +123,13 @@ static inline const char *event_spy_id(struct evspy_info *spy) * The only solution I can think of is to mark linker-list entries as 'used' * using an attribute. This should be safe, since we don't actually want to drop * any of these. However this does slightly limit LTO's optimisation choices. + * + * Another issue has come up, only with clang: using 'static' makes it throw + * away the linker-list entry sometimes, e.g. with the EVT_FT_FIXUP entry in + * vbe_simple.c - so for now, make it global. */ #define EVENT_SPY(_type, _func) \ - static __attribute__((used)) ll_entry_declare(struct evspy_info, \ - _type, evspy_info) = \ + __used ll_entry_declare(struct evspy_info, _type, evspy_info) = \ _ESPY_REC(_type, _func) /** -- 2.37.1.455.g008518b4e5-goog