Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a strategy for dealing with OS X ported compilers #54

Closed
noloader opened this issue Oct 31, 2015 · 2 comments
Closed

Need a strategy for dealing with OS X ported compilers #54

noloader opened this issue Oct 31, 2015 · 2 comments
Labels

Comments

@noloader
Copy link
Collaborator

_Background_

Crypto++ 5.6.3 and above use GCC's init_priority in an effort to tame the C++ Static Initialization Order Fiasco. Its an optional feature that is disabled by default under 5.6.3. It can be enabled with CXXFLAGS="-DCRYPTOPP_INIT_PRIORITY=250" (or similar).

OS X has about 6 projects that provide Unix and Linux tools on OS X. The projects are called "ports' and they include:

  • Fink
  • Gentoo/Alt
  • Homebrew
  • MacPorts
  • Pkgsrc
  • Rudix

Some of the ports provide GCC, but they do not enable init_priority support and subsequently fail the compile. The compiler appears to be acting as a proxy for the linker, and assume init_priority is an error because the OS X linker does not offer a pubic interface to control the order. Or maybe more correctly, Apple did not respond to a GNU/Binutils bug report on the subject. (Its not clear if the linker would actually fail a link if the metadata was present).

As far as we know, Fink will accept init_priority, and MacPorts will reject init_priority. We don't know what the other ports are doing. Additionally, other compilers are OK, like Apple's GCC and Clang.

We attempted to acquire metrics to help gauge the impact of disabling init_priority among a ports collection, but MacPorts does not test its compilers. Also see Does MacPorts provide its Test/QA results online?

_Strategies_

We don't have a strategy for dealing with GCC-compatible compilers that refuse to compile a program. The two strategies being considered are:

  1. disable init_priority for all non-Apple GCC compilers
  2. disable init_priority for port compilers that refuse to compile the program

Strategy 1 disables init_priority for all GCC compilers since Apple no longer provides GCC. For example, if we detect any port like Fink (and not just a problematic port like MacPorts), then the code disables init_priority.

Strategy 2 disables init_priority on a per-need basis. For example, if we detect a problematic port like MacPorts (and not just any port like Fink), then the code disables init_priority.

@noloader noloader changed the title Need a strategy for dealing with OS X ported programs Need a strategy for dealing with OS X ported compilers Oct 31, 2015
@mouse07410
Copy link
Collaborator

If #2 is doable and not too fragile - it is more attractive. Otherwise, I'd say just do #1 and let's be done with this issue.

@noloader
Copy link
Collaborator Author

I think we cleared this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants