This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/6] Andes nds32: configure settings for nds32 target.


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: 1-nds32-config.v2.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]