Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/boards/odroidc1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ BOOTSOURCE='https://github.com/hardkernel/u-boot.git'
BOOTBRANCH='branch:odroidc-v2011.03'
BOOTPATCHDIR="legacy"
UBOOT_COMPILER="arm-linux-gnueabi-"
UBOOT_USE_GCC='< 4.9'
BOOTCONFIG="odroidc_config"
BOOTSCRIPT="boot-odroid-c1.ini:boot.ini"

Expand Down
3 changes: 0 additions & 3 deletions config/sources/amd64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ declare -g PARTITION_TYPE_UUID_ROOT="4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709" # "Li

declare -g MAIN_CMDLINE='' # we set it in common, it was not set before
declare -g KERNEL_COMPILER=' ' # hack: use single space for host gcc. won't work on arm64 hosts
declare -g KERNEL_USE_GCC=' ' # more hacks.
declare -g KERNEL_EXTRA_TARGETS='modules' # default is "modules dtb" but x86_64 has no DTB
declare -g KERNEL_BUILD_DTBS="no" # amd64 has no DTBs. that I know of.
declare -g UBOOT_USE_GCC='none' # required by configuration.sh
#declare -g INITRD_ARCH=amd64 # Used by u-boot for mkimage in initramfs. No u-boot for x86 yet.

# Defaults, if not set by board or family.
Expand All @@ -32,7 +30,6 @@ declare -g KERNEL_INSTALL_TYPE="${KERNEL_INSTALL_TYPE:-"install"}"
if [[ "$(uname -m)" == "aarch64" ]]; then
# Allow building amd64 on aarch64, but using system toolchain only
declare -g KERNEL_COMPILER="x86_64-linux-gnu-"
declare -g SKIP_EXTERNAL_TOOLCHAINS=yes
declare -g UBOOT_COMPILER='x86_64-linux-gnu-'
fi

Expand Down
8 changes: 2 additions & 6 deletions config/sources/arm64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,25 @@ declare -g NAME_INITRD="${NAME_INITRD:-"uInitrd"}"

[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="aarch64-linux-gnu-"
[[ -z $INITRD_ARCH ]] && INITRD_ARCH=arm64
[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0'

if [ "$(uname -m)" = "aarch64" ]; then
[[ $ATF_COMPILE != "no" && -z $ATF_COMPILER ]] && ATF_COMPILER="aarch64-linux-gnu-"
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER="aarch64-linux-gnu-"
[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="aarch64-linux-gnu-"
[[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='> 8.0'
else
[[ $ATF_COMPILE != "no" && -z $ATF_COMPILER ]] && ATF_COMPILER="aarch64-none-linux-gnu-"
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER="aarch64-none-linux-gnu-"
[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="aarch64-linux-gnu-"
[[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='< 9.2'

export QEMU_CPU="cortex-a53"
fi

[[ $ATF_COMPILE != "no" && -z $ATFSOURCE ]] && ATFSOURCE='https://github.com/ARM-software/arm-trusted-firmware'
[[ $ATF_COMPILE != "no" && -z $ATFDIR ]] && ATFDIR='arm-trusted-firmware'
[[ $ATF_COMPILE != "no" && -z $ATFBRANCH ]] && ATFBRANCH='commit:af220ebbe467aa580e6b9ba554676f78ffec930f'
[[ $ATF_COMPILE != "no" && -z $ATF_USE_GCC ]] && ATF_USE_GCC='> 8.0'

# System toolchains don't have the -none- variant, remove it
[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}"
[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && ATF_COMPILER="${ATF_COMPILER//-none-/-}"
UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}"
ATF_COMPILER="${ATF_COMPILER//-none-/-}"

true # make sure to exit with 0 status; this protects against shortcircuits etc above.
7 changes: 2 additions & 5 deletions config/sources/armhf.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@ declare -g NAME_KERNEL="${NAME_KERNEL:-"zImage"}"
declare -g NAME_INITRD="${NAME_INITRD:-"uInitrd"}"

[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER='arm-linux-gnueabihf-'
[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0'

if [ "$(uname -m)" = "aarch64" ]; then
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER='arm-linux-gnueabihf-'
[[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='> 8.0'
else
# > 9.2 https://armbian.atlassian.net/browse/AR-557
#[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER="arm-none-linux-gnueabihf-"
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER='arm-none-linux-gnueabihf-'
[[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='< 9.2'
fi

# System toolchains don't have the -none- variant, remove it
[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}"
[[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]] && ATF_COMPILER="${ATF_COMPILER//-none-/-}"
UBOOT_COMPILER="${UBOOT_COMPILER//-none-/-}"
ATF_COMPILER="${ATF_COMPILER//-none-/-}"

true # make sure to exit with 0 status; this protects against shortcircuits etc above.
1 change: 0 additions & 1 deletion config/sources/families/d1.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ BOOTPATCHDIR="u-boot-nezha"
UBOOT_TARGET_MAP=";;u-boot.img"

# Arm Trusted Firmware
declare -g ATF_USE_GCC="> 8.0"
declare -g ATF_COMPILER="riscv64-linux-gnu-"
declare -g ATFSOURCE="https://github.com/riscv-software-src/opensbi.git"
declare -g ATFDIR="opensbi"
Expand Down
1 change: 0 additions & 1 deletion config/sources/families/include/crust_firmware.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if [[ -n "${CRUSTCONFIG}" ]]; then
[[ -z $CRUSTSOURCE ]] && CRUSTSOURCE='https://github.com/crust-firmware/crust'
[[ -z $CRUSTDIR ]] && CRUSTDIR='crust-sunxi-mainline'
[[ -z $CRUSTBRANCH ]] && CRUSTBRANCH='tag:v0.6'
[[ -z $CRUST_USE_GCC ]] && CRUST_USE_GCC='> 9.1.0'
[[ -z $CRUST_COMPILER ]] && CRUST_COMPILER='or1k-elf-'

# Apply crust patches if crust is enabled
Expand Down
2 changes: 0 additions & 2 deletions config/sources/families/include/mvebu-helios4.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ case $BRANCH in
;spi;u-boot-with-spl.kwb:u-boot.flash
;uart;u-boot-with-spl.kwb:u-boot.uart"

UBOOT_USE_GCC='> 7.0'

OVERLAY_PREFIX='armada-388-helios4'
;;

Expand Down
2 changes: 0 additions & 2 deletions config/sources/families/include/rockchip64_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,8 @@ prepare_boot_configuration() {
ATF_COMPILER='aarch64-linux-gnu-'
ATFDIR='arm-trusted-firmware'
ATFBRANCH='tag:v2.13.0' # also adapt ATFPATCHDIR when changing this
ATF_USE_GCC='> 6.3'
ATFPATCHDIR='atf-rockchip64/v2.13' # there's also v2.14 patches ready
ATF_TARGET_MAP="M0_CROSS_COMPILE=arm-linux-gnueabi- PLAT=$BOOT_SOC bl31;;build/$BOOT_SOC/release/bl31/bl31.elf:bl31.elf"
ATF_TOOLCHAIN2="arm-linux-gnueabi-:< 10.0"

[[ $BOOT_SCENARIO == tpl-blob-atf-mainline ]] &&
UBOOT_TARGET_MAP="BL31=bl31.elf idbloader.img u-boot.itb;;idbloader.img u-boot.itb"
Expand Down
24 changes: 9 additions & 15 deletions config/sources/families/jethub.conf
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,15 @@ comment_default_rsyslog_rules() {

buildjethomecmds() {
local toolchain
# build aarch64 in amd64
if [[ $(dpkg --print-architecture) == amd64 ]]; then

toolchain=$(find_toolchain "$UBOOT_COMPILER" "$UBOOT_USE_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${UBOOT_COMPILER}gcc $UBOOT_USE_GCC"
fi

display_alert "Compiler version" "${UBOOT_COMPILER}gcc $(eval env PATH="${toolchain}:${PATH}" "${UBOOT_COMPILER}gcc" -dumpversion)" "info"
display_alert "Compiler version" "${UBOOT_COMPILER}gcc $(eval env "${UBOOT_COMPILER}gcc" -dumpversion)" "info"

local gpp="${UBOOT_COMPILER}g++"
local gpp_options="-Os -s -Wall -Wextra -std=c++17 -I$SRC/packages/bsp/jethub"
local gcc="${UBOOT_COMPILER}gcc"

run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/jethub_get_cmdline_key.cpp" -o "$destination/usr/bin/jethub_get_cmdline_key" || exit_with_error "Unable to compile jethub_get_cmdline_key.cpp"
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/jethub_get_cmdline_key_cpuid.cpp" -o "$destination/usr/bin/jethub_get_cpuid" || exit_with_error "Unable to compile jethub_get_cmdline_key_cpuid.cpp"
run_host_command_logged env "$gpp" $gpp_options "$SRC/packages/bsp/jethub/jethub_get_cmdline_key.cpp" -o "$destination/usr/bin/jethub_get_cmdline_key" || exit_with_error "Unable to compile jethub_get_cmdline_key.cpp"
run_host_command_logged env "$gpp" $gpp_options "$SRC/packages/bsp/jethub/jethub_get_cmdline_key_cpuid.cpp" -o "$destination/usr/bin/jethub_get_cpuid" || exit_with_error "Unable to compile jethub_get_cmdline_key_cpuid.cpp"

if [[ "$BOARD" == "jethubj80" ]]; then
# Bluetooth
Expand All @@ -165,15 +159,15 @@ buildjethomecmds() {
run_host_command_logged install -m 755 "$SRC/packages/bsp/jethub/$BOARD/bluetooth/jethub-rtk-hciattach-starter" "$destination/usr/lib/armbian/" || exit_with_error "Unable to install jethub-rtk-hciattach-starter"

# Board eth led setup
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gcc" "$SRC/packages/bsp/jethub/$BOARD/jethub_set_eth_leds.c" -o "$destination/usr/sbin/jethub_set-eth_leds" || exit_with_error "Unable to compile jethub_set_eth_leds.c"
run_host_command_logged "$gcc" "$SRC/packages/bsp/jethub/$BOARD/jethub_set_eth_leds.c" -o "$destination/usr/sbin/jethub_set-eth_leds" || exit_with_error "Unable to compile jethub_set_eth_leds.c"
# Board identifiers
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_raw_key.cpp" -o "$destination/usr/bin/jethub_get_efuse_raw_key" || exit_with_error "Unable to compile jethub_get_efuse_raw_key.cpp"
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_key_mac.cpp" -o "$destination/usr/bin/jethub_get_mac" || exit_with_error "Unable to compile jethub_get_efuse_key_mac.cpp"
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_key_serial.cpp" -o "$destination/usr/bin/jethub_get_serial" || exit_with_error "Unable to compile jethub_get_efuse_key_serial.cpp"
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_key_usid.cpp" -o "$destination/usr/bin/jethub_get_usid" || exit_with_error "Unable to compile jethub_get_efuse_key_usid.cpp"
run_host_command_logged "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_raw_key.cpp" -o "$destination/usr/bin/jethub_get_efuse_raw_key" || exit_with_error "Unable to compile jethub_get_efuse_raw_key.cpp"
run_host_command_logged "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_key_mac.cpp" -o "$destination/usr/bin/jethub_get_mac" || exit_with_error "Unable to compile jethub_get_efuse_key_mac.cpp"
run_host_command_logged "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_key_serial.cpp" -o "$destination/usr/bin/jethub_get_serial" || exit_with_error "Unable to compile jethub_get_efuse_key_serial.cpp"
run_host_command_logged "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_efuse_key_usid.cpp" -o "$destination/usr/bin/jethub_get_usid" || exit_with_error "Unable to compile jethub_get_efuse_key_usid.cpp"
elif [[ "$BOARD" == "jethubj100" ]]; then
# Board identifiers
run_host_command_logged env PATH="${toolchain}:${PATH}" "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_cmdline_key_mac.cpp" -o "$destination/usr/bin/jethub_get_mac" || exit_with_error "Unable to compile jethub_get_cmdline_key_mac.cpp"
run_host_command_logged "$gpp" $gpp_options "$SRC/packages/bsp/jethub/$BOARD/jethub_get_cmdline_key_mac.cpp" -o "$destination/usr/bin/jethub_get_mac" || exit_with_error "Unable to compile jethub_get_cmdline_key_mac.cpp"

# Wifi & Bluetooth
run_host_command_logged mkdir -pv --mode=755 "$destination/lib/firmware/" || exit_with_error "Unable to mkdir firmware"
Expand Down
7 changes: 1 addition & 6 deletions config/sources/families/mvebu64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,8 @@ declare -g OVERLAY_DIR="/boot/dtb/marvell/overlay"
declare -g ATFSOURCE='https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git'
declare -g ATFDIR='arm-trusted-firmware-espressobin'
declare -g ATFBRANCH='tag:lts-v2.12.8'
declare -g ATF_USE_GCC='> 7.2'

if [[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]]; then
ATF_COMPILER='aarch64-linux-gnu-'
else
ATF_COMPILER='aarch64-none-linux-gnu-'
fi
ATF_COMPILER='aarch64-linux-gnu-'
Comment thread
igorpecovnik marked this conversation as resolved.

if [[ $BOARD = macchiatobin-doubleshot ]]; then
export SCP_BL2=$SRC/cache/sources/marvell-binaries/mrvl_scp_bl2.img # ATTENTION! This is actually a required 'export', since it's picked up by ATF's make.
Expand Down
1 change: 0 additions & 1 deletion config/sources/families/spacemit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ declare -g LINUXFAMILY="spacemit"
declare -g GOVERNOR="performance"

# OpenSBI
declare -g ATF_USE_GCC="> 8.0"
declare -g ATF_COMPILER="riscv64-linux-gnu-"
declare -g ATFSOURCE="https://gitee.com/bianbu-linux/opensbi.git"
declare -g ATFDIR="opensbi"
Expand Down
1 change: 0 additions & 1 deletion config/sources/families/thead.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ BOOTBRANCH='branch:extlinux'
BOOTPATCHDIR="legacy"
UBOOT_TARGET_MAP=";;u-boot-with-spl.bin"
UBOOT_COMPILER="riscv64-linux-gnu-"
UBOOT_USE_GCC='< 8.0'
BOOTDIR='u-boot-thead'

LINUXFAMILY="thead"
Expand Down
1 change: 0 additions & 1 deletion config/sources/families/uefi-loong64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# https://github.com/armbian/build/
#
# Important: LINUXFAMILY and ARCH are defined _before_ including the common family include
declare -g UBOOT_USE_GCC="none"
declare -g UEFI_GRUB_TERMINAL="gfxterm"
declare -g LINUXFAMILY="loong64"
declare -g ARCH="loong64"
Expand Down
1 change: 0 additions & 1 deletion config/sources/families/uefi-riscv64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# https://github.com/armbian/build/
#
# Important: LINUXFAMILY and ARCH are defined _before_ including the common family include
declare -g UBOOT_USE_GCC="none"
declare -g UEFI_GRUB_TERMINAL="gfxterm"
declare -g LINUXFAMILY="riscv64"
declare -g ARCH="riscv64"
Expand Down
3 changes: 0 additions & 3 deletions config/sources/loong64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ declare -g ARCH='loong64'
declare -g ARCHITECTURE='loongarch'
declare -g QEMU_BINARY='qemu-loongarch64-static'
declare -g IMAGE_PARTITION_TABLE='gpt'
declare -g SKIP_EXTERNAL_TOOLCHAINS='yes'
declare -g KERNEL_SRC_ARCH='loongarch'

# Linux root has a different Type-UUID for every architecture
Expand All @@ -27,7 +26,5 @@ declare -g NAME_INITRD="${NAME_INITRD:-"initrd.img"}"

[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER='loongarch64-linux-gnu-'
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER='loongarch64-linux-gnu-'
[[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='> 13.0'
[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 13.0'

true # make sure to exit with 0 status; this protects against shortcircuits etc above.
3 changes: 0 additions & 3 deletions config/sources/riscv64.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ declare -g ARCHITECTURE='riscv'
declare -g KERNEL_SRC_ARCH='riscv'
declare -g QEMU_BINARY='qemu-riscv64-static'
declare -g IMAGE_PARTITION_TABLE='gpt'
declare -g SKIP_EXTERNAL_TOOLCHAINS='yes'

# Linux root has a different Type-UUID for every architecture
# See https://uapi-group.org/specifications/specs/discoverable_partitions_specification/
Expand All @@ -27,8 +26,6 @@ declare -g NAME_INITRD="${NAME_INITRD:-"uInitrd"}"

[[ -z $KERNEL_COMPILER ]] && KERNEL_COMPILER='riscv64-linux-gnu-'
[[ -z $UBOOT_COMPILER ]] && UBOOT_COMPILER='riscv64-linux-gnu-'
[[ -z $KERNEL_USE_GCC ]] && KERNEL_USE_GCC='> 8.0'
[[ -z $UBOOT_USE_GCC ]] && UBOOT_USE_GCC='> 8.0'
[[ -z $INITRD_ARCH ]] && INITRD_ARCH=riscv

true # make sure to exit with 0 status; this protects against shortcircuits etc above.
22 changes: 2 additions & 20 deletions lib/functions/compilation/atf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,7 @@ compile_atf() {

display_alert "Compiling ATF" "" "info"

# build aarch64
if [[ $(dpkg --print-architecture) == amd64 ]]; then

local toolchain
toolchain=$(find_toolchain "$ATF_COMPILER" "$ATF_USE_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${ATF_COMPILER}gcc $ATF_USE_GCC"

if [[ -n $ATF_TOOLCHAIN2 ]]; then
local toolchain2_type toolchain2_ver toolchain2
toolchain2_type=$(cut -d':' -f1 <<< "${ATF_TOOLCHAIN2}")
toolchain2_ver=$(cut -d':' -f2 <<< "${ATF_TOOLCHAIN2}")
toolchain2=$(find_toolchain "$toolchain2_type" "$toolchain2_ver")
[[ -z $toolchain2 ]] && exit_with_error "Could not find required toolchain" "${toolchain2_type}gcc $toolchain2_ver"
fi

# build aarch64
fi

display_alert "Compiler version" "${ATF_COMPILER}gcc $(eval env PATH="${toolchain}:${PATH}" "${ATF_COMPILER}gcc" -dumpfullversion -dumpversion)" "info"
display_alert "Compiler version" "${ATF_COMPILER}gcc $(eval env "${ATF_COMPILER}gcc" -dumpfullversion -dumpversion)" "info"

local target_make target_patchdir target_files
target_make=$(cut -d';' -f1 <<< "${ATF_TARGET_MAP}")
Expand Down Expand Up @@ -101,7 +83,7 @@ compile_atf() {

# - ENABLE_BACKTRACE="0" has been added to workaround a regression in ATF. Check: https://github.com/armbian/build/issues/1157

run_host_command_logged "CROSS_COMPILE='ccache ${ATF_COMPILER}'" CCACHE_BASEDIR="$(pwd)" "CC='ccache ${ATF_COMPILER}gcc'" PATH="${toolchain}:${toolchain2}:${PATH}" \
run_host_command_logged "CROSS_COMPILE='ccache ${ATF_COMPILER}'" CCACHE_BASEDIR="$(pwd)" "CC='ccache ${ATF_COMPILER}gcc'" \
"CFLAGS='-fdiagnostics-color=always -Wno-error=attributes -Wno-error=incompatible-pointer-types'" \
"TF_LDFLAGS='${binutils_flags_atf}'" \
make ENABLE_BACKTRACE="0" LOG_LEVEL="40" BUILD_STRING="armbian" $target_make "${CTHREADS}"
Expand Down
16 changes: 4 additions & 12 deletions lib/functions/compilation/crust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ compile_crust() {

display_alert "Compiling Crust" "" "info"

# build aarch64
if [[ $(dpkg --print-architecture) == amd64 ]]; then

local toolchain
toolchain=$(find_toolchain "$CRUST_COMPILER" "$CRUST_USE_GCC")
[[ -z $toolchain ]] && exit_with_error "Could not find required toolchain" "${CRUST_COMPILER}gcc $CRUST_USE_GCC"
fi

display_alert "Compiler version" "${CRUST_COMPILER}gcc $(eval env PATH="${toolchain}:${PATH}" "${CRUST_COMPILER}gcc" -dumpfullversion -dumpversion)" "info"
display_alert "Compiler version" "${CRUST_COMPILER}gcc $(eval env "${CRUST_COMPILER}gcc" -dumpfullversion -dumpversion)" "info"

local target_make target_patchdir target_files
target_make=$(cut -d';' -f1 <<< "${CRUST_TARGET_MAP}")
Expand All @@ -55,14 +47,14 @@ compile_crust() {
fi

declare binutils_version binutils_flags_crust=""
binutils_version=$(env PATH="${toolchain}:${PATH}" or1k-elf-ld.bfd --version | head -1 | cut -d ")" -f 2 | xargs echo -n)
binutils_version=$(env or1k-elf-ld.bfd --version | head -1 | cut -d ")" -f 2 | xargs echo -n)
display_alert "Binutils version for Crust" "${binutils_version}" "info"

run_host_command_logged CCACHE_BASEDIR="$(pwd)" PATH="${toolchain}:${toolchain2}:${PATH}" \
run_host_command_logged CCACHE_BASEDIR="$(pwd)" \
"CFLAGS='-fdiagnostics-color=always -Wno-error=attributes -Wno-error=incompatible-pointer-types'" \
make ${CRUSTCONFIG} "${CTHREADS}" "CROSS_COMPILE='$CCACHE $CRUST_COMPILER'"

run_host_command_logged CCACHE_BASEDIR="$(pwd)" PATH="${toolchain}:${toolchain2}:${PATH}" \
run_host_command_logged CCACHE_BASEDIR="$(pwd)" \
"CFLAGS='-fdiagnostics-color=always -Wno-error=attributes -Wno-error=incompatible-pointer-types'" \
make $target_make "${CTHREADS}" "CROSS_COMPILE='$CCACHE $CRUST_COMPILER'"

Expand Down
Loading