1

I have some older utilities that are only sometimes needed and it came time to use a particular one and I found it didn't work. I know that some of the other utilities in the same package were working, but rather than worry about why this one was unique, I figured it just needed a recompile on the most recent Fedora and so I ran make.

I then learned that it couldn't find cc1. So the first thing I did was: dnf update gcc

This upgraded some 11 packages but didn't cure the cc1 problem, so I did which gcc to find where that is, then made a soft link to the cc1 program in the same directory. The compile then proceeded until a / the final linking, which should be:

gcc -o run${BINTYPE} run.o hashc.o

'run' here is the utility name. But the compile returns:

gcc: fatal error: ‘-fuse-linker-plugin’, but liblto_plugin.so not found
compilation terminated.

I then did a web search and found a few stack-overflow entries, such as this one, (and a handful of non-stack-overflow pages, too) but none matched or provided a working solution.

I then found where liblto_plugin.so actually is:

/usr/lib64/bfd-plugins/liblto_plugin.so

...and checked LD_LIBRARY_PATH - the location wasn't in there, so I added it as the first entry (/usr/lib64/bfd-plugins/). That didn't work - same error.

And, I also tried going to where this distribution of Fedora seems to want to find it - which is /usr/libexec/gcc/x86_64-redhat-linux/ - and then making a soft link there, too, but that didn't work either.

OK, this should be simple, but I'm stumped!

It might be worth noting that from what I understand, this plugin is about optimizing dynamic linking at runtime, and that's simply not involved for this utility. All this program does is validate an environment before running to ensure it doesn't even try to launch unless certain conditions are met, so static linking should work fine. So maybe a workaround is to simply provide a flag that says skip the plug-ins? I'd rather "fix it correctly," but I'll settle for it doing what I need to do right now.

UPDATE

As suggested by Knud Larsen in comments, I did a re-installation of gcc and nothing changed. And, it appears the ‘-fuse-linker-plugin’ isn't even rquired these days, Great! But, there's no flag calling for its use, so it seems to be automatic; how do I turn this thing off?!

Richard T
  • 4,570
  • 5
  • 37
  • 49
  • 1
    https://stackoverflow.com/questions/15606993/g-optimization-flags-fuse-linker-plugin-vs-fwhole-program : Nick Apperson's answer, etc. → » Essentially, *-fuse-linker-plugin* is no longer necessary. « – Knud Larsen Jul 30 '21 at 16:33
  • @KnudLarsen GREAT! ... But, so far as I can see "it's never referenced." That is, there are NO options (flags) given to gcc, so how do I turn this off?! BTW, I did the reinstall you suggested on the other question, but got no different results - same problem exists. ... Answer this with how to turn off the -fuse-linker-plugin and I'll be quite happy! I / we never asked for the damned thing in the first place! – Richard T Jul 30 '21 at 17:51
  • 1
    I don't know the origin of this "option -fuse-linker-plugin", but a couple of Google search´ shows that when it's used, the same error appears : liblto_plugin.so not found. ...... I have compiled thousands of application, libraries with gcc (and g++) the last 19 years, and never met this error. – Knud Larsen Jul 30 '21 at 18:25
  • @KnudLarsen Thanks for your thoughts; I have, not counting garden-variety installation tasks, compiled hundreds of applications, libraries, and small programs with gcc over the last 30-ish years and never met this error, either! I suspect it's an artifact of errant package management on this version of Fedora (32). (And that's why I asked about the package layout on the other question.) – Richard T Jul 30 '21 at 18:44
  • 1
    The Google search with : liblto_plugin.so not found, fuse-linker-plugin liblto_plugin.so, gcc option "-fuse-linker-plugin" → not only Fedora. Also Gentoo, Ubuntu, Arch I think was debated. – Knud Larsen Jul 30 '21 at 19:08

1 Answers1

1

I also meet this question when install something with cargo.

note: cc: fatal error: '-fuse-linker-plugin', but liblto_plugin.so not found
          compilation terminated.

Finally, I found the reason. I created the hard link cc of gcc by mistake. It should have been a soft link. It will be fine after changing it.