title: gcc 10.3.1.1.fc32 build failing with "gcc: fatal error: ‘-fuse-linker-plugin’, but liblto_plugin.so not found"
body: <p>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.</p>
  <p>I then learned that it couldn't find cc1. So the first thing I did was: <code>dnf update gcc</code></p>
  <p>This upgraded some 11 packages but didn't cure the cc1 problem, so I did <code>which gcc</code> 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:</p>
  <pre><code>gcc -o run${BINTYPE} run.o hashc.o
  </code></pre>
  <p>'run' here is the utility name. But the compile returns:</p>
  <pre><code>gcc: fatal error: ‘-fuse-linker-plugin’, but liblto_plugin.so not found
  compilation terminated.
  </code></pre>
  <p>I then did a web search and found a few stack-overflow entries, such as <a href="https://stackoverflow.com/questions/19272524/arm-linux-androideabi-g-fuse-linker-plugin-but-liblto-plugin-so-not-found">this one,</a> (and a handful of non-stack-overflow pages, too) but none matched or provided a working solution.</p>
  <p>I then found where <code>liblto_plugin.so</code> actually is:</p>
  <pre><code>/usr/lib64/bfd-plugins/liblto_plugin.so
  </code></pre>
  <p>...and checked <code>LD_LIBRARY_PATH</code> - the location wasn't in there, so I added it as the first entry (<code>/usr/lib64/bfd-plugins/</code>). That didn't work - same error.</p>
  <p>And, I also tried going to where this distribution of Fedora seems to want to find it - which is <code>/usr/libexec/gcc/x86_64-redhat-linux/</code> - and then making a soft link there, too, but that didn't work either.</p>
  <p>OK, this should be simple, but I'm stumped!</p>
  <p>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 &quot;fix it correctly,&quot; but I'll settle for it doing what I need to do right now.</p>
  <p>UPDATE</p>
  <p>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?!</p>