avr.h (device_to_arch): Rename to device_to_ld.

* config/avr/avr.h (device_to_arch): Rename to device_to_ld.
	(avr_device_to_arch): Rename to avr_device_to_ld.
	(avr_device_to_as): New prototype.
	(EXTRA_SPEC_FUNCTIONS): Add device_to_as.
	(ASM_SPEC): Use device_to_as to get -mmcu= and -mno-skip-bug=.
	* config/avr/driver-avr.c (avr_device_to_as): New.
	(avr_device_to_arch): Rename to avr_device_to_ld.

From-SVN: r196330
This commit is contained in:
Georg-Johann Lay 2013-02-28 09:00:25 +00:00 committed by Georg-Johann Lay
parent 6166d43380
commit 4a0e3cfe46
3 changed files with 35 additions and 13 deletions

View File

@ -1,3 +1,13 @@
2013-02-28 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.h (device_to_arch): Rename to device_to_ld.
(avr_device_to_arch): Rename to avr_device_to_ld.
(avr_device_to_as): New prototype.
(EXTRA_SPEC_FUNCTIONS): Add device_to_as.
(ASM_SPEC): Use device_to_as to get -mmcu= and -mno-skip-bug=.
* config/avr/driver-avr.c (avr_device_to_as): New.
(avr_device_to_arch): Rename to avr_device_to_ld.
2013-02-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56461

View File

@ -486,14 +486,16 @@ typedef struct avr_args
#define ADJUST_INSN_LENGTH(INSN, LENGTH) \
(LENGTH = avr_adjust_insn_length (INSN, LENGTH))
extern const char *avr_device_to_arch (int argc, const char **argv);
extern const char *avr_device_to_as (int argc, const char **argv);
extern const char *avr_device_to_ld (int argc, const char **argv);
extern const char *avr_device_to_data_start (int argc, const char **argv);
extern const char *avr_device_to_startfiles (int argc, const char **argv);
extern const char *avr_device_to_devicelib (int argc, const char **argv);
extern const char *avr_device_to_sp8 (int argc, const char **argv);
#define EXTRA_SPEC_FUNCTIONS \
{ "device_to_arch", avr_device_to_arch }, \
{ "device_to_as", avr_device_to_as }, \
{ "device_to_ld", avr_device_to_ld }, \
{ "device_to_data_start", avr_device_to_data_start }, \
{ "device_to_startfile", avr_device_to_startfiles }, \
{ "device_to_devicelib", avr_device_to_devicelib }, \
@ -507,14 +509,9 @@ extern const char *avr_device_to_sp8 (int argc, const char **argv);
#define CC1PLUS_SPEC "%{!frtti:-fno-rtti} \
%{!fenforce-eh-specs:-fno-enforce-eh-specs} \
%{!fexceptions:-fno-exceptions}"
/* A C string constant that tells the GCC driver program options to
pass to `cc1plus'. */
#define ASM_SPEC "%{mmcu=avr25:-mmcu=avr2;mmcu=avr35:-mmcu=avr3;mmcu=avr31:-mmcu=avr3;mmcu=avr51:-mmcu=avr5;\
mmcu=*:-mmcu=%*} \
%{mmcu=*:%{!mmcu=avr2:%{!mmcu=at90s8515:%{!mmcu=avr31:%{!mmcu=atmega103:\
-mno-skip-bug}}}}}"
#define ASM_SPEC "%:device_to_as(%{mmcu=*:%*}) "
#define LINK_SPEC "\
%{mrelax:--relax\
%{mpmem-wrap-around:%{mmcu=at90usb8*:--pmem-wrap-around=8k}\
@ -524,7 +521,7 @@ mmcu=*:-mmcu=%*} \
%{mmcu=atmega64*|\
mmcu=at90can64*|\
mmcu=at90usb64*:--pmem-wrap-around=64k}}}\
%:device_to_arch(%{mmcu=*:%*})\
%:device_to_ld(%{mmcu=*:%*})\
%:device_to_data_start(%{mmcu=*:%*})"
#define LIB_SPEC \

View File

@ -48,10 +48,25 @@ avr_set_current_device (const char *name)
avr_current_arch = &avr_arch_types[avr_current_device->arch];
}
/* Returns command line parameters that describe the device architecture. */
/* Returns command line parameters to pass to as. */
const char *
avr_device_to_arch (int argc, const char **argv)
const char*
avr_device_to_as (int argc, const char **argv)
{
if (0 == argc)
return NULL;
avr_set_current_device (argv[0]);
return concat ("-mmcu=", avr_current_arch->arch_name,
avr_current_device->errata_skip ? "" : " -mno-skip-bug",
NULL);
}
/* Returns command line parameters to pass to ld. */
const char*
avr_device_to_ld (int argc, const char **argv)
{
if (0 == argc)
return NULL;