Ok, so here's the automated version of the 32-bit termux Nim bootstrap part
(also fixing the **64-bit kernel/32-bit userspace** scenario) that reproduces
the OP's error during the final link:
apt install clang
apt install git
apt install libandroid-glob && apt install libandroid-glob-dev
git clone --depth 1 https://github.com/nim-lang/Nim
cd Nim && git clone --depth 1 https://github.com/nim-lang/csources && cd
csources
sed -i 's/LINK_FLAGS="${LDFLAGS:-} "/LINK_FLAGS="-landroid-glob
${LDFLAGS:-} "/;s/`uname -m`/armv7/' build.sh
sed -i 's/bin\/sh/sh/' c_code/2_1/stdlib_osproc.c
sed -i 's/bin\/sh/sh/' c_code/2_2/stdlib_osproc.c
sh build.sh
cd .. && ./bin/nim -v
[Screenshot](https://s10.postimg.org/ua96b1bjd/Screenshot_2017-03-31-13-17-51.png)