From 03d76c6d5e00d6a4f2b99ab51df7a8c4109dc1db Mon Sep 17 00:00:00 2001 From: Elie Zedeck Date: Sun, 16 Nov 2014 12:52:24 +0300 Subject: [PATCH 1/2] 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 2/2] 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)