diff mbox series

[avr] New option -nodevicespecs to omit -specs=... in self specs.

Message ID ecb04582-5e44-c50f-a5b4-e7c1e1ff0b37@gjlay.de
State New
Headers show
Series [avr] New option -nodevicespecs to omit -specs=... in self specs. | expand

Commit Message

Georg-Johann Lay Dec. 18, 2019, 3:36 p.m. UTC
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.

Comments

Georg-Johann Lay Dec. 28, 2019, 11:51 a.m. UTC | #1
Ping #1

> 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.
>
Georg-Johann Lay Jan. 6, 2020, 1 p.m. UTC | #2
Ping #2

> 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.
>
Jeff Law Jan. 6, 2020, 5:24 p.m. UTC | #3
On Wed, 2019-12-18 at 16:36 +0100, Georg-Johann Lay wrote:
> 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.
OK
jeff
diff mbox series

Patch

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