-shared

Bradley Giesbrecht brad at pixilla.com
Fri Aug 6 17:27:20 PDT 2010


I read that -shared is ignored by Apples gcc compiler.

man gcc says not supported.
...
  -shared
            Produce a shared object which can then be linked with  
other objects to form an executable.  Not all systems support this  
option.  For predictable
            results, you must also specify the same set of options  
that were used to generate code (-fpic, -fPIC, or model suboptions)  
when you specify this
            option.[1]

            This option is not supported on Mac OS X.
...

The final command of my port looks like this and the result seems to  
be working.

cc -c -dynamiclib -fno-common -undefined dynamic_lookup -fPIC -shared - 
Wall -Wextra ......

I can patch the -shared out but if it is safely ignored I'd rather not  
because I'm trying to get a patch excepted upstream and for some to  
other lines and would rather have as little impact as necessary.

Can anyone confirm that -shared will just be ignored by Apple gcc and  
thereby be safe in our MacPorts environment?


Regards,
Bradley Giesbrecht


More information about the macports-dev mailing list