[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] DO NOT INTEGRATE - FOR DISCUSSION ONLY Minimalistic headless x64 msvc2017 (#312)

Ben Coman notifications at github.com
Sat Dec 1 12:41:09 UTC 2018


bencoman commented on this pull request.



> @@ -2,6 +2,15 @@
 cmake_minimum_required(VERSION 3.1)
 project(OpenSmalltalkVM)
 
+# The following is temporary while understanding/debugging CMake build.
+message("START VARIABLES (A)")
+get_cmake_property(_variableNames VARIABLES)
+list (SORT _variableNames)
+foreach (_variableName ${_variableNames})
+    message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()
+message("END VARIABLES (A)")
+

Ignore lines 5-13, they were just adding verbosity for debugging

> @@ -77,7 +77,7 @@ static void printCrashDebugInformation(LPEXCEPTION_POINTERS exp);
 #define PROCESS_PER_MONITOR_DPI_AWARE 2
 #endif
 
-typedef HRESULT WINAPI (*SetProcessDpiAwarenessFunctionPointer) (int awareness);
+typedef HRESULT (WINAPI *SetProcessDpiAwarenessFunctionPointer) (int awareness);

I see this is already covered in #311

> @@ -530,6 +540,15 @@ endif()
 
 add_library(${VM_LIBRARY_NAME} ${VM_CORE_LIBRARY_TYPE} ${VM_SOURCES} ${VM_INTERNAL_PLUGIN_SOURCES})
 
+# The following is temporary while understanding/debugging CMake build.
+message("START VARIABLES (B)")
+get_cmake_property(_variableNames VARIABLES)
+list (SORT _variableNames)
+foreach (_variableName ${_variableNames})
+    message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()
+message("END VARIABLES (B)")
+

Ignore lines 543-551, they were just adding verbosity for debugging

> @@ -28,6 +28,7 @@
  */
 
 #define WIN32_LEAN_AND_MEAN
+#define BUILD_VM_CORE

Not required per Ronie's comment.  It was to work around an unknown symbol "_imp_osvm_main", which BUILD_OSVM_STATIC fixed already.

> @@ -114,7 +114,7 @@ size_t sqImageFileWrite(const void *ptr, size_t sz, size_t count, sqImageFile h)
 error "Not Win32!"
 #endif /* WIN32 */
 
-int ioSetCursorARGB(sqInt bitsIndex, sqInt w, sqInt h, sqInt x, sqInt y);
+sqInt ioSetCursorARGB(sqInt bitsIndex, sqInt w, sqInt h, sqInt x, sqInt y);

Required. Latest Cog branch minheadless/x64 had the same compile error. Including this change only let the build complete.

> @@ -115,7 +115,12 @@ void
 ioInitPlatformSpecific(void)
 {
     /* Setup the FPU */
-    _controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC);
+	/**** 2018.08.07.BenComan TODO, help required.
+	 **** x64 does not support _MCW_PC or _MCW_IC per https://msdn.microsoft.com/en-us/library/e9b52ceh.aspx
+	 ****/
+	//Original Line// _controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC | _MCW_PC | _MCW_IC); 
+	_controlfp(FPU_DEFAULT, _MCW_EM | _MCW_RC);
+

Required. I've included this per Ronie's comment. Fixes a runtime error.


> @@ -25,6 +25,7 @@
  *
  * Author: roniesalg at gmail.com
  */
+#define BUILD_VM_CORE

Not required per Ronie's comment.  It was to work around an unknown symbol "_imp_osvm_main", which BUILD_OSVM_STATIC fixed already.

> @@ -5,7 +5,7 @@
  * The plugin is misnamed.  It should be the AlienPlugin, but its history
  * dictates otherwise.
  */
-#if i386|i486|i586|i686
+#if i386|i486|i586|i686|_M_IX86

Not required. Already fixed by PR #311 using...
```#if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386)```

> @@ -8,7 +8,7 @@
 /* null if compiled on other than x86, to get around gnu make bugs or
  * misunderstandings on our part.
  */
-#if i386|i486|i586|i686
+#if i386|i486|i586|i686|_M_IX86

Not required. Already fixed by PR #311 using...
```#if defined(_M_I386) || defined(_X86_) || defined(i386) || defined(i486) || defined(i586) || defined(i686) || defined(__i386__) || defined(__386__) || defined(X86) || defined(I386)```

> @@ -38,6 +38,9 @@ extern
 #endif 
 struct VirtualMachine* interpreterProxy;
 
+#ifdef _MSC_VER
+# define alloca _alloca
+#endif

Required. Solves MSVC build error...
LNK2019 unresolved external symbol 'alloca' referenced in function callIA32IntegralReturn  -- File PharoVMCore.lib(xabicc.c.obj)

Visual Studio 2017" has no "alloca" only "_alloca"
   https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/312#pullrequestreview-180508863
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20181201/02f740a3/attachment.html>


More information about the Vm-dev mailing list