unicorn-engine / unicorn

Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86)
http://www.unicorn-engine.org
GNU General Public License v2.0
7.58k stars 1.34k forks source link

MSVC native port #719

Closed ZakDanger closed 7 years ago

ZakDanger commented 7 years ago

I am opening this issue as a place to pose questions during the port of unicorn to MSVC.

ZakDanger commented 7 years ago

Wow well after much work I have the x86_x64-softmmu specific part of unicorn enigne building in msvc.

One thing that I still need to fix is the atomic operations. I haven't had experience with this before and from reading about it, it sounds like something that I could do incorrectly and then cause weird random bugs that are hard to track down. So I am hoping someone can help me implement these correctly:

1)

/* Compiler barrier */
#ifdef _MSC_VER
// TODO: fix me!!!
#define barrier()   //{ __asm volatile("" ::: "memory"); (void)0; }
#else
#define barrier()   ({ asm volatile("" ::: "memory"); (void)0; })
#endif

2)

#if defined __x86_64__
# ifdef _MSC_VER
// TODO: fix me!!!
# define smp_mb()    //{ __asm volatile("mfence" ::: "memory"); (void)0; }
# else
# define smp_mb()    ({ asm volatile("mfence" ::: "memory"); (void)0; })
# endif
#else
# ifdef _MSC_VER
// TODO: fix me!!!
# define smp_mb()    //{ __asm volatile("lock; addl $0,0(%esp) " ::: "memory"); (void)0; }
# else
# define smp_mb()    ({ asm volatile("lock; addl $0,0(%%esp) " ::: "memory"); (void)0; })
# endif
#endif
aquynh commented 7 years ago

We dont have SMP or multithread anywhere, so i believe you can safely ignore these atomic stuffs.

ZakDanger commented 7 years ago

Ok cool. I'll leave the "TODO" markers in place to help make it clear that they are not implemented.

Hopefully porting across the other target CPUs will be easier since common code will already be done and I have solutions worked out now for lots of the "gotchas".

aquynh commented 7 years ago

Fantastic! You can make pull req as soon as possible.

ZakDanger commented 7 years ago

Are 64bit versions of unicorn working? If so I will add builds for 32bit and 64bit.

aquynh commented 7 years ago

Yes, msys build works well for both 32bit & 64bit.

Nukem9 commented 7 years ago

@xorstream I think the MSVC MemoryBarrier(); or _ReadWriteBarrier(); intrinsics would be sufficient as they prevent cpu/compiler reordering. (If you want to replace it - I'm not familiar with gcc syntax)

https://msdn.microsoft.com/en-us/library/windows/desktop/ms684208(v=vs.85).aspx

ZakDanger commented 7 years ago

@Nukem9 Yes they are one of the ones I was reading about. I just wanted to be 100% sure they were the right ones and weren't too heavy handed also. It seems there are solutions that work but take much longer they they need to.

I would like for someone who is 100% sure to fill in those lines, or provide code for them so I can fill them in. If this person is you then please do so :)

aquynh commented 7 years ago

Unicorn is now single-thread, but not a concurrent program like original Qemu, so this really does not matter. i guess we can define all these atomic macros like (void)0.

ZakDanger commented 7 years ago

ok. still working on this. small progress update:

sample_x86.c is now running in native 64bit, although crashing near the end of it's tests. maybe timer related.

sample_x86.c in 32bit mode is crashing strangely before it manages to run any of the tests. i think due to function param handling as while debugging it looks like the first param is in eax instead of on the stack.

ZakDanger commented 7 years ago

I am thinking that once i have x86/x64 cpu working without issues i will submit a pull request so that ppl can have a look at the various changes i have had to make so far. Then based on whether they are horrified, or have any suggestions etc I will continue with the other cpu support.

aquynh commented 7 years ago

Good idea, cant wait!

ZakDanger commented 7 years ago

Are you sure it is single threaded? I notice uc.c : enable_emu_timer() starts a timeout thread.

aquynh commented 7 years ago

Yes that is the only place, and only when you emulate with timeout. But i dont think this needs memory barrier, like in original Qemu.

cseagle commented 7 years ago

This probably needs to be changed to SetTimer on windows and setitimer on Linux. OSX seems to lack useful timers.

On 1/19/2017 9:21 PM, xorstream wrote:

Are you sure it is single threaded? I notice uc.c : enable_emu_timer() starts a timeout thread.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/unicorn-engine/unicorn/issues/719#issuecomment-273980388, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVFWiqobk1Hu9jPspH7RN20RpVEbbZUks5rUERsgaJpZM4LkHBq.

ZakDanger commented 7 years ago

Ok 32bit and 64bit versions of sample_x86 are now working without crashing :) There was a double free bug in the existing win32 thread code.

aquynh commented 7 years ago

cool, can you send a separate pull req to fix that double free bug?

aquynh commented 7 years ago

we now have a new branch for this MSVC native port at https://github.com/unicorn-engine/unicorn/tree/msvc. so far only x86 is supported. please help to test it.

aquynh commented 7 years ago

i did some cleanup on platform.h. actually termios.h & strings.h are not needed at all.

aquynh commented 7 years ago

@stephengroat, do you think it is possible to add Visual Studio support to Appveyor?

stephengroat commented 7 years ago

yup, let me look into it. i've also been working on getting mingw-w64 ported over to os x in homebrew, so there should be an opportunity to have that build up pretty soon

aquynh commented 7 years ago

@xorstream, i opened the latest file msvc_native.sln in VS2015, then chose menu "Rebuild unicorn", and got 65 errors & 78 warnings. do you have the same issue?

ZakDanger commented 7 years ago

I get zero warnings or errors in VS2012 when I build all 3 projects in debug/release 32bit/64bit modes. So 12 builds in total and all are successful with 0 warnings or errors.

What kind of warnings and errors do you get?

On Sat, Jan 21, 2017 at 10:12 PM, Nguyen Anh Quynh <notifications@github.com

wrote:

@xorstream https://github.com/xorstream, i opened the latest file msvc_native.sln in VS2015, then chose menu "Rebuild unicorn", and got 65 errors & 78 warnings. do you have the same issue?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/unicorn-engine/unicorn/issues/719#issuecomment-274255204, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ9pvHnqW6a7BUuJDO6Qec2FjYkfHLHrks5rUegfgaJpZM4LkHBq .

ZakDanger commented 7 years ago

I just checked out the current "msvc" branch you added, ready to start on other cpus, and can confirm that still no warnings or errors.

========== Rebuild All: 12 succeeded, 0 failed, 0 skipped ==========
aquynh commented 7 years ago

here is the output i got.

1>------ Rebuild All started: Project: unicorn, Configuration: Debug x64 ------
1>  qapi-visit.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qapi-types.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>  uc.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  vl.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qemu-timer-common.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qemu-thread-win32.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qemu-error.c
1>  oslib-win32.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  module.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  host-utils.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  getauxval.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  error.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  cutils.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  crc32c.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  bitops.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  bitmap.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  aes.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  tcg-runtime.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  qom-qobject.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  object.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  Generating Code...
1>  Compiling...
1>  cpu.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  container.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>  qstring.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qlist.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qint.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qfloat.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qerror.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qdict.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qbool.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qemu-timer.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qemu-log.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  string-input-visitor.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qmp-output-visitor.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qmp-input-visitor.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qapi-visit-core.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qapi-dealloc-visitor.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  qdev.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  machine.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  glib_compat.c
1>  accel.c
1>c:\users\me\documents\github\unicorn3.git\qemu\include\qemu\compiler.h(16): warning C4005: 'isinf': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(263): note: see previous definition of 'isinf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition
1>  c:\users\me\documents\github\unicorn3.git\include\unicorn\platform.h(202): note: see previous definition of 'snprintf'
1>c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error:  Macro definition of snprintf conflicts with Standard Library function declaration
1>  Generating Code...
1>  Compiling...
1>  list.c
1>  Generating Code...
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
ZakDanger commented 7 years ago

Ah not too bad, looks like only 2 issues really. MS started to actually support some C stuff from vs2013 onwards from what I read while porting this. I've made some changes, I'll push them now.

ZakDanger commented 7 years ago

Did u see the pr? It fails the build tests, but that appears to be unrelated.

aquynh commented 7 years ago

after you moved this under msvc/, build successed. there are still some warnings, though. below arethe output of Debug/Win32 & Release/X64

1>------ Rebuild All started: Project: x86_64-softmmu, Configuration: Debug Win32 ------
2>------ Skipped Rebuild All: Project: aarch64-softmmu, Configuration: Debug Win32 ------
2>Project not selected to build for this solution configuration 
3>------ Skipped Rebuild All: Project: arm-softmmu, Configuration: Debug Win32 ------
3>Project not selected to build for this solution configuration 
4>------ Skipped Rebuild All: Project: m68k-softmmu, Configuration: Debug Win32 ------
4>Project not selected to build for this solution configuration 
5>------ Skipped Rebuild All: Project: mips-softmmu, Configuration: Debug Win32 ------
5>Project not selected to build for this solution configuration 
6>------ Skipped Rebuild All: Project: mips64-softmmu, Configuration: Debug Win32 ------
6>Project not selected to build for this solution configuration 
7>------ Skipped Rebuild All: Project: mips64el-softmmu, Configuration: Debug Win32 ------
7>Project not selected to build for this solution configuration 
8>------ Skipped Rebuild All: Project: mipsel-softmmu, Configuration: Debug Win32 ------
8>Project not selected to build for this solution configuration 
9>------ Skipped Rebuild All: Project: sparc-softmmu, Configuration: Debug Win32 ------
9>Project not selected to build for this solution configuration 
10>------ Skipped Rebuild All: Project: sparc64-softmmu, Configuration: Debug Win32 ------
10>Project not selected to build for this solution configuration 
1>  translate-all.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  tcg.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  optimize.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  unicorn.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  translate.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  svm_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  smm_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  seg_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  misc_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  mem_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  int_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  fpu_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  excp_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cpu.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cc_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  arch_memory_mapping.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  memory_mapping.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  memory.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  ioport.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  Generating Code...
1>  Compiling...
1>  apic_common.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  apic.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  pc_piix.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  pc.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  softfloat.c
1>  exec.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cputlb.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cpus.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cpu-exec.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
1>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  Generating Code...
1>  x86_64-softmmu.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\Win32\Debug\x86_64-softmmu.lib
11>------ Rebuild All started: Project: unicorn, Configuration: Debug Win32 ------
11>  qapi-visit.c
11>  qapi-types.c
11>  uc.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  vl.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qemu-timer-common.c
11>  qemu-thread-win32.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qemu-error.c
11>  oslib-win32.c
11>c:\program files (x86)\microsoft sdks\windows\v7.1a\include\shlobj.h(1151): warning C4091: 'typedef ': ignored on left of 'tagGPFIDL_FLAGS' when no variable is declared
11>  module.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  host-utils.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  getauxval.c
11>  error.c
11>  cutils.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  crc32c.c
11>  bitops.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  bitmap.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  aes.c
11>  tcg-runtime.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qom-qobject.c
11>  object.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  Generating Code...
11>  Compiling...
11>  cpu.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  container.c
11>  qstring.c
11>  qlist.c
11>  qint.c
11>  qfloat.c
11>  qerror.c
11>  qdict.c
11>  qbool.c
11>  qemu-timer.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qemu-log.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  string-input-visitor.c
11>  qmp-output-visitor.c
11>  qmp-input-visitor.c
11>  qapi-visit-core.c
11>  qapi-dealloc-visitor.c
11>  qdev.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  machine.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  glib_compat.c
11>  accel.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(387): warning C4005: 'isnan': macro redefinition
11>  c:\program files (x86)\windows kits\10\include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  Generating Code...
11>  Compiling...
11>  list.c
11>  Generating Code...
11>  unicorn.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\Win32\Debug\unicorn.lib
12>------ Rebuild All started: Project: sample_x86, Configuration: Debug Win32 ------
12>  sample_x86.c
12>  sample_x86.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\Win32\Debug\sample_x86.exe
12>  sample_x86.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\Win32\Debug\sample_x86.pdb (Full PDB)
========== Rebuild All: 3 succeeded, 0 failed, 9 skipped ==========

Release/X64

1>------ Rebuild All started: Project: x86_64-softmmu, Configuration: Release x64 ------
2>------ Skipped Rebuild All: Project: aarch64-softmmu, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration 
3>------ Skipped Rebuild All: Project: arm-softmmu, Configuration: Release x64 ------
3>Project not selected to build for this solution configuration 
4>------ Skipped Rebuild All: Project: m68k-softmmu, Configuration: Release x64 ------
4>Project not selected to build for this solution configuration 
5>------ Skipped Rebuild All: Project: mips-softmmu, Configuration: Release x64 ------
5>Project not selected to build for this solution configuration 
6>------ Skipped Rebuild All: Project: mips64-softmmu, Configuration: Release x64 ------
6>Project not selected to build for this solution configuration 
7>------ Skipped Rebuild All: Project: mips64el-softmmu, Configuration: Release x64 ------
7>Project not selected to build for this solution configuration 
8>------ Skipped Rebuild All: Project: mipsel-softmmu, Configuration: Release x64 ------
8>Project not selected to build for this solution configuration 
9>------ Skipped Rebuild All: Project: sparc-softmmu, Configuration: Release x64 ------
9>Project not selected to build for this solution configuration 
10>------ Skipped Rebuild All: Project: sparc64-softmmu, Configuration: Release x64 ------
10>Project not selected to build for this solution configuration 
1>  cpu-exec.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cpus.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cputlb.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  exec.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  softfloat.c
1>  pc.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  pc_piix.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  apic.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  apic_common.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  ioport.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  memory.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  memory_mapping.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  arch_memory_mapping.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cc_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  cpu.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  excp_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  fpu_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  int_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  mem_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  Compiling...
1>  misc_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  seg_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  smm_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  svm_helper.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  translate.c
1>C:\Users\me\Documents\GitHub\unicorn6.git\qemu\include\qemu/host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  unicorn.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  optimize.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  tcg.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  translate-all.c
1>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
1>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
1>  x86_64-softmmu.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\x64\Release\x86_64-softmmu.lib
11>------ Rebuild All started: Project: unicorn, Configuration: Release x64 ------
11>  list.c
11>  accel.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  glib_compat.c
11>  machine.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qdev.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qapi-dealloc-visitor.c
11>  qapi-visit-core.c
11>  qmp-input-visitor.c
11>  qmp-output-visitor.c
11>  string-input-visitor.c
11>  qemu-log.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qemu-timer.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qbool.c
11>  qdict.c
11>  qerror.c
11>  qfloat.c
11>  qint.c
11>  qlist.c
11>  qstring.c
11>  container.c
11>  Compiling...
11>  cpu.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  object.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qom-qobject.c
11>  tcg-runtime.c
11>C:\Users\me\Documents\GitHub\unicorn6.git\qemu\include\qemu/host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  aes.c
11>  bitmap.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  bitops.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  crc32c.c
11>  cutils.c
11>C:\Users\me\Documents\GitHub\unicorn6.git\qemu\include\qemu/host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  error.c
11>  getauxval.c
11>  host-utils.c
11>C:\Users\me\Documents\GitHub\unicorn6.git\qemu\include\qemu/host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  module.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  oslib-win32.c
11>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\shlobj.h(1151): warning C4091: 'typedef ': ignored on left of 'tagGPFIDL_FLAGS' when no variable is declared
11>  qemu-error.c
11>  qemu-thread-win32.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qemu-timer-common.c
11>  vl.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  uc.c
11>c:\users\me\documents\github\unicorn6.git\qemu\include\qemu\host-utils.h(385): warning C4005: 'isnan': macro redefinition
11>  C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\math.h(264): note: see previous definition of 'isnan'
11>  qapi-types.c
11>  Compiling...
11>  qapi-visit.c
11>  unicorn.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\x64\Release\unicorn.lib
12>------ Rebuild All started: Project: sample_x86, Configuration: Release x64 ------
12>  sample_x86.c
12>  Generating code
12>  All 2937 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
12>  Finished generating code
12>  sample_x86.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\x64\Release\sample_x86.exe
12>  sample_x86.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\x64\Release\sample_x86.pdb (Full PDB)
========== Rebuild All: 3 succeeded, 0 failed, 9 skipped ==========
aquynh commented 7 years ago

it seems by default this only builds static lib. can we build both unicorn.dll & unicorn.lib at the same time?

another thing: the resulted binaries are put at different places, like msvc\win32\debug\ & msvc\x64\release. can we put them all under the same directory, such as msvc\bin\?

aquynh commented 7 years ago

at this moment, are we still missing support for all the archs, except x86?

aquynh commented 7 years ago

what is the oldest MSVC version are we supporting?

stephengroat commented 7 years ago

728 starts building the msvc folder as a separate appveyor build

ZakDanger commented 7 years ago

I have VS2012 here, so that's what I am doing the port using. Is a 5 year old version of MSVC old enough? hehe

I have issued a p.r. to fix the isnan() warning you pasted above.

ZakDanger commented 7 years ago

Yes only x86/x64 atm, tho mips support is almost done.

And yes atm this only builds a static lib, I will add building a dll too at some point during this port. We can move successfully built files somewhere, but need to decide on a naming convention for them all. There will be a dll+lib pair (for the dll) and just a lib by itself for the static lib. There will also be 32bit and 64bit versions of each. And do we want to bundle in only release versions, ie not debug versions?

There is also a question of how to include the runtime libs. You can either link the MS runtimes statically or dynamically. For my own projects I tend to prefer static linking since it's one less thing to worry about needing installed. Otherwise some end users may not have the correct MS runtimes installed and need to do so in order to use it. For this reason I am currently doing static linking of runtimes but this can be changed if someone has a good reason for it.

aquynh commented 7 years ago

yes, VS2012 is fine. we just need to document it somewhere this requirement.

yes, by default lets build Release versions only.

personally, i prefer MS runtime built in statically.

aquynh commented 7 years ago

what do you think about renaming msvc/msvc.sln to msvc/unicorn.sln?

ZakDanger commented 7 years ago

I have no issues with renaming the solution file. I tend to just name is the same as the directory it is inside of by default cos it makes it easy for me to find it. But during the move from binding to root i decluttered that dir so it'll be easy to find anything there now anyway.

I'll do this as part of the next pr.

ZakDanger commented 7 years ago

I plan to add the msvc version and build settings etc to the readme.txt file too once this is done. For now that file is a just kind of notes and stuff.

aquynh commented 7 years ago

i just cleaned up the code a bit.

you include "winsock2.h" in some places. why do we need that?

ZakDanger commented 7 years ago

Windows doesn't have the ability to sleep at the microsecond level. It can do millisecond sleeps only. Upon googling I found that the generic solution for this is to perform a sockets select() function with a microsecond timeout value.

From what Chris said it looks like in the future we will replace this timeout thread with OS based timeout functions, but for now I just used the select() "hack" to get the port working while changing as little else as possible. Once we add the timeout stuff instead of another thread the winsock stuff can be removed.

ZakDanger commented 7 years ago

@stephengroat can you please update the AppVeyor msvc build to use: C:\projects\unicorn/msvc/unicorn.sln instead of C:\projects\unicorn/msvc/msvc.sln

Thank you

stephengroat commented 7 years ago

already updated

On Sun, Jan 22, 2017 at 5:08 PM xorstream notifications@github.com wrote:

@stephengroat https://github.com/stephengroat can you please update the AppVeyor msvc build to use: C:\projects\unicorn/msvc/unicorn.sln instead of C:\projects\unicorn/msvc/msvc.sln

Thank you

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/unicorn-engine/unicorn/issues/719#issuecomment-274375735, or mute the thread https://github.com/notifications/unsubscribe-auth/ABGv4iQYXxz2bZXrqZCS2OOZUgbApOsbks5rU_2mgaJpZM4LkHBq .

aquynh commented 7 years ago

yes i just did it myself.

ZakDanger commented 7 years ago

ok, so it was just something in the yml file ehehe. feeling a bit dumb now.

I have started on the sparc port. I notice that the following files are present but don't appear to be used in the build process, is this done on purpose? unicorn\qemu\hw\sparc\sun4m.c unicorn\qemu\target-sparc\machine.c unicorn\qemu\target-sparc\gdbstub.c

aquynh commented 7 years ago

pull the latest code, i already removed some of them: https://github.com/unicorn-engine/unicorn/commit/0680b8592029c8a69d47477128151ff5455d0aee

ZakDanger commented 7 years ago

those files still exist in the latest codebase. but the makefile.objs files do not include them in the build process.

aquynh commented 7 years ago

you are right, i just pushed a commit to clean them.

aquynh commented 7 years ago

now with the m68k port, it fails to build on Win10+VS2015

1>------ Rebuild All started: Project: x86_64-softmmu, Configuration: Release x64 ------
2>------ Skipped Rebuild All: Project: aarch64-softmmu, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration 
3>------ Skipped Rebuild All: Project: arm-softmmu, Configuration: Release x64 ------
3>Project not selected to build for this solution configuration 
4>------ Skipped Rebuild All: Project: m68k-softmmu, Configuration: Release x64 ------
4>Project not selected to build for this solution configuration 
5>------ Skipped Rebuild All: Project: mips-softmmu, Configuration: Release x64 ------
5>Project not selected to build for this solution configuration 
6>------ Skipped Rebuild All: Project: mips64-softmmu, Configuration: Release x64 ------
6>Project not selected to build for this solution configuration 
7>------ Skipped Rebuild All: Project: mips64el-softmmu, Configuration: Release x64 ------
7>Project not selected to build for this solution configuration 
8>------ Skipped Rebuild All: Project: mipsel-softmmu, Configuration: Release x64 ------
8>Project not selected to build for this solution configuration 
9>------ Skipped Rebuild All: Project: sparc-softmmu, Configuration: Release x64 ------
9>Project not selected to build for this solution configuration 
10>------ Skipped Rebuild All: Project: sparc64-softmmu, Configuration: Release x64 ------
10>Project not selected to build for this solution configuration 
1>  cpu-exec.c
1>  cpus.c
1>  cputlb.c
1>  exec.c
1>  softfloat.c
1>  pc.c
1>  pc_piix.c
1>  apic.c
1>  apic_common.c
1>  ioport.c
1>  memory.c
1>  memory_mapping.c
1>  arch_memory_mapping.c
1>  cc_helper.c
1>  cpu.c
1>  excp_helper.c
1>  fpu_helper.c
1>  helper.c
1>  int_helper.c
1>  mem_helper.c
1>  Compiling...
1>  misc_helper.c
1>  seg_helper.c
1>  smm_helper.c
1>  svm_helper.c
1>  translate.c
1>  unicorn.c
1>  optimize.c
1>  tcg.c
1>  translate-all.c
1>  x86_64-softmmu.vcxproj -> C:\Users\me\Documents\GitHub\unicorn6.git\msvc\x64\Release\x86_64-softmmu.lib
11>------ Rebuild All started: Project: unicorn, Configuration: Release x64 ------
11>  list.c
11>  accel.c
11>  glib_compat.c
11>  machine.c
11>  qdev.c
11>  qapi-dealloc-visitor.c
11>  qapi-visit-core.c
11>  qmp-input-visitor.c
11>  qmp-output-visitor.c
11>  string-input-visitor.c
11>  qemu-log.c
11>  qemu-timer.c
11>  qbool.c
11>  qdict.c
11>  qerror.c
11>  qfloat.c
11>  qint.c
11>  qlist.c
11>  qstring.c
11>  container.c
11>  Compiling...
11>  cpu.c
11>  object.c
11>  qom-qobject.c
11>  tcg-runtime.c
11>  aes.c
11>  bitmap.c
11>  bitops.c
11>  crc32c.c
11>  cutils.c
11>  error.c
11>  getauxval.c
11>  host-utils.c
11>  module.c
11>  oslib-win32.c
11>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include\shlobj.h(1151): warning C4091: 'typedef ': ignored on left of 'tagGPFIDL_FLAGS' when no variable is declared
11>  qemu-error.c
11>  qemu-thread-win32.c
11>  qemu-timer-common.c
11>  vl.c
11>  uc.c
11>  qapi-types.c
11>  Compiling...
11>  qapi-visit.c
11>LINK : fatal error LNK1181: cannot open input file 'm68k-softmmu.lib'
12>------ Rebuild All started: Project: sample_x86, Configuration: Release x64 ------
13>------ Skipped Rebuild All: Project: sample_arm, Configuration: Release x64 ------
13>Project not selected to build for this solution configuration 
14>------ Skipped Rebuild All: Project: mem_apis, Configuration: Release x64 ------
14>Project not selected to build for this solution configuration 
15>------ Skipped Rebuild All: Project: sample_arm64, Configuration: Release x64 ------
15>Project not selected to build for this solution configuration 
16>------ Skipped Rebuild All: Project: sample_batch_reg, Configuration: Release x64 ------
16>Project not selected to build for this solution configuration 
17>------ Skipped Rebuild All: Project: sample_m68k, Configuration: Release x64 ------
17>Project not selected to build for this solution configuration 
18>------ Skipped Rebuild All: Project: sample_mips, Configuration: Release x64 ------
18>Project not selected to build for this solution configuration 
19>------ Skipped Rebuild All: Project: sample_sparc, Configuration: Release x64 ------
19>Project not selected to build for this solution configuration 
20>------ Skipped Rebuild All: Project: sample_x86_32_gdt_and_seg_regs, Configuration: Release x64 ------
20>Project not selected to build for this solution configuration 
21>------ Skipped Rebuild All: Project: shellcode, Configuration: Release x64 ------
21>Project not selected to build for this solution configuration 
12>  sample_x86.c
12>LINK : fatal error LNK1104: cannot open file 'unicorn.lib'
========== Rebuild All: 1 succeeded, 2 failed, 18 skipped ==========
ZakDanger commented 7 years ago

It looks like its a VS2015 issue. https://connect.microsoft.com/VisualStudio/feedback/details/976983

I have just added and pushed the suggested fix from that page.

aquynh commented 7 years ago

with that fix, i still get error.

1>------ Rebuild All started: Project: x86_64-softmmu, Configuration: Release x64 ------
2>------ Skipped Rebuild All: Project: aarch64-softmmu, Configuration: Release x64 ------
2>Project not selected to build for this solution configuration 
3>------ Skipped Rebuild All: Project: arm-softmmu, Configuration: Release x64 ------
3>Project not selected to build for this solution configuration 
4>------ Skipped Rebuild All: Project: m68k-softmmu, Configuration: Release x64 ------
4>Project not selected to build for this solution configuration 
5>------ Skipped Rebuild All: Project: mips-softmmu, Configuration: Release x64 ------
5>Project not selected to build for this solution configuration 
6>------ Skipped Rebuild All: Project: mips64-softmmu, Configuration: Release x64 ------
6>Project not selected to build for this solution configuration 
7>------ Skipped Rebuild All: Project: mips64el-softmmu, Configuration: Release x64 ------
7>Project not selected to build for this solution configuration 
8>------ Skipped Rebuild All: Project: mipsel-softmmu, Configuration: Release x64 ------
8>Project not selected to build for this solution configuration 
9>------ Skipped Rebuild All: Project: sparc-softmmu, Configuration: Release x64 ------
9>Project not selected to build for this solution configuration 
10>------ Skipped Rebuild All: Project: sparc64-softmmu, Configuration: Release x64 ------
10>Project not selected to build for this solution configuration 
1>  cpu-exec.c
1>  cpus.c
1>  cputlb.c
1>  exec.c
1>  softfloat.c
1>  pc.c
1>  pc_piix.c
1>  apic.c
1>  apic_common.c
1>  ioport.c
1>  memory.c
1>  memory_mapping.c
1>  arch_memory_mapping.c
1>  cc_helper.c
1>  cpu.c
1>  excp_helper.c
1>  fpu_helper.c
1>  helper.c
1>  int_helper.c
1>  mem_helper.c
1>  Compiling...
1>  misc_helper.c
1>  seg_helper.c
1>  smm_helper.c
1>  svm_helper.c
1>  translate.c
1>  unicorn.c
1>  optimize.c
1>  tcg.c
1>  translate-all.c
1>  x86_64-softmmu.vcxproj -> C:\Users\me\Documents\GitHub\unicorn7.git\msvc\x64\Release\x86_64-softmmu.lib
11>------ Rebuild All started: Project: unicorn, Configuration: Release x64 ------
11>  list.c
11>  accel.c
11>  glib_compat.c
11>  machine.c
11>  qdev.c
11>  qapi-dealloc-visitor.c
11>  qapi-visit-core.c
11>  qmp-input-visitor.c
11>  qmp-output-visitor.c
11>  string-input-visitor.c
11>  qemu-log.c
11>  qemu-timer.c
11>  qbool.c
11>  qdict.c
11>  qerror.c
11>  qfloat.c
11>  qint.c
11>  qlist.c
11>  qstring.c
11>  container.c
11>  Compiling...
11>  cpu.c
11>  object.c
11>  qom-qobject.c
11>  tcg-runtime.c
11>  aes.c
11>  bitmap.c
11>  bitops.c
11>  crc32c.c
11>  cutils.c
11>  error.c
11>  getauxval.c
11>  host-utils.c
11>  module.c
11>  oslib-win32.c
11>  qemu-error.c
11>  qemu-thread-win32.c
11>  qemu-timer-common.c
11>  vl.c
11>  uc.c
11>  qapi-types.c
11>  Compiling...
11>  qapi-visit.c
11>LINK : fatal error LNK1181: cannot open input file 'm68k-softmmu.lib'
12>------ Rebuild All started: Project: sample_x86, Configuration: Release x64 ------
13>------ Skipped Rebuild All: Project: sample_arm, Configuration: Release x64 ------
13>Project not selected to build for this solution configuration 
14>------ Skipped Rebuild All: Project: mem_apis, Configuration: Release x64 ------
14>Project not selected to build for this solution configuration 
15>------ Skipped Rebuild All: Project: sample_arm64, Configuration: Release x64 ------
15>Project not selected to build for this solution configuration 
16>------ Skipped Rebuild All: Project: sample_batch_reg, Configuration: Release x64 ------
16>Project not selected to build for this solution configuration 
17>------ Skipped Rebuild All: Project: sample_m68k, Configuration: Release x64 ------
17>Project not selected to build for this solution configuration 
18>------ Skipped Rebuild All: Project: sample_mips, Configuration: Release x64 ------
18>Project not selected to build for this solution configuration 
19>------ Skipped Rebuild All: Project: sample_sparc, Configuration: Release x64 ------
19>Project not selected to build for this solution configuration 
20>------ Skipped Rebuild All: Project: sample_x86_32_gdt_and_seg_regs, Configuration: Release x64 ------
20>Project not selected to build for this solution configuration 
21>------ Skipped Rebuild All: Project: shellcode, Configuration: Release x64 ------
21>Project not selected to build for this solution configuration 
12>  sample_x86.c
12>LINK : fatal error LNK1104: cannot open file 'unicorn.lib'
========== Rebuild All: 1 succeeded, 2 failed, 18 skipped ==========