Linux -> Windows crosscompiler
Paolo Invernizzi via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Tue May 16 01:22:04 PDT 2017
On Tuesday, 16 May 2017 at 08:06:10 UTC, Joakim wrote:
> On Tuesday, 16 May 2017 at 07:40:59 UTC, Marvin Gülker wrote:
>> [...]
>
> OK, sometimes mixing D compilers is the problem, so thought I'd
> mention it.
>
>> [...]
>
> How fast is your connection now? I've been using two
> connections between 2-8 Mbps until recently, so even 16 Mbps
> seems fast to me. :)
>
>> [...]
>
> Sounds like it is the C that is the problem. ;) An alternative
> to Visual Studio is to download a Windows SDK that included the
> compiler and linker, like the Windows 7.1 SDK that I used years
> ago:
>
> http://forum.dlang.org/post/hvdyyutbgehlefluvsup@forum.dlang.org
>
> I don't know if they still include the compiler/linker in later
> versions of the Windows SDK, maybe one of the newer ones would
> work too.
>
>> [...]
>
> I don't know that you'd have to work on the compiler itself, as
> ldc used to support MinGW at one point. My guess is that you'd
> just have to update some MinGW stuff in druntime, but I haven't
> looked at it.
>
>> [...]
>
> This is likely not so bad, you simply have to use -v to see the
> linker command ldc tries to invoke and replace it by manually
> running with lld instead, especially since it's only needed
> once for the final executable.
I successfully cross compiled a simple "hello world" application
on my Mac using something like:
ldc2 -c -mtriple=x86_64-pc-windows-msvc main.d
LIB=vc/lib lld-link main.obj ldc2_win/lib64/phobos2-ldc.lib
ldc2_win/lib64/druntime-ldc.lib vc/lib/msvcrt.lib
where I've copied a bunch of libraries in vc/lib, like the
mscvrt.lib, shell32.lib etc, coming out from a previous wine
attempt to use the microsoft linker in a dockerised environment.
/Paolo
More information about the digitalmars-d-ldc
mailing list