summary refs log tree commit diff
path: root/doc
diff options
context:
space:
mode:
authorDaniel Barter <danielbarter@gmail.com>2022-10-26 08:54:52 -0700
committerDaniel Barter <danielbarter@gmail.com>2022-10-26 09:33:43 -0700
commit77bd639c4c92c819c1f4444a112d2bcc72c5b92f (patch)
tree74cd075a2a02f35e5f6d5a1edc6ceb77c50e5eb0 /doc
parentabfd2fe8a834a295725621a4e749be3af80a8827 (diff)
downloadnixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.tar
nixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.tar.gz
nixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.tar.bz2
nixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.tar.lz
nixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.tar.xz
nixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.tar.zst
nixpkgs-77bd639c4c92c819c1f4444a112d2bcc72c5b92f.zip
cc-wrapper: adding a cc-wrapper-hook to the cc-wrapper
Diffstat (limited to 'doc')
-rw-r--r--doc/stdenv/stdenv.chapter.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/stdenv/stdenv.chapter.md b/doc/stdenv/stdenv.chapter.md
index 166587d3284..4fad249097c 100644
--- a/doc/stdenv/stdenv.chapter.md
+++ b/doc/stdenv/stdenv.chapter.md
@@ -1140,6 +1140,13 @@ Here are some more packages that provide a setup hook. Since the list of hooks i
 Many other packages provide hooks, that are not part of `stdenv`. You can find
 these in the [Hooks Reference](#chap-hooks).
 
+### Compiler and Linker wrapper hooks {#compiler-linker-wrapper-hooks}
+
+If the file `${cc}/nix-support/cc-wrapper-hook` exists, it will be run at the end of the [compiler wrapper](#cc-wrapper).
+If the file `${binutils}/nix-support/post-link-hook` exists, it will be run at the end of the linker wrapper.
+These hooks allow a user to inject code into the wrappers.
+As an example, these hooks can be used to extract `extraBefore`, `params` and `extraAfter` which store all the command line arguments passed to the compiler and linker respectively.
+
 ## Purity in Nixpkgs {#sec-purity-in-nixpkgs}
 
 *Measures taken to prevent dependencies on packages outside the store, and what you can do to prevent them.*