On 4/23/2011 15:34, [email protected] wrote:
> Hi,
> 
> My 32 bit mingw cross compiler works, but the 64 version
> fails when linking system libraries.
> 
> I've set up a x86_64-pc-mingw32 64 bit cross compiler (under
> gentoo linux with paludis packet manager).
> 
> I can compile 64 bit code, however, linking fails:
> 
> /usr/lib/gcc/x86_64-pc-mingw32/4.5.2/../../../../x86_64-pc-mingw32/lib/dllcrt2.o:crtdll.c:(.text+0xb):
> undefined reference to `malloc'
> (... and a lot more)
> 
> When I lookup dllcrt2.o from my existing 32 bit cross
> compiler, then 'malloc' has an underscore, but the 64 bit
> version of dllcrt2.o does NOT have one.
> 
> I have read that some calling convention has changed.
> However, what are the steps to solve this then?
> 
> FYI: I am using mingw64-runtime-20101003,
> binutils-2.21.51.0.8, gcc-4.5.2.
> 
>  Felix
> 
> 

-- Adding to mingw-w64 public list --

Hi,

The underscore part is correct, win64 symbols do not have underscore
prefixes like win32 symbols.

Yes, call convention changed, GCC 4.5.0, 4.4.x and earlier will use
underscores regardless of win32/win64 target. It was a design decision
mistake. GCC 4.5.1 and later including the 4.6.x series will use
underscore prefix only for win32.

Btw, please use x86_64-w64-mingw32 instead of x86_64-pc-mingw32, the
latter is only used for compatibility, I'd admit there isn't much
compatibility with 32bit mingw.


Attachment: 0xED74C077.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to