<div dir="ltr">Hello,<div><br></div><div>I am trying to compile ECL 16.1.2 under Android 6.0.1 in Termux environment (this has almost nothing to do with compiling for Android target --- just think of Termux as a GNU Linux implementation running on Android kernel). Termux is an Android application which provides GNU Linux environment, see here <a href="http://termux.com">http://termux.com</a></div><div><br></div><div>(After installing Termux do "apt update && apt upgrade -y" and also install a myriad of applications to turn it into proper Linux development workstation, e.g. I always install the following (plus a plethora of python modules but they are irrelevant for this discussion):</div><div><br></div><div><div>apt install autoconf automake bc binutils-dev bison bzip2 cboard clang-dev cmake coreutils ctags curl cvs diffutils dnsutils dos2unix dpkg-dev ecj elfutils-dev \</div><div>            elinks expect-dev fftw-dev ffmpeg-dev file-dev findutils flac flex-dev freetype-dev gawk-dev gcal gdb-dev git glib-dev glib-bin gnuchess gnuplot grep gzip htop iconv imagemagick-dev \</div><div>            lftp libandroid-glob-dev openssh libtool-dev libpng libpng-dev libtiff libtiff-dev libtiff-utils ltrace strace mc man-dev make-dev \</div><div>            lua-dev luarocks mlocate ncurses-dev ncurses-utils nmap patch p7zip php-dev pkg-config mpv procps python-dev qalc rsync sed tar taskwarrior tcl-dev termux-api \</div><div>            tesseract-dev tmate tracepath tree units unzip unrar vim wget zip linux-man-pages</div><div><br></div><div>but a smaller subset should be sufficient, e.g. surely one doesn't need gnuchess/cboard to compile ECL :)</div></div><div><br></div><div>So, in order to configure ECL 16.1.2 I did the following after unpacking the sources:</div><div><br></div><div>1. $ export CONFIG_SHELL = $SHELL</div><div><br></div><div>2. Fix all configure and config.guess scripts to not use #!/bin/sh because under Termux the shell is $PREFIX/bin/bash (and /bin is not accessible):</div><div><br></div><div>$ find -name 'configure' -exec termux-fix-shebang {} \;</div><div>$ find -name 'config.guess' -exec termux-fix-shebang {} \;<br></div><div><br></div><div>3. $ ./configure --prefix=$PREFIX/local</div><div><br></div><div>This succeeds. And so I go on to</div><div><br></div><div>4. $ make</div><div><br></div><div>(this fails but due to a trivial thing --- some Makefiles contain hardcoded "/bin/sh" references --- so I fix all these to refer to the proper location of bash in Termux)</div><div><br></div><div>5. Re-run make after all these changes and it fails here:</div><div><br></div><div><div>$ make</div><div>cd build; make</div><div>make[1]: Entering directory '/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build'</div><div>if (echo c gc libffi atomic | grep gmp); then \</div><div>  cd gmp && make install && \</div><div>  cd .. && mv include/gmp.h ecl/ && rmdir include &&  \</div><div>  mv ./libgmp.a ./libeclgmp.a; \</div><div>fi</div><div>test -d ecl/gc || mkdir ecl/gc</div><div>test -d ecl/gc/private || mkdir ecl/gc/private</div><div>if (echo c gc libffi atomic | grep gc); then \</div><div>  cd gc && make install && cd .. && \</div><div>  cp -rf /data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/include/private/*.h ecl/gc/private/ && \</div><div>  mv libgc.a libeclgc.a; \</div><div>fi</div><div>c gc libffi atomic</div><div>make[2]: Entering directory '/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build/gc'</div><div>make[3]: Entering directory '/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build/gc'</div><div>depbase=`echo dyn_load.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\</div><div>/data/data/com.termux/files/usr/bin/bash ./libtool  --tag=CC   --mode=compile gcc -fPIC -DHAVE_CONFIG_H   -I./include -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/include -I./libatomic_ops/src -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/libatomic_ops/src -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build/ecl -fexceptions -Wall -Wextra -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -D_THREAD_SAFE -fno-strict-aliasing -MT dyn_load.lo -MD -MP -MF $depbase.Tpo -c -o dyn_load.lo /data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/dyn_load.c &&\</div><div>mv -f $depbase.Tpo $depbase.Plo</div><div>libtool: compile:  gcc -fPIC -DHAVE_CONFIG_H -I./include -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/include -I./libatomic_ops/src -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/libatomic_ops/src -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build/ecl -fexceptions -Wall -Wextra -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -D_THREAD_SAFE -fno-strict-aliasing -MT dyn_load.lo -MD -MP -MF .deps/dyn_load.Tpo -c /data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/dyn_load.c -o dyn_load.o</div><div>/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/dyn_load.c:116:14: error: redefinition of 'link_map'</div><div>      struct link_map {</div><div>             ^</div><div>/data/data/com.termux/files/usr/include/link.h:57:8: note: previous definition is here</div><div>struct link_map {</div><div>       ^</div><div>/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/bdwgc/dyn_load.c:123:14: error: redefinition of 'r_debug'</div><div>      struct r_debug {</div><div>             ^</div><div>/data/data/com.termux/files/usr/include/link.h:66:8: note: previous definition is here</div><div>struct r_debug {</div><div>       ^</div><div>2 errors generated.</div><div>make[3]: *** [Makefile:1527: dyn_load.lo] Error 1</div><div>make[3]: Leaving directory '/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build/gc'</div><div>make[2]: *** [Makefile:1710: install-recursive] Error 1</div><div>make[2]: Leaving directory '/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build/gc'</div><div>make[1]: *** [Makefile:123: libeclgc.a] Error 2</div><div>make[1]: Leaving directory '/data/data/com.termux/files/home/Maxima/ecl-16.1.2/build'</div><div>make: *** [Makefile:70: all] Error 2</div></div><div><br></div><div>So, then I check that those two definitions (link_map and r_debug) in dyn_load.c are compatible with the system ones in link.h and comment them out. Then I restart make and it goes on successfully for quite a while until failing here:</div><div><br></div><div><div>libtool: compile:  gcc -fPIC -DHAVE_CONFIG_H -I. -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi -I. -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi/include -Iinclude -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi/src -I. -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi/include -Iinclude -I/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi/src -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2 -fPIC -D_THREAD_SAFE -MT src/arm/sysv.lo -MD -MP -MF src/arm/.deps/sysv.Tpo -c /data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi/src/arm/sysv.S -o src/arm/sysv.o</div><div>/data/data/com.termux/files/home/Maxima/ecl-16.1.2/src/libffi/src/arm/sysv.S:399:2: error: invalid instruction</div><div> stmeqia r2, {r0, r1}</div></div><div><br></div><div>And this is where I get stuck because I don't know ARM instruction set. I am a Linux kernel developer (or was, many years ago) and know C and a bit of asm for x86 architecture, but not ARM.</div><div><br></div><div>Any ideas?</div><div><br></div><div>Btw, the reason I am trying to compile ECL for Termux is because the next step would be to compile Maxima. I know that there is already Maxima for Android but it is a GUI version and so not very convenient for the real work. Real scientific work with Maxima can only be done in a text-based terminal version (and plotting is irrelevant as it is much more convenient to be done with python's matplotlib anyway which works perfectly under Termux).</div><div><br></div><div>Kind regards,</div><div>Tigran</div></div>