loader: fix 32-bit jwasm compilation
authorChristopher Degawa <ccom@randomderp.com>
Tue, 13 Jun 2023 12:57:19 +0000 (07:57 -0500)
committerCharles Giessen <46324611+charles-lunarg@users.noreply.github.com>
Thu, 15 Jun 2023 17:43:20 +0000 (11:43 -0600)
jwasm, and by extension uasm, requires setting a cpu model to at least
386 in order to set the model to flat.

References:
https://github.com/JWasm/JWasm/blob/7218960b65d69216693a655d928eb4c2fb6b505c/cpumodel.c#L330-L332
https://github.com/Terraspace/UASM/blob/bffb18461dd541479064990c3b2750ab50ae23e2/cpumodel.c#L326-L328

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
loader/CMakeLists.txt

index 30d40d54222216279d27475556e9050af1abf601..3b7cdda1d83cc058354c9ceba2b26a0f525a4c41 100644 (file)
@@ -125,7 +125,8 @@ if(WIN32)
                 if (COMPILER_VERSION_OUTPUT MATCHES "x86_64")
                     set(JWASM_FLAGS -win64)
                 else()
-                    set(JWASM_FLAGS -coff)
+                    # jwasm requires setting the cpu to at least 386 for setting a flat model
+                    set(JWASM_FLAGS -3 -coff)
                 endif()
             endif()
         endif()