On Mon, 22 Apr 2019, Kacvinsky, Tom wrote:

Hi,


-----Original Message-----
From: Martin Storsjö <[email protected]>
Sent: Monday, April 22, 2019 3:36 PM
To: [email protected]
Subject: Re: [Mingw-w64-public] PKGBUILD script for toolchain, still having
GCC compile errors

<snip/>

Yes, it should have. Technically; mingw-w64-crt installs many
different lib*crt*.a; the one that links to msvcrt.dll is named
libmsvcrt-os.a and the ucrt ones are libucrtbase.a and libucrt.a. (The
latter is the one you probably want to use.) The --with-default-msvcrt
option changes which one of them is copied to be named libmsvcrt.a,
which is the one that is linked in implicitly.

So it sounds to me like this linking step is linking using the wrong
(old) mingw installation directory, not the new one (where libmsvcrt.a
is a copy of libucrt.a).


I am using the PKGBUILD scripts from

https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD

I had received instructions that for the mingw-w64-crt-git PKGBUILD script, 
change the
git URL to

git+https://git.code.sf.net/p/mingw-w64/mingw-w64#branch=v6.x

This conceivably would checkout out the 6.0.0 branch, so the CRT would build
with UCRT if I so specified.  What I see with the official MinGW CRT tar ball -
mingw-w64-v6.0.0.tar.bz2 - is that when I configured with --with-default-msvcrt,
the line from the configure log shows

checking default msvcrt... ucrt (0x1400)

which is what I want, but the PKGBUILD script, when it runs configure, only
shows

checking default msvcrt... ucrt

That, and when compiling with the official release, I see

-D__MSVCRT_VERSION__=0x1400

This is, again, what I want.  But when the CRT compiles with the PKGBUILD 
script,
I see this instead

-D__MSVCRT_VERSION__=0x700

No, this is quite intentional. This is used for object files that are explicitly intended to be usable with both msvcrt and ucrt at the same time. (Normally an object file only works with either, except for a carefully selected set of functionality used by crt startup files and libmingwex.a; and those files are explicitly compiled with this option.)

This has nothing to do with your issue at all.

If you switched from -lmsvcrt to -lucrt using a spec file, and that worked, then everything else is correct in your setup, and it's all about invoking the right linker.

I haven't looked into how exactly that PKGBUILD file works and how it behaves wrt compiling new runtime files with the new compiler, new headers and libs from the new sysroot etc, so I can't comment on that unfortunately.

// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to