public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/6] Andes nds32: configure settings for nds32 target.
@ 2013-07-08 10:44 Chung-Ju Wu
  2013-07-09 23:05 ` Joseph S. Myers
  0 siblings, 1 reply; 4+ messages in thread
From: Chung-Ju Wu @ 2013-07-08 10:44 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

Hi,

This patch consists of the nds32 specific settings for configure process.
Because there are two kinds of libgcc support (newlib/mculib) in nds32 target,
we add --with-nds32-lib option in gcc/config.gcc and libgcc/config.host.

The nds32*|nds32le*|nds32be* recognition in config.sub has already
been applied previously:
http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01125.html


contrib/
2013-07-08  Chung-Ju Wu  <jasonwucj@gmail.com>
	    Shiva Chen  <shiva0217@gmail.com>

	* config-list.mk (nds32le-elf, nds32be-elf): Add nds32 target.

gcc/
2013-07-08  Chung-Ju Wu  <jasonwucj@gmail.com>
	    Shiva Chen  <shiva0217@gmail.com>

	* config.gcc (nds32*-*-*): Add nds32 target.

libgcc/
2013-07-08  Chung-Ju Wu  <jasonwucj@gmail.com>
	    Shiva Chen  <shiva0217@gmail.com>

	* config.host (nds32*-elf*): Add nds32 target.

[-- Attachment #2: 1-nds32-config.patch --]
[-- Type: application/octet-stream, Size: 6217 bytes --]

diff --git contrib/config-list.mk contrib/config-list.mk
index 9a141c2..08acc35 100644
--- contrib/config-list.mk
+++ contrib/config-list.mk
@@ -43,7 +43,9 @@ LIST = aarch64-elf aarch64-linux-gnu \
   mipsisa64-elfoabi mipsisa64r2el-elf mipsisa64sr71k-elf mipsisa64sb1-elf \
   mipsel-elf mips64-elf mips64vr-elf mips64orion-elf mips-rtems \
   mips-wrs-vxworks mipstx39-elf mmix-knuth-mmixware mn10300-elf moxie-elf \
-  moxie-uclinux moxie-rtems pdp11-aout picochip-elfOPT-enable-obsolete \
+  moxie-uclinux moxie-rtems \
+  nds32le-elf nds32be-elf \
+  pdp11-aout picochip-elfOPT-enable-obsolete \
   powerpc-darwin8 \
   powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
   powerpc-eabispe powerpc-eabisimaltivec powerpc-eabisim ppc-elf \
diff --git gcc/config.gcc gcc/config.gcc
index fd55d55..15fcaaa 100644
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -416,6 +416,10 @@ mips*-*-*)
 	extra_headers="loongson.h"
 	extra_options="${extra_options} g.opt mips/mips-tables.opt"
 	;;
+nds32*)
+	cpu_type=nds32
+	extra_headers="nds32_intrinsic.h"
+	;;
 picochip-*-*)
         cpu_type=picochip
         ;;
@@ -1983,6 +1987,16 @@ mn10300-*-*)
 	use_collect2=no
 	use_gcc_stdint=wrap
 	;;
+nds32le-*-*)
+	target_cpu_default="0"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+	tmake_file="nds32/t-mlibs-le"
+	;;
+nds32be-*-*)
+	target_cpu_default="0|MASK_BIG_ENDIAN"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+	tmake_file="nds32/t-mlibs-be"
+	;;
 pdp11-*-*)
 	tm_file="${tm_file} newlib-stdint.h"
 	use_gcc_stdint=wrap
@@ -3548,6 +3562,82 @@ case "${target}" in
 		esac
 		;;
 
+	nds32*-*-*)
+		supported_defaults="arch nds32_lib"
+
+		# process --with-arch
+		# the 'with_arch' will be analyzed and then set its ISA and FLAGS
+		case "${with_arch}" in
+		"")
+			# the default arch is v3
+			with_arch=v3
+			# set isa to be the same as --with_arch=v3 case
+			nds32_isa_family=v3
+			# set target_cpu_default to be the same as --with-arch=v3 case
+			target_cpu_default="${target_cpu_default}|MASK_V3PUSH|MASK_CMOV|MASK_PERF_EXT|MASK_16_BIT|MASK_GP_DIRECT"
+			;;
+		v2)
+			# OK, isa family is v2
+			nds32_isa_family=v2
+			# OK, v2 enable conditional move instructions
+			#     v2 enable performance extension instructions
+			target_cpu_default="${target_cpu_default}|MASK_CMOV|MASK_PERF_EXT|MASK_16_BIT|MASK_GP_DIRECT"
+			;;
+		v2j)
+			# OK, isa family is v2
+			nds32_isa_family=v2
+			# OK, v2j enable conditional move instructions
+			#     v2j enable performance extension instructions
+			#     v2j is reduced register set
+			target_cpu_default="${target_cpu_default}|MASK_CMOV|MASK_PERF_EXT|MASK_REDUCED_REGS|MASK_16_BIT|MASK_GP_DIRECT"
+			;;
+		v3)
+			# OK, isa family is v3
+			nds32_isa_family=v3
+			# OK, v3 enable conditional move instructions
+			#     v3 enable performance extension instructions
+			target_cpu_default="${target_cpu_default}|MASK_CMOV|MASK_PERF_EXT|MASK_16_BIT|MASK_GP_DIRECT"
+			;;
+		v3j)
+			# OK, isa family is v3
+			nds32_isa_family=v3
+			# OK, v3j enable conditional move instructions
+			#     v3j enable performance extension instructions
+			#     v3j is reduced register set
+			target_cpu_default="${target_cpu_default}|MASK_CMOV|MASK_PERF_EXT|MASK_REDUCED_REGS|MASK_16_BIT|MASK_GP_DIRECT"
+			;;
+		v3m)
+			# OK, isa family is v3m
+			nds32_isa_family=v3m
+			# OK, v3m enable conditional move instructions
+			#     v3m is reduced register set
+			target_cpu_default="${target_cpu_default}|MASK_CMOV|MASK_REDUCED_REGS|MASK_16_BIT|MASK_GP_DIRECT"
+			;;
+		*)
+			echo "Cannot accept --with-arch=$with_arch, available values are: v2 v2j v3 v3j v3m" 1>&2
+			exit 1
+			;;
+		esac
+
+		# process --with-nds32-lib
+		case "${with_nds32_lib}" in
+		"")
+			# the default library is newlib
+			with_nds32_lib=newlib
+			;;
+		newlib)
+			# OK
+			;;
+		mculib)
+			# OK
+			;;
+		*)
+			echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
+			exit 1
+			;;
+		esac
+		;;
+
 	powerpc*-*-* | rs6000-*-*)
 		supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
 
@@ -3781,6 +3871,11 @@ case ${target} in
 		tmake_file="mips/t-mips $tmake_file"
 		;;
 
+	nds32*-*-*)
+		# Append isa definition header file according to 'nds32_isa_family', which is set by --with-arch setting.
+		tm_file="${tm_file} nds32/nds32-isa-${nds32_isa_family}.h"
+		;;
+
 	powerpc*-*-* | rs6000-*-*)
 		# FIXME: The PowerPC port uses the value set at compile time,
 		# although it's only cosmetic.
diff --git libgcc/config.host libgcc/config.host
index d9d9c5f..be38014 100644
--- libgcc/config.host
+++ libgcc/config.host
@@ -137,6 +137,9 @@ mips*-*-*)
 	cpu_type=mips
 	tmake_file=mips/t-mips
 	;;
+nds32*-*)
+	cpu_type=nds32
+	;;
 powerpc*-*-*)
 	cpu_type=rs6000
 	;;
@@ -832,6 +835,43 @@ moxie-*-rtems*)
 	# Don't use default.
 	extra_parts=
 	;;
+nds32*-elf*)
+	# Basic makefile fragment and extra_parts for crt stuff.
+	tmake_file="${tmake_file} nds32/t-nds32"
+	extra_parts="crtbegin1.o crtend1.o"
+	# Append extra c-isr library according to --with-arch=X setting.
+	case "${with_arch}" in
+	v2 | v2j)
+		# The v2/v2j do not support c-isr implementation.
+		;;
+	"" | v3 | v3j | v3m)
+		# Use t-nds32-isr and libnds32_isr.a.
+		tmake_file="${tmake_file} nds32/t-nds32-isr"
+		extra_parts="${extra_parts} libnds32_isr.a"
+		;;
+	*)
+		echo "Cannot accept --with-arch=$with_arch, available values are: v2 v2j v3 v3j v3m" 1>&2
+		exit 1
+		;;
+	esac
+	# Append library definition makefile fragment according to --with-nds32-lib=X setting.
+	case "${with_nds32_lib}" in
+	"" | newlib)
+		# Append library definition makefile fragment t-nds32-newlib.
+		# Append 'soft-fp' software floating point make rule fragment provided by gcc.
+		tmake_file="${tmake_file} nds32/t-nds32-newlib t-softfp-sfdf t-softfp"
+		;;
+	mculib)
+		# Append library definition makefile fragment t-nds32-mculib.
+		# The software floating point library is included in mculib.
+		tmake_file="${tmake_file} nds32/t-nds32-mculib"
+		;;
+	*)
+		echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
+		exit 1
+		;;
+	esac
+	;;
 pdp11-*-*)
 	tmake_file="pdp11/t-pdp11 t-fdpbit"
 	;;

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

* Re: [PATCH 1/6] Andes nds32: configure settings for nds32 target.
  2013-07-08 10:44 [PATCH 1/6] Andes nds32: configure settings for nds32 target Chung-Ju Wu
@ 2013-07-09 23:05 ` Joseph S. Myers
  2013-07-24 15:49   ` Chung-Ju Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Joseph S. Myers @ 2013-07-09 23:05 UTC (permalink / raw)
  To: Chung-Ju Wu; +Cc: gcc-patches

On Mon, 8 Jul 2013, Chung-Ju Wu wrote:

> +	nds32*-*-*)
> +		supported_defaults="arch nds32_lib"
> +
> +		# process --with-arch
> +		# the 'with_arch' will be analyzed and then set its ISA and FLAGS

I don't think this approach for processing --with-arch and setting 
target_cpu_default in a complicated way based on it is a good idea.

The normal handling of --with-arch is to generate a -march= option via 
OPTION_DEFAULT_SPECS.  If you do that, then the conversion from -march= 
strings to sets of options enabled internally is done within the compiler 
proper.

> +nds32*-elf*)
> +	# Basic makefile fragment and extra_parts for crt stuff.
> +	tmake_file="${tmake_file} nds32/t-nds32"
> +	extra_parts="crtbegin1.o crtend1.o"
> +	# Append extra c-isr library according to --with-arch=X setting.

Now, given that you add a -march= option, there's the possibility that 
someone might do a build with multilibs for different -march= values.  So 
the choice here (libgcc configuration) needs to depend on the actual 
configuration of the compiler for the multilib being built, probably via 
configure tests in libgcc/configure.ac.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH 1/6] Andes nds32: configure settings for nds32 target.
  2013-07-09 23:05 ` Joseph S. Myers
@ 2013-07-24 15:49   ` Chung-Ju Wu
  2013-09-08 16:14     ` Chung-Ju Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Chung-Ju Wu @ 2013-07-24 15:49 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2500 bytes --]

Hi, Joseph,

Sorry for the late revised patch.
We have completed all of it based on your review comments.

On 7/10/13 6:56 AM, Joseph S. Myers wrote:
> On Mon, 8 Jul 2013, Chung-Ju Wu wrote:
>
>> +	nds32*-*-*)
>> +		supported_defaults="arch nds32_lib"
>> +
>> +		# process --with-arch
>> +		# the 'with_arch' will be analyzed and then set its ISA and FLAGS
>
> I don't think this approach for processing --with-arch and setting
> target_cpu_default in a complicated way based on it is a good idea.
>
> The normal handling of --with-arch is to generate a -march= option via
> OPTION_DEFAULT_SPECS.  If you do that, then the conversion from -march=
> strings to sets of options enabled internally is done within the compiler
> proper.
>

Now we handled --with-arch as you suggested.
The OPTION_DEFAULT_SPECS is added in nds32.h and we enable/disable
corresponding flags internally for -march= option in nds32.c.
The option -march is further described in documentation.

>> +nds32*-elf*)
>> +	# Basic makefile fragment and extra_parts for crt stuff.
>> +	tmake_file="${tmake_file} nds32/t-nds32"
>> +	extra_parts="crtbegin1.o crtend1.o"
>> +	# Append extra c-isr library according to --with-arch=X setting.
>
> Now, given that you add a -march= option, there's the possibility that
> someone might do a build with multilibs for different -march= values.  So
> the choice here (libgcc configuration) needs to depend on the actual
> configuration of the compiler for the multilib being built, probably via
> configure tests in libgcc/configure.ac.
>

After discussing with other engineers,
we decided to support c-isr library for all arch configuration
so that we can avoid modifying libgcc/configure.ac.


Thanks for the review comments.
A revised patch is provided and here is a summary:

   1. Handle -march option within the compiler proper.
      Simplify the handling of --with-arch in config.gcc.
   2. The c-isr library is supported for all arch configuration.
   3. Use tm_defines so that we can have only one t-mlibs used.


contrib/
2013-07-24  Chung-Ju Wu  <jasonwucj@gmail.com>
	    Shiva Chen  <shiva0217@gmail.com>

	* config-list.mk (nds32le-elf, nds32be-elf): Add nds32 target.

gcc/
2013-07-24  Chung-Ju Wu  <jasonwucj@gmail.com>
	    Shiva Chen  <shiva0217@gmail.com>

	* config.gcc (nds32*-*-*): Add nds32 target.

libgcc/
2013-07-24  Chung-Ju Wu  <jasonwucj@gmail.com>
	    Shiva Chen  <shiva0217@gmail.com>

	* config.host (nds32*-elf*): Add nds32 target.


Best regards,
jasonwucj


[-- Attachment #2: 1-nds32-config.v2.patch --]
[-- Type: text/plain, Size: 3720 bytes --]

diff --git contrib/config-list.mk contrib/config-list.mk
index 9a141c2..08acc35 100644
--- contrib/config-list.mk
+++ contrib/config-list.mk
@@ -43,7 +43,9 @@ LIST = aarch64-elf aarch64-linux-gnu \
   mipsisa64-elfoabi mipsisa64r2el-elf mipsisa64sr71k-elf mipsisa64sb1-elf \
   mipsel-elf mips64-elf mips64vr-elf mips64orion-elf mips-rtems \
   mips-wrs-vxworks mipstx39-elf mmix-knuth-mmixware mn10300-elf moxie-elf \
-  moxie-uclinux moxie-rtems pdp11-aout picochip-elfOPT-enable-obsolete \
+  moxie-uclinux moxie-rtems \
+  nds32le-elf nds32be-elf \
+  pdp11-aout picochip-elfOPT-enable-obsolete \
   powerpc-darwin8 \
   powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
   powerpc-eabispe powerpc-eabisimaltivec powerpc-eabisim ppc-elf \
diff --git gcc/config.gcc gcc/config.gcc
index 177677c..e941152 100644
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -416,6 +416,10 @@ mips*-*-*)
 	extra_headers="loongson.h"
 	extra_options="${extra_options} g.opt mips/mips-tables.opt"
 	;;
+nds32*)
+	cpu_type=nds32
+	extra_headers="nds32_intrinsic.h"
+	;;
 picochip-*-*)
         cpu_type=picochip
         ;;
@@ -2037,6 +2041,18 @@ mn10300-*-*)
 	use_collect2=no
 	use_gcc_stdint=wrap
 	;;
+nds32le-*-*)
+	target_cpu_default="0"
+	tm_defines="${tm_defines}"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+	tmake_file="nds32/t-mlibs"
+	;;
+nds32be-*-*)
+	target_cpu_default="0|MASK_BIG_ENDIAN"
+	tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+	tmake_file="nds32/t-mlibs"
+	;;
 pdp11-*-*)
 	tm_file="${tm_file} newlib-stdint.h"
 	use_gcc_stdint=wrap
@@ -3622,6 +3638,39 @@ case "${target}" in
 		esac
 		;;
 
+	nds32*-*-*)
+		supported_defaults="arch nds32_lib"
+
+		# process --with-arch
+		case "${with_arch}" in
+		"" | v2 | v3 | v3m)
+			# OK
+			;;
+		*)
+			echo "Cannot accept --with-arch=$with_arch, available values are: v2 v3 v3m" 1>&2
+			exit 1
+			;;
+		esac
+
+		# process --with-nds32-lib
+		case "${with_nds32_lib}" in
+		"")
+			# the default library is newlib
+			with_nds32_lib=newlib
+			;;
+		newlib)
+			# OK
+			;;
+		mculib)
+			# OK
+			;;
+		*)
+			echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
+			exit 1
+			;;
+		esac
+		;;
+
 	powerpc*-*-* | rs6000-*-*)
 		supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
 
diff --git libgcc/config.host libgcc/config.host
index 9c47e1b..2bd2c1e 100644
--- libgcc/config.host
+++ libgcc/config.host
@@ -137,6 +137,9 @@ mips*-*-*)
 	cpu_type=mips
 	tmake_file=mips/t-mips
 	;;
+nds32*-*)
+	cpu_type=nds32
+	;;
 powerpc*-*-*)
 	cpu_type=rs6000
 	;;
@@ -832,6 +835,29 @@ moxie-*-rtems*)
 	# Don't use default.
 	extra_parts=
 	;;
+nds32*-elf*)
+	# Basic makefile fragment and extra_parts for crt stuff.
+	# We also append c-isr library implementation.
+	tmake_file="${tmake_file} nds32/t-nds32 nds32/t-nds32-isr"
+	extra_parts="crtbegin1.o crtend1.o libnds32_isr.a"
+	# Append library definition makefile fragment according to --with-nds32-lib=X setting.
+	case "${with_nds32_lib}" in
+	"" | newlib)
+		# Append library definition makefile fragment t-nds32-newlib.
+		# Append 'soft-fp' software floating point make rule fragment provided by gcc.
+		tmake_file="${tmake_file} nds32/t-nds32-newlib t-softfp-sfdf t-softfp"
+		;;
+	mculib)
+		# Append library definition makefile fragment t-nds32-mculib.
+		# The software floating point library is included in mculib.
+		tmake_file="${tmake_file} nds32/t-nds32-mculib"
+		;;
+	*)
+		echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
+		exit 1
+		;;
+	esac
+	;;
 pdp11-*-*)
 	tmake_file="pdp11/t-pdp11 t-fdpbit"
 	;;

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

* Re: [PATCH 1/6] Andes nds32: configure settings for nds32 target.
  2013-07-24 15:49   ` Chung-Ju Wu
@ 2013-09-08 16:14     ` Chung-Ju Wu
  0 siblings, 0 replies; 4+ messages in thread
From: Chung-Ju Wu @ 2013-09-08 16:14 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 640 bytes --]

On 7/24/13 11:46 PM, Chung-Ju Wu wrote:
> On 7/10/13 6:56 AM, Joseph S. Myers wrote:
>> On Mon, 8 Jul 2013, Chung-Ju Wu wrote:
>
> Thanks for the review comments.
> A revised patch is provided and here is a summary:
> 
>   1. Handle -march option within the compiler proper.
>      Simplify the handling of --with-arch in config.gcc.
>   2. The c-isr library is supported for all arch configuration.
>   3. Use tm_defines so that we can have only one t-mlibs used.
> 
> 

It has been a while since last v2 patch.
So I create a new v3 patch to resolve conflict with current trunk.

Is it OK to apply on the trunk?


Best regards,
jasonwucj


[-- Attachment #2: 1-nds32-config.v3.patch --]
[-- Type: text/plain, Size: 3720 bytes --]

diff --git contrib/config-list.mk contrib/config-list.mk
index 9a141c2..08acc35 100644
--- contrib/config-list.mk
+++ contrib/config-list.mk
@@ -43,7 +43,9 @@ LIST = aarch64-elf aarch64-linux-gnu \
   mipsisa64-elfoabi mipsisa64r2el-elf mipsisa64sr71k-elf mipsisa64sb1-elf \
   mipsel-elf mips64-elf mips64vr-elf mips64orion-elf mips-rtems \
   mips-wrs-vxworks mipstx39-elf mmix-knuth-mmixware mn10300-elf moxie-elf \
-  moxie-uclinux moxie-rtems pdp11-aout picochip-elfOPT-enable-obsolete \
+  moxie-uclinux moxie-rtems \
+  nds32le-elf nds32be-elf \
+  pdp11-aout picochip-elfOPT-enable-obsolete \
   powerpc-darwin8 \
   powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
   powerpc-eabispe powerpc-eabisimaltivec powerpc-eabisim ppc-elf \
diff --git gcc/config.gcc gcc/config.gcc
index 36d5ae8..6ea8bba 100644
--- gcc/config.gcc
+++ gcc/config.gcc
@@ -418,6 +418,10 @@ mips*-*-*)
 	extra_headers="loongson.h"
 	extra_options="${extra_options} g.opt mips/mips-tables.opt"
 	;;
+nds32*)
+	cpu_type=nds32
+	extra_headers="nds32_intrinsic.h"
+	;;
 picochip-*-*)
         cpu_type=picochip
         ;;
@@ -2030,6 +2034,18 @@ mn10300-*-*)
 	use_collect2=no
 	use_gcc_stdint=wrap
 	;;
+nds32le-*-*)
+	target_cpu_default="0"
+	tm_defines="${tm_defines}"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+	tmake_file="nds32/t-mlibs"
+	;;
+nds32be-*-*)
+	target_cpu_default="0|MASK_BIG_ENDIAN"
+	tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1"
+	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
+	tmake_file="nds32/t-mlibs"
+	;;
 pdp11-*-*)
 	tm_file="${tm_file} newlib-stdint.h"
 	use_gcc_stdint=wrap
@@ -3645,6 +3661,39 @@ case "${target}" in
 		esac
 		;;
 
+	nds32*-*-*)
+		supported_defaults="arch nds32_lib"
+
+		# process --with-arch
+		case "${with_arch}" in
+		"" | v2 | v3 | v3m)
+			# OK
+			;;
+		*)
+			echo "Cannot accept --with-arch=$with_arch, available values are: v2 v3 v3m" 1>&2
+			exit 1
+			;;
+		esac
+
+		# process --with-nds32-lib
+		case "${with_nds32_lib}" in
+		"")
+			# the default library is newlib
+			with_nds32_lib=newlib
+			;;
+		newlib)
+			# OK
+			;;
+		mculib)
+			# OK
+			;;
+		*)
+			echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
+			exit 1
+			;;
+		esac
+		;;
+
 	powerpc*-*-* | rs6000-*-*)
 		supported_defaults="cpu cpu_32 cpu_64 float tune tune_32 tune_64"
 
diff --git libgcc/config.host libgcc/config.host
index 187391e..20f56d2 100644
--- libgcc/config.host
+++ libgcc/config.host
@@ -137,6 +137,9 @@ mips*-*-*)
 	cpu_type=mips
 	tmake_file=mips/t-mips
 	;;
+nds32*-*)
+	cpu_type=nds32
+	;;
 powerpc*-*-*)
 	cpu_type=rs6000
 	;;
@@ -831,6 +834,29 @@ moxie-*-rtems*)
 	# Don't use default.
 	extra_parts=
 	;;
+nds32*-elf*)
+	# Basic makefile fragment and extra_parts for crt stuff.
+	# We also append c-isr library implementation.
+	tmake_file="${tmake_file} nds32/t-nds32 nds32/t-nds32-isr"
+	extra_parts="crtbegin1.o crtend1.o libnds32_isr.a"
+	# Append library definition makefile fragment according to --with-nds32-lib=X setting.
+	case "${with_nds32_lib}" in
+	"" | newlib)
+		# Append library definition makefile fragment t-nds32-newlib.
+		# Append 'soft-fp' software floating point make rule fragment provided by gcc.
+		tmake_file="${tmake_file} nds32/t-nds32-newlib t-softfp-sfdf t-softfp"
+		;;
+	mculib)
+		# Append library definition makefile fragment t-nds32-mculib.
+		# The software floating point library is included in mculib.
+		tmake_file="${tmake_file} nds32/t-nds32-mculib"
+		;;
+	*)
+		echo "Cannot accept --with-nds32-lib=$with_nds32_lib, available values are: newlib mculib" 1>&2
+		exit 1
+		;;
+	esac
+	;;
 pdp11-*-*)
 	tmake_file="pdp11/t-pdp11 t-fdpbit"
 	;;

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

end of thread, other threads:[~2013-09-08 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-08 10:44 [PATCH 1/6] Andes nds32: configure settings for nds32 target Chung-Ju Wu
2013-07-09 23:05 ` Joseph S. Myers
2013-07-24 15:49   ` Chung-Ju Wu
2013-09-08 16:14     ` Chung-Ju Wu

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