Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3889441rwb; Mon, 5 Sep 2022 21:50:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR742ex2t8XEWihbEQ2ZnCMY57CIL1x2WQf++ZFoZp32UV2rDyWrsuElUBtQQP0a39+nUx3C X-Received: by 2002:a17:907:272a:b0:741:855c:8875 with SMTP id d10-20020a170907272a00b00741855c8875mr27002412ejl.575.1662439837239; Mon, 05 Sep 2022 21:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662439837; cv=none; d=google.com; s=arc-20160816; b=IE9OFFVm/BYu6HIq3hIRnOhUyhkfVJjkbBC13Mm5snCVlzu5XLM1T2b4VwvBcVBVi2 8dyw4uvcAGqxLQn1x5LBR6maKUOsDwsZ/M4H0aPjjp/UgnLz3XNErb/zzDr6XEA0qi7c AdzWb9e+wunABNWKuxsfY4xJPupAdooRIu4gxVYRaeBXKDbCIrwm9w8YjBxWNctUhK5a +rj0+1S3H4XLYJPLPZlrKNDwd7EW58cntFyA2EasC4h5t7jFAsOqOznbnreYK6rUFKV4 b3/mXxxprG2H7p5p36MceZ0koyRdwRbKB/KpG3ZYm+Xv6V1yEt5AM5rqoPwXjFAC5Ep1 9ljw== 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=yJocQqdGUtQo2Dm/po1a0co0Hu0iLcxrzlPJAX/p0LY=; b=YT7u2Oyn4CxaDC194/BIft9nkEEOvInB0Wrq4eSVFKmcT+VXETdMvLgHCSJbw/G4sR 4ZhvvJEDqGqtA9nZQRiMuRgFRtG3vUViqoDmCEP1f2g6l6XMvXTRu3sEI5+Ob1IMTBMP XUGuWrk7jyJyGPPLthaYw0RAmenxGNr55BCRfKkvrXZAOh2HTn3HjE+OovkLadvji+uZ QKnPR04qR/GDYz7LUQF31CiWUi/6ecNRKMCdl4B0Vsn6zLEwC+1aCyxoyN/Ro3afsCL1 /vOeTsJwGJ0gHs5Y0lu1XarUvFfUkP86fevWwNBSuudtRiiqgYKeLpAJ1tWmOZy7Bd06 OjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mCbCXwVq; 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 y20-20020a056402271400b0044ed33f008dsi377453edd.423.2022.09.05.21.50.12; Mon, 05 Sep 2022 21:50:37 -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=mCbCXwVq; 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 S232225AbiIFEnw (ORCPT + 99 others); Tue, 6 Sep 2022 00:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbiIFEnv (ORCPT ); Tue, 6 Sep 2022 00:43:51 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3659965544 for ; Mon, 5 Sep 2022 21:43:50 -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 sin.source.kernel.org (Postfix) with ESMTPS id 8EEEFCE0A0C for ; Tue, 6 Sep 2022 04:43:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FC1AC43140 for ; Tue, 6 Sep 2022 04:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662439426; bh=7TjMi3dv4P+rRVTd8H7v8fPFr0supL/24PBj+1I7I9w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=mCbCXwVq8PHAqEhWIP6ZFLri2XK5qsy7UFTua2m6x4OUpu1VLX+GtqJ9BgJ4pSra8 fc7CgFSbwOrgzgoyKt1vSDc8+HbzTu5TyVDe2Dwly4uNjoHvTRHNNWXh2JzY3uqyN1 hs930Z7wQ3T/J4z3bUdr2xIsFQQFZjGsverBNNIZ8EQOmKhEWs3TvVeUGs/DxkMEuX VB7JROZHpO7Fb02ysbVrVVcMuG1794iCX+V9JYaUCR8rZ5eoPe4K5v3dHtXzsvcnwR ElKqKFOUBmebjITRKINIyIX0keocU1I8Fzb9cnOXDwOZ2yx3/aRBwxlJewLZl+Cs3N 1blTwqbrteT9A== Received: by mail-vs1-f48.google.com with SMTP id a129so369813vsc.0 for ; Mon, 05 Sep 2022 21:43:46 -0700 (PDT) X-Gm-Message-State: ACgBeo2lNYZ7N5G5DqNG31pHWQ5JePINxPHZh926s+r6Q59CYeBCHEzC apCKPnGXmhWAm+Q+aKiFPn9DSRdENQHZDtcHSb8= X-Received: by 2002:a67:d49e:0:b0:390:dccf:23c8 with SMTP id g30-20020a67d49e000000b00390dccf23c8mr13262980vsj.59.1662439425056; Mon, 05 Sep 2022 21:43:45 -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: <8d0f96e2977c5c78f17bb410087f2aad986ef5a4.camel@xry111.site> From: Huacai Chen Date: Tue, 6 Sep 2022 12:43:34 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 0/5] LoongArch: Support toolchain with new relocation types To: Xi Ruoyao , Ard Biesheuvel Cc: 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 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. :) Huacai > > -- > Xi Ruoyao > School of Aerospace Science and Technology, Xidian University >