unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.
@ 2020-10-16  2:56 Cooper Qu via Libc-alpha
  2020-10-16 15:28 ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 5+ messages in thread
From: Cooper Qu via Libc-alpha @ 2020-10-16  2:56 UTC (permalink / raw)
  To: libc-alpha, han_mao; +Cc: Cooper Qu

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(-)

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)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.
  2020-10-16  2:56 [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp Cooper Qu via Libc-alpha
@ 2020-10-16 15:28 ` Adhemerval Zanella via Libc-alpha
       [not found]   ` <7bee7575-fc74-4e87-9621-77f2c51354e1.han_mao@c-sky.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2020-10-16 15:28 UTC (permalink / raw)
  To: Cooper Qu, libc-alpha, han_mao



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)
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 回复:Re: [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.
       [not found]   ` <7bee7575-fc74-4e87-9621-77f2c51354e1.han_mao@c-sky.com>
@ 2020-10-19  6:24     ` Cooper Qu via Libc-alpha
  2020-10-19 12:22       ` Adhemerval Zanella via Libc-alpha
  0 siblings, 1 reply; 5+ messages in thread
From: Cooper Qu via Libc-alpha @ 2020-10-19  6:24 UTC (permalink / raw)
  To: 毛晗, adhemerval.zanella, libc-alpha

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 回复:Re: [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.
  2020-10-19  6:24     ` 回复:Re: " Cooper Qu via Libc-alpha
@ 2020-10-19 12:22       ` Adhemerval Zanella via Libc-alpha
  2020-10-20  2:22         ` 回复:Re: " 毛晗
  0 siblings, 1 reply; 5+ messages in thread
From: Adhemerval Zanella via Libc-alpha @ 2020-10-19 12:22 UTC (permalink / raw)
  To: Cooper Qu, 毛晗, libc-alpha



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?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* 回复:Re: 回复:Re: [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp.
  2020-10-19 12:22       ` Adhemerval Zanella via Libc-alpha
@ 2020-10-20  2:22         ` 毛晗
  0 siblings, 0 replies; 5+ messages in thread
From: 毛晗 @ 2020-10-20  2:22 UTC (permalink / raw)
  To: Adhemerval Zanella, Cooper Qu, G. Branden Robinson via Libc-alpha

>>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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-10-20  2:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16  2:56 [PATCH 1/1] C-SKY:Fix dynamic linker's name when mfloat-abi=softfp Cooper Qu via Libc-alpha
2020-10-16 15:28 ` Adhemerval Zanella via Libc-alpha
     [not found]   ` <7bee7575-fc74-4e87-9621-77f2c51354e1.han_mao@c-sky.com>
2020-10-19  6:24     ` 回复:Re: " Cooper Qu via Libc-alpha
2020-10-19 12:22       ` Adhemerval Zanella via Libc-alpha
2020-10-20  2:22         ` 回复:Re: " 毛晗

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).