public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Han Mao <maohan@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] C-SKY: Make dynamic linker's name compitable with the older gcc. Date: Wed, 21 Oct 2020 08:07:51 +0000 (GMT) [thread overview] Message-ID: <20201021080751.C1D04386F81C@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=56b223c1c8334e4255bf11aed1386a007822702a commit 56b223c1c8334e4255bf11aed1386a007822702a Author: Cooper Qu <cooper.qu@linux.alibaba.com> Date: Tue Oct 20 23:00:59 2020 +0800 C-SKY: Make dynamic linker's name compitable with the older gcc. __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 not set). To be compatible with older gcc, use __CSKY_HARD_FLOAT_FPU_SF__ identify if -mfloat-abi is supported, because it is added to gcc at the same time as -mfloat-abi. Reviewed-by: Mao Han <han_mao@linux.alibaba.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Diff: --- sysdeps/csky/preconfigure | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure index 16f3b60cf5..5f22416f95 100644 --- a/sysdeps/csky/preconfigure +++ b/sysdeps/csky/preconfigure @@ -2,8 +2,12 @@ case "$machine" in 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 | + hard_float=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __CSKY_HARD_FLOAT__ \(.*\)/\1/p'` + hard_float_sf=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | + sed -n 's/^#define __CSKY_HARD_FLOAT_FPU_SF__ \(.*\)/\1/p'` + hard_float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | + sed -n 's/^#define __CSKY_HARD_FLOAT_ABI__ \(.*\)/\1/p'` case "$abi" in 1) @@ -19,14 +23,27 @@ csky*) ;; esac - case "$float_abi" in - 1) - with_fp_cond=1 - ;; - *) - with_fp_cond=0 - ;; - esac + # __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 not set). To be compatible with older gcc, + # use __CSKY_HARD_FLOAT_FPU_SF__ identify if -mfloat-abi is supported, + # because it is added to gcc at the same time as -mfloat-abi. + if test -n "$hard_float"; then + if test -z "$hard_float_sf"; then + with_fp_cond=1 + else + if test -n "$hard_float_abi"; then + with_fp_cond=1 + else + with_fp_cond=0 + fi + fi + else + with_fp_cond=0 + fi base_machine=csky machine=csky/$machine
reply other threads:[~2020-10-21 8:07 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201021080751.C1D04386F81C@sourceware.org \ --to=maohan@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).