Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp764065rwb; Wed, 7 Dec 2022 04:54:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf79e1NC4bG0H6f0JEwhj0vzialtf61Zp07n9HilJqbB980g9wwQXXfxDziSMbpByn3wv6+2 X-Received: by 2002:a05:6402:505:b0:46b:aa:856a with SMTP id m5-20020a056402050500b0046b00aa856amr42754129edv.171.1670417649031; Wed, 07 Dec 2022 04:54:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670417649; cv=none; d=google.com; s=arc-20160816; b=Kh1C0DcvN05uuUC4wgqsxhMSql4M7mmgYJ9HdTCRvm66hwyt1Tnwq9LrXcp/zBAWCM A/j/7G/Wuib1Nlc/Qy11RzPrXyPxk0Km8oFKHOSUcMak4Ag0+hG6vC5pnd5+2jYv9N+V /5Ud4FRvXF/vw+8lD22FA99PtbSSV+r/bImOrT4A+ZC15Qug2CuFmPuuckxnPJs9YUkQ QvhT3gvLz0rZjJT7sYwrNb6ejU53+HCsFygY+UFCLPQc0/qPm9R1SNdA3hT37/ihigga icAZY5dwbjdyIVOyKsLoCAG8ebpDsKkr85Ax8mUtZuMv6LxBV+DaPhHHlk5ou7J/ktMy ipsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=ZRrflo0GcL3wDE3RqSPwP5BDQbI3MrgakFXIOceJCzo=; b=fUcz7afAVeBOx7tilbr6wSlgtb9bUWRiVRnsHmjPoNHtE5OQvopb/mWX0EZ9JmVveY XdqJTgnka8VQVnULjtAWlNdxjnambmgNvCcAtHyh4mzbXxAOebmxGgnPFBcC41w/RlYu OmoKu0GJ6KXllR/CbMs8o54srpTxU5mf3r9zpnSZjdI3GKq+DNUzBOpOypG5xRrkqg01 k0bEFpzfm9unxtui8ahWfm2D7DnPeafmWiHRFCc4gPUC00CVHpT5hS6ve8TiWOcfjSCz xdVzuCsIdqyttchjMu5/kvgoyKYnyYCVwYtO8KrrApZWWD3Ip0sgpkL5OAfFqGbFQ33z a7WA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e15-20020a17090658cf00b007c087110276si17655067ejs.151.2022.12.07.04.53.46; Wed, 07 Dec 2022 04:54:09 -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; 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 S229611AbiLGMjX (ORCPT + 76 others); Wed, 7 Dec 2022 07:39:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbiLGMiq (ORCPT ); Wed, 7 Dec 2022 07:38:46 -0500 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6418F419BB; Wed, 7 Dec 2022 04:38:34 -0800 (PST) Received: by mail-wr1-f43.google.com with SMTP id m14so27887379wrh.7; Wed, 07 Dec 2022 04:38:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZRrflo0GcL3wDE3RqSPwP5BDQbI3MrgakFXIOceJCzo=; b=SlfDRCyxNGDt7HpPAS9DcfJf0pFUmoaSomGG7uiiDYcTvWsx3IWKnyw9V7VRHeiaMH EmCN6drRbqsHoYecTq3KbxiFIC3WnvKdiNVoqhOMNw/uhZ0Pd/C6DOAT/+TnVfKVQ+8h YbgnGrAc0BLtfJf5bjFgc/DadsSNId+4efNK5NOtgThYFnADtEZaMp/ds8CVk3bPlP+P X3sPcUYBGO3eCg2dUpoEETmTb6OWO0G+PBOt7Q5jA8ZjT9F0pIXTOt7D9DjEU2wxhNga ScNGpXGON/idOrqPrBhFSqwE/HBie7cS8zgBbDCfGviXVBMH7JgYDXGQKB2Em+JlPr25 2oYg== X-Gm-Message-State: ANoB5pk5kArfNawBk7jG29EYqciZW7xXnXQb8IsaHPu2knTYjbJV+whB IRrqNgwpbpNPmcJu3bKsOC1ErYRuAYs= X-Received: by 2002:a5d:6d49:0:b0:236:bad6:44df with SMTP id k9-20020a5d6d49000000b00236bad644dfmr53115389wri.489.1670416712839; Wed, 07 Dec 2022 04:38:32 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id h41-20020a05600c49a900b003c6bd91caa5sm1508156wmp.17.2022.12.07.04.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 04:38:32 -0800 (PST) Date: Wed, 7 Dec 2022 12:38:30 +0000 From: Wei Liu To: Gary Guo Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Wei Liu Subject: Re: [PATCH v4] rust: compiler_builtins: make stubs non-global Message-ID: References: <20221205215000.2563281-1-gary@garyguo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221205215000.2563281-1-gary@garyguo.net> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 05, 2022 at 09:50:00PM +0000, 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]. This approach was also > independently proposed by Nick Desaulniers in [2]. > > Link: https://github.com/Rust-for-Linux/linux/pull/779 [1] > Link: https://lore.kernel.org/lkml/CAKwvOdkc0Qhwu=gfe1+H23TnAa6jnO6A3ZCO687dH6mSrATmDA@mail.gmail.com/ > Suggested-by: Nick Desaulniers > Acked-by: Nick Desaulniers > Signed-off-by: Gary Guo Reviewed-by: Wei Liu It seems that the only difference between v3 and v4 is Nick's ack. You can put a changelog by adding a `---` section -- it will be stripped by git-am automatically. Thanks, Wei.