I have PPL and CLooG installed in /usr/local/lib. The configure script finds these two libraries and generates makefiles that link with them simply by adding -lppl_c -lppl -lcloog. For example,
i686-slackware-linux-gcc -g -fkeep-inline-functions -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -DHAVE_CONFIG_H -o cc1-dummy c-lang.o stub-objc.o attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o c-convert.o c-aux-info.o c-common.o c-opts.o c-format.o c-semantics.o c-ppoutput.o c-cppbuiltin.o c-objc-common.o c-dump.o c-pch.o c-parser.o i386-c.o c-gimplify.o tree-mudflap.o c-pretty-print.o c-omp.o \ dummy-checksum.o main.o libbackend.a ../libcpp/libcpp.a ../libdecnumber/libdecnumber.a ../libcpp/libcpp.a ../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lcloog -lppl_c -lppl -lgmpxx -L/home/artem/testing/gcc-build/./gmp/.libs -L/home/artem/testing/gcc-build/./mpfr/.libs -lmpc -lmpfr -lgmp -rdynamic -ldl -lz -lelf This works well when GNU ld is used, because it can be taught to look for libraries in /usr/local/bin by editing /etc/ld.so.conf. However, GNU gold doesn't have such an option and requires that all library paths be passed in the command line explicitly (at least a brief look at options.cc shows no other way to specify additional library paths). The program can be partially resolved by saying LDFLAGS=-L/usr/local/lib ../gcc/configure ......, which makes stage1 compiler to build successfully. However, building stage2 compiler fails because -L/usr/local/lib does not get added to the command line during compilation of stage2. I used the following options to configure GCC: ../gcc/configure --prefix=/usr/local/gcc-current --libdir=/usr/local/gcc-current/lib --enable-shared --enable-bootstrap --enable-languages=c,c++ --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-gold --enable-lto --verbose --with-arch=i686 --target=i686-slackware-linux --build=i686-slackware-linux --host=i686-slackware-linux -- Summary: Build fails if gold is used as linker and some libraries reside is /usr/local/lib Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: other AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: aanisimov at inbox dot ru GCC build triplet: i686-slackware-linux GCC host triplet: i686-slackware-linux GCC target triplet: i686-slackware-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42756