Commit 5ce77d7d by Enkelmann Committed by Thomas Barabosch

Add dockcross for C++ x86 cross compilation. (#8)

* Add dockcross for C++ x86 cross compilation.

* Add dockcross containers for all cross compilation targets
parent a75cf88f
......@@ -215,4 +215,6 @@ test/run_real_world_samples.sh
src/cwe_checker.plugin
test/artificial_samples/dockcross*
.#*
#!/bin/bash
echo "Installing cross compiler for ARM architecture."
sudo apt install -y gcc-multilib-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo docker pull dockcross/linux-arm64
sudo docker run -rm dockcross/linux-arm64 > ./dockcross-linux-arm64
chmod +x ./dockcross-linux-arm64
echo "Installing cross compiler for MIPS architecture."
sudo apt install -y gcc-multilib-mips-linux-gnu g++-7-mips-linux-gnu
sudo docker pull dockcross/linux-mips
sudo docker run -rm dockcross/linux-mips > ./dockcross-linux-mips
chmod +x ./dockcross-linux-mips
echo "Installing cross compiler for PPC architecture."
sudo apt install -y gcc-multilib-powerpc-linux-gnu g++-7-powerpc-linux-gnu
sudo docker pull dockcross/linux-ppc64le
sudo docker run -rm dockcross/linux-ppc64le > ./dockcross-linux-ppc64le
chmod +x ./dockcross-linux-ppc64le
echo "Installing dockcross image for x86 C++ cross-compiler"
sudo docker pull dockcross/linux-x86
sudo docker run -rm dockcross/linux-x86 > ./dockcross-linux-x86
chmod +x ./dockcross-linux-x86
echo "Done."
CC_x64=gcc
CC_X86=gcc
CC_ARM=arm-linux-gnueabi-gcc-7
CC_MIPS=mips-linux-gnu-gcc-7
CC_PPC=powerpc-linux-gnu-gcc-7
CC_X86=./dockcross-linux-x86 gcc
CC_ARM=./dockcross-linux-arm64 arm-linux-gnueabi-gcc-7
CC_MIPS=./dockcross-linux-mips mips-linux-gnu-gcc-7
CC_PPC=./dockcross-linux-ppc64le powerpc-linux-gnu-gcc-7
CPP_x64=g++
CPP_X86=g++
CPP_ARM=arm-linux-gnueabi-g++-7
CPP_MIPS=mips-linux-gnu-g++-7
CPP_PPC=powerpc-linux-gnu-g++-7
CPP_X86=./dockcross-linux-x86 g++
CPP_ARM=./dockcross-linux-arm64 arm-linux-gnueabi-g++-7
CPP_MIPS=./dockcross-linux-mips mips-linux-gnu-g++-7
CPP_PPC=./dockcross-linux-ppc64le powerpc-linux-gnu-g++-7
CFLAGS_X64=-O0 -g -fno-stack-protector
CFLAGS_X86=-O0 -g -m32 -fno-stack-protector
......@@ -88,8 +88,7 @@ endef
define compile_all_cpp
$(shell mkdir -p "build")
$(call compile_x64_cpp,$(1))
# building fails
# (call compile_x86_cpp,$(1))
$(call compile_x86_cpp,$(1))
$(call compile_arm_cpp,$(1))
$(call compile_mips_cpp,$(1))
$(call compile_ppc_cpp,$(1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment