Skip to content

Commit

Permalink
Genode fixes
Browse files Browse the repository at this point in the history
Readline pasthru, Add linker to config, do not pass -lm to linker.
  • Loading branch information
ehmry committed Feb 27, 2019
1 parent b6d96ca commit 8bd7336
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
5 changes: 4 additions & 1 deletion config/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,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
9 changes: 9 additions & 0 deletions lib/impure/rdstdin.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/pure/fenv.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

{.deadCodeElim: on.} # dce option deprecated

when defined(Posix):
when defined(Posix) and not defined(genode):
{.passl: "-lm".}

var
Expand Down
2 changes: 1 addition & 1 deletion lib/pure/math.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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
Expand Down

0 comments on commit 8bd7336

Please sign in to comment.