I have the base gcc that came with my distro and i'd like to have the option of using a newer version without replacing the older one. I'd like to install the newer version in a different path, like /opt. I run into a problem though when compiling with the newer version in /opt, it links against the libstdc++ in /opt, but at runtime the executable tries to link with the systems version in /usr/lib. Is there a way to have the gcc in /opt automatically set the rpath when linking so that executables can run against the /opt libstdc++?