This is the mail archive of the gcc-bugs@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]

[Bug c/35851] New: gcc should report an error and not a warning if fstack-protector is not supported


glibc-2.7 test for ssp support and use ssp if no error is reported

configure:6449: gcc -B/tools_alpha/bin/ -g -O2   -fstack-protector
                            -o conftest conftest.c 1>&5
conftest.c:1: warning: -fstack-protector not supported for this target
configure:6452: $? = 0
configure:6461: result: yes

If warning is changed to error, glibc configure now work

I look in gcc-4.2.3 and gcc-4.3 code at gcc/toplev.c
  /* Targets must be able to place spill slots at lower addresses.  If the
     target already uses a soft frame pointer, the transition is trivial.  */
  if (!FRAME_GROWS_DOWNWARD && flag_stack_protect)
    {
      warning (0, "-fstack-protector not supported for this target");
      flag_stack_protect = 0;
    }
  if (!flag_stack_protect)
    warn_stack_protect = 0;

So with only a warning emittted by gcc, configure receive 0 and report that ssp
work.
I try changing the warning to an error on gcc-4.2.3 and now glib-2.7 configure
on alpha rightfully find
checking for -fstack-protector... no
--- gcc-4.2.3/gcc/toplev.c.old  2007-09-01 17:28:30.000000000 +0200
+++ gcc-4.2.3/gcc/toplev.c      2008-04-06 17:08:14.000000000 +0200
@@ -1834,7 +1834,7 @@
      target already uses a soft frame pointer, the transition is trivial.  */
   if (!FRAME_GROWS_DOWNWARD && flag_stack_protect)
     {
-      warning (0, "-fstack-protector not supported for this target");
+      error ("-fstack-protector not supported for this target");
       flag_stack_protect = 0;
     }
   if (!flag_stack_protect)


-- 
           Summary: gcc should report an error and not a warning if fstack-
                    protector is not supported
           Product: gcc
           Version: 4.2.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: g dot esp at free dot fr
  GCC host triplet: alpha-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35851


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