=====Hardware - DreamPlug - Crosscompile - Notes======
FIXME: For safekeeping. Make this more tidy.
=====With crosstool-ng=====
=====crosstool-ng 1.23.0=====
# http://crosstool-ng.github.io/
./ct-ng arm-unknown-linux-gnueabi
./ct-ng menuconfig
# Set Operating System -> Linux kernel version to 3.2.87 (not clear if this is needed, have not yet tried without).
# Set C-library -> Minimum supported kernel version -> Specific kernel version to 2.6.9 (not clear if this is needed, have not yet tried without).
# Leave the rest on the default settings.
unset CPLUS_INCLUDE_PATH
./ct-ng build
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
./configure --host=arm-unknown-linux-gnueabi --prefix=/home/bas/x-tools/arm-unknown-linux-gnueabi
=====LMDB 0.9.22=====
# https://symas.com/lmdb/
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
vi Makefile
# Change:
-8<-----------------------------------------------------------------------
CC = arm-unknown-linux-gnueabi-gcc
AR = arm-unknown-linux-gnueabi-ar
prefix = /home/bas/x-tools/arm-unknown-linux-gnueabi
-8<-----------------------------------------------------------------------
make
make install
=====QDBM 1.8.78=====
# http://fallabs.com/qdbm/index.html
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
./configure --host=arm-unknown-linux-gnueabi --prefix=/home/bas/x-tools/arm-unknown-linux-gnueabi
# Open Makefile.
# Change "-minline-all-stringops" to "-finline-functions".
make
make install
-8<-----------------------------------------------------------------------
bash-4.3$ make
arm-unknown-linux-gnueabi-gcc -c -I. -I/home/bas/x-tools/arm-unknown-linux-gnueabi/include -I/home/bas/include -I/usr/local/include -D_XOPEN_SOURCE_EXTENDED=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__=1 -D_HPUX_SOURCE=1 -D_POSIX_MAPPED_FILES=1 -D_POSIX_SYNCHRONIZED_IO=1 -DPIC=1 -D_THREAD_SAFE=1 -D_REENTRANT=1 -DNDEBUG -Wall -pedantic -fPIC -fsigned-char -O3 -fomit-frame-pointer -fforce-addr -minline-all-stringops depot.c
arm-unknown-linux-gnueabi-gcc: error: unrecognized command line option '-minline-all-stringops'; did you mean '-finline-functions'?
Makefile:80: recipe for target 'depot.o' failed
make: *** [depot.o] Error 1
-8<-----------------------------------------------------------------------
=====OpenSSL 0.9.8g=====
# https://www.openssl.org/source/old/0.9.x/
# 0.9.8g matches the version of OpenSSL on a Dreamplug with Ubuntu 9.04 (jaunty).
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
vi Makefile
CC= arm-unknown-linux-gnueabi-gcc
make
cp *.a /home/bas/x-tools/arm-unknown-linux-gnueabi/lib/
mkdir /home/bas/x-tools/arm-unknown-linux-gnueabi/include/openssl/
cp include/openssl/* /home/bas/x-tools/arm-unknown-linux-gnueabi/include/openssl/
=====pcre-7.8=====
# https://sourceforge.net/projects/pcre/files/pcre/7.8/
# http://www.pcre.org/
# 7.8 matches the version of pcre on a Dreamplug with Ubuntu 9.04 (jaunty).
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
./configure --host=arm-unknown-linux-gnueabi --prefix=/home/bas/x-tools/arm-unknown-linux-gnueabi
make
make install
=====CFEngine 3.10.4=====
====Compile with LMDB=====
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
./configure --without-pam --host=arm-unknown-linux-gnueabi \
--with-lmdb=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--with-openssl=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--with-pcre=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--prefix=/home/bas/Downloads/CFengine/3.10.4/prefix/
mkdir /home/bas/Downloads/CFengine/3.10.4/prefix/
make
make install
bash-4.3$ file cf-upgrade/cf-upgrade
cf-upgrade/cf-upgrade: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, not stripped
cd /home/bas/Downloads/CFengine/3.10.4/prefix/
cp ~/x-tools/arm-unknown-linux-gnueabi/lib/liblmdb.so ../lib/
tar czvf ../cfengine-3.10.4-arm-unknown-linux-gnueabi.tar.gz .
====Recompile with QDBM instead of LMDB====
#To sidestep the following error on a Dreamplug with Ubuntu 9.04 (jaunty):
cd /root
mkdir cfengine
tar xzvf cfengine-3.10.4-arm-unknown-linux-gnueabi.tar.gz -C cfengine/
cd cfengine/bin
LD_LIBRARY_PATH=../lib/ ./cf-agent --version
./cf-agent: /lib/libpthread.so.0: version `GLIBC_2.12' not found (required by ../lib/liblmdb.so)
# libpthread.so is not available under /home/bas/x-tools/lib/ after creating a
# toolchain with crosstool-ng
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
./configure --without-pam --host=arm-unknown-linux-gnueabi \
--with-qdbm=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--with-openssl=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--with-pcre=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--prefix=/home/bas/Downloads/CFengine/3.10.4/prefix/
mkdir /home/bas/Downloads/CFengine/3.10.4/prefix/
cd /home/bas/Downloads/CFengine/3.10.4/prefix/
cp -d ~/x-tools/arm-unknown-linux-gnueabi/lib/libqdbm* ~/Downloads/CFengine/3.10.4/prefix/lib/
tar czvf ../cfengine-3.10.4-arm-unknown-linux-gnueabi.tar.gz .
# After this it shows the version on a Dreamplug with Ubuntu 9.04 (jaunty):
ln -s /lib/libpcre.so.3 /lib/libpcre.so.0
LD_LIBRARY_PATH=../lib/ ./cf-agent --version
CFEngine Core 3.10.4
=====Zabbix 3.4.10=====
# https://www.zabbix.com/download_sources
# https://www.zabbix.com/documentation/3.4/manual/installation/install
export PATH=/home/bas/x-tools/arm-unknown-linux-gnueabi/bin:$PATH
./configure --host=arm-unknown-linux-gnueabi \
--prefix=/home/bas/Downloads/Zabbix/prefix \
--with-libpcre=/home/bas/x-tools/arm-unknown-linux-gnueabi \
--enable-agent
mkdir /home/bas/Downloads/Zabbix/prefix
make install
cd /home/bas/Downloads/Zabbix/prefix/
tar czvf ../zabbix-3.4.10-arm-unknown-linux-gnueabi.tar.gz .
# On the Dreamplug
ln -s /usr/lib/libpcresposix.so.3.12.1 /usr/lib/libpcreposix.so.0
# Workaround against:
# ./zabbix_agentd: error while loading shared libraries: libpcreposix.so.0: cannot open shared object file: No such file or directory
# Followed by the following:
#./zabbix_agentd: /lib/libc.so.6: version `GLIBC_2.17' not found (required by ./zabbix_agentd)
# As the Dreamplug with Ubuntu 9.04 (jaunty) has libc.so.6 linked to libc-2.9.so
=====With EmbToolkit=====
[[https://www.embtoolkit.org/|EmbToolkit]]
https://www.embtoolkit.org/
bunzip2 -k embtoolkit-1.9.0.tar.bz2
tar xvf embtoolkit-1.9.0.tar
cd embtoolkit-1.9.0
make menuconfig
Target OS: Linux
Target architecture ->
Architecture -> ARM
ARM Endian -> Little endian
ARM ABI to use (eabi)
ARM Family: arm9e, ARMv5tej
ARM arm9e core in the target: arm926ej-s
Floating point type -> Soft floating point
Show old revisions of some packages: yes
Toolchain configuration ->
Cross Compiler environment ->
GCC series to use -> gcc-4.9.x
Version of gcc-4.9.x -> gcc-4.9.4
Support C++ -> yes
C++ standard library implementation (GCC libstc++)
Support Objective-C: no
Support Objective-C++: no
Support Fortran: no
C library to use ->
Choose which C library to use -> glibc
GLIBC version you wish -> glibc-2.17
Binutils ->
Version of binutils you wish -> binutils-2.26.1
Linux kernel headers
Linux kernel source -> Generic
Generic linux version to use -> linux-2.6.33.x
Linux v2.6.33.x series exact version to use -> linux-2.6.33.20
Use a linux mirror: no
Toolchain Addons - Debugging systems
None selected.
Target build options ->
Generated libraries/biniaries optimization -> Optimize for size
No other options selected here.
Embtoolkit build options and host tools ->
No changes here.
Build Linux kernel image: no
Build root filesystem: no
-8<-----------------------------------------------------------------------------------------
-2018-06-12 15:18:22-- ftp://ftp.embtoolkit.org/embtoolkit.org/packages-mirror/mpc-1.0.2.tar.gz
=> '/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/dl/mpc-1.0.2.tar.gz'
Resolving ftp.embtoolkit.org... 62.210.124.59
Connecting to ftp.embtoolkit.org|62.210.124.59|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /embtoolkit.org/packages-mirror ... done.
==> SIZE mpc-1.0.2.tar.gz ... done.
==> PORT ... done. ==> RETR mpc-1.0.2.tar.gz ...
No such file 'mpc-1.0.2.tar.gz'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ EmbToolkit ~~ ERROR: On mpc-1.0.2.tar.gz download!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
core/toolchain/toolchain.mk:66: recipe for target 'toolchain_install' failed
make: *** [toolchain_install] Error 1
-8<-----------------------------------------------------------------------------------------
cd dl
wget http://ftp.snt.utwente.nl/pub/software/gnu/mpc/mpc-1.0.2.tar.gz
cd ..
make
-8<-----------------------------------------------------------------------------------------
----------------------------------------------------------------------
Libraries have been installed in:
/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/generated/tools-arm-linux-arm926ej-s/arm-unknown-linux-gnueabi/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ EmbToolkit ~~ Building new arm-linux/arm926ej-s toolchain ADDONS - please wait...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ EmbToolkit ~~ Packaging new arm-linux/arm926ej-s toolchain - please wait...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ EmbToolkit ~~ New arm-linux/arm926ej-s toolchain successfully built!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ EmbToolkit ~~ Selected features built successfully...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~
| Toolchain |
~~~~~~~~~~~
EmbToolkit : v1.9.0
Architecture : ARM (arm926ej-s)
Floating Point : Soft
Linux kernel headers: linux-2.6.33.20
Binutils : binutils-2.26.1
GCC : gcc-4.9.4
C library : glibc-2.17
Toolchain location :
âââ generated
â ââ[ sysroot ] sysroot-arm-linux-arm926ej-s
â ââ[ xtools ] tools-arm-linux-arm926ej-s
âââ generated/toolchains
ââ[ tarball ] toolchain-arm-linux-gcc-4.9.4-glibc-2.17-arm926ej-s-sf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Embedded systems Toolkit |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We hope that EmbToolkit will be useful for your project !!!
We will be happy to know it at embtk-users@embtoolkit.org
Please report any bugs/suggestion at:
http://bugs.embtoolkit.org/projects/embtoolkit
You can also visit the project web site at:
http://www.embtoolkit.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-8<-----------------------------------------------------------------------------------------
bash-4.3$ pwd
/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0
bash-4.3$ ls -l
total 76
-rw-r--r-- 1 bas users 1169 Jun 5 2017 BSDmakefile
-rw-r--r-- 1 bas users 18092 Jun 5 2017 COPYING
-rw-r--r-- 1 bas users 3004 Jun 5 2017 Kconfig
-rw-r--r-- 1 bas users 2445 Jun 5 2017 Makefile
-rw-r--r-- 1 bas users 2162 Jun 5 2017 README
drwxr-xr-x 4 bas users 4096 Jun 12 15:15 build
drwxr-xr-x 6 bas users 4096 Jun 5 2017 core
drwxr-xr-x 2 bas users 4096 Jun 12 15:45 dl
drwxr-xr-x 6 bas users 4096 Jun 12 15:19 generated
lrwxrwxrwx 1 bas users 79 Jun 12 15:15 host-tools-arm926ej-s -> /home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/generated/host-tools-arm926ej-s
drwxr-xr-x 18 bas users 4096 Jun 5 2017 packages
drwxr-xr-x 4 bas users 4096 Jun 5 2017 scripts
drwxr-xr-x 7 bas users 4096 Jun 5 2017 src
lrwxrwxrwx 1 bas users 86 Jun 12 15:15 sysroot-arm-linux-arm926ej-s -> /home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/generated/sysroot-arm-linux-arm926ej-s
lrwxrwxrwx 1 bas users 84 Jun 12 15:15 tools-arm-linux-arm926ej-s -> /home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/generated/tools-arm-linux-arm926ej-s
=====pcre-7.8 en zabbix-agent 3.4.10=====
export PATH=/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/tools-arm-linux-arm926ej-s/bin:$PATH
cd ~/Downloads/pcre/pcre-7.8
./configure --host=arm-unknown-linux-gnueabi --prefix=/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/tools-arm-linux-arm926ej-s
make
make install
cd ~/Downloads/Zabbix/zabbix-3.4.10/
make clean
./configure --host=arm-unknown-linux-gnueabi \
--prefix=/home/bas/Downloads/Zabbix/prefix \
--with-libpcre=/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/tools-arm-linux-arm926ej-s \
--enable-static \
--enable-agent
make
make install
cd ~/Downloads/Zabbix/prefix/
tar czvf ../zabbix-3.4.10-arm-unknown-linux-gnueabi_glibc217_static.tar.gz .
====Python 2.7.17====
Source: [[https://python-mips.blogspot.com/|How to cross compile python for MIPS]]
// Compiled on Slackware64 14.2. //
export PATH=/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/tools-arm-linux-arm926ej-s/bin:$PATH
cd Downloads/Python
tar xzvf Python-2.7.17.tgz
cd Python-2.7.17
echo ac_cv_file__dev_ptmx=yes > config.site
echo ac_cv_file__dev_ptc=no >> config.site
./configure
make python Parser/pgen
mv python hostpython
mv Parser/pgen hostpgen
make distclean
./configure --host=arm-unknown-linux-gnueabi --build=x86_64-slackware-linux --target=x86_64-slackware-linux --prefix=/opt/python/ --disable-ipv6 CONFIG_SITE=config.site
make -j1 HOSTPYTHON=./hostpython \
HOSTPGEN=./hostpgen \
BLDSHARED="arm-unknown-linux-gnueabi-gcc -shared" \
CROSS_COMPILE_TARGET=yes \
CROSS_COMPILE=arm-unknown-linux-gnueabi- \
HOSTARCH=arm-unknown-linux-gnueabi \
BUILDARCH=x86_64-slackware-linux
su
export PATH=/home/bas/Downloads/EmbToolKit/embtoolkit-1.9.0/tools-arm-linux-arm926ej-s/bin:$PATH
make -j1 -i install HOSTPYTHON=./hostpython \
BLDSHARED="arm-unknown-linux-gnueabi-gcc -shared" \
CC=arm-unknown-linux-gnueabi-gcc \
CXX=arm-unknown-linux-gnueabi-g++ \
AR=arm-unknown-linux-gnueabi-ar \
RANLIB=arm-unknown-linux-gnueabi-ranlib \
CROSS_COMPILE_TARGET=yes \
CROSS_COMPILE=arm-unknown-linux-gnueabi-
tar czvf ../python-2.7.17-arm-unknown-linux-gnueabi.tar.gz /opt/python/
exit