New issue 2538: _ssl_build.py fails on macOS with the py3.5
https://bitbucket.org/pypy/pypy/issues/2538/_ssl_buildpy-fails-on-macos-with-the-py35

Dan Villiom Podlaski Christiansen:

`lib_pypy/_ssl_build.py` fails on macOS with undefined symbols such as 
`_PyPyErr_NoMemory`. The patch below fixes it, and I was able to translate and 
package a pypy3 VM on my Mac — is it ok to push?

```
#!diff
# HG changeset patch
# User Dan Villiom Podlaski Christiansen <[email protected]>
# Date 1492025965 -7200
#      Wed Apr 12 21:39:25 2017 +0200
# Branch py3.5
# Node ID cfaf8a2a21a456a3d6ce8dcc08b484a25ac06e5c
# Parent  a25d530e67738b1638b694325509abc73c55ff9b
fix building SSL on macOS

The Darwin linker has rather different semantics from most other
linkers, and tends to require that dynamic libraries define all their
symbols. As a result, the ssl module fails to link with undefined
references to PyPy-internal symbols; we fix this by marking the
library as embedded, so the library links against libpypy3-c.dylib.

diff --git a/lib_pypy/_ssl_build.py b/lib_pypy/_ssl_build.py
--- a/lib_pypy/_ssl_build.py
+++ b/lib_pypy/_ssl_build.py
@@ -49,5 +49,9 @@ ffi = build_ffi_for_binding(
     extra_link_args=extra_link_args(compiler_type()),
 )
 
+if sys.platform == 'darwin':
+    # link against libpypy library on macOS
+    ffi._embedding = ''
+
 if __name__ == '__main__':
     ffi.compile()
```

Responsible: danchr
_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to