www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Weird thing about building ldc under VS2013 x86

reply "Toby Chen" <tobychen912 gmail.com> writes:
Dear all,

I was trying to build the LDC from master(de75dc), the ldc2.exe 
built just fine (although the LLVMX86Utils.lib was not linked 
against firstly).

However, I could not get the runtime library to be built, in 
which there was a problem within 
${BUILD_ROOT_DIR}\import\core\stdc\math.d.

Here is a snippet form it:

version( DigitalMars )
{
     version( Win32 )
         version = DMC_RUNTIME;
     version( Win64 )
         version = MSVC_RUNTIME;
}

version( LDC )
{
     version( Win64 )
         version = MSVC_RUNTIME;
}

It seems like it intends not to specify the runtime library when 
compiling under Win32, which caused isnan(XXX); to be undefined.
I noticed that the wiki page explicitly points out that I have to 
have "Windows 7 x64, of course!". Is it intentional to prevent me 
from building under x86?
Sep 25 2014
next sibling parent reply "Kai Nacke" <kai redstar.de> writes:
Hi Toby!

On Friday, 26 September 2014 at 01:22:59 UTC, Toby Chen wrote:
 It seems like it intends not to specify the runtime library 
 when compiling under Win32, which caused isnan(XXX); to be 
 undefined.
 I noticed that the wiki page explicitly points out that I have 
 to have "Windows 7 x64, of course!". Is it intentional to 
 prevent me from building under x86?
LLVM does not support exception handling on Windows with MSVC runtime. Therefore nobody has tried to use LDC with x86 on Windows because a major feature is missing. If you like to work on the druntime/phobos issues I am happy to accept pull request. But if you need a working compiler you should resort to the MinGW version. Regards, Kai
Sep 25 2014
parent reply "Toby Chen" <tobychen912 gmail.com> writes:
On Friday, 26 September 2014 at 05:53:17 UTC, Kai Nacke wrote:
 Hi Toby!

 On Friday, 26 September 2014 at 01:22:59 UTC, Toby Chen wrote:
 It seems like it intends not to specify the runtime library 
 when compiling under Win32, which caused isnan(XXX); to be 
 undefined.
 I noticed that the wiki page explicitly points out that I have 
 to have "Windows 7 x64, of course!". Is it intentional to 
 prevent me from building under x86?
LLVM does not support exception handling on Windows with MSVC runtime. Therefore nobody has tried to use LDC with x86 on Windows because a major feature is missing. If you like to work on the druntime/phobos issues I am happy to accept pull request. But if you need a working compiler you should resort to the MinGW version. Regards, Kai
Hi Kay, Thank you for such a quick reply! I have successfully built those runtime libraries finally. However, some missing symbols were found when I was trying to compile helloworld. They seem like due to the missing functionality related to inline asm. I'll try to dig into it.
 OT: Why would you have to go with x86? Just curious.
Well, I don't have to. I just feel better with the BSD licensed llvm, and llvm works closer to windows ecosystem than gcc. I'm just trying it out.
Sep 26 2014
parent reply "Trass3r" <un known.com> writes:
 OT: Why would you have to go with x86? Just curious.
Well, I don't have to. I just feel better with the BSD licensed llvm, and llvm works closer to windows ecosystem than gcc. I'm just trying it out.
? I asked about 32 bit software, not llvm vs gcc.
Sep 26 2014
next sibling parent reply "kink" <noone nowhere.com> writes:
On Friday, 26 September 2014 at 16:47:37 UTC, Trass3r wrote:
 OT: Why would you have to go with x86? Just curious.
Well, I don't have to. I just feel better with the BSD licensed llvm, and llvm works closer to windows ecosystem than gcc. I'm just trying it out.
? I asked about 32 bit software, not llvm vs gcc.
That's what I thought. Using x64, LDC/druntime/Phobos all compile [only thing needed: "x86utils" in LDC's CMakeLists.txt, line 19]; druntime and Phobos even pass all unit tests (in debug at least, I haven't checked the release yet). I'm deeply impressed by the progress regarding MSVC x64 since last time I checked (approximately a year ago)!! Kudos to the LDC developers! Btw I've just created a Wiki account to update the MSVC page accordingly.
Sep 26 2014
next sibling parent reply "Trass3r" <un known.com> writes:
 druntime and Phobos even pass all unit tests (in debug at 
 least, I haven't checked the release yet).
 I'm deeply impressed by the progress regarding MSVC x64 since 
 last time I checked (approximately a year ago)!!
What? Many tests still failed the last time ran 'em cause of broken EH.
Sep 26 2014
parent reply "kink" <noone nowhere.com> writes:
On Friday, 26 September 2014 at 21:10:50 UTC, Trass3r wrote:
 What? Many tests still failed the last time ran 'em cause of 
 broken EH.
Yeah sorry, silly me expected to get some useful feedback on the console when building the unittest-projects via msbuild... as I got neither errors nor warnings, I jumped to way too optimistic conclusions. ;) A trivial program won't link. :/ I'll try to submit some pull requests.
Sep 26 2014
parent reply "Trass3r" <un known.com> writes:
 Yeah sorry, silly me expected to get some useful feedback on 
 the console when building the unittest-projects via msbuild...
If you want to run the tests use makefiles. Then some runtime modules like core.time should fail and almost everything in phobos cause of EH.
Sep 27 2014
parent reply "kink" <noone nowhere.com> writes:
 If you want to run the tests use makefiles.
Will do, thanks dude.
Sep 27 2014
parent "Trass3r" <un known.com> writes:
On Saturday, 27 September 2014 at 13:16:46 UTC, kink wrote:
 If you want to run the tests use makefiles.
Will do, thanks dude.
You're welcome. I tried getting the tests to run with the VS generator but no luck so far. And I don't want to waste more time on that.
Sep 27 2014
prev sibling parent reply "Kai Nacke" <kai redstar.de> writes:
On Friday, 26 September 2014 at 19:19:29 UTC, kink wrote:
 [only thing needed: "x86utils" in LDC's CMakeLists.txt, line 19]
This is fixed now. Regards, Kai
Sep 26 2014
parent "kink" <noone nowhere.com> writes:
 This is fixed now.
Thanks, very convenient. I've updated the Wiki page accordingly. I've also just created 2 issues incl. proposed patches. Fixing these 2 would allow for a painless first LDC experience with VS 2013: * compiling LLVM and LDC/druntime/Phobos successfully without any patches * getting a hello-world program correctly compiled and linked
Sep 27 2014
prev sibling parent "Toby Chen" <tobychen912 gmail.com> writes:
On Friday, 26 September 2014 at 16:47:37 UTC, Trass3r wrote:
 OT: Why would you have to go with x86? Just curious.
Well, I don't have to. I just feel better with the BSD licensed llvm, and llvm works closer to windows ecosystem than gcc. I'm just trying it out.
? I asked about 32 bit software, not llvm vs gcc.
Sorry for my misunderstanding. However, I said that I do not have to go with 32bit, and I'm not going to struggle with x86 vs x64 nor LLVM vs GCC vs MSVC. Just, as a compiler, the lack of x86 support could be fatal since x86 has not yet faded out of history.
Sep 26 2014
prev sibling parent "Trass3r" <un known.com> writes:
 I noticed that the wiki page explicitly points out that I have 
 to have "Windows 7 x64, of course!". Is it intentional to 
 prevent me from building under x86?
OT: Why would you have to go with x86? Just curious.
Sep 26 2014