Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33024 )
Change subject: crossgcc: Add nasm to toolchain ......................................................................
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 --- M util/crossgcc/Makefile M util/crossgcc/Makefile.inc M util/crossgcc/buildgcc A util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum 4 files changed, 36 insertions(+), 7 deletions(-)
Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved Paul Menzel: Looks good to me, but someone else must approve HAOUAS Elyes: Looks good to me, approved
diff --git a/util/crossgcc/Makefile b/util/crossgcc/Makefile index a8ea815..c4f4262 100644 --- a/util/crossgcc/Makefile +++ b/util/crossgcc/Makefile @@ -10,12 +10,12 @@ all all_with_gdb: $(MAKE) build-i386 build-x64 build-arm build-mips \ 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: $(MAKE) SKIP_GDB=1 build-i386 build-x64 build-arm build-mips \ 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
@@ -43,12 +43,15 @@ build_make: 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: - @$(MAKE) build_tools BUILD_PLATFORM=i386-elf + @$(MAKE) build_tools build_nasm BUILD_PLATFORM=i386-elf
build-x64: - @$(MAKE) build_tools BUILD_PLATFORM=x86_64-elf + @$(MAKE) build_tools build_nasm BUILD_PLATFORM=x86_64-elf
build-arm: @$(MAKE) build_tools BUILD_PLATFORM=arm-eabi @@ -86,5 +89,6 @@ .PHONY: build_gcc build_iasl build_gdb build_clang all all_with_gdb \ all_without_gdb build_tools build-i386 build-x64 build-arm \ build-aarch64 build-mips build-riscv build-ppc64 build-nds32le \ + build-nasm \ clean distclean clean_tempfiles .NOTPARALLEL: diff --git a/util/crossgcc/Makefile.inc b/util/crossgcc/Makefile.inc index 8f8257c..0ef6b9c 100644 --- a/util/crossgcc/Makefile.inc +++ b/util/crossgcc/Makefile.inc @@ -23,6 +23,7 @@ @echo ' iasl - Build coreboot IASL compiler (built by all cross targets)' @echo ' clang - Build coreboot clang compiler' @echo ' gnumake - Build coreboot make' + @echo ' nasm - Build coreboot nasm' @echo ' test-toolchain - Reports if toolchain components are out of date' @echo ' crossgcc-ARCH - Build cross-compiler for specific architecture' @echo ' crosstools-ARCH - Build cross-compiler with GDB for specific architecture' @@ -41,7 +42,7 @@ crossgcc-mips crossgcc-riscv crossgcc-power8 crossgcc-clean iasl \ clang crosstools-i386 crosstools-x64 crosstools-arm \ 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 $(MAKE) -C util/crossgcc $(patsubst crossgcc-%,build-%,$@) build_iasl SKIP_GDB=1 @@ -58,6 +59,9 @@ gnumake: clean-for-update $(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 $(MAKE) -C util/crossgcc $(patsubst crosstools-%,build-%,$@) build_iasl
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index cb9838f..c7f63c3b 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -61,6 +61,7 @@ CLANG_VERSION=8.0.0 MAKE_VERSION=4.2.1 CMAKE_VERSION=3.15.0 +NASM_VERSION=2.14.02
# GCC toolchain archive locations # These are sanitized by the jenkins toolchain test builder, so if @@ -82,11 +83,13 @@ CTE_ARCHIVE="https://releases.llvm.org/$%7BCLANG_VERSION%7D/clang-tools-extra-$%7BCLANG_V..." MAKE_ARCHIVE="https://ftpmirror.gnu.org/make/make-$%7BMAKE_VERSION%7D.tar.bz2" CMAKE_ARCHIVE="https://cmake.org/files/v3.15/cmake-$%7BCMAKE_VERSION%7D.tar.gz" +NASM_ARCHIVE="https://www.nasm.us/pub/nasm/releasebuilds/$%7BNASM_VERSION%7D/nasm-$%7BNASM..."
ALL_ARCHIVES="$GMP_ARCHIVE $MPFR_ARCHIVE $MPC_ARCHIVE \ $GCC_ARCHIVE $BINUTILS_ARCHIVE $GDB_ARCHIVE $IASL_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 GMP_DIR="gmp-${GMP_VERSION}" @@ -107,6 +110,7 @@ CTE_DIR="clang-tools-extra-${CLANG_VERSION}.src" MAKE_DIR="make-${MAKE_VERSION}" CMAKE_DIR="cmake-${CMAKE_VERSION}" +NASM_DIR="nasm-${NASM_VERSION}"
unset MAKELEVEL MAKEFLAGS
@@ -910,6 +914,17 @@ 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() { case "$PRINTSUPPORTED" in AUTOCONF|autoconf) printf "%s\n" "$GCC_AUTOCONF_VERSION";; @@ -924,6 +939,7 @@ MPFR|mpfr) printf "%s\n" "$MPFR_VERSION";; PYTHON|python) printf "%s\n" "$PYTHON_VERSION";; MAKE|make) printf "%s\n" "$MAKE_VERSION";; + NASM|nasm) printf "%s\n" "${NASM_VERSION}";; *) printf "Unknown tool %s\n" "$PRINTSUPPORTED";; esac } @@ -1044,8 +1060,12 @@ NAME="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 ;; esac diff --git a/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum b/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum new file mode 100644 index 0000000..f3b9de9 --- /dev/null +++ b/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum @@ -0,0 +1 @@ +fe098ee4dc9c4c983696c4948e64b23e4098b92b tarballs/nasm-2.14.02.tar.bz2