| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Oct 30, 2007, at 1:46 PM, Alexander von Below wrote:
The visibility controls are threefold: • 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. • Pragmas in source code. These take the form of #pragma GCC visibility push(default) void g() { } void h() { } #pragma GCC visibility pop and designate that all symbols declared in the #pragma section will have the designated visibility at link time. In both above cases, "default" refers not to a particular visibility, but to the default visibility as passed on the command line by Xcode build settings. • Command-line flags controlled by Xcode build settings 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. • Ex-post-facto stripping 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. Apart from the bug Rich mentioned, one way to get the above error is to have a symbol declared "default" visibility in a heaer file, then #include that header from two different source files, one built with -fvisibility=hidden and one not. That gets conflicting definitions for the "default" visibility for that symbol. Chris |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden This email sent to email@hidden
| References: | |
| >Re: "different visibility" warning? (From: Rich Siegel <email@hidden>) | |
| >Re: "different visibility" warning? (From: Alexander von Below <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.