Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1468736rdb; Mon, 2 Oct 2023 10:19:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/LyZ7uPtLhluToxYj9emCJUHEc58bxlPIBQi9RwSD7WKWqV6mZ4Qp56nxAbmp/rZfrzsu X-Received: by 2002:a05:6a20:970f:b0:153:a160:89dc with SMTP id hr15-20020a056a20970f00b00153a16089dcmr9905999pzc.58.1696267185363; Mon, 02 Oct 2023 10:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696267185; cv=none; d=google.com; s=arc-20160816; b=RdihTCHjhhs++jGfhMOODB6g4JxJSk91QhdkaFddnos93XeMA7aSbRdXvkh/4xO6Jr bx27ZDJE6K/OMhJdzEyKhOf3lgdk6kSJxGBTBtmBWKBbpbA/4+Bi63bZt02ExP/r0ibn hQI4Z4sAkhtWwQd1xLAAIa7Dc/c3N/wb6XweAb3Y8Qz+IOUh5XkwdVz5C7Hr+a8HY0cO Qp8FDckpUYNaTeBTS7GDsEiwhLz3mXaY0ksoV1vHaR4dO2C2Ny53AwalsPUf69u5pi3v 1ssoe5JHrQdcP/ZlH0mRdSACg73enY4MOLRAAXGDwDRnvEHRVb6KC98MQpC92zJ+gHXD 1gYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=vSh85qp98TAtPCnT67pcz20dczDxxqTD4YcLwPP44io=; fh=mt7EhL1CXp7O1Alq1YlUAGWK863/z4VaI7hfGB0V1VA=; b=b5nqqcCX0K3D2PMATO3O2MqN2N59L4nGswoTBO93HPcT68YAVkk+7drT++h14s842g 8oBTc6CXekwsdKvvygl7ctT+139ui/F+pOz4XUDUy4OaOKi9nydvnwx85NqdYwxvYn28 LdzOUkYoiuo6j3DeTdDgnxc1jlgsVxVg/LTAmNqKYe8lE/miKwv+Fj4WfBHRpgMIm3M7 jSJGgeuK7uymKAY9hQjF/lij90sSjex4vLeORKrNvgZsfEDQ8ecgHQ4ocj/zC2YwCqDS FdcAqovQHMF1LuKgV6DyZARUMlRFvTHirtRjUJZUJBfS/dVmfnYiuMBWl3K+7hTD+mwy 3UHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kCNawjjI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id f8-20020a056a001ac800b0068fd0b1bd61si28899994pfv.50.2023.10.02.10.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 10:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=kCNawjjI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id BFAC7804C218; Mon, 2 Oct 2023 00:42:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235708AbjJBHmp (ORCPT + 99 others); Mon, 2 Oct 2023 03:42:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230011AbjJBHmo (ORCPT ); Mon, 2 Oct 2023 03:42:44 -0400 Received: from mail-vk1-xa31.google.com (mail-vk1-xa31.google.com [IPv6:2607:f8b0:4864:20::a31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4781B3 for ; Mon, 2 Oct 2023 00:42:40 -0700 (PDT) Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-49a319c9e17so4769945e0c.1 for ; Mon, 02 Oct 2023 00:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696232559; x=1696837359; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vSh85qp98TAtPCnT67pcz20dczDxxqTD4YcLwPP44io=; b=kCNawjjI/f4n+biV+vLjAA/Cfl6jcOXHeKOk6l1DA+XWCEw7e9oVx73OoewqH0LByQ +bzuu0sAWaZYVwCLahYw+AukSMGBd7pll8bDsGEWTI0KsZB6jskePOTvjQBwKXBM0XAB bwFAZNoS3nvrC759EuJ9C5P8R/AeSST675QPXxop/lqONFbnhx4tzfwsP+2aS1+tuq9y 3g6AnYWtZMCAniGXwxEg8IO43lILdpQBB9hVZ0p68LFPBqFrN+OuQWhR6tJLKxp804S+ +SjVQNgF7PS52qa5Lel7ragBcrINhcf0LT7zRq7aGv2DSQI47Hl5DsAw6T4OaJg6tGqm l/cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696232559; x=1696837359; h=content-transfer-encoding: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=vSh85qp98TAtPCnT67pcz20dczDxxqTD4YcLwPP44io=; b=mEtnZ8FmiNGq2cALfDO+XSLgO96WLZnY39AVTx3dshTOWZnNdLs9fc09H8YdoaulGU CAYikp6QdlVj+mp6twQoe4Chgc8MwUAh7x4jv9ZVbd+Kicq6qDd6/gt11LwYuDBL+qoG ajjJLKZpKhWcqYqL4/eBK22eEvL81Pv63hHf0BReqd3GXGrLoghTFGR4qyZSROGDHG9m 7f68fKeFAHS5idMLaHJV5Ej+YwcXEG1rvMGParafurNbGad8n02DVWYw8Aw5OeSzn14x ZdBVc1LOhlz2SqSyi46vY5a6byNRzwRWnwavo3NsnOHlFdV9WnQ448E6upaW+602lcrP IXwg== X-Gm-Message-State: AOJu0YwA59fTe+BvJ3D4AnEdnrQdFiBjvwhjE0YzvwIq5U3ApCwPqlSz tPt5KuWdrAbgsGOrW/YxiEq0fKWr/+bLRqMsNejJxA== X-Received: by 2002:a1f:ca82:0:b0:496:f00a:88b2 with SMTP id a124-20020a1fca82000000b00496f00a88b2mr6397262vkg.7.1696232559619; Mon, 02 Oct 2023 00:42:39 -0700 (PDT) MIME-Version: 1.0 References: <20230928194801.2278999-1-mmaurer@google.com> In-Reply-To: <20230928194801.2278999-1-mmaurer@google.com> From: Alice Ryhl Date: Mon, 2 Oct 2023 09:42:28 +0200 Message-ID: Subject: Re: [PATCH v3] rust: Respect HOSTCC when linking for host To: Matthew Maurer Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Masahiro Yamada , Nathan Chancellor , Nick Desaulniers , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Nicolas Schier , Tom Rix , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 00:42:48 -0700 (PDT) On Thu, Sep 28, 2023 at 9:48=E2=80=AFPM Matthew Maurer = wrote: > > Currently, rustc defaults to invoking `cc`, even if `HOSTCC` is defined, > resulting in build failures in hermetic environments where `cc` does not > exist. This includes both hostprogs and proc-macros. > > Since we are setting the linker to `HOSTCC`, we set the linker flavor to > `gcc` explicitly. The linker-flavor selects both which linker to search > for if the linker is unset, and which kind of linker flags to pass. > Without this flag, `rustc` would attempt to determine which flags to > pass based on the name of the binary passed as `HOSTCC`. `gcc` is the > name of the linker-flavor used by `rustc` for all C compilers, including > both `gcc` and `clang`. > > Signed-off-by: Matthew Maurer Tested-by: Alice Ryhl