nixpkgs/pkgs
Rahul Butani b41933a1be
bintools-wrapper: specify SHA1 as the build-id hash style explicitly
NixOS/nixpkgs#146275 has more discussion on this; the abridged version
is that `lld` defaults to using `--build-id=fast` while GNU `ld` defaults
to `--build-id=sha1`. These differ in length and so
`separate-debug-info.sh`, as of this writing, errors on `lld`'s shorter
`--build-id=fast`-generated hashes.

`lld` offers the following `build-id` styles:
  - UUID (random; fast but bad for reproducibility)
  - fast (xxhash; fast but shorter hashes)
  - user provided hexstring
  - SHA1
  - MD5

GNU `ld` supports the latter three options, `mold` supports all of these
plus SHA256.

UUID is out because it's not reproducible, fast isn't supported by GNU
`ld`

Using a nix provided (sourced from the output base hash) hash as the
`build-id` seems tempting but would require a little extra work
(we have to include some characteristic of the binary being hashed
so that binaries within a derivation still have unique hashes; it
seems easy to get this wrong; i.e. a path based approach would make
two otherwise identical binaries that reside at different paths have
different `build-id` hashes)

That leaves SHA1 and MD5 and GNU `ld` already defaults to the former.

This commit adds `$NIX_BUILD_ID_STYLE` as an escape hatch, in case any
packages have strong opinions about which hash to use.

----

Note that if/when NixOS/nixpkgs#146275 goes through, this change can be
reverted if linker speed is a priority.
2023-02-25 12:49:40 -06:00
..
applications Merge staging-next into staging 2023-02-24 18:02:00 +00:00
build-support bintools-wrapper: specify SHA1 as the build-id hash style explicitly 2023-02-25 12:49:40 -06:00
common-updater
data Merge staging-next into staging 2023-02-24 12:01:52 +00:00
desktops Merge staging-next into staging 2023-02-23 18:01:49 +00:00
development Merge pull request #217977 from amjoseph-nixpkgs/pr/gcc/fix-plugin-order-assertion 2023-02-25 08:40:28 +00:00
games Merge pull request #217206 from Artturin/stdenvimprovements1 2023-02-23 12:07:47 +00:00
misc Merge staging-next into staging 2023-02-24 18:02:00 +00:00
os-specific Merge staging-next into staging 2023-02-24 18:02:00 +00:00
pkgs-lib
servers Merge staging-next into staging 2023-02-24 12:01:52 +00:00
shells fishPlugins.plugin-git: init at 0.1 2023-02-24 07:09:36 -08:00
stdenv Merge staging-next into staging 2023-02-23 18:01:49 +00:00
test Merge staging-next into staging 2023-02-23 18:01:49 +00:00
tools Merge staging-next into staging 2023-02-24 18:02:00 +00:00
top-level Merge staging-next into staging 2023-02-24 18:02:00 +00:00