nixpkgs/pkgs/stdenv/generic
Alyssa Ross 0d44b5b773 pkgsStatic.stdenv: fix custom CMake LINKER_LANGUAGE
If a CMake target has a non-default LINKER_LANGUAGE set, CMake will
manually add the libraries it has detected that language's compiler as
linking implicitly.  When it does this, it'll pass -Bstatic and
-Bdynamic options based on the vibes it gets from each such detected
library.  This in itself isn't a problem, because the compiler
toolchain, or our wrapper, or something, seems to be smart enough to
ignore -Bdynamic for those libraries.  But it does create a problem if
the compiler adds extra libraries to the linker command line after
that final -Bdynamic, because those will be linked dynamically.  Since
our compiler is static by default, CMake should reset to -Bstatic
after it's done manually specifying libraries, but CMake didn't
actually know that our compiler is static by default.  The fix for
that is to tell it, like so.

Until recently, this problem was difficult to notice, because it would
result binaries that worked, but that were dynamically linked.  Since
e08ce498f0 ("cc-wrapper: Account for NIX_LDFLAGS and NIX_CFLAGS_LINK
in linkType"), though, -Wl,-dynamic-linker is no longer mistakenly
passed for executables that are supposed to be static, so they end up
created with a /lib interpreter path, and so don't run at all on
NixOS.

This fixes pkgsStatic.graphite2.
2023-11-30 10:46:44 +00:00
..
builder.sh Revert "Merge remote-tracking branch 'origin/python-unstable' into staging-next" 2021-09-05 15:02:25 +02:00
check-meta.nix check-meta: don't use rec 2023-11-14 16:00:42 +02:00
common-path.nix stdenv/common-path.nix: move to stdenv/generic/ 2022-07-29 18:24:00 -04:00
default-builder.sh treewide: refactor .attrs.sh detection 2023-10-04 18:36:57 +02:00
default.nix Revert "stdenv: use improved strip.sh for aarch64-linux" 2023-07-31 11:20:15 +02:00
make-derivation.nix pkgsStatic.stdenv: fix custom CMake LINKER_LANGUAGE 2023-11-30 10:46:44 +00:00
setup.sh Merge pull request #230874 from Ninlives/runPhase 2023-11-07 20:00:47 +02:00