public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [ubsan] Add -static-libubsan
@ 2013-07-30 14:29 Marek Polacek
  0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2013-07-30 14:29 UTC (permalink / raw)
  To: GCC Patches

This adds missing -static-libubsan option.  It's already handled in
the gcc.c via various macros.

Tested x86_64-pc-linux-gnu, applying to ubsan branch.

diff --git a/gcc/ChangeLog.ubsan b/gcc/ChangeLog.ubsan
index 3d15c19..47f81b4 100644
--- a/gcc/ChangeLog.ubsan
+++ b/gcc/ChangeLog.ubsan
@@ -1,3 +1,8 @@
+2013-07-29  Marek Polacek  <polacek@redhat.com>
+
+	* common.opt (static-libubsan): New option.
+	* doc/invoke.texi: Document -static-libubsan.
+
 2013-07-24  Marek Polacek  <polacek@redhat.com>
 
 	* ubsan.c (struct ubsan_typedesc): Improve comment.
diff --git a/gcc/common.opt b/gcc/common.opt
index 123d593..fe6bc9c 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -2580,6 +2580,9 @@ Driver
 static-libtsan
 Driver
 
+static-libubsan
+Driver
+
 symbolic
 Driver
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 3596c6c..5dd9a62 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -452,7 +452,7 @@ Objective-C and Objective-C++ Dialects}.
 @gccoptlist{@var{object-file-name}  -l@var{library} @gol
 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
 -s  -static -static-libgcc -static-libstdc++ @gol
--static-libasan -static-libtsan @gol
+-static-libasan -static-libtsan -static-libubsan @gol
 -shared -shared-libgcc  -symbolic @gol
 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
 -u @var{symbol}}
@@ -10102,6 +10102,15 @@ option is not used, then this links against the shared version of
 driver to link @file{libtsan} statically, without necessarily linking
 other libraries statically.
 
+@item -static-libubsan
+When the @option{-fsanitize=undefined} option is used to link a program,
+the GCC driver automatically links against @option{libubsan}.  If
+@file{libubsan} is available as a shared library, and the @option{-static}
+option is not used, then this links against the shared version of
+@file{libubsan}.  The @option{-static-libubsan} option directs the GCC
+driver to link @file{libubsan} statically, without necessarily linking
+other libraries statically.
+
 @item -static-libstdc++
 When the @command{g++} program is used to link a C++ program, it
 normally automatically links against @option{libstdc++}.  If

	Marek

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-07-30 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-30 14:29 [ubsan] Add -static-libubsan Marek Polacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).