From nobody Wed Sep 17 18:08:13 2025 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 D4A15C4332F for ; Sat, 17 Dec 2022 04:45:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230122AbiLQEo5 (ORCPT ); Fri, 16 Dec 2022 23:44:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230046AbiLQEou (ORCPT ); Fri, 16 Dec 2022 23:44:50 -0500 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C41B130562 for ; Fri, 16 Dec 2022 20:44:48 -0800 (PST) Received: by mail-pg1-x54a.google.com with SMTP id 84-20020a630257000000b00477f88d334eso2582894pgc.11 for ; Fri, 16 Dec 2022 20:44:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=oCkOLeUT8z9uWy5v5k8t9XGXY+OZQL+wMiMJpjklfMk=; b=NkQAhros/6X1C1DqT6opfUL3F1fT6++iMSU6wymnZhCK5ti0wioHiihwyt8oVKB0Nu MgUxlCztzY3GF0CsapECuOVpjQzsA/HfxIxj+HUz4spuCfAnTFk1I3TqTawO2XpqG6UU 56J6gfM57ah6xKmO6caUJfUfZx3tNLKF2KhkvRLvfNvFqMBBsEhHyB3A7TvYLarcLN6P fKVvVrpvUkOfhUDpOOzx2dUl5F1s46Ffosa6phFHdnfhYsFDpD/qgpTwV2UOy/FRNJvl OQIDtS8w7AaUhUhw5rDfSJQ6xtVHReyzqm5xpHermfANmJjYUhaP8hnhRxrFGiuGYe1a ancQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oCkOLeUT8z9uWy5v5k8t9XGXY+OZQL+wMiMJpjklfMk=; b=LzMPZngVpw93w2GDKKyuoXSI4hjd/t/F6JL7RGSLKDxdyzvxWLvUTrHeJXXGRNLpZk dd1hlbRZnOZJ0f1Y81zLRlv+j4EWiNFidsCM9QIpnB8W8IvYRWrw8IFksle2/nsiCvtj eWouwgELE3qDoLczwQ9xYe+g5BbZ6ZJokksnoC/Z4Cze2I0uZIQ8pWCQVpLgt5W+GDYH 8dbNI3hoiwnUeS2dKvk54G0R04iPpSsX+HwZDwTDt+QxEtQaITvL5Sce5J4lf1kxtzEy JOfyWYa4niGecTf/xF8qiKtAhSpD5TBx3JZLQ1hgE6WJjV3dig4iyp9e31FNbcRUYyeg KDBA== X-Gm-Message-State: ANoB5pnbg6giizovbaUHm+YpUUCuA7U/mbaFpDJPdYUk9TTPLRfVrb3s d5PcWi8uHVcL5dWHdUKHvv+1zxt9FBrzEg== X-Google-Smtp-Source: AA0mqf5WvCHE4FnTVtZCQe/4IUCPwpqYVRfZ0jHUmlZpfPT/x7sGQmkzk8ex0J4cnMv1HrvC8Eo90rNa2kROmQ== X-Received: from slicestar.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:20a1]) (user=davidgow job=sendgmr) by 2002:a62:8342:0:b0:577:8eba:c019 with SMTP id h63-20020a628342000000b005778ebac019mr7776687pfe.35.1671252288299; Fri, 16 Dec 2022 20:44:48 -0800 (PST) Date: Sat, 17 Dec 2022 12:44:34 +0800 In-Reply-To: <20221217044436.4138642-1-davidgow@google.com> Mime-Version: 1.0 References: <20221217044436.4138642-1-davidgow@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20221217044436.4138642-2-davidgow@google.com> Subject: [PATCH 1/3] rust: arch/um: Use 'pie' relocation mode under UML From: David Gow To: Miguel Ojeda , "=?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?=" , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Nathan Chancellor , Nick Desaulniers Cc: David Gow , rust-for-linux@vger.kernel.org, linux-um@lists.infradead.org, llvm@lists.linux.dev, linux-doc@vger.kernel.org, kunit-dev@googlegroups.com, x86@kernel.org, linux-kernel@vger.kernel.org, Wedson Almeida Filho , Gary Guo , Brendan Higgins , Daniel Latypov , Jonathan Corbet Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" UML expects a position independent executable for some reason, so tell rustc to generate pie objects. Otherwise we get a bunch of relocations we can't deal with in libcore. Signed-off-by: David Gow --- arch/um/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/um/Makefile b/arch/um/Makefile index f1d4d67157be..ae321282dc6f 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -68,6 +68,8 @@ KBUILD_CFLAGS +=3D $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \ -Din6addr_loopback=3Dkernel_in6addr_loopback \ -Din6addr_any=3Dkernel_in6addr_any -Dstrrchr=3Dkernel_strrchr =20 +KBUILD_RUSTFLAGS +=3D -Crelocation-model=3Dpie + KBUILD_AFLAGS +=3D $(ARCH_INCLUDE) =20 USER_CFLAGS =3D $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFL= AGS))) \ --=20 2.39.0.314.g84b9a713c41-goog