digitalmars.D - DMD + msvc
- Gor Gyolchanyan (5/5) Jun 16 2012 Is it possible to use the VC2010 linker with DMD? That would allow
- Jacob Carlborg (7/9) Jun 17 2012 No.
- Gor Gyolchanyan (6/16) Jun 17 2012 Thanks for the reply.
- Mehrdad (3/23) Jun 18 2012 Yeah, but do note that even if DMD _was_ compatible with the
- Kagamin (2/4) Jun 18 2012 Use GDC?
- Manu (13/18) Jun 18 2012 I use GDC now. It produces COFF objects, and is technically capable of
- Iain Buclaw (6/27) Jun 18 2012 DMD would be linking against it's own runtime on windows too, rather
- Sean Kelly (4/19) Jun 17 2012 What about GDC? Makes me wonder how hard it would be to add a cfront op...
- Manu (5/22) Jun 18 2012 I've been bugging Walter for this for months, and the word on the street...
- Walter Bright (2/5) Jun 18 2012 I intend to fix all of those, at least for 64 bit Windows, in the near t...
- Adam Wilson (21/27) Jun 18 2012 Does this somewhat vague statement meant that we are getting COFF suppor...
- Walter Bright (4/28) Jun 18 2012 Probably not, though it will be better.
- Trass3r (1/4) Jun 18 2012 Hooray!
- Jacob Carlborg (14/24) Jun 18 2012 A start is to have a rigorous set of tests for this part of the
- Trass3r (2/5) Jun 19 2012 Funnily enough, cppcheck shares your opinion on the backend: Interrupted...
- =?UTF-8?B?Ik1pY2hhw6ts?= Larouche" (7/13) Jun 18 2012 This is great news !
- Manu (4/17) Jun 18 2012 It really is. I suspect we will see a gigantic boots to the D community ...
- Kagamin (3/6) Jun 19 2012 KickAss would be a cool codename for new object file writing
- Jonathan M Davis (3/5) Jun 18 2012 Well, we could all use a good pair of shoes. ;)
- Rene Zwanenburg (15/21) Jun 19 2012 COFF and 64 bit support for windows are on the top of my wish
- Walter Bright (5/22) Jun 19 2012 Right. Frankly, I think the future is all 64 bits. That future is alread...
- Adam Wilson (11/40) Jun 19 2012 Is there any reason we the community could not do this work? You need to...
- Walter Bright (2/6) Jun 19 2012 No, there's no reason the community could not do it.
- Jacob Carlborg (8/14) Jun 21 2012 Now why isn't that on the dlang.org site in a road map or similar. Why
- Dmitry Olshansky (7/9) Jun 17 2012 You can do it with UniLink, as it's able to link OMF & COFF together.
Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries. -- Bye, Gor Gyolchanyan.
Jun 16 2012
On 2012-06-17 07:15, Gor Gyolchanyan wrote:Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries.No. 1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtime -- /Jacob Carlborg
Jun 17 2012
On Sun, Jun 17, 2012 at 2:34 PM, Jacob Carlborg <doob me.com> wrote:On 2012-06-17 07:15, Gor Gyolchanyan wrote:Thanks for the reply. This is so ridiculous and frustrating. -- Bye, Gor Gyolchanyan.Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries.No. 1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtime -- /Jacob Carlborg
Jun 17 2012
On Sunday, 17 June 2012 at 10:49:30 UTC, Gor Gyolchanyan wrote:On Sun, Jun 17, 2012 at 2:34 PM, Jacob Carlborg <doob me.com> wrote:Yeah, but do note that even if DMD _was_ compatible with the VC2010 linker, then that still wouldn't get you 64-bit code...On 2012-06-17 07:15, Gor Gyolchanyan wrote:Thanks for the reply. This is so ridiculous and frustrating.Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries.No. 1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtime -- /Jacob Carlborg
Jun 18 2012
On Sunday, 17 June 2012 at 10:49:30 UTC, Gor Gyolchanyan wrote:Thanks for the reply. This is so ridiculous and frustrating.Use GDC?
Jun 18 2012
On 18 June 2012 11:38, Kagamin <spam here.lot> wrote:On Sunday, 17 June 2012 at 10:49:30 UTC, Gor Gyolchanyan wrote:I use GDC now. It produces COFF objects, and is technically capable of linking against MSVC code, except the 2 compilers expect different runtimes. You have to be REALLY careful with your GDC code to make sure it doesn't produce implicit calls into the GNU runtime, otherwise you'll get link conflicts. You can afford some really standard runtime calls that are also present in the mscrt, and it'll just link to those instead of the gnu ones. I have successfully build small scale projects with GDC linking against MSVC code, but there's a long list of problems and gotchas... My current approach is to build D code into DLL's and dynamically link against my MSVC code, or vice-versa. Hopefully the new 64bit dmd comes soon :)Thanks for the reply. This is so ridiculous and frustrating.Use GDC?
Jun 18 2012
On 18 June 2012 16:08, Manu <turkeyman gmail.com> wrote:On 18 June 2012 11:38, Kagamin <spam here.lot> wrote:DMD would be linking against it's own runtime on windows too, rather than msvc runtime, iirc. So you may have similar problems there too. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';On Sunday, 17 June 2012 at 10:49:30 UTC, Gor Gyolchanyan wrote:I use GDC now. It produces COFF objects, and is technically capable of linking against MSVC code, except the 2 compilers expect different runtimes. You have to be REALLY careful with your GDC code to make sure it doesn't produce implicit calls into the GNU runtime, otherwise you'll get link conflicts. You can afford some really standard runtime calls that are also present in the mscrt, and it'll just link to those instead of the gnu ones. I have successfully build small scale projects with GDC linking against MSVC code, but there's a long list of problems and gotchas... My current approach is to build D code into DLL's and dynamically link against my MSVC code, or vice-versa. Hopefully the new 64bit dmd comes soon :)Thanks for the reply. This is so ridiculous and frustrating.Use GDC?
Jun 18 2012
On Jun 17, 2012, at 3:49 AM, Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> w= rote:On Sun, Jun 17, 2012 at 2:34 PM, Jacob Carlborg <doob me.com> wrote:What about GDC? Makes me wonder how hard it would be to add a cfront option= to DMD. I guess asm blocks make that a bit tricky though.=20=On 2012-06-17 07:15, Gor Gyolchanyan wrote:=20 Thanks for the reply. This is so ridiculous and frustrating.=20=20 Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries.=20 =20 No. =20 1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtime
Jun 17 2012
On 17 June 2012 13:49, Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> wrote:On Sun, Jun 17, 2012 at 2:34 PM, Jacob Carlborg <doob me.com> wrote:I've been bugging Walter for this for months, and the word on the street is that he's working on it now :) Intention is to support the MS linker and runtimes (which is what I need too).On 2012-06-17 07:15, Gor Gyolchanyan wrote:Thanks for the reply. This is so ridiculous and frustrating.Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries.No. 1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtime -- /Jacob Carlborg
Jun 18 2012
On 6/17/2012 3:34 AM, Jacob Carlborg wrote:1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.
Jun 18 2012
On Mon, 18 Jun 2012 10:50:44 -0700, Walter Bright <newshound2 digitalmars.com> wrote:On 6/17/2012 3:34 AM, Jacob Carlborg wrote:Does this somewhat vague statement meant that we are getting COFF support in the near term? Because if so, I have some serious plans for source embedding in custom sections. The only thing blocking it is the fact that OMF doesn't support custom sections. Once the source is embedded in libraries, we can finally jettison DI files once and for all! Also would it be possible at this point to clean up the backend such that we have a clean interface for interacting with object files during their construction, given that with COFF, all object format wills be roughly feature equal? Object generation is an unholy disaster of IFDEF's and my brain has melted every time I try to venture into it; but if we have a clean interface for interacting with them it would make it significantly easier to add things like custom sections, which in turn will open up a plethora of new options, including source embedding. -- Adam Wilson IRC: LightBender Project Coordinator The Horizon Project http://www.thehorizonproject.org/1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.
Jun 18 2012
On 6/18/2012 11:10 AM, Adam Wilson wrote:On Mon, 18 Jun 2012 10:50:44 -0700, Walter Bright <newshound2 digitalmars.com> wrote:Yes, because that is necessary for MSVC linker compatibility.On 6/17/2012 3:34 AM, Jacob Carlborg wrote:Does this somewhat vague statement meant that we are getting COFF support in the near term?1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.Because if so, I have some serious plans for source embedding in custom sections. The only thing blocking it is the fact that OMF doesn't support custom sections. Once the source is embedded in libraries, we can finally jettison DI files once and for all! Also would it be possible at this point to clean up the backend such that we have a clean interface for interacting with object files during their construction, given that with COFF, all object format wills be roughly feature equal?Probably not, though it will be better.Object generation is an unholy disaster of IFDEF's and my brain has melted every time I try to venture into it; but if we have a clean interface for interacting with them it would make it significantly easier to add things like custom sections, which in turn will open up a plethora of new options, including source embedding.Yeah, me too. But fixing that is not so easy.
Jun 18 2012
Hooray!Does this somewhat vague statement meant that we are getting COFF support in the near term?Yes, because that is necessary for MSVC linker compatibility.
Jun 18 2012
On 2012-06-19 01:22, Walter Bright wrote:On 6/18/2012 11:10 AM, Adam Wilson wrote:A start is to have a rigorous set of tests for this part of the compiler. I know the compiler has a test suite but I don't know how much of this particular code is covered. With a rigorous set of tests one will feel more comfortable in refactoring the code. Then it just some hard work that will probably take some time. The first thing would probably be to try to put everything platform specific in one place. Ideally there would only be one set of if-def's. If possible this can happen iteratively in several steps. When a function needs to be changed refactor it as well to make it more clean. Ideally we don't want to the new COFF backend to become a part of this mess. -- /Jacob CarlborgObject generation is an unholy disaster of IFDEF's and my brain has melted every time I try to venture into it; but if we have a clean interface for interacting with them it would make it significantly easier to add things like custom sections, which in turn will open up a plethora of new options, including source embedding.Yeah, me too. But fixing that is not so easy.
Jun 18 2012
Object generation is an unholy disaster of IFDEF's and my brain has melted every time I try to venture into itFunnily enough, cppcheck shares your opinion on the backend: Interrupted checking because of too many #ifdef configurations
Jun 19 2012
On Monday, 18 June 2012 at 17:51:39 UTC, Walter Bright wrote:On 6/17/2012 3:34 AM, Jacob Carlborg wrote:This is great news ! For one of my personal projects I wanted to use LLVM with D, after trying to convert the MSVC .lib to OMF format, linking with Win64GDC and MinGW LLVM (but I didn't include all LLVM libs), I gave up and I booted to my Mac partition where the object and the linker are the same for all.1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.
Jun 18 2012
On 18 June 2012 22:07, <michael.larouche gmail.com>" puremagic.com < "\"Micha=C3=ABl".Larouche"> wrote:On Monday, 18 June 2012 at 17:51:39 UTC, Walter Bright wrote:It really is. I suspect we will see a gigantic boots to the D community on the back of this change! :)On 6/17/2012 3:34 AM, Jacob Carlborg wrote:This is great news !1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.
Jun 18 2012
On Monday, 18 June 2012 at 20:23:31 UTC, Manu wrote:It really is. I suspect we will see a gigantic boots to the D community on the back of this change! :)KickAss would be a cool codename for new object file writing capability in the backend.
Jun 19 2012
On Monday, June 18, 2012 23:23:02 Manu wrote:It really is. I suspect we will see a gigantic boots to the D community on the back of this change! :)Well, we could all use a good pair of shoes. ;) - Jonathan M Davis
Jun 18 2012
On Monday, 18 June 2012 at 17:51:39 UTC, Walter Bright wrote:On 6/17/2012 3:34 AM, Jacob Carlborg wrote:COFF and 64 bit support for windows are on the top of my wish list for D, so this is great news! A few questions: What do you mean by 'at least for 64 bit windows'? No COFF support when targeting, or building on, 32 bit? 'in the near term': I know it's a hard question, but does that mean a few months, or more like a year? Perhaps we could look into writing a COFF linker in D to replace optlink, that way OMF support can be dropped completely. It'd be cool to have part of the toolchain written in D itself. It's not a high priority though, since the MS linker comes with the free Express editions of Visual Studio. Anyways, this is really exiting. It'll greatly ease use of C libraries on windows, even open-source ones, because most don't compile out-of-the-box with dmc.1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.
Jun 19 2012
On 6/19/2012 7:16 AM, Rene Zwanenburg wrote:On Monday, 18 June 2012 at 17:51:39 UTC, Walter Bright wrote:Right. Frankly, I think the future is all 64 bits. That future is already here on the Mac, where supporting 32 bits seems more and more of a backwater.On 6/17/2012 3:34 AM, Jacob Carlborg wrote:COFF and 64 bit support for windows are on the top of my wish list for D, so this is great news! A few questions: What do you mean by 'at least for 64 bit windows'? No COFF support when targeting, or building on, 32 bit?1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.'in the near term': I know it's a hard question, but does that mean a few months, or more like a year?On the order of months.Perhaps we could look into writing a COFF linker in D to replace optlink, that way OMF support can be dropped completely. It'd be cool to have part of the toolchain written in D itself.I'd love to do that, but I can't spare the month or so to do it.
Jun 19 2012
Walter Bright wrote:On 6/19/2012 7:16 AM, Rene Zwanenburg wrote:Is there any reason we the community could not do this work? You need to focus on the compiler. And with the ability to use the linkers available on each system, the need for this drops drastically. The primary use case would become portability and special case features. -- Adam Wilson IRC: LightBender Project Coordinator The Horizon Project http://www.thehorizonproject.org/On Monday, 18 June 2012 at 17:51:39 UTC, Walter Bright wrote:Right. Frankly, I think the future is all 64 bits. That future is already here on the Mac, where supporting 32 bits seems more and more of a backwater.On 6/17/2012 3:34 AM, Jacob Carlborg wrote:COFF and 64 bit support for windows are on the top of my wish list for D, so this is great news! A few questions: What do you mean by 'at least for 64 bit windows'? No COFF support when targeting, or building on, 32 bit?1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.'in the near term': I know it's a hard question, but does that mean a few months, or more like a year?On the order of months.Perhaps we could look into writing a COFF linker in D to replace optlink, that way OMF support can be dropped completely. It'd be cool to have part of the toolchain written in D itself.I'd love to do that, but I can't spare the month or so to do it.
Jun 19 2012
On 6/19/2012 11:33 AM, Adam Wilson wrote:Is there any reason we the community could not do this work? You need to focus on the compiler. And with the ability to use the linkers available on each system, the need for this drops drastically. The primary use case would become portability and special case features.No, there's no reason the community could not do it.
Jun 19 2012
On 2012-06-18 19:50, Walter Bright wrote:On 6/17/2012 3:34 AM, Jacob Carlborg wrote:Now why isn't that on the dlang.org site in a road map or similar. Why do we always need to dig deep in threads like this on the newsgroup to found this useful information. This is probably so important that we can have it on the front page. Something like "What's currently being worked on" and "Latest news". -- /Jacob Carlborg1. DMD can only output OMF binaries 2. DMD cannot output 64bit code for Windows 3. DMD is not compatible with the MSVC linker or runtimeI intend to fix all of those, at least for 64 bit Windows, in the near term.
Jun 21 2012
On 17.06.2012 9:15, Gor Gyolchanyan wrote:Is it possible to use the VC2010 linker with DMD? That would allow easily linking with COFF libraries and building 64 bit binaries.You can do it with UniLink, as it's able to link OMF & COFF together. The problem is that there is no 64 bit object file generator on Windows. Last time I've heard about it Walter & co investigated on which way to go w.r.t. 64bit toolchain on Windows. -- Dmitry Olshansky
Jun 17 2012