zezer3 / cmaked2

Automatically exported from code.google.com/p/cmaked2
0 stars 0 forks source link

mixed tests on windows 7 64bit failing #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.build nmake tests

What version of the product are you using? On what operating system?
DMD 2.053, VS2010, cmaked rev51

Please provide any additional information below.
Probably .d file is built as 64bit and .c as 32bit, but i'm not sure how to 
check it. Nevertheless link is recognizing one of modules as corrupted as you 
can see below. I don't really know how to fix this problem myself, because i 
don't know cmake well enough (no money for book :( ). Furthermore, had no 
previous problems with .obj, don't know how to check its format as well. If You 
need more information, just reply please. If you have no time to fix this 
yourself i'd be glad to hear any hints.

OPTLINK (R) for Win32  Release 8.00.12
Copyright (C) Digital Mars 1989-2010  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
CMakeFiles\app_5.dir\cfunc.obj Offset 00000H Record Type 004D
 Error 138: Module or Dictionary corrupt
--- errorlevel 1
NMAKE : fatal error U1077: 'C:\D\dmd2\windows\bin\dmd.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.

Original issue reported on code.google.com by alienbal...@gmail.com on 10 Jun 2011 at 4:48

GoogleCodeExporter commented 9 years ago
This will take me some time to reproduce since I don't have Visual Studio 
installed.  Does dmd 64-bit even work yet in Windows?

Original comment by kingshiz...@gmail.com on 11 Jun 2011 at 10:52

GoogleCodeExporter commented 9 years ago
I'm wrong. There was something wrong with generated modules since both files 
were 32-bit. They were proper PE files before, and today I've rebuilt tests 
again. Today none of them is recognized as PE file.

Original comment by s6...@pjwstk.edu.pl on 12 Jun 2011 at 9:55

GoogleCodeExporter commented 9 years ago
So it works?

Original comment by jens.k.mueller@gmail.com on 24 Nov 2011 at 8:18

GoogleCodeExporter commented 9 years ago
No, error is still on. I was just wrong in conclusion.
I'm sorry about this confusion. I was in hurry(i'm currently programming for 
linux, and this windows thing was out of curiosity), and now when you reminded 
me about it, i probably know what is going on here.
Firstly, I'm on windows x64 but i compile x86.
The problem is:
* microsoft compiler is using COFF .obj format
* DMD is compiling like DMC, to Intel OMF .obj format
- This two formats are generally incompatible (you can't expect CMakeD user 
will have necessary tools for this)
So... options are:
* compile both to OMF (compile .c file via DMC, or another non-microsoft 
compiler)
* ok, you can't compile D code to COFF, but you can use Digital Mars COFF2OMF 
(which is paid and closed source), OR another inventions like UNILINK

Going back to context of CMakeD... if user is willing to build static library, 
dmc is an option for C/C++ files, because it's shipped in one package with dmd.
If user doesn't care about static library, just build C module as shared one 
(.dll). He might care about compiler more, because if he chose MSVC generator, 
he probably would like to compile his C/C++ code with Microsoft compiler, and 
it's only possible when using shared lib.
I don't know other solutions (besides of implementing COFF to D compiler).

Original comment by alienbal...@gmail.com on 25 Nov 2011 at 1:53