Page 1 of 1

i686 cross compiler, GCC can't find liblto_plugin.so

Posted: Fri Apr 24, 2015 2:16 pm
by SamTebbs33
I was following the cross compiler tutorial, but stopped halfway when I wasn't able to make binutils without getting massive amounts of errors that I am unable to solve. I then downloaded the first toolchain for OS X at the bottom of the page, and decided to use the cross compiler in there for compiling my kernel. However, when I run the new version of GCC (found within the folders of the tool chain) I get the following error:

Code: Select all

gcc: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found
compilation terminated.
This happens, even though I have added the folder where the liblto_plugin.so can be found to my PATH and the LD_LIBRARY_PATH. I have the toolchain and kernel source et.c within my Documents folder on my HDD.

How would I go about solving this problem?

Re: i686 cross compiler, GCC can't find liblto_plugin.so

Posted: Sat Apr 25, 2015 8:56 pm
by teenHack42
Hey Sam,
I had the same problem about a year ago and after much research and hair pulling I found a gcc flag that you append to your compilation.

my list of flags are

Code: Select all

CFLAGS=-nostdlib -ffreestanding -nostdinc -g -fno-builtin
I believe it was either the -nostdlib flag or the -fnobuiltin flag that fixed the problem.

I hope I have been of help.

teenHack42

Re: i686 cross compiler, GCC can't find liblto_plugin.so

Posted: Sun Apr 26, 2015 2:00 am
by jnc100
-fno-use-linker-plugin is the official flag to use. I still don't understand why some cross compilers insist on trying to use it though (I think it relates to the gcc version).

Regards,
John.