Patchwork [08/25] Specs cleanup: AVR

login
register
mail settings
Submitter Joseph S. Myers
Date Jan. 14, 2011, 12:07 a.m.
Message ID <Pine.LNX.4.64.1101140006540.6059@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/78835/
State New
Headers show

Comments

Joseph S. Myers - Jan. 14, 2011, 12:07 a.m.
Some targets have specs accepting a -posix option to define
_POSIX_SOURCE (the feature test macro for a very old version of POSIX,
but that's another matter), and some have specs accepting -profile to
mean profiling and linking with a profiling version of libc.

Whether these make sense depends on the target OS, not the
architecture, and whether the options are accepted should also depend
on the OS.  In particular, it seems inappropriate for AVR to have
specs to accept these options.  AVR devices are hardly going to be
hosting POSIX-conforming operating systems, and the -profile spec is
only for cc1; there's nothing to make that option affect linking, so
it's just a useless alias of other profiling options.  This patch
removes both the specs in question for AVR.  OK to commit?

2011-01-13  Joseph Myers  <joseph@codesourcery.com>

	* config/avr/avr.h (CPP_SPEC): Don't handle -posix.
	(CC1_SPEC): Don't handle -profile.
Weddington, Eric - Jan. 14, 2011, 3:04 a.m.
> -----Original Message-----
> From: Joseph Myers [mailto:joseph@codesourcery.com]
> Sent: Thursday, January 13, 2011 5:08 PM
> To: gcc-patches@gcc.gnu.org
> Cc: chertykov@gmail.com; aesok@post.ru; Weddington, Eric
> Subject: [08/25] Specs cleanup: AVR


<snip> 
> In particular, it seems inappropriate for AVR to have
> specs to accept these options.  AVR devices are hardly going to be
> hosting POSIX-conforming operating systems, and the -profile spec is
> only for cc1; there's nothing to make that option affect linking, so
> it's just a useless alias of other profiling options.  This patch
> removes both the specs in question for AVR.  OK to commit?
> 
> 2011-01-13  Joseph Myers  <joseph@codesourcery.com>
> 
> 	* config/avr/avr.h (CPP_SPEC): Don't handle -posix.
> 	(CC1_SPEC): Don't handle -profile.
> 
<patch snipped>

Looks good to me. Please commit.

Eric Weddington

Patch

diff -rupN --exclude=.svn gcc-mainline-7/gcc/config/avr/avr.h gcc-mainline/gcc/config/avr/avr.h
--- gcc-mainline-7/gcc/config/avr/avr.h	2010-10-20 15:23:36.000000000 -0700
+++ gcc-mainline/gcc/config/avr/avr.h	2011-01-12 14:14:37.000000000 -0800
@@ -739,9 +739,9 @@  extern const char *avr_device_to_devicel
   { "device_to_startfile", avr_device_to_startfiles }, \
   { "device_to_devicelib", avr_device_to_devicelib },
 
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
+#define CPP_SPEC ""
 
-#define CC1_SPEC "%{profile:-p}"
+#define CC1_SPEC ""
 
 #define CC1PLUS_SPEC "%{!frtti:-fno-rtti} \
     %{!fenforce-eh-specs:-fno-enforce-eh-specs} \