From mboxrd@z Thu Jan 1 00:00:00 1970 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 8FD68C38145 for ; Tue, 6 Sep 2022 08:20:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiIFIUj (ORCPT ); Tue, 6 Sep 2022 04:20:39 -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-Google-Smtp-Source: AA6agR7UVZ0Tj0zsxXqzRKUKDPugPMJ4MIAV237ApqkIFDn2SD4HuTsX5zoXyqCjRLDWNMpSokz/nMB5lSirOHJ+XeA= 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" 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