https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84153
Bug ID: 84153 Summary: Bootstrap failure when using dependency libraries in non-system location Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap Assignee: unassigned at gcc dot gnu.org Reporter: bneumeier at gmail dot com Target Milestone: --- I am trying to build a native GCC to install under my home directory, in $HOME/gcc73. I first build, out of tree, GMP 6.1.2, MPFR 4.0.0, MPC 1.1.0, and ISL 0.18, all installed to that directory. I then configure the GCC build with: --with-gmp=$HOME/gcc73 --with-mpfr=$HOME/gcc73 --with-mpc=$HOME/gcc73 --with-isl=$HOME/gcc73 The build aborts with: /tmp/build-mipsel/build-gcc/./gcc/xgcc -B/tmp/build-mipsel/build-gcc/./gcc/ -nostdinc -x c /dev/null -S -o /dev/null -fself-test=/tmp/build-mipsel/gcc-7.3.0/gcc/testsuite/selftests /tmp/build-mipsel/build-gcc/./gcc/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory Inspecting the situation, I find that the programs lto1, cc1, and cc1plus are using the system libraries for ISL, GMP, and MPC, and are of course unable to use the system MPFR because it's version 3.1.6 rather than 4.0.0. The builds for MPC, MPFR, and ISL all link their shared library files with an RPATH so that the correct version of all libraries (specified with similar --with-gmp, etc., configuration directives) is found at runtime. I believe the internal GCC programs cc1, lto1, cc1plus (and anything else linked against these dependency libraries) should also be built with an RPATH or RUNPATH when locations for those libraries are specified with configure directives (e.g., with --with-gmp, --with-gmp-lib, etc). I tried reconfiguring with LDFLAGS set to -Wl,-rpath,$HOME/gcc73/lib but this does not affect the way the internal programs are built. Please let me know if you need additional information, log files, etc.