]> Savannah Git Hosting - gnulib.git/commitdiff
doc: Add more details regarding the undefined behaviour sanitizer.
authorBruno Haible <bruno@clisp.org>
Sun, 6 Dec 2020 16:59:45 +0000 (17:59 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 6 Dec 2020 16:59:45 +0000 (17:59 +0100)
* doc/gnulib-readme.texi (High Quality): Describe
-fsanitize-undefined-trap-on-error better.

ChangeLog
doc/gnulib-readme.texi

index 5cb643ed75391e98778d85f904da8036d4ade4f0..08cef4d15174a919f091421e17cdaf2dfdd72bff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-12-06  Bruno Haible  <bruno@clisp.org>
+
+       doc: Add more details regarding the undefined behaviour sanitizer.
+       * doc/gnulib-readme.texi (High Quality): Describe
+       -fsanitize-undefined-trap-on-error better.
+
 2020-12-06  Bruno Haible  <bruno@clisp.org>
 
        Do the Windows oldnames workaround through the C++ GNULIB_NAMESPACE.
index a2a59628b17801ed0c478c89734f367b567441c9..cde6d7aaba32e726813b2d3d14d75b326f16cab9 100644 (file)
@@ -546,8 +546,21 @@ for your compiler.  For example:
 @end example
 
 @noindent
-Here, @code{-D_FORTIFY_SOURCE=2} enables extra security hardening
-checks in the GNU C library, @code{-fsanitize=undefined} enables GCC's
-undefined behavior sanitizer (@code{ubsan}), and
-@code{-fsanitize-undefined-trap-on-error} prevents @code{ubsan}'s
-linking to unnecessary libraries like @code{libstdc++}.
+Here:
+
+@itemize @bullet
+@item
+@code{-D_FORTIFY_SOURCE=2} enables extra security hardening checks in
+the GNU C library.
+@item
+@code{-fsanitize=undefined} enables GCC's undefined behavior sanitizer
+(@code{ubsan}), and
+@item
+@code{-fsanitize-undefined-trap-on-error} causes @code{ubsan} to
+abort the program (through an ``illegal instruction'' signal).  This
+measure stops exploit attempts and also allows you to debug the issue.
+Without this option, @code{-fsanitize=undefined} causes messages to be
+printed, execution continues after an undefined behavior situation, and
+GCC links the program against @code{libstdc++} (which you can avoid
+through the option @code{-static-libubsan}).
+@end itemize