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

Problems compiling with Xcode 5 (OSX 10.9) #62

Closed
frensley opened this issue Mar 2, 2014 · 2 comments
Closed

Problems compiling with Xcode 5 (OSX 10.9) #62

frensley opened this issue Mar 2, 2014 · 2 comments

Comments

@frensley
Copy link

frensley commented Mar 2, 2014

Seems there are some issues with linking Python in Xcode 5 (https://developer.apple.com/library/ios/technotes/tn2328/_index.html).

gcc -mmacosx-version-min=10.7 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv  -bundle -multiply_defined suppress -o multicorn.so src/errors.o src/python.o src/query.o src/multicorn.o -L/Applications/Postgres.app/Contents/Versions/9.3/lib -L/Applications/Postgres.app/Contents/Versions/9.3/lib  -L/Applications/Postgres.app/Contents/Versions/9.3/lib -Wl,-dead_strip_dylibs   -F/System/Library/Frameworks -framework Python  
ld: framework not found Python
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Using PYTHON_OVERRIDE = python also errors:

gcc -mmacosx-version-min=10.7 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv  -bundle -multiply_defined suppress -o multicorn.so src/errors.o src/python.o src/query.o src/multicorn.o -L/Applications/Postgres.app/Contents/Versions/9.3/lib -L/Applications/Postgres.app/Contents/Versions/9.3/lib  -L/Applications/Postgres.app/Contents/Versions/9.3/lib -Wl,-dead_strip_dylibs   -ldl -framework CoreFoundation -lpython2.7  
ld: library not found for -lpython2.7

Determined that $(PY_LDFLAGS) is missing from :

SHLIB_LINK = $(PY_LIBSPEC) $(PY_LDFLAGS) $(PY_ADDITIONAL_LIBS) $(filter -lintl,$(LIBS)) 

Which results in lots of missing symbol errors:
[....]

"_untransformRelOptions", referenced from:
      _multicorn_GetUserMapping in python.o
      _multicorn_validator in multicorn.o
ld: symbol(s) not found for architecture x86_64

Determined that SHLIB_LINK is clobbering PGXS info. So changing SHLIB_LINK to:

SHLIB_LINK += $(PY_LIBSPEC) $(PY_LDFLAGS) $(PY_ADDITIONAL_LIBS) $(filter -lintl,$(LIBS)) 

This seems to resolve the issue. I am not sure how to patch this specifically for OSX yet. I wanted to get this into the project issues in case someone else has suggestions or stumbles onto the same problem.

@rdunklau
Copy link
Contributor

rdunklau commented Mar 3, 2014

I don't have access to an OSX box, and I don't know either how to run XCode.

Applying your proposed change when using PYTHON_OVERRIDE is not harmful, but does this resolve your issue ?

It it does, I'll merge it. Thanks for the report !

@frensley
Copy link
Author

frensley commented Mar 3, 2014

Yes the proposed changes work great. I am wondering if for OSX 10.9 (and maybe lower) should override automatically (python 2.7 is always included with OSX).

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

No branches or pull requests

2 participants