Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5787816rdb; Sun, 17 Sep 2023 12:17:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFY5wo7CCL0z0ywIDxyaZBD2OD2YT+6LW5cOrJdBxh5xMQUKrzkx+VojO/fDZ9T6gw0Lbdi X-Received: by 2002:a05:6e02:1e06:b0:34f:1ee7:2adf with SMTP id g6-20020a056e021e0600b0034f1ee72adfmr13738916ila.2.1694978265194; Sun, 17 Sep 2023 12:17:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694978265; cv=none; d=google.com; s=arc-20160816; b=UpElVTFGSUQYINHtLoA3/LpmcYqE2div9BnWJEfG63PQ5lMKCXx8ZtQ9Uj2t3ygqkB nOMgLvjQyFS78T7KqOsLTjDvc+zIBffTqedxhYUesb+9N0jOtUQ/14k8uQNIZJxZm/51 zEH/byDPmILSrMhNYatqbg0GU/P+lTEFto7wXqtbslfc9U86PZ/KfprbdLq4n6KF2u10 oH2J+EI1nTGwil8kp1jheMr4oVvaDobpAeZh4JXf07Hkloc+ndSk5HBzj9VRKfZJAKyV OBQLtrsPD5cq2LyzV1+5/uIhnLfv8fVE1f9JoaUYXG/TWsOfNDCc7GV9uVdTWfQljyC5 VpYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=WowTavHHUt6VXrXWYAIAmM5GQAVg53+hUmPjaFGm7W8=; fh=CP5sk/f6+h/2SOoH6bX+QyVfAML4Y96w5F6o/ksfqbE=; b=gPz4/yN1+H9xEEL6Pv18i54V8ZgaVt8WS00WIMRfsGySuu7N6+GY7tPphqVla+83Po BgxB9wUtXZrd61KBIjC/oddcJjJuCXDT2OZVSP/wX93HDJiqSkSHOoUXX+BqyMO3tl92 pGUpXslBpVMv7NFfMp5tqaIAqqu0X8wnZVWqrlf6IO2xpAi0L7BTQ1HZA9xUfNRDQnf7 y9HKHtS7wentTe4NCTaJKpLPJQm0w74HV7sAgbbYVklJnsdZopS+0Nz4qMsUTLpAtZGy hHMSbSNQNh8qUSBsd0ovjYLE4toZpiam36EJYGoZIWztzviLfV/ORgf5eTbi9YGdovKk UppA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dhyiUTh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u25-20020a656719000000b0056fa5d8c2ffsi6672588pgf.325.2023.09.17.12.17.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Sep 2023 12:17:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dhyiUTh8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E58C88028412; Sun, 17 Sep 2023 06:25:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233662AbjIQNYl (ORCPT + 99 others); Sun, 17 Sep 2023 09:24:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232880AbjIQNYR (ORCPT ); Sun, 17 Sep 2023 09:24:17 -0400 Received: from mail-oi1-x22b.google.com (mail-oi1-x22b.google.com [IPv6:2607:f8b0:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B38130; Sun, 17 Sep 2023 06:24:11 -0700 (PDT) Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3aa14d8641cso2602451b6e.3; Sun, 17 Sep 2023 06:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1694957051; x=1695561851; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=WowTavHHUt6VXrXWYAIAmM5GQAVg53+hUmPjaFGm7W8=; b=dhyiUTh8x46T1uJ3OtUkdONibVXePNhq4VVgT7hwZIlxRa770kDDjMYeC8WKX4Pgjf EaIFRfhanxdwS3V5yhvnpjPGNBmHncrYqds+UMCBbNP6RNUOi+Rxsy1IPcQdYUAtHJI7 dxvqTJ6i5EMT9PFY+MDjA7NK+kIfGOvbVhsAG2z/W/VfFe4R7tAcuHatHuXHPl/EDem1 TcjTfnYRI1RosGWB3d4NXyFkcsv+ofHDJEUHhwDn/MVe6Jvfk5gZ1FF3rJLljlxxWyKY LmoetcFI9yZmovgoSePSQfUD9OD5O1Thf3PBXY1sN6GScITEiuxsxpM8meigCchSNqDu eA7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694957051; x=1695561851; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WowTavHHUt6VXrXWYAIAmM5GQAVg53+hUmPjaFGm7W8=; b=HDKl5yYpnOaUvoQomv8mBMk7zecnzQjCLhY+ulVvtkSsBtk29bFQH+lHIY+o8PwtYk JdRja9RM0q/8xQn4I8Wur2BoYvFE1QKb733ReBK95WSkPoDN9VvSJFkqIo2COQm0xpEd 8yM+18XCGpka/4cK+UJrzntpYYzgcekG9c/Q4jYZk79U7nX6yUpDLgZZ3tkJ6QSTMsD6 oszNnCBRk7/yJpFl2BH6IuPcwyHHZtecM8OXM0pdFKK1qe4xJqsglxyrEtVIQAyeOhUo rH6g1RGH0WmLXe9U4hhkFyGnttfZDgwR6oKum92LQV5LOg6vkqH2+xiSV1nNBr5TLn/J +30g== X-Gm-Message-State: AOJu0YzjYSMMn/JzaYhza+vnDOWhnSBhAOclu8LSIfhC4JkUYSVRdIVU x3qT4faNJSPA2D83URxZBvry7RDA27U= X-Received: by 2002:a05:6870:548f:b0:1d5:f43a:3a5c with SMTP id f15-20020a056870548f00b001d5f43a3a5cmr8738173oan.45.1694957051135; Sun, 17 Sep 2023 06:24:11 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id zf6-20020a0568716a8600b001d4d7238a78sm3932734oab.54.2023.09.17.06.24.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Sep 2023 06:24:10 -0700 (PDT) Message-ID: <0ed5448e-cd54-4a99-9389-e27deddfda90@gmail.com> Date: Sun, 17 Sep 2023 10:24:04 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] rust: Respect HOSTCC when linking for host To: Matthew Maurer , Finn Behrens Cc: =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Masahiro Yamada , Boqun Feng , Gary Guo , Benno Lossin , Andreas Hindborg , Alice Ryhl , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org References: <20230915172900.3784163-1-mmaurer@google.com> <9966E047-44E7-4665-9628-169F3EBE2F06@kloenk.dev> <0561303E-2089-43FC-AA31-836C7BB844B7@kloenk.dev> Content-Language: en-US From: Martin Rodriguez Reboredo In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Sun, 17 Sep 2023 06:25:21 -0700 (PDT) On 9/16/23 16:54, Matthew Maurer wrote:> Yes, thanks Bjorn - "gcc" is the linker flavor used for "Use the C > compiler as a linker". > > With regards to HOSTLD, I was trying to make the minimum possible > change. Currently, it is using the command `cc` as a linker, so this > would preserve existing behavior when HOSTCC is unset. > > If we would prefer `HOSTLD` instead we can do that, but we would need > to additionally inspect `LLVM` to set the linker flavor accordingly > (e.g. set ld vs ld.lld). LLVM can use all of bfd, gold, lld and mold plus each and one of them support roughly the same set of flags, so we can kinda ignore the differences between them. > Do folks have strong opinions between these? My primary concern is to > avoid calling programs by foo when their HOSTFOO variable is set. > > See https://doc.rust-lang.org/rustc/codegen-options/index.html#linker-flavor > for details on linker flavor settings. If I were to talk about my experiences with CMake then I'd say that build systems tend to kinda ignore your linker choice if you thought that it was going to be used standalone. I think KBuild does indeed honor it, so if we can go ahead with that then we could do so. Although I don't know what else would bring upon the table.