aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2013-02-28 09:00:25 +0000
committerGeorg-Johann Lay <gjl@gcc.gnu.org>2013-02-28 09:00:25 +0000
commit4a0e3cfe46c4884da118d0c9f2c94987de39b642 (patch)
tree9347de85a8e37b51437f88b609b684b0083d5469 /gcc
parent6166d4338031eb59d07ada087cd9c5c272f83bf0 (diff)
downloadgcc-4a0e3cfe46c4884da118d0c9f2c94987de39b642.zip
gcc-4a0e3cfe46c4884da118d0c9f2c94987de39b642.tar.gz
gcc-4a0e3cfe46c4884da118d0c9f2c94987de39b642.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/avr/avr.h17
-rw-r--r--gcc/config/avr/driver-avr.c21
3 files changed, 35 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 08fd6b8..ea397c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 7491f34..f223a61 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -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 \
diff --git a/gcc/config/avr/driver-avr.c b/gcc/config/avr/driver-avr.c
index 47a04e5..e859f5f 100644
--- a/gcc/config/avr/driver-avr.c
+++ b/gcc/config/avr/driver-avr.c
@@ -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;