From 90b606b3da125af0b4645e20b2efb1f10e1c59c8 Mon Sep 17 00:00:00 2001 From: Simon Krauter Date: Sat, 15 Nov 2014 18:05:49 +0100 Subject: [PATCH 1/3] Fix issue #1660 https://github.com/Araq/Nimrod/issues/1660 --- compiler/jsgen.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 4772aecb5f..37eaa9fb73 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1669,7 +1669,8 @@ proc genHeader(): PRope = "/* (c) 2014 Andreas Rumpf */$n$n" & "$nvar Globals = this;$n" & "var framePtr = null;$n" & - "var excHandler = null;$n", + "var excHandler = null;$n" & + "var lastJSError = null;$n", [toRope(VersionAsString)]) proc genModule(p: PProc, n: PNode) = From 03d76c6d5e00d6a4f2b99ab51df7a8c4109dc1db Mon Sep 17 00:00:00 2001 From: Elie Zedeck Date: Sun, 16 Nov 2014 12:52:24 +0300 Subject: [PATCH 2/3] Added generic OpenWrt compilers for --cpu:mips --- config/nim.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/nim.cfg b/config/nim.cfg index 62fe3307eb..ef416323ab 100644 --- a/config/nim.cfg +++ b/config/nim.cfg @@ -13,6 +13,9 @@ cc = gcc arm.linux.gcc.exe = "arm-linux-gcc" arm.linux.gcc.linkerexe = "arm-linux-gcc" +mips.linux.gcc.exe = "mips-openwrt-linux-gcc" +mips.linux.gcc.linkerexe = "mips-openwrt-linux-gcc" + @if not nimfix: cs:partial @end From 04069bbe9d9cef3e0f5a8cc6eb80c5a900ec0b86 Mon Sep 17 00:00:00 2001 From: Elie Zedeck Date: Sun, 16 Nov 2014 12:53:43 +0300 Subject: [PATCH 3/3] Uses execve() in osproc on OpenWrt and uClibc-based platforms. --- lib/pure/osproc.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 2983712c82..bfdb0efeda 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -822,7 +822,11 @@ elif not defined(useNimRtl): environ = data.sysEnv discard execvp(data.sysCommand, data.sysArgs) else: - discard execvpe(data.sysCommand, data.sysArgs, data.sysEnv) + when defined(uClibc): + # uClibc environment (OpenWrt included) doesn't have the full execvpe + discard execve(data.sysCommand, data.sysArgs, data.sysEnv) + else: + discard execvpe(data.sysCommand, data.sysArgs, data.sysEnv) else: discard execve(data.sysCommand, data.sysArgs, data.sysEnv)