Debian Bug report logs - #658856
gcc-mingw-w64: Provide a way to produce programs that do not rely on msvcrt.dll

Package: src:gcc-mingw-w64; Maintainer for src:gcc-mingw-w64 is Stephen Kitt <skitt@debian.org>;

Reported by: Sam Morris <sam@robots.org.uk>

Date: Mon, 6 Feb 2012 13:21:01 UTC

Severity: wishlist

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Stephen Kitt <steve@sk2.org>:
Bug#658856; Package gcc-mingw-w64. (Mon, 06 Feb 2012 13:21:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sam Morris <sam@robots.org.uk>:
New Bug report received and forwarded. Copy sent to Stephen Kitt <steve@sk2.org>. (Mon, 06 Feb 2012 13:21:08 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Sam Morris <sam@robots.org.uk>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: gcc-mingw-w64: Provide a way to produce programs that do not rely on msvcrt.dll
Date: Mon, 06 Feb 2012 13:19:43 +0000
Package: gcc-mingw-w64
Version: 4.6.1-16+2
Severity: wishlist

This is a big ask, and I'm not even sure about the best way to go about
it, but I figured I'd at least document it somewhere.

I'd like a way to produce an executable that does not rely on
msvcrt.dll. Microsoft say that this file is not intended to be used by
third-parties; it is a system component that provides different
facilities on each version of Windows, and could be changed in a way
that breaks backwards-compatibility at any time.

The best eventual way to achieve this goal would be for mingw-w64-dev to
provide a complete replacment C runtime, but until that happens I'd
like to be able to link against the redistributable C runtime DLLs
provided by Microsoft, msvcr{71,80,90,100}.dll.

mingw-w64-dev already ships import libraries for these DLLs, however the
specs file hardcodes the use of libmsvcrt.a. The specs file can be
modified, but a simple replacement of -lmsvcrt with -lmsvcr100 does not
work:

$ i686-w64-mingw32-gcc -specs=sam -static -o a.exe a.c
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/lib/../lib/libmingw32.a(lib32_libmingw32_a-tlssup.o): In function `__dyn_tls_init':
/tmp/buildd/mingw-w64-2.0.1+svn4784/build/i686-w64-mingw32/all/mingw-w64-crt/../../../../mingw-w64-crt/crt/tlssup.c:98: undefined reference to `__imp___winmajor'
collect2: ld returned 1 exit status

mingw.org has a page, <http://www.mingw.org/wiki/SpecsFileHOWTO>, that
explains how to modify the specs file, but it's not very clear and I
don't think it's compatible with mingw-w64 anyway (it advises you to
change -lmoldname to -lmoldname80 but this import library is absent from
mingw-w64-dev).

If that were to be overcome then there's the matter of how the end-user
decides which C runtime to use. Ideally it'd be a simple as linking with
-lmsvcr100, but if that's not possible then I guess you'd have to ship a
specs file for each C runtime, and let the end users pick one with
-specs.

Finally there's the problem of the DLLs that gcc itself provides. These
are also each linked to msvcrt.dll! So you'd have to ship each of the
DLLs linked against each of the C runtimes too, and provide some other
mechanism for picking which ones get used! At this point I have to admit
that I'm out of my depth, hence this very low priority feature
request/beg for help. :)

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (530, 'testing'), (520, 'unstable'), (510, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages gcc-mingw-w64 depends on:
ii  binutils-mingw-w64  2.22-1+1
ii  libc6               2.13-24
ii  libgmp10            2:5.0.2+dfsg-2
ii  libmpc2             0.9-4
ii  libmpfr4            3.1.0-3
ii  mingw-w64-dev       2.0.1+svn4784-1
ii  zlib1g              1:1.2.3.4.dfsg-3

Versions of packages gcc-mingw-w64 recommends:
ii  libstdc++6-4.6-dev  4.6.2-12

Versions of packages gcc-mingw-w64 suggests:
pn  gcc-4.6-locales  <none>

-- no debconf information




Bug reassigned from package 'gcc-mingw-w64' to 'src:gcc-mingw-w64'. Request was from Stephen Kitt <steve@sk2.org> to control@bugs.debian.org. (Wed, 18 Apr 2012 06:42:16 GMT) Full text and rfc822 format available.

No longer marked as found in versions gcc-mingw-w64/2. Request was from Stephen Kitt <steve@sk2.org> to control@bugs.debian.org. (Wed, 18 Apr 2012 06:42:17 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 06:47:07 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.