-
Notifications
You must be signed in to change notification settings - Fork 1
Cross compilation
Adam Crain edited this page Dec 4, 2017
·
8 revisions
These instructions are for targeting the Moxa UC-8100 with the vendor supplied GCC 4.9 tool-chain.
> wget https://www.moxa.com/drivers/UC/UC-8100/arm-linux-gnueabihf_4.9_Build_amd64_16053113.zip
> unzip arm-linux-gnueabihf_4.9_Build_amd64_16053113.zip
> chmod +x arm-linux-gnueabihf_4.9_Build_amd64_16053113.sh
> sudo ./arm-linux-gnueabihf_4.9_Build_amd64_16053113.sh
Follow the on screen prompt to install the tool-chain to the default location.
Add the following line to the bottom of your ~/.bashrc
export PATH=$PATH:/usr/local/arm-linux-gnueabihf-4.9/usr/bin
> git clone https://github.com/jedisct1/libsodium.git
> git checkout 1.0.15
> cd libsodium
> ./autogen.sh
> ./configure --host=arm-linux-gnueabihf CFLAGS="--sysroot=/usr/local/arm-linux-gnueabihf-4.9" CXXFLAGS="--sysroot=/usr/local/arm-linux-gnueabihf-4.9" --prefix=/usr/local/arm-linux-gnueabihf-4.9/usr
> make
> sudo make install
> mkdir build-arm
> cd build-arm
> cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross/uc8100-gcc-4.9.cmake -DSTATIC_LIBS=ON
> make
This will create executables with all dependencies including libsodium statically linked.
> scp ssp21-proxy moxa@<ip-address>:~/