This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with -static-libstdc++ on Mac OS X
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Simon Wright <simon at pushface dot org>
- Cc: gcc-help <gcc-help at gcc dot gnu dot org>, Iain Sandoe <iain at codesourcery dot com>
- Date: Wed, 17 Jun 2015 21:29:25 +0100
- Subject: Re: Problem with -static-libstdc++ on Mac OS X
- Authentication-results: sourceware.org; auth=none
- References: <C16C1E37-10FC-485A-9063-3041D240B809 at pushface dot org>
On 17 June 2015 at 20:43, Simon Wright wrote:
> For reasons connected with https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61027 I want to build GCC with shared libgcc (so cross-library exception handling works) and static libstdc++.
>
> You would think that configuring GCC with --with-boot-ldflags=-static-libstdc++ (or --with-stage1-ldflags=-static-libstdc++ for a cross-compiler) would do the trick; but itâs ignored.
>
> It turns out that on Mac OS X (Mavericks, Darwin 13.4.0) g++ ignores -static-libstdc++ unless you also say -static-libgcc (which is exactly what I need to avoid). Same behaviour on GCC 5.1.0, 4.9.1, 4.8.1, 4.7.0.
>
> GCC 4.9.1 built on Debian wheezy doesnât have this problem (the ld command is something like -Bstatic -lstdc++ -Bdynamic).
>
> Any workrounds?
Apparently not, one of our Darwin experts (CC'd) says:
yes, it doesn't work with current sources - I have a patch to make it
work for linkers without -Bdynamic/Bstatic