<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>129598</bug_id>
          
          <creation_ts>2006-04-11 08:48 0000</creation_ts>
          <short_desc>add support for MingW to crossdev</short_desc>
          <delta_ts>2006-09-17 21:54:44 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Development</component>
          <version>2006.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>zephiris@gmail.com</reporter>
          <assigned_to>toolchain@gentoo.org</assigned_to>
          <cc>basic@mozdev.org</cc>
    
    <cc>cretin@gentoo.org</cc>
    
    <cc>radek@podgorny.cz</cc>

      

      
          <long_desc isprivate="0">
            <who>zephiris@gmail.com</who>
            <bug_when>2006-04-11 08:48:44 0000</bug_when>
            <thetext>Pardon if I&apos;m rather new to all of this, I&apos;ll try to make it very clear.
The problem is that crossdev can generate a C cross-compiler for i686-pc-mingw32 or i586-mingw32msvc adaquetely enough to produce apparently correct code, but the name handling certainly isn&apos;t correct. I&apos;m not sure if this is necessarily more of a problem of portage (though binutils apparently doesn&apos;t append .exe by default) with trying to emerge things for it, but for instance, on my AMD64-based Gentoo installation, you can get files like this: /usr/i586-mingw32msvc/lib64/libz.so.1.2.3: MS-DOS executable PE  for MS Windows (DLL) (console) Intel 80386 32-bit
for: CHOST=i586-pc-mingw32 CFLAGS=&quot;-march=i586 -pipe -O3 -ffast-math&quot; ROOT=/usr/i586-mingw32msvc emerge zlib, which I&apos;m told is the correct way to do it.
Also, because base libraries and other things are already precompiled for MingW, and it doesn&apos;t support glibc (or newlib, uclibc, et cetera), it means that glibc and linux-headers aren&apos;t support for it, which means you can&apos;t install a C++ cross-compiler, either. IIRC, static versions of libraries should be libz.a, for instance, with shared linkable being libz.dll.a or just linking against libz.dll.

I know conventional wisdom would be to download and use xmingw, but those are somewhat out of date comparatively, the only &apos;additional&apos; step should be putting mingw-runtime and w32api tarballs into the target directory before making the cross-compiler, which I can do easily, but using portage+crossdev, I should reasonably be able to get a nicely working target (and emerge support for compatible things) for cross-compilation with it. That&apos;s mostly compatible with a large number of things, including the very libraries that I&apos;d need to be able to compile my projects with.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-04-11 10:11:27 0000</bug_when>
            <thetext>i mentioned this already but i have no urge to investigate how to integrate it</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>cretin@gentoo.org</who>
            <bug_when>2006-04-11 11:40:58 0000</bug_when>
            <thetext>Hi,

I&apos;ll see. Strangle I was just trying to update the dev-util/xmingw-*
ebuild today and yesterday.

I would first have to look into the crossdev process to see if it can
do the special things needed for xmingw</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2006-09-17 00:09:05 0000</bug_when>
            <thetext>ive just gone ahead and done this myself ;)

# crossdev mingw32
--------------------------------------------------------------------------------
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   amd64
 * Target System:         mingw32
 * Stage:                 4 (C/C++ compiler)

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               w32api-[latest]
 * libc:                  mingw-runtime-[latest]

 * PORTDIR_OVERLAY:       /usr/local/portage
 * PORT_LOGDIR:           /var/log/portage
 * PKGDIR:                /usr/portage/packages/cross/mingw32
 * PORTAGE_TMPDIR:        /var/tmp/cross/mingw32
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -
 * Using dev-util/w32api from /usr/local/portage instead of /usr/portage
 * Using dev-util/mingw-runtime from /usr/local/portage instead of /usr/portage
 * Forcing the latest versions of binutils-config/gcc-config ...         [ ok ]
 * Log: /var/log/portage/cross-mingw32-binutils.log
 * Emerging cross-binutils ...                                           [ ok ]
 * Log: /var/log/portage/cross-mingw32-w32api-quick.log
 * Emerging cross-w32api-quick ...                                       [ ok ]
 * Log: /var/log/portage/cross-mingw32-mingw-runtime-headers.log
 * Emerging cross-mingw-runtime-headers ...                              [ ok ]
 * Log: /var/log/portage/cross-mingw32-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                         [ ok ]
 * Log: /var/log/portage/cross-mingw32-w32api.log
 * Emerging cross-w32api ...                                             [ ok ]
 * Log: /var/log/portage/cross-mingw32-mingw-runtime.log
 * Emerging cross-mingw-runtime ...                                      [ ok ]
 * Log: /var/log/portage/cross-mingw32-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...                                         [ ok ]

# echo &apos;int main(){}&apos; &gt; test.c
# mingw32-gcc test.c 
# file a.exe 
a.exe: MS-DOS executable PE  for MS Windows (console) Intel 80386 32-bit
# mingw32-gcc --version
mingw32-gcc (GCC) 4.1.1 (Gentoo 4.1.1-r1)</thetext>
          </long_desc>
      
    </bug>

</bugzilla>