Article 4RQ0H Compiling GCC, not baking rpath correctly

Compiling GCC, not baking rpath correctly

by
OstermanA
from LinuxQuestions.org on (#4RQ0H)
I am attempting to compile my own copy of gcc 9.2.0 on CentOS 8 in a non-standard path, ~/tools/system. I have local copies of automake, autoconf, libtool, gmc, mpc and mpfr in there and they all work fine. However, when I compile gcc there are five files which are not getting rpath backed in, even though I've included -Wl,-rpath,/home/aosterman/tools/system/lib -Wl,-rpath,/home/aosterman/tools/system/lib64 in LDFLAGS, CFLAGS and CPPFLAGS.

If I do not set LD_LIBRARY_PATH during compilation, which I frankly hate doing, the build fails entirely as soon as it tries to run one of these files missing rpath.

The list of files:
Code:/home/aosterman/tools/system/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/cc1
/home/aosterman/tools/system/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/cc1obj
/home/aosterman/tools/system/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/cc1plus
/home/aosterman/tools/system/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/f951
/home/aosterman/tools/system/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto1For my own sanity, I've actually written up a makefile to build all of these, which can be found >on github<. The complete build log can be found >here<.

Does anyone know what I'm missing here? Everything else is working just dandy, and I've used a similar process to compile several other software sets in the past.

Edit: There's actually a LOT of ELF files not getting rpath baked in. Looks like basically everything from gcc is being compiled without an rpath. Those five above stood out because they're linked to mpfr and I don't have a system copy installed. All of gcc is dynamically linking to the system libraries, not the ones in my standalone space.

How do I force gcc to compile while actually honoring LDFLAGS?latest?d=yIl2AUoC8zA latest?i=ebmzBqRCzUU:Q9nsOcfsnTw:F7zBnMy latest?i=ebmzBqRCzUU:Q9nsOcfsnTw:V_sGLiP latest?d=qj6IDK7rITs latest?i=ebmzBqRCzUU:Q9nsOcfsnTw:gIN9vFwebmzBqRCzUU
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments