Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3888822rwb; Mon, 5 Sep 2022 21:49:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qMi1BzAZl7t6zIfVLcoIO1f93JzbT+GZQrl9M02FcPM0+ZVIvDOqF3qaKE5JR7LHBsQFc X-Received: by 2002:a05:6402:f21:b0:446:19c5:59ea with SMTP id i33-20020a0564020f2100b0044619c559eamr2576971eda.371.1662439769227; Mon, 05 Sep 2022 21:49:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662439769; cv=none; d=google.com; s=arc-20160816; b=KUNiaY3uo0ZcSBWoF/GnOwfwn8GpQVCT6HaAab8JSjhCe66A0nG4JNZSqoQgE0mR0T 54x6E8ahQkuMpYo1ClMyh3HNBuLiySSbOdINFZhN3QcocCsc8IUdNzfaG4usjHIhunzk 4OVhRAyIz3HxZuWA6YTds7f5f+UWcBHoF6DlpAbMq5WZdheBIzwpd2vdrFhTupIkE6AF akBoBP4Q/XwtBOCjVVGptj8kaaKExnf9RrF5xkErljKM052D+9L4EAEuBTyVjDpkjTYk qI8E3lM0taZ8sROhRXTsX5MBU/dfbLWAvE3w3kO0Ef4VeMQHzc7VTRu6guSj1iH6/I7f lSJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=kTdA+rmZXbVdG8ICt1zbpHgGakrezcprp5dPvu5m308=; b=JNVgW3SJUMleUFnYtXJrEogEtqI7kn2aLYZPfKg2o/upzCdeTT1MRj2cdH+uBoal3J BoT6lOx1euinuEai5KJ+habxpNQPw20Be0zdO1YfKeBQqGlcLQ3geWlZML9DrwMFK/bS 5+EEKlk2FD4TOCm/mmi/kd+6VVChoJYfV18vpqBrzMouspiG792SwdOEJvbfrXB4CF3L +8BgHYPtA92FwV0G9BtnhP6eI9EXuJva95ywsUHGHQteHDy72xVDwdiVr7H4hx6w2ZIt hc27blwkWyI/Thn6aFR5X47AWNV755RZJPDODKJwdPAEEK7KKyG9MCJomFrv2shrziyH 1FNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=L3SS+6vz; 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg14-20020a170907970e00b0073d68cdd0a8si9430357ejc.9.2022.09.05.21.48.58; Mon, 05 Sep 2022 21:49:29 -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=@xry111.site header.s=default header.b=L3SS+6vz; 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=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232570AbiIFE10 (ORCPT + 99 others); Tue, 6 Sep 2022 00:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231441AbiIFE1N (ORCPT ); Tue, 6 Sep 2022 00:27:13 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74FEF58DE2 for ; Mon, 5 Sep 2022 21:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1662438428; bh=0cI1Rk0Un9o1Oj+XrrEKadSkkh9tk38OEijCtoyUORY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=L3SS+6vzjxpAfuWaGy8T+L2LY/1t3nD6hbtrRRl0JyDEwty7AROoGIZCQunSQanUF 6d8QrqDI9jG93ZX0E9CwwDGIKfktQqEokFCabb8YggjAWAzAZ0UNeonF0LLOEc0vrQ t6CoVqBp6DkGZs5nMYA3K2A8Ka4bj25oDCXK6AD0= Received: from [IPv6:240e:358:116c:5200:dc73:854d:832e:4] (unknown [IPv6:240e:358:116c:5200:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 53EE466857; Tue, 6 Sep 2022 00:27:03 -0400 (EDT) Message-ID: <8d0f96e2977c5c78f17bb410087f2aad986ef5a4.camel@xry111.site> Subject: Re: [PATCH v7 0/5] LoongArch: Support toolchain with new relocation types From: Xi Ruoyao To: Huacai Chen Cc: Jinyang He , WANG Xuerui , loongarch@lists.linux.dev, LKML , Youling Tang Date: Tue, 06 Sep 2022 12:26:56 +0800 In-Reply-To: References: <20220830104806.128365-1-xry111@xry111.site> <5b87173faeef587a2ffaaa6f58d34e0940231067.camel@xry111.site> <97291c0fe5a660c844475ff019c8db6af77ecf86.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.3 MIME-Version: 1.0 X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD, PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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, 2022-09-06 at 09:52 +0800, Huacai Chen wrote: > > =C2=A0 cflags-$(CONFIG_LOONGARCH)=C2=A0=C2=A0=C2=A0=C2=A0 :=3D $(subst = $(CC_FLAGS_FTRACE),,$(KBUILD_CFLAGS)) \ > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -fpic > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -fpie > >=20 > > =C2=A0 cflags-$(CONFIG_EFI_GENERIC_STUB) +=3D -I$(srctree)/scripts/dtc/= libfdt > >=20 > > (Some explanation: -fpic does not only mean "generate position- > > independent code", but "generate position-independent code *suitable fo= r > > use in a shared library*".=C2=A0 On LoongArch -mdirect-extern-access ca= nnot > > work for a shared library so the "-fpic -mdirect-extern-access" > > combination is rejected deliberately.) > >=20 > > Not sure how to submit these changes properly...=C2=A0 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).=20 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. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University