https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66521
--- Comment #9 from Eric Gallager <egall at gwmail dot gwu.edu> --- Created attachment 36101 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36101&action=edit additional patch to fix this issue As a follow-up to my previous comment, the attached patch fixes the issue described in it, by using the correct rpath flag for the darwin linker, and also putting some space between the "-u" linker flag and the symbol that it names, as the darwin linker requires. There's some room to improve it though: * Seeing as libstdc++-v3 already uses libtool to link, why not just use libtool's own "-rpath" or "-R" flag to link? Shouldn't it just then DTRT for each platform, instead of needing to have to specify the correct linker rpath flag manually? * Adding darwin to the target_os conditional is probably wrong; the target system says nothing about the linker flags supported by the linker being used. I'm not sure if making a separate host_os or build_os conditional would be any better, though. Of course, the best way to do it would be to avoid conditionalizing on OS altogether, and doing things "the autoconf way" and testing to see which linker flags are actually supported by whichever linker is being used, but that would be harder... * I didn't include all the files that would need to be regenerated after changing the patched file, because I figure anyone reading this is a maintainer with autotools installed, and can regenerate the necessary files themselves.