diff --git a/Readme.md b/Readme.md index daee6e8588dc..1666cbc4f752 100644 --- a/Readme.md +++ b/Readme.md @@ -205,6 +205,19 @@ error: failed to build archive: failed to open object file: No such file or dire That can be caused by the fact that you try to compile with `lto = "fat"`, but you didn't compile the sysroot with LTO. (Not sure if that's the reason since I cannot reproduce anymore. Maybe it happened when forgetting setting `FAT_LTO`.) +### ld: cannot find crtbegin.o + +When compiling an executable with libgccijt, if setting the `*LIBRARY_PATH` variables to the install directory, you will get the following errors: + +``` +ld: cannot find crtbegin.o: No such file or directory +ld: cannot find -lgcc: No such file or directory +ld: cannot find -lgcc: No such file or directory +libgccjit.so: error: error invoking gcc driver +``` + +To fix this, set the variables to `gcc-build/build/gcc`. + ### How to debug GCC LTO Run do the command with `-v -save-temps` and then extract the `lto1` line from the output and run that under the debugger.