Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4046857rwb; Tue, 6 Sep 2022 01:25:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR6YbQDDffkFBeXy96hZhyc1hzJWJO0oJPsc0QuX0aZmG2JuJ5VB96kVPg5p9ps2cETSQSqG X-Received: by 2002:a17:902:8498:b0:172:a201:5c12 with SMTP id c24-20020a170902849800b00172a2015c12mr52704530plo.166.1662452732304; Tue, 06 Sep 2022 01:25:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662452732; cv=none; d=google.com; s=arc-20160816; b=EzVYdXBgUk/jTeaTEjeeUl7QgxIDo68cclUdb9p8f8IC9b1af0nenagZbT8ucX83yi L7JBgJu4IpkFIDO7FlM/b69HiFXOv/mIcKqjk34JgjqpMf4XANPYTkT4Ceo8MxK3mPzp teH4QNrLF6dqt8tH/eV49xD0CABl/vGG+Pwfp7NP91D2FUSCSz2/0cOh+1YTP+bK4QFr RNaxGcUmnmfIZ8toTwB4H3NQ7jjnXYVOkMEhds6GB4pg59TjlCyIoDACUd8q2Tv5C5HW 6zRM30bMzqEBzMw+EavghTSKFDC2GTKjoYY55wQy/LSoxw4LTkKCKH69Lp0bmVF8KtVt zMDg== 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=6GsPcZaytbShanCrO+mFyQHktIOo231dr4tgLYnlhR0=; b=he/LitO1Ruk47AIwJTRPSz0uIXFCoaquscxgjOctBGu4gt/gjGyWpP3wHclWosj2E7 DmW2N8rJfQONmK94QbL/lVMFSLjEkT8nU3FLq1a16C/AuDYKclL00ZlD+NQNOYfVPct/ QLFM51GpxzDQlfbpE/PVLKZBMIOTiQsXgNrHGSc/MC16VDDm8Z6bYKzoxgQ0Sf5XSsRD RxvKJ31g1aQ26P41spNepKo/9+VhF7+uOtCC2fMKWYalhWLvp36WTrqeJfpCr5MhG4On nmg55bJCSKjJMyzmQzI6wq3sjoe/APo0WS0PsR9akvvRX2eldxlTPiI/EhkAJUqKLjAL uXDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OiBttTdW; 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 qi2-20020a17090b274200b001f8b8d48e3csi1236723pjb.103.2022.09.06.01.25.20; Tue, 06 Sep 2022 01:25: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=OiBttTdW; 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 S239112AbiIFIUi (ORCPT + 99 others); Tue, 6 Sep 2022 04:20:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238950AbiIFIUf (ORCPT ); Tue, 6 Sep 2022 04:20:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F345C949 for ; Tue, 6 Sep 2022 01:20:32 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9F41EB8164A for ; Tue, 6 Sep 2022 08:20:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67EF6C43470 for ; Tue, 6 Sep 2022 08:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662452430; bh=ZbibMUNAjjoNAAvz1ql7CXchqgAEAiETKd4gTDwr06c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=OiBttTdW0feoadUUVSeiY5YxgLI/IG9xVMRfe9L5VClNiIfpRYyEChQTzNLjvw6u5 r+HOcj9DkQKkY816b7iApBE9j/4t+K98zV1JUnxrwJ4Tg1cvl4qfHJ4f+XfHXvF1yF i2JEyxniYVFUG5ZXMV/B5XEozrAjIuzu6lRL6kFfQMyujo6fqofRhDYoIQWgrbUtlZ 6AwByAUS+AEShSrHmeXWCCoVk8ZgCcpvX860dwJq/fjz3s8LZ3bvs9TLHydkvNIOT0 cRHMk/WNxPqlh5Wi60Ry8HN8QdfNZI7EGrgODibw2/mAIwTbBqgqdDev/6gEp1AmHp QyVbSowLp0vjg== Received: by mail-ua1-f46.google.com with SMTP id z26so387637uaq.0 for ; Tue, 06 Sep 2022 01:20:30 -0700 (PDT) X-Gm-Message-State: ACgBeo1vwAknmZD91P9koMr7+t2aPJ5yTYb18yINFNZhN9RST/8sRhRi /tRn9r/RuoN2CoqJ1RSP1Z2R/M6QBe87BMSirmA= X-Received: by 2002:ab0:2ea9:0:b0:395:b672:508 with SMTP id y9-20020ab02ea9000000b00395b6720508mr3564505uay.63.1662452429281; Tue, 06 Sep 2022 01:20:29 -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: Huacai Chen Date: Tue, 6 Sep 2022 16:20:18 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 0/5] LoongArch: Support toolchain with new relocation types To: Ard Biesheuvel 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, Sep 6, 2022 at 3:18 PM Ard Biesheuvel wrote: > > 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. OK, Ruoyao, please send a patch to change the efistub cflags. Thank you. Huacai