www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - LDC now supports Windows MSVC x86/x64 as first class targets

reply kinke <noone nowhere.com> writes:
Hey all,

I'm proud to announce that MSVC is fully supported now for LDC 
trunk. Rainer Schuetze has implemented MSVC-compatible exception 
handling (available since brand-new LLVM 3.8) for LDC, so that we 
have fully working exception chaining now on Win64. Along the 
way, he also added 32-bit MSVC support and a TLS alignment bugfix 
for Windows < 8.1 (a Windows bug/wontfix!). It requires a 
bleeding edge LLVM though, as Rainer's work has uncovered a few 
LLVM bugs which didn't make it into 3.8 final.
So a round of applause for Rainer and the LLVM devs, excellent 
job, thank you very much! Full PDB support for LLVM is also 
underway...

CI testing with AppVeyor has been improved, so that the full test 
suite is run for both x86 and x64 MSVC targets. All tests pass 
except for 3 rather negligible issues (see 
https://github.com/ldc-developers/ldc/pull/1354#issuecomment-198572582 for
details).

The automatically updated GitHub release 
(http://wiki.dlang.org/Latest_LDC_binaries_for_Windows) now also 
includes a downloadable 32-bit LDC build.

Wiki pages have been updated accordingly. Check out 
http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC if you
want to start contributing too! Setting up the dev environment isn't that hard,
I promise. :)
Mar 19 2016
next sibling parent Walter Bright <newshound2 digitalmars.com> writes:
On 3/19/2016 6:23 AM, kinke wrote:
 I'm proud to announce that MSVC is fully supported now for LDC trunk. Rainer
 Schuetze has implemented MSVC-compatible exception handling (available since
 brand-new LLVM 3.8) for LDC, so that we have fully working exception chaining
 now on Win64. Along the way, he also added 32-bit MSVC support and a TLS
 alignment bugfix for Windows < 8.1 (a Windows bug/wontfix!). It requires a
 bleeding edge LLVM though, as Rainer's work has uncovered a few LLVM bugs which
 didn't make it into 3.8 final.
 So a round of applause for Rainer and the LLVM devs, excellent job, thank you
 very much! Full PDB support for LLVM is also underway...
Congratulations!
Mar 20 2016
prev sibling next sibling parent reply Manu via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> writes:
This is extremely good news!

Where is LDC at with the D frontend at the moment?
Have Walter's numerous February fixes for C++ compatibility made their
way in yet?

Also, out of curiosity, has anyone looked at connecting the MS codegen
(C2.DLL) to LDC like MS do with Clang+C2 (Clang frontend w/ MS
codegen) that was released in VS2015 Update 1/2?
I suspect their C2.DLL connectivity code must be available(?), and
theoretically LDC could connect to it for codegen the same way Clang
does(?), and that would lead to 100% MS compatible binary and
debuginfo output.
ClangC2 produces binaries that are almost indistinguishable from MSVC
compiled binaries while debugging.

On 19 March 2016 at 23:23, kinke via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 Hey all,

 I'm proud to announce that MSVC is fully supported now for LDC trunk. Rainer
 Schuetze has implemented MSVC-compatible exception handling (available since
 brand-new LLVM 3.8) for LDC, so that we have fully working exception
 chaining now on Win64. Along the way, he also added 32-bit MSVC support and
 a TLS alignment bugfix for Windows < 8.1 (a Windows bug/wontfix!). It
 requires a bleeding edge LLVM though, as Rainer's work has uncovered a few
 LLVM bugs which didn't make it into 3.8 final.
 So a round of applause for Rainer and the LLVM devs, excellent job, thank
 you very much! Full PDB support for LLVM is also underway...

 CI testing with AppVeyor has been improved, so that the full test suite is
 run for both x86 and x64 MSVC targets. All tests pass except for 3 rather
 negligible issues (see
 https://github.com/ldc-developers/ldc/pull/1354#issuecomment-198572582 for
 details).

 The automatically updated GitHub release
 (http://wiki.dlang.org/Latest_LDC_binaries_for_Windows) now also includes a
 downloadable 32-bit LDC build.

 Wiki pages have been updated accordingly. Check out
 http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC if you
 want to start contributing too! Setting up the dev environment isn't that
 hard, I promise. :)
Mar 20 2016
next sibling parent reply kinke <noone nowhere.com> writes:
On Sunday, 20 March 2016 at 10:54:54 UTC, Manu wrote:
 Where is LDC at with the D frontend at the moment?
 Have Walter's numerous February fixes for C++ compatibility 
 made their
 way in yet?
Trunk (master branch) is at D2.069.2. The merge-2.070 branch already exists, so it won't take long for us to catch up.
 Also, out of curiosity, has anyone looked at connecting the MS 
 codegen
 (C2.DLL) to LDC like MS do with Clang+C2 (Clang frontend w/ MS
 codegen) that was released in VS2015 Update 1/2?
Nope, I haven't and I suspect noone else has. I don't see any benefit except for debug infos at the moment, but I guess full support in LLVM itself won't take ages.
Mar 20 2016
parent reply Manu via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> writes:
On 20 March 2016 at 22:53, kinke via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Sunday, 20 March 2016 at 10:54:54 UTC, Manu wrote:
 Where is LDC at with the D frontend at the moment?
 Have Walter's numerous February fixes for C++ compatibility made their
 way in yet?
Trunk (master branch) is at D2.069.2. The merge-2.070 branch already exists, so it won't take long for us to catch up.
Awesome, looking forward to trying it out!
 Also, out of curiosity, has anyone looked at connecting the MS codegen
 (C2.DLL) to LDC like MS do with Clang+C2 (Clang frontend w/ MS
 codegen) that was released in VS2015 Update 1/2?
Nope, I haven't and I suspect noone else has. I don't see any benefit except for debug infos at the moment, but I guess full support in LLVM itself won't take ages.
It's been many years so far... what's a couple more? ;) It would be interesting to know if it's possible/reasonably simple. The advantage is, in addition to the obvious debuginfo, that the binary generated by the same codegen would definitely be completely compatible. I suspect performing the plug like Clang would take a very small time compared to the years we've already been waiting for the LLVM/MS guys to get comprehensive debuginfo into LLVM, and that's assuming that LLVM is even capable of expressing all the data in MS's debuginfo format? MSVC debuginfo is very good; it has data such that variables follow their registers around in fully optimised builds, making release build debugging fast and effortless.
Mar 20 2016
next sibling parent reply kinke <noone nowhere.com> writes:
On Sunday, 20 March 2016 at 14:15:19 UTC, Manu wrote:
 It's been many years so far... what's a couple more? ;)
I know, but MSVC targets have just recently gained a lot of momentum, and MS has started contributing too.
 The advantage is, in addition to the obvious debuginfo, that the
 binary generated by the same codegen would definitely be 
 completely compatible.
Completely compatible to what? An identical IR generated by clang for a 1:1 translation of a D source to C++ (in cases where that's even possible)?
 assuming that LLVM is even capable of expressing all the data 
 in MS's debuginfo format?
For me the question is rather whether the MS backend really fully supports LLVM IR, especially wrt. ABI details, alignments, EH etc., or if it just supports what clang emits.
Mar 20 2016
parent kinke <noone nowhere.com> writes:
Wrt. MSVC compatibility and LDC's new, MSVC-compatible EH: a few 
additional lines enable catching D exceptions in C++, see 
https://github.com/ldc-developers/druntime/pull/54/commits/7484da5a6b98c938fa15
ec9a70bb4a08cc1fcf2 and
https://github.com/ldc-developers/dmd-testsuite/pull/15/commits/a99e368cdd5bf5e1a6d48209093404a9fc114579
Mar 20 2016
prev sibling parent reply Kagamin <spam here.lot> writes:
On Sunday, 20 March 2016 at 14:15:19 UTC, Manu wrote:
 MSVC debuginfo is very good; it has data such that variables
 follow their registers around in fully optimised builds, making
 release build debugging fast and effortless.
That's backend feature, there are (usually) no registers on the frontend level.
Mar 21 2016
parent Manu via Digitalmars-d-announce <digitalmars-d-announce puremagic.com> writes:
On 22 March 2016 at 03:12, Kagamin via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Sunday, 20 March 2016 at 14:15:19 UTC, Manu wrote:
 MSVC debuginfo is very good; it has data such that variables
 follow their registers around in fully optimised builds, making
 release build debugging fast and effortless.
That's backend feature, there are (usually) no registers on the frontend level.
Yes, that's why the C2 backend is useful; it populates the debuginfo with very high quality data.
Mar 21 2016
prev sibling parent Rainer Schuetze <r.sagitario gmx.de> writes:
On 20.03.2016 11:54, Manu via Digitalmars-d-announce wrote:
 Also, out of curiosity, has anyone looked at connecting the MS codegen
 (C2.DLL) to LDC like MS do with Clang+C2 (Clang frontend w/ MS
 codegen) that was released in VS2015 Update 1/2?
 I suspect their C2.DLL connectivity code must be available(?), and
 theoretically LDC could connect to it for codegen the same way Clang
 does(?), and that would lead to 100% MS compatible binary and
 debuginfo output.
 ClangC2 produces binaries that are almost indistinguishable from MSVC
 compiled binaries while debugging.
I just tried to find some information about C2.DLL, but it seems they haven't made anything public yet. Grepping Microsofts' github forks of llvm/clang didn't reveal anything, too.
Mar 20 2016
prev sibling next sibling parent Guillaume Piolat <contact gam3sfrommars.fr> writes:
On Saturday, 19 March 2016 at 13:23:48 UTC, kinke wrote:
 Hey all,

 I'm proud to announce that MSVC is fully supported now for LDC 
 trunk. Rainer Schuetze has implemented MSVC-compatible 
 exception handling (available since brand-new LLVM 3.8) for 
 LDC, so that we have fully working exception chaining now on 
 Win64. Along the way, he also added 32-bit MSVC support and a 
 TLS alignment bugfix for Windows < 8.1 (a Windows 
 bug/wontfix!). It requires a bleeding edge LLVM though, as 
 Rainer's work has uncovered a few LLVM bugs which didn't make 
 it into 3.8 final.
 So a round of applause for Rainer and the LLVM devs, excellent 
 job, thank you very much! Full PDB support for LLVM is also 
 underway...
This is great, I don't have to write assembly anymore! Thanks LDC team.
Mar 21 2016
prev sibling next sibling parent deadalnix <deadalnix gmail.com> writes:
Got the news first hand by David Majnemer first hand not so long 
ago. Congrats guys :)
Mar 21 2016
prev sibling next sibling parent Bruno Medeiros <bruno.do.medeiros+dng gmail.com> writes:
On 19/03/2016 13:23, kinke wrote:
 Hey all,

 I'm proud to announce that MSVC is fully supported now for LDC trunk.
 Rainer Schuetze has implemented MSVC-compatible exception handling
 (available since brand-new LLVM 3.8) for LDC, so that we have fully
 working exception chaining now on Win64. Along the way, he also added
 32-bit MSVC support and a TLS alignment bugfix for Windows < 8.1 (a
 Windows bug/wontfix!). It requires a bleeding edge LLVM though, as
 Rainer's work has uncovered a few LLVM bugs which didn't make it into
 3.8 final.
 So a round of applause for Rainer and the LLVM devs, excellent job,
 thank you very much! Full PDB support for LLVM is also underway...

 CI testing with AppVeyor has been improved, so that the full test suite
 is run for both x86 and x64 MSVC targets. All tests pass except for 3
 rather negligible issues (see
 https://github.com/ldc-developers/ldc/pull/1354#issuecomment-198572582
 for details).

 The automatically updated GitHub release
 (http://wiki.dlang.org/Latest_LDC_binaries_for_Windows) now also
 includes a downloadable 32-bit LDC build.

 Wiki pages have been updated accordingly. Check out
 http://wiki.dlang.org/Building_and_hacking_LDC_on_Windows_using_MSVC if
 you want to start contributing too! Setting up the dev environment isn't
 that hard, I promise. :)
Awesome, keep up the good work! Now, I'm making a note to try again at some point soon to build lldb-mi, and see if it works well with the Eclipse CDT debugger. And more interestingly, if it would work with MSVC executables. -- Bruno Medeiros https://twitter.com/brunodomedeiros
Mar 22 2016
prev sibling parent reply Corey Lubin <i-fear-the-spam coreylub.in> writes:
On Saturday, 19 March 2016 at 13:23:48 UTC, kinke wrote:
 Hey all,

 I'm proud to announce that MSVC is fully supported now for LDC 
 trunk. Rainer Schuetze has implemented MSVC-compatible 
 exception handling (available since brand-new LLVM 3.8) for 
 LDC, so that we have fully working exception chaining now on 
 Win64. Along the way, he also added 32-bit MSVC support and a 
 TLS alignment bugfix for Windows < 8.1 (a Windows 
 bug/wontfix!). It requires a bleeding edge LLVM though, as 
 Rainer's work has uncovered a few LLVM bugs which didn't make 
 it into 3.8 final.
 So a round of applause for Rainer and the LLVM devs, excellent 
 job, thank you very much! Full PDB support for LLVM is also 
 underway...
Truly great news. Thank you Rainer, if you're reading this. (I don't think you ever take a break, do you? :]) Awesome progress, LDC team. Your challenging work is much appreciated. (P.S.: On a related front, any news on the Android on ARM work? Last I read, my understanding was that the problem you were running into was a lack of proper LLVM TLS support for the platform? Is my recollection correct?)
Mar 27 2016
parent reply Joakim <dlang joakim.fea.st> writes:
On Monday, 28 March 2016 at 05:52:34 UTC, Corey Lubin wrote:
 On Saturday, 19 March 2016 at 13:23:48 UTC, kinke wrote:
 [...]
Truly great news. Thank you Rainer, if you're reading this. (I don't think you ever take a break, do you? :]) Awesome progress, LDC team. Your challenging work is much appreciated. (P.S.: On a related front, any news on the Android on ARM work? Last I read, my understanding was that the problem you were running into was a lack of proper LLVM TLS support for the platform? Is my recollection correct?)
Try it out, beta coming up: https://github.com/joakim-noah/android/releases
Mar 27 2016
parent Vadim Lopatin <coolreader.org gmail.com> writes:
On Monday, 28 March 2016 at 05:56:07 UTC, Joakim wrote:
 On Monday, 28 March 2016 at 05:52:34 UTC, Corey Lubin wrote:
 On Saturday, 19 March 2016 at 13:23:48 UTC, kinke wrote:
 [...]
Truly great news. Thank you Rainer, if you're reading this. (I don't think you ever take a break, do you? :]) Awesome progress, LDC team. Your challenging work is much appreciated. (P.S.: On a related front, any news on the Android on ARM work? Last I read, my understanding was that the problem you were running into was a lack of proper LLVM TLS support for the platform? Is my recollection correct?)
Try it out, beta coming up: https://github.com/joakim-noah/android/releases
Great work! I've used it for Android support in DlangUI http://forum.dlang.org/post/cdekkumjynhqoxvmgjze forum.dlang.org
Apr 21 2016