123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- From 7eac5d7aba0ea86e4393eb75a995423946375dd9 Mon Sep 17 00:00:00 2001
- From: Khem Raj <raj.khem@gmail.com>
- Date: Tue, 3 Oct 2017 12:37:01 -0700
- Subject: [PATCH] sysdeps/riscv: Execute preconfiure only for risv target
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- ---
- sysdeps/riscv/preconfigure | 93 ++++++++++++++++++++++++----------------------
- 1 file changed, 48 insertions(+), 45 deletions(-)
- diff --git a/sysdeps/riscv/preconfigure b/sysdeps/riscv/preconfigure
- index 43e2a4fac0..da4afb278d 100644
- --- a/sysdeps/riscv/preconfigure
- +++ b/sysdeps/riscv/preconfigure
- @@ -1,50 +1,53 @@
- -xlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_xlen \(.*\)/\1/p'`
- -flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_flen \(.*\)/\1/p'`
- -float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_float_abi_\([^ ]*\) .*/\1/p'`
- +case "$machine" in
- +riscv*)
- + xlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_xlen \(.*\)/\1/p'`
- + flen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_flen \(.*\)/\1/p'`
- + float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 's/^#define __riscv_float_abi_\([^ ]*\) .*/\1/p'`
-
- -case "$xlen" in
- -32 | 64)
- - ;;
- -*)
- - echo "Unable to determine XLEN" >&2
- - exit 1
- - ;;
- -esac
- + case "$xlen" in
- + 32 | 64)
- + ;;
- + *)
- + echo "Unable to determine XLEN" >&2
- + exit 1
- + ;;
- + esac
-
- -case "$flen" in
- -64)
- - float_machine=rvd
- - ;;
- -32)
- - float_machine=rvf
- - ;;
- -"")
- - float_machine=
- - ;;
- -*)
- - echo "Unable to determine FLEN" >&2
- - exit 1
- - ;;
- -esac
- + case "$flen" in
- + 64)
- + float_machine=rvd
- + ;;
- + 32)
- + float_machine=rvf
- + ;;
- + "")
- + float_machine=
- + ;;
- + *)
- + echo "Unable to determine FLEN" >&2
- + exit 1
- + ;;
- + esac
-
- -case "$float_abi" in
- -soft)
- - abi_flen=0
- - ;;
- -single)
- - abi_flen=32
- - ;;
- -double)
- - abi_flen=64
- - ;;
- -*)
- - echo "Unable to determine floating-point ABI" >&2
- - exit 1
- - ;;
- -esac
- + case "$float_abi" in
- + soft)
- + abi_flen=0
- + ;;
- + single)
- + abi_flen=32
- + ;;
- + double)
- + abi_flen=64
- + ;;
- + *)
- + echo "Unable to determine floating-point ABI" >&2
- + exit 1
- + ;;
- + esac
-
- -base_machine=riscv
- -machine=riscv/rv$xlen/$float_machine
- + base_machine=riscv
- + machine=riscv/rv$xlen/$float_machine
-
- -$as_echo "#define RISCV_ABI_XLEN $xlen" >>confdefs.h
- -$as_echo "#define RISCV_ABI_FLEN $abi_flen" >>confdefs.h
- + $as_echo "#define RISCV_ABI_XLEN $xlen" >>confdefs.h
- + $as_echo "#define RISCV_ABI_FLEN $abi_flen" >>confdefs.h
- +esac
- --
- 2.14.2
|