Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3956442rwb; Mon, 16 Jan 2023 15:54:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtV2spDcqucTvfgfGO4twk42mVLKTlIbiE3deHV8Ooe/mMFB1VZao7SpHA32Hzr4lZ/26kT X-Received: by 2002:a17:90b:698:b0:226:ad9f:92c6 with SMTP id m24-20020a17090b069800b00226ad9f92c6mr22908460pjz.32.1673913240574; Mon, 16 Jan 2023 15:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673913240; cv=none; d=google.com; s=arc-20160816; b=ncS6GhMX5bAKMMNZcZcBJcc5JhwdKxXr9ZfcTbqEyrZlkqWXHM5wWT8vVQygBKzSWN 2V/bLL8wYqhsQO1vztZCPI4pkcrBxP7PGqij3tUK2+e/xN+oXEz9IYYidYldCnZ05Iys +tt7h7K/nHG7IatBh0oSLXceq/p6O8IpzxU5IGwRDVO5cG3/YqKFAWZtpl5hv2F4OED7 Gj3cW5n6NH2CW0vfiK6SyJUkXJ+9mCXxhokZI2pxIrilhqhSojQ8mYQmJqw1//PuSPb4 K8R4mhg/EbiAlKi0kyrNDt0VdoQ/YBxJsyohXaOBYYtLTRSOTGbRCMxVl5nsL1nHobSx yHWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ivDU9Ro37F3LuZ7hP1KJdu6lEpnACciyXmME6mUAv2o=; b=R4T21pruc8OaMd4KnWH8ge6og+Zqs5wR6wpOOcCDgSDtns7QlYc9+AOJCIvZlE9g0Z CBr+vEfyMxI6YS+/9DKPBie1+E3qhH8shKjvtJNrS9N6wwHF2yNYOoiZwIvpLxr6ia0A rM1LSK+MenCvs9Rt9bV1c7VhR4kjOxHBLdzsblaS6CuEDxvNIVv05hSjhzlcWoM9qHXP TJcm1E2X+jT65weq5gG59N4uOYMrR2LhPlJJeDWjuOYwAMsZJ/hmopFVD1psiMrFauQu aMH13kmbUidVqCdkVc2sPS6NJnws/039BSRuS0WVmDB5v+B3RccglCVou+5ZPl3fDaIz hUzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UnUAoO9C; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a17090a450c00b00225ca23faddsi11631282pjg.54.2023.01.16.15.53.54; Mon, 16 Jan 2023 15:54:00 -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=@gmail.com header.s=20210112 header.b=UnUAoO9C; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235497AbjAPXf2 (ORCPT + 49 others); Mon, 16 Jan 2023 18:35:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbjAPXe4 (ORCPT ); Mon, 16 Jan 2023 18:34:56 -0500 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E61892B2B0; Mon, 16 Jan 2023 15:33:35 -0800 (PST) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-4d4303c9de6so249514867b3.2; Mon, 16 Jan 2023 15:33:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ivDU9Ro37F3LuZ7hP1KJdu6lEpnACciyXmME6mUAv2o=; b=UnUAoO9C4bejerdcar2SMro8ESQo9VE1qYnQdXDVVtEtHy/ZKAGbLDmDY1nZBn3MdQ 0j6SINS/LdQ2vDXIigrTebkYjHeNAK8x43+a5hrF4yOPozgPiJdpkqLEK4W9H1XRw6+T +1oupZMO8d3wdWZ4JIcT65POYrz9aaid/dJzcef5Yi5VD+vjWo8Dnfr79ReqkLv47TtE hskPMFp7Cf45vH0BMNuCh8rY3CKuA8rqDvOsw7SwBwZbskw87wepJ6kpsjFYvSI22OM3 9gdTnKDf1/aAqc/hTh5YiUvosRUj7t+MmwcRTY2m1c8WB42Mn95U4PrX90IyYPsANBmi vJww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ivDU9Ro37F3LuZ7hP1KJdu6lEpnACciyXmME6mUAv2o=; b=MKXfgJHJ1rKGR1x9hyB9UjcBNjR/+SFX+/FdxRODwYqZrmem7a1LqpcgjKZfblFcjG GKyGn4GyTjEUm/+a6m77Se/JA6RMPJ1TlIyYliAkQL13HVMYCFDJzG1CAFVH/3AYjxlY XGjXkheh69gGO7sIlgL7HNg+VZQLG74iVX9whRLhrYMbWovmZ0g7Jvs4h/LhUXThAQxn rrNWmCxvoaXDs8wjf4DZNNflqgpMY8mJXTeqgAymmX4UyiJPZjV3jZAop/AZJHcKydPh 5bwN2k6ywPN3qVcq32vX9UXimRS2hrRRDjYSbvgkm3tl37VtX4Qdk4VCDEVu2Z57e+lb ouMw== X-Gm-Message-State: AFqh2kqOBLclkQ7/fUcW9g+ILlFC5bfYYfjVonUw20VXwX3DRHZ9uIGb OLal/zAZXhPdYI/owR1K9l7PFDAB+Q8YjOYf134= X-Received: by 2002:a81:5402:0:b0:3d8:8c0e:6d48 with SMTP id i2-20020a815402000000b003d88c0e6d48mr82639ywb.462.1673912015171; Mon, 16 Jan 2023 15:33:35 -0800 (PST) MIME-Version: 1.0 References: <20221205214454.2542888-1-gary@garyguo.net> In-Reply-To: <20221205214454.2542888-1-gary@garyguo.net> From: Miguel Ojeda Date: Tue, 17 Jan 2023 00:33:24 +0100 Message-ID: Subject: Re: [PATCH v3] rust: compiler_builtins: make stubs non-global To: Gary Guo Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Mon, Dec 5, 2022 at 10:45 PM Gary Guo wrote: > > Currently we define a number of stubs for compiler-builtin intrinsics > that compiled libcore generates. The defined stubs are weak so they will > not conflict with genuine implementation of these intrinsics, but their > effect is global and will cause non-libcore code that accidently > generate these intrinsics calls compile and bug on runtime. > > Instead of defining a stub that can affect all code, this patch uses > objcopy's `--redefine-sym` flag to redirect these calls (from libcore > only) to a prefixed version (e.g. redirect `__multi3` to `__rust_multi3`), > so we can define panciking stubs that are only visible to libcore. > > This patch was previously discussed on GitHub [1]. > > Link: https://github.com/Rust-for-Linux/linux/pull/779 [1] > Signed-off-by: Gary Guo Applied to rust-next, thanks all! Cheers, Miguel