-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use libffi instead of older vendored version
- Loading branch information
Showing
2 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Branch py3.7 | ||
# Node ID 914662db611500eb62661bf6d1dcb38e327f25c2 | ||
# Parent d23b62357222d2768c072fbceb0650a174acd7e5 | ||
|
||
diff -r d23b62357222 -r 914662db6115 lib-python/3/venv/__init__.py | ||
--- a/lib-python/3/venv/__init__.py Fri Jul 09 19:45:42 2021 +0100 | ||
+++ b/lib-python/3/venv/__init__.py Sun Jul 11 12:46:37 2021 +0300 | ||
@@ -259,9 +259,9 @@ | ||
if not os.path.islink(path): | ||
os.chmod(path, 0o755) | ||
# | ||
- # PyPy extension: also copy the main library, not just the | ||
+ # PyPy extension: also copy needed dlls, not just the | ||
# small executable | ||
- for libname in ['libpypy3-c.so', 'libpypy3-c.dylib']: | ||
+ for libname in ['libpypy3-c.so', 'libpypy3-c.dylib', 'libffi-7.dll']: | ||
dest_library = os.path.join(binpath, libname) | ||
src_library = os.path.join(os.path.dirname(context.executable), | ||
libname) | ||
diff -r d23b62357222 -r 914662db6115 pypy/tool/release/package.py | ||
--- a/pypy/tool/release/package.py Fri Jul 09 19:45:42 2021 +0100 | ||
+++ b/pypy/tool/release/package.py Sun Jul 11 12:46:37 2021 +0300 | ||
@@ -185,7 +185,9 @@ | ||
print('Picking {} as pypy.exe'.format(src)) | ||
# Can't rename a DLL | ||
win_extras = [('lib' + POSIX_EXE + '-c.dll', None), | ||
- ('sqlite3.dll', lib_pypy)] | ||
+ ('sqlite3.dll', lib_pypy), | ||
+ ('libffi-7.dll', None), | ||
+ ] | ||
if not options.no__tkinter: | ||
tkinter_dir = lib_pypy.join('_tkinter') | ||
win_extras += [('tcl86t.dll', tkinter_dir), ('tk86t.dll', tkinter_dir)] | ||
diff -r d23b62357222 -r 914662db6115 rpython/rlib/clibffi.py | ||
--- a/rpython/rlib/clibffi.py Fri Jul 09 19:45:42 2021 +0100 | ||
+++ b/rpython/rlib/clibffi.py Sun Jul 11 12:46:37 2021 +0300 | ||
@@ -38,10 +38,7 @@ | ||
|
||
if _WIN32: | ||
from rpython.rlib import rwin32 | ||
- | ||
-if _WIN32: | ||
separate_module_sources = [''' | ||
- #include "src/precommondefs.h" | ||
#include <stdio.h> | ||
#include <windows.h> | ||
|
||
@@ -107,22 +104,22 @@ | ||
]) | ||
else: | ||
USE_C_LIBFFI_MSVC = True | ||
- libffidir = py.path.local(cdir).join('src', 'libffi_msvc') | ||
+ # libffidir = py.path.local(cdir).join('src', 'libffi_msvc') | ||
if not _WIN64: | ||
asm_ifc = 'win32.c' | ||
else: | ||
asm_ifc = 'win64.asm' | ||
eci = ExternalCompilationInfo( | ||
includes = ['ffi.h', 'windows.h'], | ||
- libraries = ['kernel32'], | ||
- include_dirs = [libffidir, cdir], | ||
+ libraries = ['kernel32', 'libffi-7'], | ||
+ # include_dirs = [libffidir, cdir], | ||
separate_module_sources = separate_module_sources, | ||
post_include_bits = post_include_bits, | ||
- separate_module_files = [libffidir.join('ffi.c'), | ||
- libffidir.join('prep_cif.c'), | ||
- libffidir.join(asm_ifc), | ||
- libffidir.join('pypy_ffi.c'), | ||
- ], | ||
+ # separate_module_files = [libffidir.join('ffi.c'), | ||
+ # libffidir.join('prep_cif.c'), | ||
+ # libffidir.join(asm_ifc), | ||
+ # libffidir.join('pypy_ffi.c'), | ||
+ # ], | ||
) | ||
|
||
FFI_TYPE_P = lltype.Ptr(lltype.ForwardReference()) | ||
@@ -265,7 +262,7 @@ | ||
return rffi.llexternal(name, args, result, compilation_info=eci, calling_conv='win') | ||
|
||
|
||
-if not _MSVC: | ||
+if 1 or not _MSVC: | ||
def check_fficall_result(result, flags): | ||
pass # No check | ||
else: | ||
@@ -329,7 +326,7 @@ | ||
|
||
c_ffi_prep_cif = external('ffi_prep_cif', [FFI_CIFP, FFI_ABI, rffi.UINT, | ||
FFI_TYPE_P, FFI_TYPE_PP], rffi.INT) | ||
-if _MSVC: | ||
+if 0 and _MSVC: | ||
c_ffi_call_return_type = rffi.INT | ||
else: | ||
c_ffi_call_return_type = lltype.Void | ||
|
||
diff -r d23b62357222 -r 914662db6115 rpython/translator/driver.py | ||
--- a/rpython/translator/driver.py Fri Jul 09 19:45:42 2021 +0100 | ||
+++ b/rpython/translator/driver.py Sun Jul 11 12:46:37 2021 +0300 | ||
@@ -507,6 +507,11 @@ | ||
newname = newexename.new(basename=soname.basename) | ||
shutil.copyfile(str(name), str(newname.new(ext=ext))) | ||
self.log.info("copied: %s" % (newname,)) | ||
+ # HACK: copy libcffi-7.dll which is required for venvs | ||
+ # At some point, we should stop doing this, and instead | ||
+ # use the artifact from packaging the build instead | ||
+ libffi = py.path.local.sysfind('libffi-7.dll') | ||
+ shutil.copyfile(str(libffi), os.getcwd() + r'\libffi-7.dll') | ||
self.c_entryp = newexename | ||
self.log.info("created: %s" % (self.c_entryp,)) | ||
|
||
|