This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: distutils/_msvccompiler does not remove /DLL during link(CCompiler.EXECUTABLE)
Type: compile error Stage: resolved
Components: Distutils Versions: Python 3.5
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: James Salter, dstufft, eric.araujo, steve.dower
Priority: normal Keywords: patch

Created on 2015-07-20 11:05 by James Salter, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
_msvccompiler_link.patch James Salter, 2015-07-20 11:05
Messages (2)
msg246976 - (view) Author: James Salter (James Salter) * Date: 2015-07-20 11:05
Encountered trying to build numpy with python 3.5b3, visual studio 2015.

From distutils/

        if self._need_link(objects, output_filename):
            ldflags = (self.ldflags_shared_debug if debug
                       else self.ldflags_shared)
            if target_desc == CCompiler.EXECUTABLE:
                ldflags = ldflags[1:]


        self.ldflags_shared = [
            '/nologo', '/DLL', '/INCREMENTAL:NO'
        self.ldflags_shared_debug = [
            '/nologo', '/DLL', '/INCREMENTAL:no', '/DEBUG:FULL'

Which leads to a DLL being created instead of a .exe.

I have attached a patch that explicitly removes '/DLL' rather than trimming by index.
msg386382 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:26
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68861
2021-02-03 18:26:24steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386382

resolution: out of date
stage: resolved
2015-07-20 11:05:19James Saltercreate