From patchwork Tue Oct 20 15:09:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?556/5LuZ5re8?= X-Patchwork-Id: 40782 Return-Path: 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 B179A3946C32; Tue, 20 Oct 2020 15:10:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B179A3946C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1603206603; bh=6PwBccDCOHC7PK4lqp7bPHKa4mTzUFIEV9NcGiK7qFQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=SMf4kfaPC8Ix+yT2RCYztTy0iUwSc3qRFDXc9SgnWj3AY8dVsL9sNIjlQLhKr/lux 0WwlfyzNMDZgoQcBD5+kMYi4lzHncMpyac5ui6XBBfKcbGS2m34XyNWCYdHH7fN8FD A0vhyGNrRkapzCJ53JmrPHSJFwaa44r35ccjSKSU= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from out30-44.freemail.mail.aliyun.com (out30-44.freemail.mail.aliyun.com [115.124.30.44]) by sourceware.org (Postfix) with ESMTPS id A4AED3945C14 for ; Tue, 20 Oct 2020 15:09:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A4AED3945C14 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R181e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04420; MF=cooper.qu@linux.alibaba.com; NM=1; PH=DS; RN=4; SR=0; TI=SMTPD_---0UCf1cKt_1603206591; Received: from localhost(mailfrom:cooper.qu@linux.alibaba.com fp:SMTPD_---0UCf1cKt_1603206591) by smtp.aliyun-inc.com(127.0.0.1); Tue, 20 Oct 2020 23:09:51 +0800 To: libc-alpha@sourceware.org, han_mao@c-sky.com Subject: [PATCH] C-SKY: Make dynamic linker's name compitable with the older gcc. Date: Tue, 20 Oct 2020 23:09:38 +0800 Message-Id: <20201020150938.35160-1-cooper.qu@linux.alibaba.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Status: No, score=-20.9 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Cooper Qu via Libc-alpha From: =?utf-8?b?556/5LuZ5re8?= Reply-To: Cooper Qu Cc: Cooper Qu Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" __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. * sysdeps/csky/preconfigure : Make it compitable with the older gcc. Reviewed-by: Adhemerval Zanella --- sysdeps/csky/preconfigure | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/sysdeps/csky/preconfigure b/sysdeps/csky/preconfigure index 11b887f..5f22416 100644 --- a/sysdeps/csky/preconfigure +++ b/sysdeps/csky/preconfigure @@ -2,7 +2,11 @@ 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 @@ -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