From: Feng Z. <fz...@fi...> - 2011-07-22 18:05:51
|
Hi, I rerun ./configure and get this output: checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for a BSD-compatible install... /usr/bin/install -c checking build system type... i686-pc-cygwin checking host system type... i686-pc-cygwin checking target system type... i686-pc-cygwin checking for msvc cl.exe (optional)... found checking ocaml version is at least 3.08... version is 3.12.0, ok checking existence of related ocaml tools... ok checking for Perl... found version 5.010001, port cygwin checking for known cygwin Perl bug in File::Spec... no bug found checking if performance counters are usable... ok (3165.138 cycles per us) checking for gcc version... checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for __builtin_va_list... yes checking if __thread is a keyword... true checking if gcc adds underscores to assembly labels.... true checking for ANSI C header files... (cached) yes checking for stdlib.h... (cached) yes checking for strings.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking stdbool.h usability... yes checking stdbool.h presence... yes checking for stdbool.h... yes checking for an ANSI C-conforming const... yes checking for inline... inline checking whether time.h and sys/time.h may both be included... yes checking for working memcmp... yes checking for mkdir... yes checking for select... yes checking for socket... yes checking for __sysv_signal... no checking for real definition of size_t... unsigned int checking for real definition of wchar_t... unsigned short configuring for Cygwin on win32/x86 checking obj/x86_WIN32 and related files... done checking whether to use CIL feature blockinggraph... no checking whether to use CIL feature zrapp... no checking whether to use CIL feature llvm... no configure: creating ./config.status config.status: creating Makefile config.status: creating META config.status: creating cil.spec config.status: creating config.mk config.status: creating bin/cilly.bat config.status: creating bin/patcher.bat config.status: creating bin/CilConfig.pm config.status: creating doc/index.html config.status: creating doc/header.html config.status: creating ocamlutil/perfcount.c config.status: creating test/llvm/Makefile config.status: creating src/machdep-ml.c config.status: creating config.h config.status: config.h is unchanged CIL configuration: architecture/OS: ARCHOS x86_WIN32 source tree root: CILHOME /cygdrive/e/cil (optional) cl.exe found: HAS_MSVC yes gcc to use CC E:/cygwin/bin/gcc default compiler DEFAULT_COMPILER _GNUCC CIL version CIL_VERSION 1.3.7 CIL features CIL_FEATURES Extra source directories EXTRASRCDIRS Cycles per microsecond CYCLES_PER_USEC 3165.138 I wrote test.c as follows: int main() { printf("Sizeof(int)=%d\n",sizeof(int)); return 0; } Then I use cilly to compile test.c, FengZhu@FengZhu-PC /cygdrive/e $cilly --mode=MSVC test.c and get this output: cl ./nologo /P /D_MSVC /DCIL=1 test.c test.c E:/cil/obj/x86_WIN32/cilly.asm.exe --out ./test.cil.c --MSVC ./test.i Warning: Will work in MSVC mode but will be using machine-dependent parameters for GCC since you do not have the MSVC compiler installed. cl /nologo /P /D_MSVC ./test.cil.c test.cil.c cl /nologo /D_MSVC /c /Fo./test.obj /Tc ./test.cil.i cl /nologo /D_MSVC /Fe./test.exe ./test.obj Then I run test.exe $./test.exe and get an output: Sizeof(int)=4 Thanks, Feng Zhu 2011/7/22 Gabriel Kerneis <ke...@pp...> > On Thu, Jul 21, 2011 at 06:41:53PM -0400, Feng Zhu wrote: > > To use cilly in MSVC mode, I: > > 1. set environment variables. > > 2. launch the Visual Studio Command Prompt (2010) > > 3. launch Cygwin in it > > 4. test cilly (cilly --mode=MSVC test.c) > > But I got a warning : > > > > Warning: Will work in MSVC mode but will be using machine-dependent > > parameters for GCC since you do not have the MSVC compiler installed. > > I do not use Windows but here is a quick hint: > ./configure compiles and executes a small piece of C code to get > machine-dependent values. Those values are then hard-coded in CIL (ie. > used to > generate an OCaml file which contains them). > > What most probably happens is that when you run ./configure, it does not > find > msvc and thus compiles the C code with gcc (which is probably part of your > toolchain anyway). > > I would advise you to re-run ./configure, looking carefully at the output > (maybe submitting it here). It might be a bug in CIL, for sure, so do not > hesitate to report on your findings or submit a patch :-) > > Best, > -- > Gabriel > |