diff options
author | gjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-23 18:19:01 +0000 |
---|---|---|
committer | gjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-03-23 18:19:01 +0000 |
commit | 9b55c016f93385476967fc1cea86eaddd78551a4 (patch) | |
tree | e2c03422a8e473f3589b737d426c8c6efa05c5f2 | |
parent | ff9aa3f957fff3c1d074fd50010bd848e261d057 (diff) | |
download | gcc-9b55c016f93385476967fc1cea86eaddd78551a4.tar.gz |
PR target/65296
* config/avr/driver-avr.c (avr_devicespecs_file): Allow to specify
the same -mmcu=MCU more than once.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221602 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/avr/driver-avr.c | 23 |
2 files changed, 21 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ae062f89810..ad9ca05bd29 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-23 Georg-Johann Lay <avr@gjlay.de> + + PR target/65296 + * config/avr/driver-avr.c (avr_devicespecs_file): Allow to specify + the same -mmcu=MCU more than once. + 2015-03-23 Jakub Jelinek <jakub@redhat.com> PR bootstrap/65522 diff --git a/gcc/config/avr/driver-avr.c b/gcc/config/avr/driver-avr.c index dbc5043d996..4890a39b489 100644 --- a/gcc/config/avr/driver-avr.c +++ b/gcc/config/avr/driver-avr.c @@ -55,9 +55,10 @@ avr_diagnose_devicespecs_error (const char *mcu, const char *filename) /* Implement spec function `device-specs-fileĀ“. - Compose -specs=<specs-file-name>. If everything went well then argv[0] - is the inflated specs directory and argv[1] is a device or core name as - supplied to -mmcu=*. */ + Compose -specs=<specs-file-name>%s. If everything went well then argv[0] + is the inflated (absolute) specs directory and argv[1] is a device or + core name as supplied by -mmcu=*. When building GCC the path might + be relative. */ const char* avr_devicespecs_file (int argc, const char **argv) @@ -82,13 +83,19 @@ avr_devicespecs_file (int argc, const char **argv) mmcu = AVR_MMCU_DEFAULT; break; - case 2: + default: mmcu = argv[1]; - break; - default: - error ("specified option %qs more than once", "-mmcu="); - return X_NODEVLIB; + // Allow specifying the same MCU more than once. + + for (int i = 2; i < argc; i++) + if (0 != strcmp (mmcu, argv[i])) + { + error ("specified option %qs more than once", "-mmcu"); + return X_NODEVLIB; + } + + break; } specfile_name = concat (argv[0], dir_separator_str, "specs-", mmcu, NULL); |