[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -single_module flag on Darwin

From: Peter O'Gorman
Subject: Re: -single_module flag on Darwin
Date: Wed, 19 Nov 2003 07:57:18 +0900
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030902 Thunderbird/0.2

Hash: SHA1

Sushil Kambampati wrote:

| I could compile and link to a somewhat older version of InterViews using
| libtool 1.4.2 but with version 1.5 of libtool the -single_module flag is
| activated by default and now I cannot link against InterViews libraries,
| I get an error from ld "multiple definitions of symbol".  The class
| PSFont is the culprit.
| When I go into libtool and rip out the -single_module flag then the
| executable links again.
| Why was -single_module made the default and what is the proper way of
| dealing with this issue?  I admit I know next to nothing about the GNU
| build utils.

The -single_module flag on darwin is the equivalent of doing ld -r ...
and then linking the shared library, it is necessary for C++ shared
libraries if you want static initializers to work. Darwin's dyld is
extremely lazy and will not call static initializers until/unless a
symbol from the same module as the initializer is referenced, using the
- -single_module flags ensures that all static initializers are called as
soon as any symbol from the library is used.

If you are seeing a library containing only C code linked with
- -single_module, then it is my bug, and I apologise for it.

You'll have to fix the code so that you don't implement any of the same
global symbols as the InterViews library.

- --
Peter O'Gorman -
Version: GnuPG v1.2.3 (Darwin)
Comment: Using GnuPG with Thunderbird -


reply via email to

[Prev in Thread] Current Thread [Next in Thread]