This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
- From: Mathieu Malaterre <mmalater at nycap dot rr dot com>
- To: Mike Stump <mrs at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 10 Jun 2005 17:48:28 -0400
- Subject: Re: ld: common symbols not allowed with MH_DYLIB output format with the -multi_module option
- References: <3B2EAD1C-D9E8-11D9-AE6C-003065BDF310@apple.com>
On Jun 10, 2005, at 3:45 PM, Mike Stump wrote:
I'd put this more simply...
On Monday, June 6, 2005, at 02:06 PM, Mathieu Malaterre wrote:
I have a question about a valid C code. I am trying to compile the
following code in MacOSX (*). I don't understand what the problem is?
You must use -fno-common when you are building dynamic libraries on
darwin.
Could someone please explain me what is going on?
You didn't use -fno-common.
Can someone please tell me then which one of the three possibilities is
the right one:
#1. I need to tell the linker to use -single_module
#2. Rewrite the code to make a fake initialization
#3. I need to pass -fno-common to the compiler
I really don't understand why I need to do that, since this is valid C
code. Why the linker does not default to proper option, or why the
-fno-common option isn't used. At compile time gcc should figure that
out, right ?
Now compared to the linker option, at least the compiler flag I can
specify it for the specific file I want, which is great. But then again
why is this up to the user to do it ? Is there a performance reason ?
Why isn't it the default ?
How do other people do when porting *nix lib to MacOSX ? Is this is
trial-and-error process to get the lib compiled ?
Thanks
Mathieu