diff options
author | Emery Hemingway <ehmry@posteo.net> | 2019-01-29 15:08:43 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-01-29 15:08:43 +0100 |
commit | 15422a3e5a24d6c10d1f713cff7e04289bf7a232 (patch) | |
tree | ee5250344ef3adb8453a15753fea0f27c1beb524 | |
parent | 07a0a61875f4f5c7ac74acfd0c7dd4e4eb333dce (diff) | |
download | Nim-15422a3e5a24d6c10d1f713cff7e04289bf7a232.tar.gz |
Genode fixes (#10491)
Readline pasthru, add linker to config, do not pass -lm to linker.
-rw-r--r-- | config/nim.cfg | 5 | ||||
-rw-r--r-- | lib/impure/rdstdin.nim | 9 | ||||
-rw-r--r-- | lib/pure/fenv.nim | 2 | ||||
-rw-r--r-- | lib/pure/math.nim | 2 |
4 files changed, 15 insertions, 3 deletions
diff --git a/config/nim.cfg b/config/nim.cfg index 2a118c5cf..c3e0823b6 100644 --- a/config/nim.cfg +++ b/config/nim.cfg @@ -290,13 +290,16 @@ tcc.options.always = "-w" # Configuration for the Genode toolchain @if genode: + noCppExceptions # avoid std C++ + tlsEmulation:on # no TLS segment register magic gcc.path = "/usr/local/genode-gcc/bin" - gcc.cpp.options.always = "-D__GENODE__ -fno-stack-protector" @if i386 or amd64: gcc.exe = "genode-x86-gcc" gcc.cpp.exe = "genode-x86-g++" + gcc.cpp.linkerexe = "genode-x86-ld" @elif arm: gcc.exe = "genode-arm-gcc" gcc.cpp.exe = "genode-arm-g++" + gcc.cpp.linkerexe = "genode-arm-ld" @end @end diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim index 54bab82f0..ac38addba 100644 --- a/lib/impure/rdstdin.nim +++ b/lib/impure/rdstdin.nim @@ -73,6 +73,15 @@ when defined(Windows): discard readConsoleInputW(hStdin, irInputRecord, 1, dwEventsRead) return result +elif defined(genode): + proc readLineFromStdin*(prompt: string): TaintedString {. + tags: [ReadIOEffect, WriteIOEffect].} = + stdin.readLine() + + proc readLineFromStdin*(prompt: string, line: var TaintedString): bool {. + tags: [ReadIOEffect, WriteIOEffect].} = + stdin.readLine(line) + else: import linenoise, termios diff --git a/lib/pure/fenv.nim b/lib/pure/fenv.nim index 0725973ca..ab47da08e 100644 --- a/lib/pure/fenv.nim +++ b/lib/pure/fenv.nim @@ -12,7 +12,7 @@ {.deadCodeElim: on.} # dce option deprecated -when defined(Posix): +when defined(Posix) and not defined(genode): {.passl: "-lm".} var diff --git a/lib/pure/math.nim b/lib/pure/math.nim index 460be1cd0..526ddbbb2 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -95,7 +95,7 @@ proc fac*(n: int): int = {.push checks:off, line_dir:off, stack_trace:off.} -when defined(Posix): +when defined(Posix) and not defined(genode): {.passl: "-lm".} const |