diff options
author | Sergei Trofimovich <slyich@gmail.com> | 2023-07-06 23:28:09 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyich@gmail.com> | 2023-07-08 14:17:51 +0100 |
commit | 41b146ff40ade8fea42addebc2f5bc7a36a154f9 (patch) | |
tree | fdda84108966e3073d402fdad474458d0a642e5a | |
parent | daf025e9156e0e32a02ec81f16e0f18f7b8ea700 (diff) | |
download | nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.tar nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.tar.gz nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.tar.bz2 nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.tar.lz nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.tar.xz nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.tar.zst nixpkgs-41b146ff40ade8fea42addebc2f5bc7a36a154f9.zip |
gcc: restore 'Configured with:' output on 'gcc -v' output
When reporting 'gcc' bugs upstream I'm occasionally asked for the actual configure flags I used to build gcc. Before the change `gcc -v` always reported empty string: $ gcc -v ... Target: x86_64-unknown-linux-gnu Configured with: After the change `gcc -v` contains original options with slightly mangled nix store paths to avoid build-only dependency retention: $ gcc -v ... Target: x86_64-unknown-linux-gnu Configured with: ../source/configure --prefix=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gcc-14.0.0 --with-gmp-include=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gmp-6.2.1-dev/include --with-gmp-lib=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-gmp-6.2.1/lib --with-mpfr-include=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mpfr-4.2.0-dev/include --with-mpfr-lib=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-mpfr-4.2.0/lib --with-mpc=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-libmpc-1.3.1 --with-native-system-header-dir=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-glibc-2.37-8-dev/include --with-build-sysroot=/ --program-prefix= --enable-lto --disable-libstdcxx-pch --without-included-gettext --with-system-zlib --enable-checking=release --enable-static --enable-languages=c,c++ --disable-multilib --enable-plugin --disable-libcc1 --with-isl=/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-isl-0.20 --disable-bootstrap --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=x86_64-unknown-linux-gnu While a bit verbose I think it's useful to see how we build gcc.
-rw-r--r-- | pkgs/development/compilers/gcc/builder.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index 5147df1e4cc..75ff2a1317a 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -185,8 +185,9 @@ preConfigure() { postConfigure() { - # Don't store the configure flags in the resulting executables. - sed -e '/TOPLEVEL_CONFIGURE_ARGUMENTS=/d' -i Makefile + # Avoid store paths when embedding ./configure flags into gcc. + # Mangled arguments are still useful when reporting bugs upstream. + sed -e "/TOPLEVEL_CONFIGURE_ARGUMENTS=/ s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" -i Makefile } |