i686-apple-darwin10 to i386-pc-linux-gnu, ld invoked with gnu options

Yann E. MORIN yann.morin.1998@anciens.enib.fr
Sun Jun 26 13:35:00 GMT 2011

Andrea, Titus, All,

On Sunday 26 June 2011 14:26:45 Andrea Franceschini wrote:
> 2011/6/24 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>:
> > What does the MacOS-X' ld says to used static/shared libraries? GNU ld
> > at least supports the equivalents:
> > - for static: -Bstatic   -dn  -non_shared   -static
> > - for shared: -Bdynamic  -dy  -call_shared
> > If you can find a common option for both, then the better.
> To the best of my knowledge, Apple's ld supports -static and -dynamic.
> Man page for ld states that
>      -dynamic    The default.  Implied by -dylib, -bundle, or -execute
>      -static     Produces a mach-o file that does not use the dyld.
> Only used building the kernel.
> though trying to compile a sample hello world results in a not working
> executable (segfaults) even if file reports it being a "Mach-O 64-bit
> executable x86_64". So I'm not sure it's an option. Anyways I could
> get past the point in my original email by not forcing libstdcxx to be
> linked statically.

OK. Looking at:

It seems static linking is not supported on MacOS-X. Sigh...

And for the specific issue at hand, as Titus pointed out:

we have a static version libtsdc++-static that we can link against.

> Like Titus, I'm not really sure why we should
> consider linking gcc statically against libstcxx (and at this point I
> can say I chose that option with no knowledge about it, just because
> it sounded nice :).

The idea is to be able to move the toolchain from one host to another
without too much hassles...

While the C library is pretty standard and backward-compatible, the
libstdc++ is very tightly coupled to the compiler.

But if you do not need that, then you can disable this option.

Yann E. MORIN.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

For unsubscribe information see http://sourceware.org/lists.html#faq

More information about the crossgcc mailing list