Message ID | 20201016025620.86747-1-cooper.qu@linux.alibaba.com |
---|---|
State | Committed |
Commit | 7449320983b664aba506d7674ea0ce142dd3d4ed |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 145C13857C73; Fri, 16 Oct 2020 02:56:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 145C13857C73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1602816989; bh=fRC6iGc8ar7coNMNQ8is7ydJYenQsUiufGlh7uZpO80=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=paBEf41X2Dx0qfQ1e88EOzKGRv5Td4wEoVibXebz/rOZcnqhdynF5n5c63UQ9pLv5 c/PoABTAbLR1nrA/rgWkALGvhsm1OQKCYfFrzg8fjzavLkFfioMpDrsyCuKh83OV0P QdEjnb4fmBUILcDMYSUy23Vb8NMqXBeaVz0eZN1E= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by sourceware.org (Postfix) with ESMTPS id 6306B3858C27 for <libc-alpha@sourceware.org>; Fri, 16 Oct 2020 02:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6306B3858C27 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R571e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=cooper.qu@linux.alibaba.com; NM=1; PH=DS; RN=3; SR=0; TI=SMTPD_---0UC9EkxB_1602816982; Received: from localhost(mailfrom:cooper.qu@linux.alibaba.com fp:SMTPD_---0UC9EkxB_1602816982) by smtp.aliyun-inc.com(127.0.0.1); Fri, 16 Oct 2020 10:56:22 +0800 To: libc-alpha@sourceware.org, han_mao@c-sky.com Subject: [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp. Date: Fri, 16 Oct 2020 10:56:20 +0800 Message-Id: <20201016025620.86747-1-cooper.qu@linux.alibaba.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-21.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Cooper Qu via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Cooper Qu <cooper.qu@linux.alibaba.com> Cc: Cooper Qu <cooper.qu@linux.alibaba.com> Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
[1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.
|
|
Commit Message
瞿仙淼
Oct. 16, 2020, 2:56 a.m. UTC
The dynamic linker should be chosen according to float abi, the predefined macro __CSKY_HARD_FLOAT__ stand for architecure not abi. * sysdeps/csky/preconfigure: Use __CSKY_HARD_FLOAT_ABI__ instead of __CSKY_HARD_FLOAT__. --- sysdeps/csky/preconfigure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 15/10/2020 23:56, Cooper Qu via Libc-alpha wrote: > The dynamic linker should be chosen according to float abi, the > predefined macro __CSKY_HARD_FLOAT__ stand for architecure not > abi. > > * sysdeps/csky/preconfigure: Use __CSKY_HARD_FLOAT_ABI__ instead > of __CSKY_HARD_FLOAT__. Is this really correct? On a gcc built for csky-linux-gnuabiv2 using build-many-glibcs.py: $ csky-glibc-linux-gnuabiv2-gcc --version csky-glibc-linux-gnuabiv2-gcc (GCC) 9.3.1 20200415 [releases/gcc-9 revision 54ab0a7d757:262f0d53795:1eccf9955614a6f0597bf624bbc88788b8b0fdc5] [...] $ csky-glibc-linux-gnuabiv2-gcc test.c -E -dM < /dev/null | grep __CSKY_HARD_FLOAT_ABI__ ; echo $? $ csky-glibc-linux-gnuabiv2-gcc test.c -E -dM < /dev/null | grep __CSKY_HARD_FLOAT__ ; echo $? #define __CSKY_HARD_FLOAT__ 1 0 It seems this flags was added along with -mfloat-abi=soft option on gcc11 (commit 01d56aeaffa1) which means that building a patched glibc with older gcc version will always set the 'float_abi' to always use soft-fp. I think to get full backwards compatible you will need to handle and __CSKY_HARD_FLOAT_FPU_SF__ to check whether - mfloat-abi is used, something like the below (untested): --- hard_float=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` hard_float_fpu_sf=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __CSKY_HARD_FLOAT_FPU_SF__ \(.*\)/\1/p'` # __CSKY_HARD_FLOAT_ABI__ was added on gcc 11 to specify whether # -mfloat-abi=hard is set. On older gcc, the float ABI is defined solely # with __CSKY_HARD_FLOAT__. If __CSKY_HARD_FLOAT__ is set it can be # either a hard-float ABI (gcc older than 11, or gcc11 -mfloat-abi=hard # (__CSKY_HARD_FLOAT_ABI__ is set) or -mfloat-abi=softfp # (__CSKY_HARD_FLOAT_ABI__ is set). if test -n $hard_float; then if test -z $hard_float_fpu_sf; then float_abi=1 else float_abi=0 fi else float_abi=0 fi --- > --- > sysdeps/csky/preconfigure | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure > index 16f3b60..11b887f 100644 > --- a/sysdeps/csky/preconfigure > +++ b/sysdeps/csky/preconfigure > @@ -3,7 +3,7 @@ csky*) > abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | > sed -n 's/^#define __CSKYABI__ \(.*\)/\1/p'` > float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | > - sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` > + sed -n 's/^#define __CSKY_HARD_FLOAT_ABI__ \(.*\)/\1/p'` > > case "$abi" in > 1) >
Hi Adhemerval, > *发件人:*Adhemerval Zanella <adhemerval.zanella@linaro.org> > *发送时间:*10/16/20 23:36:15 > *收件人:*Cooper Qu <cooper.qu@linux.alibaba.com>, Alistair Francis > via Libc-alpha <libc-alpha@sourceware.org>, Mao Han > <han_mao@c-sky.com> > *主题:*Re: [PATCH 1/1] C-SKY:Fix dynamic linker's name when > mfloat-abi=softfp. > > > > On 15/10/2020 23:56, Cooper Qu via Libc-alpha wrote: > > The dynamic linker should be chosen according to float abi, the > > predefined macro __CSKY_HARD_FLOAT__ stand for architecure not > > abi. > > > > * sysdeps/csky/preconfigure: Use __CSKY_HARD_FLOAT_ABI__ instead > > of __CSKY_HARD_FLOAT__. > > Is this really correct? On a gcc built for csky-linux-gnuabiv2 using > build-many-glibcs.py: > > $ csky-glibc-linux-gnuabiv2-gcc --version > csky-glibc-linux-gnuabiv2-gcc (GCC) 9.3.1 20200415 [releases/gcc-9 revision 54ab0a7d757:262f0d53795:1eccf9955614a6f0597bf624bbc88788b8b0fdc5] > [...] > > $ csky-glibc-linux-gnuabiv2-gcc test.c -E -dM < /dev/null | grep __CSKY_HARD_FLOAT_ABI__ ; echo $? > > $ csky-glibc-linux-gnuabiv2-gcc test.c -E -dM < /dev/null | grep __CSKY_HARD_FLOAT__ ; echo $? > #define __CSKY_HARD_FLOAT__ 1 > 0 > > It seems this flags was added along with -mfloat-abi=soft option on gcc11 > (commit 01d56aeaffa1) which means that building a patched glibc with > > older gcc version will always set the 'float_abi' to always use soft-fp. > Yes, it cannot be compatible with the old version GCC. > > > I think to get full backwards compatible you will need to handle > and __CSKY_HARD_FLOAT_FPU_SF__ to check whether - mfloat-abi is used, something > > like the below (untested): > > --- > > hard_float=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | > sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` > hard_float_fpu_sf=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | > sed -n 's/^#define __CSKY_HARD_FLOAT_FPU_SF__ \(.*\)/\1/p'` > > # __CSKY_HARD_FLOAT_ABI__ was added on gcc 11 to specify whether > > # -mfloat-abi=hard is set. On older gcc, the float ABI is defined solely > # with __CSKY_HARD_FLOAT__. If __CSKY_HARD_FLOAT__ is set it can be > > # either a hard-float ABI (gcc older than 11, or gcc11 -mfloat-abi=hard > > # (__CSKY_HARD_FLOAT_ABI__ is set) or -mfloat-abi=softfp > # (__CSKY_HARD_FLOAT_ABI__ is set). > if test -n $hard_float; then > if test -z $hard_float_fpu_sf; then > float_abi=1 > else > float_abi=0 > fi > else > float_abi=0 > fi > This is a feasible method, I will verify and fix it.Thanks very much! Cooper
On 19/10/2020 03:24, Cooper Qu wrote: > Hi Adhemerval, > >> *发件人:*Adhemerval Zanella <adhemerval.zanella@linaro.org> >> *发送时间:*10/16/20 23:36:15 >> *收件人:*Cooper Qu <cooper.qu@linux.alibaba.com>, Alistair Francis via Libc-alpha <libc-alpha@sourceware.org>, Mao Han <han_mao@c-sky.com> >> *主题:*Re: [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp. >> >> >> >> On 15/10/2020 23:56, Cooper Qu via Libc-alpha wrote: >> > The dynamic linker should be chosen according to float abi, the >> > predefined macro __CSKY_HARD_FLOAT__ stand for architecure not >> > abi. >> > >> > * sysdeps/csky/preconfigure: Use __CSKY_HARD_FLOAT_ABI__ instead >> > of __CSKY_HARD_FLOAT__. >> >> Is this really correct? On a gcc built for csky-linux-gnuabiv2 using >> build-many-glibcs.py: >> >> $ csky-glibc-linux-gnuabiv2-gcc --version >> csky-glibc-linux-gnuabiv2-gcc (GCC) 9.3.1 20200415 [releases/gcc-9 revision 54ab0a7d757:262f0d53795:1eccf9955614a6f0597bf624bbc88788b8b0fdc5] >> [...] >> >> $ csky-glibc-linux-gnuabiv2-gcc test.c -E -dM < /dev/null | grep __CSKY_HARD_FLOAT_ABI__ ; echo $? >> >> $ csky-glibc-linux-gnuabiv2-gcc test.c -E -dM < /dev/null | grep __CSKY_HARD_FLOAT__ ; echo $? >> #define __CSKY_HARD_FLOAT__ 1 >> 0 >> >> It seems this flags was added along with -mfloat-abi=soft option on gcc11 >> (commit 01d56aeaffa1) which means that building a patched glibc with >> older gcc version will always set the 'float_abi' to always use soft-fp. >> > Yes, it cannot be compatible with the old version GCC. >> >> >> I think to get full backwards compatible you will need to handle >> and __CSKY_HARD_FLOAT_FPU_SF__ to check whether - mfloat-abi is used, something >> like the below (untested): >> >> --- >> >> hard_float=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | >> sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` >> hard_float_fpu_sf=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | >> sed -n 's/^#define __CSKY_HARD_FLOAT_FPU_SF__ \(.*\)/\1/p'` >> >> # __CSKY_HARD_FLOAT_ABI__ was added on gcc 11 to specify whether >> # -mfloat-abi=hard is set. On older gcc, the float ABI is defined solely >> # with __CSKY_HARD_FLOAT__. If __CSKY_HARD_FLOAT__ is set it can be >> # either a hard-float ABI (gcc older than 11, or gcc11 -mfloat-abi=hard >> # (__CSKY_HARD_FLOAT_ABI__ is set) or -mfloat-abi=softfp >> # (__CSKY_HARD_FLOAT_ABI__ is set). >> if test -n $hard_float; then >> if test -z $hard_float_fpu_sf; then >> float_abi=1 >> else >> float_abi=0 >> fi >> else >> float_abi=0 >> fi >> > This is a feasible method, I will verify and fix it.Thanks very much! Hi, It seems that you still committed the older versions which is incompatible with older GCC. Could you revert it and push a version that work with any gcc version?
>>Hi, >> >> It seems that you still committed the older versions which is >> incompatible with older GCC. Could you revert it and push >> a version that work with any gcc version? Sorry for missing your reply and the incomplete thought on the incompatibility. I found you reply in the afternoon and disscussed the solution with Cooper, but didn't revet the commit. We've revet the commit now and will update that patch later. Thanks, Mao Han
diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure index 16f3b60..11b887f 100644 --- a/sysdeps/csky/preconfigure +++ b/sysdeps/csky/preconfigure @@ -3,7 +3,7 @@ csky*) abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __CSKYABI__ \(.*\)/\1/p'` float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | - sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` + sed -n 's/^#define __CSKY_HARD_FLOAT_ABI__ \(.*\)/\1/p'` case "$abi" in 1)