crossgcc: Add nasm to toolchain
Tianocore payload uses nasm. Supply it in the coreboot toolchain instead of relying on system version. Signed-off-by: Martin Roth <martinroth@chromium.org> Change-Id: I086cbe6c46f7c09b2a7a83e177b32fd1bdf99266 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33024 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
1662c0bbfe
commit
d70f5fae1c
|
@ -10,12 +10,12 @@ DEST ?= $(CURDIR)/xgcc
|
||||||
all all_with_gdb:
|
all all_with_gdb:
|
||||||
$(MAKE) build-i386 build-x64 build-arm build-mips \
|
$(MAKE) build-i386 build-x64 build-arm build-mips \
|
||||||
build-riscv build-aarch64 build-ppc64 build-nds32le \
|
build-riscv build-aarch64 build-ppc64 build-nds32le \
|
||||||
build_clang build_iasl build_make
|
build_clang build_iasl build_make build_nasm
|
||||||
|
|
||||||
all_without_gdb:
|
all_without_gdb:
|
||||||
$(MAKE) SKIP_GDB=1 build-i386 build-x64 build-arm build-mips \
|
$(MAKE) SKIP_GDB=1 build-i386 build-x64 build-arm build-mips \
|
||||||
build-riscv build-aarch64 build-ppc64 build-nds32le \
|
build-riscv build-aarch64 build-ppc64 build-nds32le \
|
||||||
build_clang build_iasl build_make
|
build_clang build_iasl build_make build_nasm
|
||||||
|
|
||||||
build_tools: build_gcc build_gdb
|
build_tools: build_gcc build_gdb
|
||||||
|
|
||||||
|
@ -43,12 +43,15 @@ endif
|
||||||
build_make:
|
build_make:
|
||||||
bash ./buildgcc -P make $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
bash ./buildgcc -P make $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
||||||
|
|
||||||
|
build_nasm:
|
||||||
|
bash ./buildgcc -P nasm $(if $(CPUS),-j $(CPUS)) $(if $(KEEP_SOURCES),-t) $(BUILDGCC_OPTIONS) -d $(DEST)
|
||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
build-i386:
|
build-i386:
|
||||||
@$(MAKE) build_tools BUILD_PLATFORM=i386-elf
|
@$(MAKE) build_tools build_nasm BUILD_PLATFORM=i386-elf
|
||||||
|
|
||||||
build-x64:
|
build-x64:
|
||||||
@$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf
|
@$(MAKE) build_tools build_nasm BUILD_PLATFORM=x86_64-elf
|
||||||
|
|
||||||
build-arm:
|
build-arm:
|
||||||
@$(MAKE) build_tools BUILD_PLATFORM=arm-eabi
|
@$(MAKE) build_tools BUILD_PLATFORM=arm-eabi
|
||||||
|
@ -86,5 +89,6 @@ distclean: clean
|
||||||
.PHONY: build_gcc build_iasl build_gdb build_clang all all_with_gdb \
|
.PHONY: build_gcc build_iasl build_gdb build_clang all all_with_gdb \
|
||||||
all_without_gdb build_tools build-i386 build-x64 build-arm \
|
all_without_gdb build_tools build-i386 build-x64 build-arm \
|
||||||
build-aarch64 build-mips build-riscv build-ppc64 build-nds32le \
|
build-aarch64 build-mips build-riscv build-ppc64 build-nds32le \
|
||||||
|
build-nasm \
|
||||||
clean distclean clean_tempfiles
|
clean distclean clean_tempfiles
|
||||||
.NOTPARALLEL:
|
.NOTPARALLEL:
|
||||||
|
|
|
@ -23,6 +23,7 @@ help_toolchain help::
|
||||||
@echo ' iasl - Build coreboot IASL compiler (built by all cross targets)'
|
@echo ' iasl - Build coreboot IASL compiler (built by all cross targets)'
|
||||||
@echo ' clang - Build coreboot clang compiler'
|
@echo ' clang - Build coreboot clang compiler'
|
||||||
@echo ' gnumake - Build coreboot make'
|
@echo ' gnumake - Build coreboot make'
|
||||||
|
@echo ' nasm - Build coreboot nasm'
|
||||||
@echo ' test-toolchain - Reports if toolchain components are out of date'
|
@echo ' test-toolchain - Reports if toolchain components are out of date'
|
||||||
@echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
|
@echo ' crossgcc-ARCH - Build cross-compiler for specific architecture'
|
||||||
@echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture'
|
@echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture'
|
||||||
|
@ -41,7 +42,7 @@ crossgcc: clean-for-update
|
||||||
crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
|
crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \
|
||||||
clang crosstools-i386 crosstools-x64 crosstools-arm \
|
clang crosstools-i386 crosstools-x64 crosstools-arm \
|
||||||
crosstools-aarch64 crosstools-mips crosstools-riscv crosstools-power8 \
|
crosstools-aarch64 crosstools-mips crosstools-riscv crosstools-power8 \
|
||||||
jenkins-build-toolchain gnumake
|
jenkins-build-toolchain gnumake nasm
|
||||||
|
|
||||||
$(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
|
$(foreach arch,$(TOOLCHAIN_ARCHES),crossgcc-$(arch)): clean-for-update
|
||||||
$(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1
|
$(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1
|
||||||
|
@ -58,6 +59,9 @@ clang: clean-for-update
|
||||||
gnumake: clean-for-update
|
gnumake: clean-for-update
|
||||||
$(MAKE) -C util/crossgcc build_make
|
$(MAKE) -C util/crossgcc build_make
|
||||||
|
|
||||||
|
nasm: clean-for-update
|
||||||
|
$(MAKE) -C util/crossgcc build_nasm
|
||||||
|
|
||||||
$(foreach arch,$(TOOLCHAIN_ARCHES),crosstools-$(arch)): clean-for-update
|
$(foreach arch,$(TOOLCHAIN_ARCHES),crosstools-$(arch)): clean-for-update
|
||||||
$(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl
|
$(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ EXPAT_VERSION=2.2.7
|
||||||
CLANG_VERSION=8.0.0
|
CLANG_VERSION=8.0.0
|
||||||
MAKE_VERSION=4.2.1
|
MAKE_VERSION=4.2.1
|
||||||
CMAKE_VERSION=3.15.0
|
CMAKE_VERSION=3.15.0
|
||||||
|
NASM_VERSION=2.14.02
|
||||||
|
|
||||||
# GCC toolchain archive locations
|
# GCC toolchain archive locations
|
||||||
# These are sanitized by the jenkins toolchain test builder, so if
|
# These are sanitized by the jenkins toolchain test builder, so if
|
||||||
|
@ -82,11 +83,13 @@ CRT_ARCHIVE="https://releases.llvm.org/${CLANG_VERSION}/compiler-rt-${CLANG_VERS
|
||||||
CTE_ARCHIVE="https://releases.llvm.org/${CLANG_VERSION}/clang-tools-extra-${CLANG_VERSION}.src.tar.xz"
|
CTE_ARCHIVE="https://releases.llvm.org/${CLANG_VERSION}/clang-tools-extra-${CLANG_VERSION}.src.tar.xz"
|
||||||
MAKE_ARCHIVE="https://ftpmirror.gnu.org/make/make-${MAKE_VERSION}.tar.bz2"
|
MAKE_ARCHIVE="https://ftpmirror.gnu.org/make/make-${MAKE_VERSION}.tar.bz2"
|
||||||
CMAKE_ARCHIVE="https://cmake.org/files/v3.15/cmake-${CMAKE_VERSION}.tar.gz"
|
CMAKE_ARCHIVE="https://cmake.org/files/v3.15/cmake-${CMAKE_VERSION}.tar.gz"
|
||||||
|
NASM_ARCHIVE="https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2"
|
||||||
|
|
||||||
ALL_ARCHIVES="$GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE \
|
ALL_ARCHIVES="$GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE \
|
||||||
$GCC_ARCHIVE $BINUTILS_ARCHIVE $GDB_ARCHIVE $IASL_ARCHIVE \
|
$GCC_ARCHIVE $BINUTILS_ARCHIVE $GDB_ARCHIVE $IASL_ARCHIVE \
|
||||||
$PYTHON_ARCHIVE $EXPAT_ARCHIVE $LLVM_ARCHIVE $CFE_ARCHIVE \
|
$PYTHON_ARCHIVE $EXPAT_ARCHIVE $LLVM_ARCHIVE $CFE_ARCHIVE \
|
||||||
$CRT_ARCHIVE $CTE_ARCHIVE $MAKE_ARCHIVE $CMAKE_ARCHIVE"
|
$CRT_ARCHIVE $CTE_ARCHIVE $MAKE_ARCHIVE $CMAKE_ARCHIVE \
|
||||||
|
$NASM_ARCHIVE"
|
||||||
|
|
||||||
# GCC toolchain directories
|
# GCC toolchain directories
|
||||||
GMP_DIR="gmp-${GMP_VERSION}"
|
GMP_DIR="gmp-${GMP_VERSION}"
|
||||||
|
@ -107,6 +110,7 @@ CRT_DIR="compiler-rt-${CLANG_VERSION}.src"
|
||||||
CTE_DIR="clang-tools-extra-${CLANG_VERSION}.src"
|
CTE_DIR="clang-tools-extra-${CLANG_VERSION}.src"
|
||||||
MAKE_DIR="make-${MAKE_VERSION}"
|
MAKE_DIR="make-${MAKE_VERSION}"
|
||||||
CMAKE_DIR="cmake-${CMAKE_VERSION}"
|
CMAKE_DIR="cmake-${CMAKE_VERSION}"
|
||||||
|
NASM_DIR="nasm-${NASM_VERSION}"
|
||||||
|
|
||||||
unset MAKELEVEL MAKEFLAGS
|
unset MAKELEVEL MAKEFLAGS
|
||||||
|
|
||||||
|
@ -910,6 +914,17 @@ build_CMAKE() {
|
||||||
normalize_dirs
|
normalize_dirs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_NASM() {
|
||||||
|
CC="$(hostcc host)" CXX="$(hostcxx host)" CFLAGS="$HOSTCFLAGS"
|
||||||
|
../${NASM_DIR}/configure --prefix="$TARGETDIR" \
|
||||||
|
|| touch .failed
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
$MAKE $JOBS || touch .failed
|
||||||
|
$MAKE install DESTDIR=$DESTDIR || touch .failed
|
||||||
|
|
||||||
|
normalize_dirs
|
||||||
|
}
|
||||||
|
|
||||||
print_supported() {
|
print_supported() {
|
||||||
case "$PRINTSUPPORTED" in
|
case "$PRINTSUPPORTED" in
|
||||||
AUTOCONF|autoconf) printf "%s\n" "$GCC_AUTOCONF_VERSION";;
|
AUTOCONF|autoconf) printf "%s\n" "$GCC_AUTOCONF_VERSION";;
|
||||||
|
@ -924,6 +939,7 @@ print_supported() {
|
||||||
MPFR|mpfr) printf "%s\n" "$MPFR_VERSION";;
|
MPFR|mpfr) printf "%s\n" "$MPFR_VERSION";;
|
||||||
PYTHON|python) printf "%s\n" "$PYTHON_VERSION";;
|
PYTHON|python) printf "%s\n" "$PYTHON_VERSION";;
|
||||||
MAKE|make) printf "%s\n" "$MAKE_VERSION";;
|
MAKE|make) printf "%s\n" "$MAKE_VERSION";;
|
||||||
|
NASM|nasm) printf "%s\n" "${NASM_VERSION}";;
|
||||||
*) printf "Unknown tool %s\n" "$PRINTSUPPORTED";;
|
*) printf "Unknown tool %s\n" "$PRINTSUPPORTED";;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
@ -1044,8 +1060,12 @@ case "$PACKAGE" in
|
||||||
NAME="CMake"
|
NAME="CMake"
|
||||||
PACKAGES=CMAKE
|
PACKAGES=CMAKE
|
||||||
;;
|
;;
|
||||||
|
NASM|nasm)
|
||||||
|
NAME="NASM"
|
||||||
|
PACKAGES=NASM
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
printf "${red}ERROR: Unsupported package $PACKAGE. (Supported packages are GCC, GDB, CLANG, IASL, MAKE)${NC}\n\n";
|
printf "${red}ERROR: Unsupported package $PACKAGE. (Supported packages are GCC, GDB, CLANG, IASL, MAKE, and NASM)${NC}\n\n";
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
fe098ee4dc9c4c983696c4948e64b23e4098b92b tarballs/nasm-2.14.02.tar.bz2
|
Loading…
Reference in New Issue