Commit ed137300 by Georg-Johann Lay Committed by Georg-Johann Lay

re PR target/65296 ([avr] fix various issues with specs file generation)

	PR target/65296
	* config/avr/driver-avr.c (avr_devicespecs_file): Allow to specify
	the same -mmcu=MCU more than once.

From-SVN: r221602
parent 1c5ad287
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> 2015-03-23 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/65522 PR bootstrap/65522
......
...@@ -55,9 +55,10 @@ avr_diagnose_devicespecs_error (const char *mcu, const char *filename) ...@@ -55,9 +55,10 @@ avr_diagnose_devicespecs_error (const char *mcu, const char *filename)
/* Implement spec function `device-specs-file´. /* Implement spec function `device-specs-file´.
Compose -specs=<specs-file-name>. If everything went well then argv[0] Compose -specs=<specs-file-name>%s. If everything went well then argv[0]
is the inflated specs directory and argv[1] is a device or core name as is the inflated (absolute) specs directory and argv[1] is a device or
supplied to -mmcu=*. */ core name as supplied by -mmcu=*. When building GCC the path might
be relative. */
const char* const char*
avr_devicespecs_file (int argc, const char **argv) avr_devicespecs_file (int argc, const char **argv)
...@@ -82,13 +83,19 @@ avr_devicespecs_file (int argc, const char **argv) ...@@ -82,13 +83,19 @@ avr_devicespecs_file (int argc, const char **argv)
mmcu = AVR_MMCU_DEFAULT; mmcu = AVR_MMCU_DEFAULT;
break; break;
case 2: default:
mmcu = argv[1]; mmcu = argv[1];
break;
default: // Allow specifying the same MCU more than once.
error ("specified option %qs more than once", "-mmcu=");
return X_NODEVLIB; 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); specfile_name = concat (argv[0], dir_separator_str, "specs-", mmcu, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment