https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87808
acsawdey at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2019-07-22 CC| |acsawdey at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #6 from acsawdey at gcc dot gnu.org --- I'm also seeing this same problem simply from not having the gcc driver in PATH. Using the example from downstream redhat BZ 1566178: [sawdey@marlin trunk]$ /home2/sawdey/work/gcc/trunk/install/bin/gcc -Wl,-rpath,/home2/sawdey/work/gcc/trunk/install/lib -g -Wall -Werror t.c -lgccjit [sawdey@marlin trunk]$ ./a.out ld: cannot find crtbeginS.o: No such file or directory ld: cannot find -lgcc ld: cannot find -lgcc_s libgccjit.so: error: error invoking gcc driver gcc_jit_result_get_code: NULL result Segmentation fault (core dumped) [sawdey@marlin trunk]$ PATH=/home2/sawdey/work/gcc/trunk/install/bin:$PATH ./a.out hello foo Using strace the failing version makes this ld command, with no path for crtbeginS.o: /usr/bin/ld --eh-frame-hdr -shared -m elf64lppc -o /tmp/libgccjit-lMbVEL/fake.so /usr/lib/powerpc64le-linux-gnu/crti.o crtbeginS.o -L/lib/powerpc64le-linux-gnu -L/lib/../lib64 -L/usr/lib/powerpc64le-linux-gnu /tmp/cchtuxH0.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state crtendS.o /usr/lib/powerpc64le-linux-gnu/crtn.o When it can find the driver, this is the ld command, with the full path to the correct installed bits: /usr/bin/ld --eh-frame-hdr -shared -m elf64lppc -o /tmp/libgccjit-t81bpM/fake.so /usr/lib/powerpc64le-linux-gnu/crti.o /home2/sawdey/work/gcc/trunk/install/lib/gcc/powerpc64le-unknown-linux-gnu/10.0.0/crtbeginS.o -L/home2/sawdey/work/gcc/trunk/install/lib/gcc/powerpc64le-unknown-linux-gnu/10.0.0 -L/home2/sawdey/work/gcc/trunk/install/lib/gcc/powerpc64le-unknown-linux-gnu/10.0.0/../../../../lib64 -L/lib/powerpc64le-linux-gnu -L/lib/../lib64 -L/usr/lib/powerpc64le-linux-gnu -L/home2/sawdey/work/gcc/trunk/install/lib/gcc/powerpc64le-unknown-linux-gnu/10.0.0/../../.. /tmp/ccD4Cbi4.o -lgcc --push-state --as-needed -lgcc_s -pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /home2/sawdey/work/gcc/trunk/install/lib/gcc/powerpc64le-unknown-linux-gnu/10.0.0/crtendS.o /usr/lib/powerpc64le-linux-gnu/crtn.o This is with trunk, configured with --disable-bootstrap --enable-languages=c,c++,jit --enable-host-shared --prefix=/home2/sawdey/work/gcc/trunk/install