This is the command that I used: ../gcc-4.7.2/configure --prefix=/tools/gcc-4.7.2 --enable-static make -j10 make install My directory structure looks like this: <root>/gcc-4.7.2 <root>/binutils-2.21.1 // linked all directories in gcc-4.7.2 <root>/x86_64 // configure called from here I wiped the directory x86_64 clean and tried again and this time it seems to have worked so I guess it was a fluke. Maybe I shouldn't be compiling in parallel? Now I'm getting a different error though when using the compiler: collect2: fatal error: cannot find 'ld' My compile command is this: /tools/gcc-4.7.2/bin/g++ -o myExec -Xlinker -R /tools/gcc-4.7.2/lib64 <.o files> -static -L/tools/gcc-4.7.2/lib64 <.a files> -lnsl -ldl -Wl,--wrap,open -Wl,--wrap,close -Wl,--wrap,lseek -Wl,--wrap,write -Wl,--wrap,printf -Wl,--wrap,puts -Wl,--wrap,vfprintf -Wl,--wrap,fputc -Wl,--wrap,putchar -flto -O3 -mtune=generic -fuse-linker-plugin -L/tools/gcc-4.7.2/lib64 -lm -lstdc++ -lsupc++ ld exists in the target path: -rwxr-xr-x 4 <user> <group> 6238594 Jun 18 16:06 /tools/gcc-4.7.2/bin/ld strace shows a number of stat calls before GCC exists but not to this path or LD at all. Seems to be looking for ld-new and real-ld. I don't see either of those in the installed directory (/tools/gcc-4.7.2) but I see a few instances of ld-new in the build directory (<root>/x86_64 above: ./prev-ld/ld-new, ./stage1-ld/ld-new, and ./ld/ld-new). Any idea what's wrong now? On Tue, Jun 18, 2013 at 6:16 PM, Ian Lance Taylor <iant@xxxxxxxxxx> wrote: > On Tue, Jun 18, 2013 at 1:07 PM, Uri Moszkowicz <uri@xxxxxxxxx> wrote: > >> I'm having trouble building GCC. I've decompressed GCC 4.7.2 source >> into a directory and binutils 2.21.1 into a directory in parallel with >> symbolic links to all subdirectories. I ran the contrib script to get >> all other dependencies and then ran GCC's configure in a parallel >> directory, following all installation instructions. It builds just >> fine but when I install it AR seems to be missing. Any idea what >> happened to it and how to get it? >> >> Looks like it's supposed to be built with binutils and I'm getting >> other tools from it like LD just not that one. There is a program >> called gcc-ar that seems to exist but not sure if it's the same tool? >> It may appear if I build binutils by itself but I'm trying to build >> them together so that I can get -flto optimization to work, as >> apparently GCC balks at using the linker plugin if they weren't built >> together. > > Tell us exactly how you ran configure. > > It's not clear from the above: did you build the binutils also, or did > you only build GCC? > > Ian