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

Fix issue with node-gyp linking to wrong c++ std lib on OS X >= 10.9 #3

Merged
merged 1 commit into from
Oct 6, 2014

Conversation

andrewaustin
Copy link

By default node-gyp links against libstdc++ instead of libc++. OS X >= 10.9 builds against libc++ by default. This causes CLN and jinacs not not be linked against the same standard C++ library and things explode.

The upstream issue is discussed here: nodejs/node-gyp#469

The attached patch will correctly select the right C++ standard library (taken from the above github issue):

Before patch (OS X 10.9.5):

otool -L build/Release/rationalnumber.node
build/Release/rationalnumber.node:
    /usr/local/lib/libcln.6.dylib (compatibility version 7.0.0, current version 7.3.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0)

After patch (OS X 10.9.5):

otool -L build/Release/rationalnumber.node
build/Release/rationalnumber.node:
    /usr/local/lib/libcln.6.dylib (compatibility version 7.0.0, current version 7.3.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)

@tbonelaforge
Copy link
Owner

Looks fine to me, I'm merging it.

tbonelaforge added a commit that referenced this pull request Oct 6, 2014
Fix issue with node-gyp linking to wrong c++ std lib on OS X >= 10.9
@tbonelaforge tbonelaforge merged commit dd86d1f into tbonelaforge:master Oct 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants