Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4010842rwb; Tue, 6 Sep 2022 00:41:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR5b0kqh0mlta/fOuBPuglrbceEQyJnQlcNEYSEOC89BlsL5w528XV8p1CRkAEMGbpNt10Pz X-Received: by 2002:a05:6a00:2184:b0:53d:deac:cc16 with SMTP id h4-20020a056a00218400b0053ddeaccc16mr6083766pfi.10.1662450092977; Tue, 06 Sep 2022 00:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662450092; cv=none; d=google.com; s=arc-20160816; b=Pz9GNtiwizrr5OtjJ7HB/rcLoWDB1N3Xi1BSowhtSsh7LJTjvnVFYgzdgb8XWYd6wn rm+pxkapPcingLUFlLMzF3FyXtZ8Vcjdt8ien1cVWVBZsQDpYtkiEHFw3OGNtxkE3Hgd 3/jJ/iTUuOgt3oa/O6bKKAqocFhNmRdI/Dx9ox8MLK7jTIhf0P7QAnl9xuU2YwBFYvxu yJbWNJvZF+DhYFIThPD8sNuW7kcbaxo3nq11GV+zkS9WrspqcamCJFSHDr2EZqCxmZqV 4MjsG8sFAEp81ZN7fEgwjkRs+WM0P3vtXEZJ+LNfOaqeKeV8I7WjwESPgmT3YGIQcnfg Z4Sg== 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=NZe7+paNSEeJI0jxUbV91K+jdNS4v9O2YEeZpkZIUG8=; b=aOBXirQHDMsGaGU08qQg2Lb2A8QRZre9SjejeBZCAAt/hJ8oKsut1yOe++TVW4fhE0 b8uIytI+fQSc0L7S+sMjKIXFkX5XHXNGnr6Z7iJ9NSu48o91I5IjqF/ZHTWdbMuTMzql Eivgyquv8TS9ZVYxIRhxNt0qUG+LmyJLxL5uhI7iTg1GY4ircvu7vqrF8nWpBa0R7zDL TpzpPKWeBrHlJZCDgyVith9bX1pTlO2wCD3lYcvootDX/6Z5NQx7RXPFs+xTyrBjvBaT A4HWzMCKwf1/A8kpCEu+dMJ2M1b/dpV+Hxp16MD4cJ+epkJqDPzpRR9LbJwn258/op+J CV7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E4+RHbLs; 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 d14-20020a056a00244e00b0053e1d52560bsi1396566pfj.305.2022.09.06.00.41.21; Tue, 06 Sep 2022 00:41:32 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=E4+RHbLs; 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 S238844AbiIFHSu (ORCPT + 99 others); Tue, 6 Sep 2022 03:18:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238882AbiIFHSn (ORCPT ); Tue, 6 Sep 2022 03:18:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2F1774359 for ; Tue, 6 Sep 2022 00:18:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 61B13612DD for ; Tue, 6 Sep 2022 07:18:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD18DC433B5 for ; Tue, 6 Sep 2022 07:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662448721; bh=wOasH0d9vVnsQ6vVQd+RRAYmkKfASMZfn5I/64WuHBk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=E4+RHbLsSEhU9eHu6jt9ZcHz9QjmVwSYc6PVN8GL3d4qvw6K/LkGVzwzrpfSxNNLL hjKgNiKW0HkCPk9Y1fvwpuh7EyHPzyJ5EVNxcD5YleIm1i+UgkY26G05p5RAywdIQY 2pmi6PPvDpxUFWvXR6vJjcVEfcTDrjzp5LBYZ1u6ucAig+lsyw0u/FoBxyoOSDw29C tDAjJZGYehcpRB9untrnvLxIyiIv+zQFxRA/1qbpZRRSR2rcW1uXkRtK7FavdEi80/ 72bCmVK1Hi79xknulp+be9KduiajX/xbxxRqzpWL33GQmSc8w1qJcMfbCk4V88S56l FG4qN0gxK0POA== Received: by mail-lj1-f170.google.com with SMTP id bn9so11295665ljb.6 for ; Tue, 06 Sep 2022 00:18:41 -0700 (PDT) X-Gm-Message-State: ACgBeo2+etNGcyxVS8vfbWv+sSABt8DjeSALcD7oPY+6HsxhN9dfxe0i VqkHGrsyNQrSfnMbeh8Hv2RewP2btxViJ8VQ85w= X-Received: by 2002:a2e:9115:0:b0:26a:c086:5138 with SMTP id m21-20020a2e9115000000b0026ac0865138mr25505ljg.189.1662448719736; Tue, 06 Sep 2022 00:18:39 -0700 (PDT) MIME-Version: 1.0 References: <20220830104806.128365-1-xry111@xry111.site> <5b87173faeef587a2ffaaa6f58d34e0940231067.camel@xry111.site> <97291c0fe5a660c844475ff019c8db6af77ecf86.camel@xry111.site> <8d0f96e2977c5c78f17bb410087f2aad986ef5a4.camel@xry111.site> In-Reply-To: From: Ard Biesheuvel Date: Tue, 6 Sep 2022 09:18:28 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 0/5] LoongArch: Support toolchain with new relocation types To: Huacai Chen Cc: Xi Ruoyao , Jinyang He , WANG Xuerui , loongarch@lists.linux.dev, LKML , Youling Tang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Tue, 6 Sept 2022 at 06:43, Huacai Chen wrote: > > Hi, Ruoyao, > > On Tue, Sep 6, 2022 at 12:27 PM Xi Ruoyao wrote: > > > > On Tue, 2022-09-06 at 09:52 +0800, Huacai Chen wrote: > > > > cflags-$(CONFIG_LOONGARCH) := $(subst $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \ > > > > - -fpic > > > > + -fpie > > > > > > > > cflags-$(CONFIG_EFI_GENERIC_STUB) += -I$(srctree)/scripts/dtc/libfdt > > > > > > > > (Some explanation: -fpic does not only mean "generate position- > > > > independent code", but "generate position-independent code *suitable for > > > > use in a shared library*". On LoongArch -mdirect-extern-access cannot > > > > work for a shared library so the "-fpic -mdirect-extern-access" > > > > combination is rejected deliberately.) > > > > > > > > Not sure how to submit these changes properly... Do you prefer me to > > > > send V8 of this series or a single patch on top of your tree on GitHub? > > > > > Don't need V8, I will squash it into the previous patch myself. But > > > can we keep efistub as is? > > > > No, we can't allow -mdirect-extern-access -fpic on LoongArch because > > without copy relocation such a combination just does not make sense (i. > > e. we cannot find a sensible way to handle such a combination in GCC). > > So such a combination will cause GCC refuse to run. > > > > Note that -fpic/-fPIC is "position-independent code *suitable for > > use in a shared library*", while -fpie/-fPIE is more like just > > "position-independent code". The names of those options are confusing. > > (When -fpic was invented first time, people mostly believed "PIC had > > been only for shared libraries", so it's named -fpic instead of -shlib > > or something.) IMO in the EFI stub for other ports, -fpie should be > > used instead of -fpic as well because the EFI stub is not similar to a > > shared library in any means. > You are right, but I guess that Ard doesn't want to squash the efistub > change into the LoongArch efistub support patch. :) > I don't mind changing the stable tag at this point - I don't have anything queued up on top of it at the moment. But I don't see the actual patch: please send me the delta patch that you want to apply, and I will update it. Then, you can rebase your v6.1 tree on top of it.