[7 Regression] gnat bootstrap broken on linux targets with _FORTIFY_SOURCE enabled

Bug #1644888 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc
Unknown
Unknown
gcc-snapshot (Ubuntu)
Invalid
High
Unassigned

Bug Description

seen with trunk r242874 on all linux architectures, and this patch to enable the build with -D_FORTIFY_SOURCE=2. This works on the gcc-6-branch, system glibc is 2.24.

--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1176,6 +1176,10 @@ c_cpp_builtins (cpp_reader *pfile)
   builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
   builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);

+ /* Fortify Source enabled by default for optimization levels > 0 */
+ if (optimize)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", 2);
+
   /* Misc. */
   if (flag_gnu89_inline)
     cpp_define (pfile, "__GNUC_GNU_INLINE__");

Matthias Klose (doko)
Changed in gcc-snapshot (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Matthias Klose (doko)
Changed in gcc-snapshot (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.