summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernardo Meurer <bernardo@meurer.org>2023-09-30 19:19:30 -0400
committerBernardo Meurer <bernardo@meurer.org>2023-09-30 19:19:30 -0400
commitd0a2f13774bc60532c4b9066c6a8151ddc2baf6c (patch)
tree3703034c65f5070d169c8c55ed873474bfe5c006
parentMerge pull request #258113 from viraptor/justbuild-darwin-partial (diff)
downloadnixpkgs-origin/dont-strip-lto-plugin.tar.gz
libgcc: don't strip liblto_plugin.{so,la}origin/dont-strip-lto-plugin
-rw-r--r--pkgs/development/compilers/gcc/common/libgcc.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/development/compilers/gcc/common/libgcc.nix b/pkgs/development/compilers/gcc/common/libgcc.nix
index f3bf14e36f7e..5e9edddf893d 100644
--- a/pkgs/development/compilers/gcc/common/libgcc.nix
+++ b/pkgs/development/compilers/gcc/common/libgcc.nix
@@ -74,6 +74,12 @@ in
(pkg: pkg.overrideAttrs (previousAttrs: lib.optionalAttrs ((!langC) || langJit || enableLibGccOutput) {
outputs = previousAttrs.outputs ++ lib.optionals enableLibGccOutput [ "libgcc" ];
+
+ # Otherwise the plugins don't load, since strip removes marker symbols and you
+ # get errors like:
+ # cc1: fatal error: plugin /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/liblto_plugin.so is not licensed under a GPL-compatible license /nix/store/h5kvfrjmpw792v8jg7nrzfkffmn0iyy8-gcc-12.3.0/libexec/gcc/x86_64-unknown-linux-gnu/12.3.0/liblto_plugin.so: undefined symbol: plugin_is_GPL_compatible
+ stripExclude = [ "libexec/gcc/*/*/liblto_plugin.*" ];
+
# This is a separate phase because gcc assembles its phase scripts
# in bash instead of nix (we should fix that).
preFixupPhases = (previousAttrs.preFixupPhases or []) ++ lib.optionals ((!langC) || enableLibGccOutput) [ "preFixupLibGccPhase" ];