I am trying to build a new toolchain on a Chromebook, which means I have very limited permissions. I can only really put things into /usr/local. I have a toolchain installed into /usr/local with gcc 4.8, but I'm trying to install a new toolchain using Linuxbrew with gcc 4.9.2. When I try to compile gcc 4.9.2, everything is fine until at some point it starts using xgcc located in /usr/local/linuxbrew/tmp/gcc-tGay0V/gcc-4.9.2/build/./gcc/xgcc instead of my old gcc. When building libgcc_s.so, I get an error: /usr/local/linuxbrew/Cellar/binutils/2.24/x86_64-unknown-linux-gnu/bin/ld: cannot find crti.o: No such file or directory /usr/local/linuxbrew/Cellar/binutils/2.24/x86_64-unknown-linux-gnu/bin/ld: cannot find /usr/lib64/libc_nonshared.a I found that setting GCC_EXEC_PREFIX from the debug shell at this point fixes this error, but setting it from the beginning causes my old gcc not to work and ./configure to fail. How can I specify the location of the glibc I want to link with, or alternatively, how do I at least split the process up into the part with gcc and the part with xgcc so I can change my environment variables?