Hi, currently device support in avr-gcc is accomplished by injecting a
specs file my means of -specs=... in dirver self specs.
This patch adds a new avr driver option to omit the addition of
respective -specs option so give the user more freedom.
Ok to apply?
Johann
* config/avr/avr.opt (-nodevicespecs): New driver option.
* config/avr/driver-avr.c (avr_devicespecs_file): Only issue
"-specs=device-specs/..." if that option is not set.
* doc/invoke.texi (AVR Options) <-nodevicespecs>: Document.
Index: config/avr/avr.opt
===================================================================
--- config/avr/avr.opt (revision 279522)
+++ config/avr/avr.opt (working copy)
@@ -118,3 +118,7 @@ Assume that all data in static storage c
nodevicelib
Driver Target Report RejectNegative
Do not link against the device-specific library lib<MCU>.a.
+
+nodevicespecs
+Driver Target Report RejectNegative
+Do not use the device-specific specs file device-specs/specs-<MCU>.
Index: config/avr/driver-avr.c
===================================================================
--- config/avr/driver-avr.c (revision 279522)
+++ config/avr/driver-avr.c (working copy)
@@ -26,8 +26,8 @@ along with GCC; see the file COPYING3.
#include "diagnostic.h"
#include "tm.h"
-// Remove -nodevicelib from the command line if not needed
-#define X_NODEVLIB "%<nodevicelib"
+// Remove -nodevicelib and -nodevicespecs from the command line if not needed.
+#define X_NODEVLIB "%<nodevicelib %<nodevicespecs"
static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
@@ -102,8 +102,8 @@ avr_devicespecs_file (int argc, const ch
return X_NODEVLIB;
}
- return concat ("-specs=device-specs", dir_separator_str, "specs-",
- mmcu, "%s"
+ return concat ("%{!nodevicespecs:-specs=device-specs", dir_separator_str,
+ "specs-", mmcu, "%s} %<nodevicespecs"
#if defined (WITH_AVRLIBC)
" %{mmcu=avr*:" X_NODEVLIB "} %{!mmcu=*:" X_NODEVLIB "}",
#else