From c2e14a73e664626c74537fc5dffba84069d50418 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 4 Apr 2023 07:35:03 +0100 Subject: xgcc: avoid libc.so mix between gcc and binutils-ld linker plugin Without the change when I attempt to built `nixpkgs` with weekly `gcc-13` (it pulls in `flex` as a build input`) I am getting build failure related to glibc mix caused by glibc loading: ...-binutils-patchelfed-ld-2.40/bin/ld: ...-xgcc-13.0.0/libexec/gcc/x86_64-unknown-linux-gnu/13.0.1/liblto_plugin.so: error loading plugin: ...-bootstrap-tools/lib/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE The change disables LTO plugin entirely to avoid loading of `glibc` mix. --- pkgs/stdenv/linux/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkgs/stdenv') diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index ca6d720fe77c5..ddfbc11b6405c 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -341,6 +341,13 @@ in # name = "xgcc"; + # xgcc uses ld linked against nixpkgs' glibc and gcc built + # against bootstrapTools glibc. We can't allow loading + # $out/libexec/gcc/x86_64-unknown-linux-gnu/13.0.1/liblto_plugin.so + # to mix libc.so: + # ...-binutils-patchelfed-ld-2.40/bin/ld: ...-xgcc-13.0.0/libexec/gcc/x86_64-unknown-linux-gnu/13.0.1/liblto_plugin.so: + # error loading plugin: ...-bootstrap-tools/lib/libpthread.so.0: undefined symbol: __libc_vfork, version GLIBC_PRIVATE + enableLTO = false; })).overrideAttrs (a: { # This signals to cc-wrapper (as overridden above in this file) to add `--sysroot` -- cgit 1.4.1