> -----Original Message-----
> From: David Grayson <[email protected]>
> Sent: Thursday, April 18, 2019 12:19 PM
> To: [email protected]
> Subject: Re: [Mingw-w64-public] PKGBUILD script for toolchain, still having
> GCC compile errors
>
> It's not really a chicken and egg situation. You just need to convince GCC to
> be a cross-compiler hosted on the mingw-msvcrt environment and targeting
> the mingw-ucrt environment. Any libraries you build targeting ucrt (including
> mingw-w64's) would go in a directory like /mingw64-ucrt instead of
> /mingw64 to avoid confusion.
> When you build executables that are part of GCC, they would link to the
> UCRT.
>
> But that seems like an uncommon configuration and GCC might not
> understand it. I did a quick search for "ucrt" in the GCC 8.3.0 source code
> and
> I don't see anything about it except in libsanitizer.
> I'm not sure if you can somehow add "ucrt" to the triple that GCC uses to
> identify the system it's targeting (x86_64-w64-mingw32). There might be a
> lot of code in GCC that assumes that all MinGW environments are equal if
> their architectures are equal, so it might be hard to convince GCC that it is
> a
> cross-compiler. That makes me think it might actually be easier if the cross-
> compiler where hosted in the msys2/Cygwin runtime, or on Linux.
>
> Here's a project I made to make it easy to cross-compile for MinGW on Linux:
>
> https://github.com/DavidEGrayson/nixcrpkgs
>
> It has no support the UCRT, but since its scripts are small and simple, it
> might
> be easy to add it. (Right now it only takes 362 lines of scripts and 8
> patches to
> build a cross-compiling toolchain with binutils, GCC 8, and mingw-w64.)
>
OK, I can give this a whirl. the main problem I face is not so much GCC's C
and C++
compilers building as it is the GNAT compiler building. When you go to build
that,
it wants to pull in the systems libgnat.a, which contains the symbol _p_environ,
which is not resolved:
ada/argv.o:argv.c:(.text+0x9a): undefined reference to `__imp___p__environ'
ada/argv.o:argv.c:(.text+0xc9): undefined reference to `__imp___p__environ'
ada/argv.o:argv.c:(.text+0x10b): undefined reference to `__imp___p__environ'
ada/env.o:env.c:(.text+0x96): undefined reference to `__imp___p__environ'
ada/env.o:env.c:(.text+0x10a): undefined reference to `__imp___p__environ'
collect2.exe: error: ld returned 1 exit status
I know _p_environ is part of the UCRT, if I recall correctly, so why building
the
CRT with UCRT support and installing ended up with an unresolved symbol, I
don't know.
Any help with this particular facet would be greatly appreciated. I am oh so
close to getting this nailed own.
Thanks,
Tom
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public