Re: "different visibility" warning?
Re: "different visibility" warning?
- Subject: Re: "different visibility" warning?
- From: Steve Mills <email@hidden>
- Date: Wed, 31 Oct 2007 10:53:15 -0500
On Oct 30, 2007, at 17:19:43, Chris Espinosa wrote:
Directives in source code. These take the form of
__attribute__((visibility("hidden"))) void MyFunction2() {}
and designate that the following symbol is to be hidden from
linkage with other compilation units at link time.
We don't use this.
The gcc flag -fvisibility=hidden sets the default visibility of all
symbols compiled in that pass. It can be set per-file in the
Compiler Flags, or set for an entire target or project with the
Symbols Hidden by Default build setting.
Here's something weird. In the main project, the Project Settings
shows Symbols Hidden by Default to be off. This setting is not defined
in the project (it's not bold). But in the Target Settings, it shows
it is ON, yet it's not defined in the target (it's not bold). Um, what
changed it between the project and the target? The project uses
a .xcconfig file for both Debug and Release configs, but
GCC_SYMBOLS_PRIVATE_EXTERN does not appear in either of these files.
Now in the subproject, the project or target do not define Symbols
Hidden by Default, and both show it to be off.
Even if you have declared a symbol to be visible with an
__attribute__ or #pragma and are not hiding it by default with the
build setting, a symbol may still be rendered unexported by stripping
of the binary, either with use of an Exported Symbols File or
Unexported Symbols File, or by use of Strip Linked Product and Strip
Style.
For Strip Linked Product, it's the opposite; it's off in the target
but on in the project, and neither define that setting. Strip Style
appears as All Symbols in both the project and the target, neither
define this setting, but the Release .xcconfig used by the project
does set it to STRIP_STYLE = all.
The subproject shows that the target defines Strip Linked Product to
on, and the Strip Style is set to Debugging Symbols, yet it does not
define it. The project shows it to be All Symbols.
This is confusing. Here, I'll paste it all in an easier to read format:
Main project
Project Settings
GCC_SYMBOLS_PRIVATE_EXTERN = NO
STRIP_INSTALLED_PRODUCT = YES
STRIP_STYLE = all defined via .xcconfig
Target Settings
GCC_SYMBOLS_PRIVATE_EXTERN = YES
STRIP_INSTALLED_PRODUCT =
STRIP_STYLE = all
Subproject
Project Settings
GCC_SYMBOLS_PRIVATE_EXTERN = NO
STRIP_INSTALLED_PRODUCT = YES
STRIP_STYLE = all
Target Settings
GCC_SYMBOLS_PRIVATE_EXTERN = NO
STRIP_INSTALLED_PRODUCT = YES defined here
STRIP_STYLE = debugging
Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden