classification
Title: Cygwin link failure with builtin modules since issue30860
Type: Stage: resolved
Components: Build Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, erik.bray, miss-islington, vstinner
Priority: normal Keywords: 3.7regression, patch

Created on 2018-07-24 17:10 by erik.bray, last changed 2018-11-27 10:54 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 8446 closed erik.bray, 2018-07-24 17:13
PR 8712 merged erik.bray, 2018-08-09 13:39
PR 10734 merged miss-islington, 2018-11-27 02:21
Messages (5)
msg322316 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2018-07-24 17:10
Since issue30860, libpython is no longer able to be linked as a shared library, because built-in modules are not compiled with the correct external linkage flags.

This is due to the removal of -DPy_BUILD_CORE, which in pyport.h is used to control wither __declspec(dllexport) is used as opposed to __declspec(dllimport).

Fortunately Eric Snow already added in https://github.com/python/cpython/pull/3458 a new flag Py_BUILD_CORE_BUILTIN which is used sparingly on Windows, and which should also be used, e.g. on Cygwin or MinGW, when compiling modules that are linked into libpython as built-ins.  It sets the right external linkage flags without carrying the additional weight of Py_BUILD_CORE.

This along with issue34211 need to be fixed in order to get Python 3.7+ building on Cygwin again.
msg323322 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2018-08-09 13:42
I added a new PR modifying makesetup and adding a new variable to Makefile.pre.in, PY_BUILTIN_MODULE_CFLAGS, explicitly for building built-in modules.

I think this, or some version of it, is a cleaner solution than my previous brute-force approach.
msg330485 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-11-27 02:21
New changeset da324d53d420347344236ff64cf5eb9b675d6f86 by Benjamin Peterson (E. M. Bray) in branch 'master':
closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)
https://github.com/python/cpython/commit/da324d53d420347344236ff64cf5eb9b675d6f86
msg330487 - (view) Author: miss-islington (miss-islington) Date: 2018-11-27 02:33
New changeset 716a8089b04095acaba493925751df194a4916bb by Miss Islington (bot) in branch '3.7':
closes bpo-34212: Build core extension modules with Py_BUILD_CORE_BUILTIN. (GH-8712)
https://github.com/python/cpython/commit/716a8089b04095acaba493925751df194a4916bb
msg330502 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-27 10:54
What about modules compiled by setup.py? They don't have the issue?

Only 2 modules are built by setup.py with Py_BUILD_CORE_BUILTIN (_json) or Py_BUILD_CORE (_xxsubinterpreters).

By the way, it seems like Py_BUILD_CORE_BUILTIN should be used for modules, not Py_BUILD_CORE. No?
History
Date User Action Args
2018-11-27 10:54:45vstinnersetmessages: + msg330502
2018-11-27 02:33:01miss-islingtonsetnosy: + miss-islington
messages: + msg330487
2018-11-27 02:21:53miss-islingtonsetpull_requests: + pull_request9982
2018-11-27 02:21:42benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg330485

resolution: fixed
stage: patch review -> resolved
2018-11-26 09:41:37vstinnersetnosy: + vstinner
2018-08-09 13:42:04erik.braysetmessages: + msg323322
2018-08-09 13:39:38erik.braysetpull_requests: + pull_request8199
2018-07-24 17:13:12erik.braysetkeywords: + patch
stage: patch review
pull_requests: + pull_request7968
2018-07-24 17:10:52erik.braycreate