This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Tiny fix of LINK_COMMAND_SPEC


James E Wilson <wilson@specifix.com> wrote:
> I ran into this problem myself while trying to write docs for the 
> -fstack-protector option.
> 
> The relevant clue is in gcc.c handle_brace_body, the first comment, 
> which says
>    /* Locate the closing } or ;, honoring nested braces.
>       Trim trailing whitespace.  */
> So white space before a trailing } is always ignored.  The code 
> implementing this is a few lines down where end_body is decremented.
> 
> So I think we need to changes to properly fix this:
> 1) The useless space at the end of LINK_SPP_SPEC should be deleted.
> 2) The missing space in LINK_COMMAND_SPEC should be added.
> 
> You have the second one, but not the first.  This is patch is OK if you 
> add the missing part.

Thanks for the reviewing and the explanation.  I've commited the attached
patch.

Regards,
	kaz
--
2005-08-12  Kaz Kojima  <kkojima@gcc.gnu.org>

	* gcc.c (LINK_SSP_SPEC): Remove space before a trailing }.
	(LINK_COMMAND_SPEC): Add space after %(link_ssp).

diff -uprN ORIG/gcc/gcc/gcc.c LOCAL/gcc/gcc/gcc.c
--- ORIG/gcc/gcc/gcc.c	2005-08-08 19:36:20.000000000 +0900
+++ LOCAL/gcc/gcc/gcc.c	2005-08-12 10:39:31.000000000 +0900
@@ -674,7 +674,7 @@ proper position among the other output f
 #ifdef TARGET_LIBC_PROVIDES_SSP
 #define LINK_SSP_SPEC "%{fstack-protector:}"
 #else
-#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp }"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
 #endif
 #endif
 
@@ -699,7 +699,7 @@ proper position among the other output f
     %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
     %{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
     %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
-    %{!nostdlib:%{!nodefaultlibs:%(link_ssp)%(link_gcc_c_sequence)}}\
+    %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
     %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
 #endif
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]