This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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:
  https://discussions.apple.com/thread/2252567?threadID=2252567

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

And for the specific issue at hand, as Titus pointed out:
  http://lists.apple.com/archives/unix-porting/2006/Aug/msg00012.html

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.

Regards,
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]