summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-07 19:14:14 +0100
committerAraq <rumpf_a@web.de>2015-02-08 13:38:04 +0100
commitf7f87a7709e40953be74ddd8924a8a77be7a2fa7 (patch)
tree8dc8f11bf187d0bdf453f9e7742e62a891fc5424
parent5f54ccf0bd8a4465c887ed80a453b4fb56568d3b (diff)
downloadNim-f7f87a7709e40953be74ddd8924a8a77be7a2fa7.tar.gz
merged #2083 manually
-rw-r--r--compiler/platform.nim2
-rw-r--r--config/nim.cfg14
-rw-r--r--lib/nimbase.h11
3 files changed, 25 insertions, 2 deletions
diff --git a/compiler/platform.nim b/compiler/platform.nim
index 8360a9dcc..a21e73248 100644
--- a/compiler/platform.nim
+++ b/compiler/platform.nim
@@ -138,7 +138,7 @@ const
       props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}),
      (name: "VxWorks", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
       objExt: ".o", newLine: "\x0A", pathSep: ";", dirSep: "\\",
-      scriptExt: ".sh", curDir: ".", exeExt: "", extSep: ".",
+      scriptExt: ".sh", curDir: ".", exeExt: ".vxe", extSep: ".",
       props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}),
      (name: "JS", parDir: "..", 
       dllFrmt: "lib$1.so", altDirSep: "/", 
diff --git a/config/nim.cfg b/config/nim.cfg
index e4ea43a59..8f5d7e8e7 100644
--- a/config/nim.cfg
+++ b/config/nim.cfg
@@ -112,6 +112,20 @@ hint[LineTooLong]=off
   gcc.cpp.options.always = "-w -fpermissive"
 @end
 
+# Configuration for the VxWorks
+# This has been tested with VxWorks 6.9 only
+@if vxworks:
+  # For now we only support compiling RTPs applications (i.e. no DKMs)
+  gcc.options.always = "-mrtp -fno-strict-aliasing -D_C99 -D_HAS_C9X -std=c99 -fasm -Wall -Wno-write-strings"
+  # The linker config must add the VxWorks common library for the selected
+  # processor which is usually found in:
+  # "$WIND_BASE/target/lib/usr/lib/PROCESSOR_FAMILY/PROCESSOR_TYPE/common",
+  # where PROCESSOR_FAMILY and PROCESSOR_TYPE are those supported by the VxWorks
+  # compiler (e.g. ppc/PPC32 or mips/MIPSI64, etc)
+  # For now we only support the PowerPC CPU
+  gcc.options.linker %= "-L $WIND_BASE/target/lib/usr/lib/ppc/PPC32/common -mrtp -fno-strict-aliasing -D_C99 -D_HAS_C9X -std=c99 -fasm -Wall -Wno-write-strings"
+@end
+
 gcc.options.speed = "-O3 -fno-strict-aliasing"
 gcc.options.size = "-Os"
 gcc.options.debug = "-g3 -O0"
diff --git a/lib/nimbase.h b/lib/nimbase.h
index b72e60ac2..50c7968ac 100644
--- a/lib/nimbase.h
+++ b/lib/nimbase.h
@@ -379,7 +379,7 @@ static inline void GCGuard (void *ptr) { asm volatile ("" :: "X" (ptr)); }
 #  define GC_GUARD
 #endif
 
-/* Test to see if nimrod and the C compiler agree on the size of a pointer.
+/* Test to see if Nim and the C compiler agree on the size of a pointer.
    On disagreement, your C compiler will say something like: 
    "error: 'assert_numbits' declared as an array with a negative size" */
 typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1];
@@ -390,3 +390,12 @@ typedef int assert_numbits[sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(
 #else
 #  define NIM_EXTERNC
 #endif
+
+/* ---------------- platform specific includes ----------------------- */
+
+/* VxWorks related includes */
+#if defined(__VXWORKS__)
+#  include <sys/types.h>
+#  include <types/vxWind.h>
+#  include <tool/gnu/toolMacros.h>
+#endif