summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2018-08-16 18:12:37 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-08-16 18:12:37 +0200
commit2da0341b4d6828479c5dc75a233b47732f53cf6c (patch)
tree525b358312f727da17dc631e0e2090041c46f8eb /compiler
parent87b2d2aad6a19ae0e2cafb7fcc8ac1502aed01fa (diff)
downloadNim-2da0341b4d6828479c5dc75a233b47732f53cf6c.tar.gz
Genode fixes (#8501)
* Genode fixes

- wrap strings in "Genode::Cstring" when logging
- define SIGABRT for Genode
- disable GCC -fstack-protector
- use log RPC for fatal messages
- add --os:genode build to appveyor
- define paramStr and paramCount

* Select fixups for Genode POSIX
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgexprs.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index dd1c72ab6..9ec034f67 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -982,7 +982,7 @@ proc genEcho(p: BProc, n: PNode) =
   # is threadsafe.
   internalAssert p.config, n.kind == nkBracket
   if p.config.target.targetOS == osGenode:
-    # bypass libc and print directly to the Genode LOG session
+    # echo directly to the Genode LOG session
     var args: Rope = nil
     var a: TLoc
     for it in n.sons:
@@ -990,8 +990,9 @@ proc genEcho(p: BProc, n: PNode) =
         add(args, ", \"\"")
       else:
         initLocExpr(p, it, a)
-        add(args, ropecg(p.module, ", #nimToCStringConv($1)", [rdLoc(a)]))
+        add(args, ropecg(p.module, ", Genode::Cstring($1->data, $1->len)", [rdLoc(a)]))
     p.module.includeHeader("<base/log.h>")
+    p.module.includeHeader("<util/string.h>")
     linefmt(p, cpsStmts, """Genode::log(""$1);$n""", args)
   else:
     if n.len == 0: