# DP: Document distro specific compiler flags turned on by default

--- a/src/gcc/doc/invoke.texi
+++ b/src/gcc/doc/invoke.texi
@@ -9410,6 +9410,10 @@ to turn on such checking by using @optio
 and is equivalent to @option{-Wbidi-chars=unpaired,ucn}, if no previous
 @option{-Wbidi-chars=any} was specified.
 
+NOTE: In Ubuntu 25.10 and later versions, @option{-Wbidi-chars} is
+enabled by default for C, C++, ObjC, ObjC++, unless
+@option{-Wno-bidi-chars} or @option{-Wbidi-chars=none} is found.
+
 @opindex Wno-bool-compare
 @opindex Wbool-compare
 @item -Wbool-compare
@@ -13468,6 +13472,19 @@ also turns on the following optimization
 Please note the warning under @option{-fgcse} about
 invoking @option{-O2} on programs that use computed gotos.
 
+NOTE: In Ubuntu 8.10 and later versions, @option{-D_FORTIFY_SOURCE=2},
+in Ubuntu 24.04 and later versions, @option{-D_FORTIFY_SOURCE=3}, is
+set by default, and is activated when @option{-O} is set to 2 or higher.
+This enables additional compile-time and run-time checks for several libc
+functions.  To disable, specify either @option{-U_FORTIFY_SOURCE} or
+@option{-D_FORTIFY_SOURCE=0}.
+
+NOTE: In Debian 13 and Ubuntu 24.04 and later versions,
+@option{-D_TIME_BITS=64} together with @option{-D_FILE_OFFSET_BITS=64} is
+set by default on the 32bit architectures @samp{armel}, @samp{armhf},
+@samp{hppa}, @samp{m68k}, @samp{mips}, @samp{mipsel}, @samp{powerpc} and
+@samp{sh4}.
+
 @opindex O3
 @item -O3
 Optimize yet more.  @option{-O3} turns on all optimizations specified
@@ -17767,6 +17784,10 @@ Currently the x86 GNU/Linux target provi
 on Intel Control-flow Enforcement Technology (CET) which works for
 i686 processor or newer.
 
+NOTE: In Ubuntu 19.10 and later versions, @option{-fcf-protection}
+is enabled by default for C, C++, ObjC, ObjC++, if none of
+@option{-fno-cf-protection} nor @option{-fcf-protection=*} are found.
+
 @opindex fharden-compares
 @opindex fno-harden-compares
 @item -fharden-compares
@@ -17926,6 +17947,11 @@ references to local frame addresses.  On
 allocated on the stack are considered, optimized away variables or variables
 allocated in registers don't count.
 
+NOTE: In Ubuntu 14.10 and later versions,
+@option{-fstack-protector-strong} is enabled by default for C,
+C++, ObjC, ObjC++, if none of @option{-fno-stack-protector},
+@option{-nostdlib}, nor @option{-ffreestanding} are found.
+
 @opindex fstack-protector-explicit
 @item -fstack-protector-explicit
 Like @option{-fstack-protector} but only protects those functions which
@@ -17991,6 +18017,10 @@ allocations.  @option{-fstack-clash-prot
 protection for static stack allocations if the target supports
 @option{-fstack-check=specific}.
 
+NOTE: In Ubuntu 19.10 and later versions,
+@option{-fstack-clash-protection} is enabled by default for C,
+C++, ObjC, ObjC++, unless @option{-fno-stack-clash-protection} is found.
+
 @opindex fstack-limit-register
 @opindex fstack-limit-symbol
 @opindex fno-stack-limit
@@ -18789,6 +18819,9 @@ For example, @option{-Wl,-Map,output.map
 linker.  When using the GNU linker, you can also get the same effect with
 @option{-Wl,-Map=output.map}.
 
+NOTE: In Ubuntu 8.10 and later versions, for LDFLAGS, the option
+@option{-Wl,-z,relro} is used.  To disable, use @option{-Wl,-z,norelro}.
+
 @opindex u
 @opindex force-link
 @item -u @var{symbol}
@@ -19761,6 +19794,11 @@ zero initialization of padding bits of o
 the padding in between @code{b.a} and @code{b.b} (if any) and
 tail padding in the structure (if any).
 
+NOTE: In Ubuntu 25.10 and later versions,
+@option{-fzero-init-padding-bits=all} is enabled by default for C,
+C++, ObjC, ObjC++, unless @option{-fzero-init-padding-bits=standard}
+is found.
+
 @end table
 
 @node Developer Options
--- a/src/gcc/doc/params.texi
+++ b/src/gcc/doc/params.texi
@@ -884,6 +884,9 @@ value of a shared integer constant.
 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
 protection when @option{-fstack-protector} is used.
 
+This default before Ubuntu 10.10 was "8". Currently it is "4", to increase
+the number of functions protected by the stack protector.
+
 @paindex min-size-for-stack-sharing
 @item min-size-for-stack-sharing
 The minimum size of variables taking part in stack slot sharing when not
