Support for MIPS architecture + small improvement to Linux cross-build script.

This commit is contained in:
LoRd_MuldeR 2022-05-21 17:21:09 +02:00
parent 3901bd6a1d
commit f6cd289725
Signed by: mulder
GPG Key ID: 2B5913365F57E03F
3 changed files with 14 additions and 5 deletions

View File

@ -1,11 +1,10 @@
#!/bin/bash
# sudo apt install crossbuild-essential-i386
# sudo apt install crossbuild-essential-arm64
# sudo apt install crossbuild-essential-{i386,armel,arm64,mips,mips64}
set -e
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
function mk_musl() {
local outdir="/usr/local/musl/${1}-linux-gnu"
local outdir="/usr/local/musl/${1}"
local build="musl-build-${1}"
rm -rf "${build}" && mkdir -p "${build}"
tar -xvf "musl-latest.tar.gz" --strip-components=1 -C "${build}"
@ -31,4 +30,7 @@ curl -vkf -o "musl-latest.tar.gz" "https://musl.libc.org/releases/musl-latest.ta
mk_musl x86_64
mk_musl i686 i686-linux-gnu
mk_musl arm arm-linux-gnueabi
mk_musl aarch64 aarch64-linux-gnu
mk_musl mips mips-linux-gnu
mk_musl mips64 mips64-linux-gnuabi64

View File

@ -58,6 +58,10 @@
# define CPU_ARCH "arm64"
#elif defined(__arm__) || defined(_M_ARM)
# define CPU_ARCH "arm"
#elif defined(__mips__) && defined(__mips64)
# define CPU_ARCH "mips64"
#elif defined(__mips__) || defined(__mips)
# define CPU_ARCH "mips"
#else
# error Unknown CPU architecture!
#endif

View File

@ -4,7 +4,7 @@ set -e
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
function mk_slunk() {
local command="make -B CC=/usr/local/musl/${1}-linux-gnu/bin/musl-gcc STATIC=1 STRIP=1 FLTO=1"
local command="make -B CC=/usr/local/musl/${1}/bin/musl-gcc STATIC=1 STRIP=1 FLTO=1"
if [ ! -z "${2}" ]; then
command="${command} ${2}"
fi
@ -16,8 +16,11 @@ rm -rf "out" && mkdir -p "out"
$BASH -x -c "make clean"
mk_slunk "x86_64" "MARCH=x86-64 MTUNE=nocona"
mk_slunk "i686" "MARCH=pentiumpro MTUNE=generic"
mk_slunk "x86_64" "MARCH=x86-64 MTUNE=nocona"
mk_slunk "arm"
mk_slunk "aarch64"
mk_slunk "mips"
mk_slunk "mips64"
printf "\033[1;32m\nBuild completed successfully.\033[0m\n\n"