Advertisement
Guest User

Untitled

a guest
Jun 13th, 2015
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. To compile with Visual Studio 2013, I'm using Cygwin because this is where I have Autotools installed.
  2.  
  3. 1. navigate to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts
  4. 2. open either the x86 or x64 native tools command prompt depending on what you want to build
  5. 3. $ C:\cygwin64\Cygwin.bat
  6. 4. $ cd path/to/libffi
  7. 5. $ ./autogen.sh
  8.  
  9. Once inside Cygwin, to build the x86 architecture (if you launched the x86 prompt)
  10.  
  11. 6. $ mkdir build-x86
  12. 7. $ cd build-x86
  13. 8. $ ../configure CC=../msvcc.sh CXX=../msvcc.sh LD=link CPP="cl -nologo -EP" --build=i686-unknown-cygwin
  14.  
  15. Once inside Cygwin, to build the x86_64 architecture (if you launched the x64 prompt)
  16.  
  17. 6. $ mkdir build-x64
  18. 7. $ cd build-x64
  19. 8. $ ../configure CC="../msvcc.sh -m64" CXX="../msvcc.sh -m64" LD=link CPP="cl -nologo -EP" --build=i686-unknown-cygwin
  20. 9. $ rm include/ffitarget.h
  21. 10. $ cp ../src/x86/ffitarget.h include/
  22.  
  23. Finally,
  24.  
  25. 9. $ rm include/ffitarget.h
  26. 10. $ cp ../src/x86/ffitarget.h include/
  27. 11. comment out #define FFI_TARGET_HAS_COMPLEX_TYPE from include/ffitarget.h
  28. 12. make
  29.  
  30. Steps 9. and 10. are required because Visual Studio doesn't understand Cygwin's symlinks. And now you realize Windows platform with Visual Studio is really a second class citizen if msvcc.sh wasn't a strong enough hint ;)
  31.  
  32. If you reproduce this, on tag v3.2.1 you will build for the x86 architecture just fine while MASM bails out on win64.asm with error A2075 for the x86_64 architecture. To make the x86_64 architecture, I have to replace "jmp SHORT" with "jmp" in win64.asm lines 1026 and 1035.
  33.  
  34. You can reproduce these steps with Visual Studio 2012: just launch the appropriate command prompt before Cygwin and you'll face the C99 issues.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement