I've tried my hardest to build gcc without resorting to the use of LD_LIBRARY_PATH. I simply can't understand why if LD_FLAGS is set to the path of the mpfr library, the compiler can't use them.
My compile bombs out with the well known error: error: cannot compute suffix of object files: cannot compile after trying to build it for a couple of hours. A read of $BUILD_DIRECOTRYsparc-sun-solaris2.10/libgcc/config.log shows the real reason is that the compiler can't find the mpfr library. ld.so.1: cc1: fatal: libmpfr.so.1: open failed: No such file or directory But I've specified in three ways where to look for this library. 1) Use of -L 2) Use of -R 3) Use of the configure flag --with-mpfr= I've seen others report the same failure (cannot compute suffix of object files) - see for example http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35693 but it gets closed as 'invalid'. Given gcc finds the library during the initial configure stage, spends two hours compiling (making two copies of xgcc), then to bomb out since it can't find the library seems crazy. So I decided to set LD_LIBRARY_PATH (against my better judgement), but the build would not proceed. However, I expect it will if I set it first, then rebuild. Personally I think there are three things wrong here, that should be fixed, but do doubt the bug will be closed as invalid. 1) Don't expect people to use LD_LIBRARY_PATH 2) Check the location of the libraries in the configure script, so people don't waste two hours building, only to find the library is not found. 3) Respect the option --with-mpfr= 4) Respect LD_FLAGS I expect this will be closed as invalid, so you will still get people (especially on Solaris) finding this odd error. Clearly the configure script found the libraries in a way specified by the options - perhaps the compiler should not forget them a couple of hours later. I note a note by Brian Dessent on bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35693 (reported against 4.3), that the top level configure script should pick this up earlier, not when it comes to run state 1 xgcc for the first time. I can't actually understand why it wont even I will both config.log and sparc-sun-solaris2.10/libgcc/config.log in the hope someone might actually fix this bug, rather than dismiss it. -- Summary: gcc insistance on using LD_LIBRARY_PATH and ignoring LD_FLAGS Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: bootstrap AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: david dot kirkby at onetel dot net GCC build triplet: Sun T5240 Solaris 10 update 4 GCC host triplet: Sun T5240 Solaris 10 update 4 GCC target triplet: Sun T5240 Solaris 10 update 4 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40572