diff options
author | johannst <johannst@users.noreply.github.com> | 2025-03-14 01:19:37 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2025-03-14 01:19:37 +0000 |
commit | b6627f53bf459334446bb1e2c51728a764c8651d (patch) | |
tree | 91d1326986ddb28a4bf29071c6db1bd379814402 /development | |
parent | 2413e9cbad620ca20b3aaffeb9cf4bb132e6113f (diff) | |
download | notes-b6627f53bf459334446bb1e2c51728a764c8651d.tar.gz notes-b6627f53bf459334446bb1e2c51728a764c8651d.zip |
deploy: cb9e06f3a5bd9d42494e6abdaf61fb3fe19d4ea4
Diffstat (limited to 'development')
-rw-r--r-- | development/c++.html | 6 | ||||
-rw-r--r-- | development/c++filt.html | 6 | ||||
-rw-r--r-- | development/cmake.html | 6 | ||||
-rw-r--r-- | development/gcc.html | 33 | ||||
-rw-r--r-- | development/gcov.html | 6 | ||||
-rw-r--r-- | development/git.html | 6 | ||||
-rw-r--r-- | development/glibc.html | 6 | ||||
-rw-r--r-- | development/index.html | 6 | ||||
-rw-r--r-- | development/ld.so.html | 6 | ||||
-rw-r--r-- | development/make.html | 6 | ||||
-rw-r--r-- | development/pgo.html | 6 | ||||
-rw-r--r-- | development/python.html | 6 | ||||
-rw-r--r-- | development/symbolver.html | 6 |
13 files changed, 62 insertions, 43 deletions
diff --git a/development/c++.html b/development/c++.html index efa3275..97758c8 100644 --- a/development/c++.html +++ b/development/c++.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/c++filt.html b/development/c++filt.html index f412c28..4a69661 100644 --- a/development/c++filt.html +++ b/development/c++filt.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/cmake.html b/development/cmake.html index 9dde93f..b301649 100644 --- a/development/cmake.html +++ b/development/cmake.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/gcc.html b/development/gcc.html index 2de7655..5b0fcc0 100644 --- a/development/gcc.html +++ b/development/gcc.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> @@ -157,6 +157,16 @@ <main> <h1 id="gcc1"><a class="header" href="#gcc1">gcc(1)</a></h1> <h2 id="cli"><a class="header" href="#cli">CLI</a></h2> +<ul> +<li><code>-v</code> verbose, outputs exact compiler/linker invocations made by the gcc driver</li> +<li><code>-###</code> dry-run, outputting exact compiler/linker invocations</li> +<li><code>-print-multi-lib</code> print available multilib configurations</li> +<li><code>--help=<class></code> print description of cmdline options for given class, eg +<code>warnings</code>, <code>optimizers</code>, <code>target</code>, <code>c</code>, <code>c++</code></li> +<li><code>-Wl,<opt></code> additional option passed to the linker invocation (can +be specified multiple times)</li> +<li><code>-Wl,--trace</code> trace each file the linker touches</li> +</ul> <h3 id="preprocessing"><a class="header" href="#preprocessing">Preprocessing</a></h3> <p>While debugging can be helpful to just pre-process files.</p> <pre><code class="language-bash">gcc -E [-dM] ... @@ -164,10 +174,6 @@ <ul> <li><code>-E</code> run only preprocessor</li> <li><code>-dM</code> list only <code>#define</code> statements</li> -<li><code>-###</code> dry-run, outputting exact compiler/linker invocations</li> -<li><code>-print-multi-lib</code> print available multilib configurations</li> -<li><code>--help=<class></code> print description of cmdline options for given class, eg -<code>warnings</code>, <code>optimizers</code>, <code>target</code>, <code>c</code>, <code>c++</code></li> </ul> <h3 id="target-options"><a class="header" href="#target-options">Target options</a></h3> <pre><code class="language-bash"># List all target options with their description. @@ -185,6 +191,19 @@ gcc --help=optimizers # Prepend --help with `-Q` to print wheter options are enabled or disabled # instead showing their description. </code></pre> +<h3 id="sanitizer"><a class="header" href="#sanitizer">Sanitizer</a></h3> +<pre><code class="language-bash"># Enable address sanitizer, a memory error checker (out of bounds, use after free, ..). +gcc -fsanitize=address ... + +# Enable leak sanitizer, a memory leak detector. +gcc -fsanitize=leak + +# Enable undefined behavior sanitizer, detects various UBs (integer overflow, ..). +gcc -fsanitize=undefined ... + +# Enable thread sanitizer, a data race detector. +gcc -fsanitize=thread +</code></pre> <h2 id="builtins"><a class="header" href="#builtins"><a href="https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html">Builtins</a></a></h2> <h3 id="__builtin_expectexpr-cond"><a class="header" href="#__builtin_expectexpr-cond"><code>__builtin_expect(expr, cond)</code></a></h3> <p>Give the compiler a hint which branch is hot, so it can lay out the code diff --git a/development/gcov.html b/development/gcov.html index ed839c5..2bb0b94 100644 --- a/development/gcov.html +++ b/development/gcov.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/git.html b/development/git.html index 4dbf81b..c25adc2 100644 --- a/development/git.html +++ b/development/git.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/glibc.html b/development/glibc.html index 3ab9f50..d10049c 100644 --- a/development/glibc.html +++ b/development/glibc.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/index.html b/development/index.html index 21abf36..b93cc47 100644 --- a/development/index.html +++ b/development/index.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/ld.so.html b/development/ld.so.html index e330072..24bcef5 100644 --- a/development/ld.so.html +++ b/development/ld.so.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/make.html b/development/make.html index 4cc6650..5e9470a 100644 --- a/development/make.html +++ b/development/make.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/pgo.html b/development/pgo.html index 7f8d9c8..cb041d6 100644 --- a/development/pgo.html +++ b/development/pgo.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/python.html b/development/python.html index f536432..1652215 100644 --- a/development/python.html +++ b/development/python.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> diff --git a/development/symbolver.html b/development/symbolver.html index 1436741..0615e83 100644 --- a/development/symbolver.html +++ b/development/symbolver.html @@ -24,9 +24,9 @@ <link rel="stylesheet" href="../fonts/fonts.css"> <!-- Highlight.js Stylesheets --> - <link rel="stylesheet" href="../highlight.css"> - <link rel="stylesheet" href="../tomorrow-night.css"> - <link rel="stylesheet" href="../ayu-highlight.css"> + <link rel="stylesheet" id="highlight-css" href="../highlight.css"> + <link rel="stylesheet" id="tomorrow-night-css" href="../tomorrow-night.css"> + <link rel="stylesheet" id="ayu-highlight-css" href="../ayu-highlight.css"> <!-- Custom theme stylesheets --> |