nixpkgs/pkgs/stdenv/linux
Adam Joseph d7fe0a5548 make-bootstrap-tools.nix: use a patchelf built with -static-{libgcc,libstdc++}
Our bootstrap-files unpacker has always relied on a lot of unstated
assumptions, one of them being that every library has a DT_NEEDED
for librt.so, so patchelf'ing something into the RUNPATH into
librt.so means that it will be searched for every library load in
all of the bootstrap-files.

Unfortunately that assumption is not true for libgcc.

This causes problems, because patchelf links against libgcc (and
against libstdc++, which links against libgcc).  So we can't use
patchelf on libgcc, because it needs libgcc, so patchelf doesn't
work until libgcc is patchelfed.

The robust solution here is to use static linking for the copy of
patchelf that is shipped with the bootstrap-files.  We don't have to
go all the way to a statically linked libc; just -static-libgcc and
-static-libstdc++ are enough to break the circular dependency.
2023-04-02 13:49:53 -07:00
..
bootstrap-files Merge remote-tracking branch 'origin/master' into staging-next 2023-03-10 13:09:25 +01:00
bootstrap-tools gcc: mark hardeningUnsupportedFlags fortify3 for all but gcc 12 2023-01-24 21:52:12 +00:00
bootstrap-tools-musl gcc: mark hardeningUnsupportedFlags fortify3 for all but gcc 12 2023-01-24 21:52:12 +00:00
default.nix stdenv: Nix-driven bootstrap of gcc 2023-04-02 13:49:41 -07:00
make-bootstrap-tools-cross.nix make-bootstrap-tools-cross: enable Hydra builds of mips32el bootstrap-files 2022-06-29 14:48:13 -07:00
make-bootstrap-tools.nix make-bootstrap-tools.nix: use a patchelf built with -static-{libgcc,libstdc++} 2023-04-02 13:49:53 -07:00