summaryrefslogtreecommitdiff
path: root/util/crossgcc
diff options
context:
space:
mode:
Diffstat (limited to 'util/crossgcc')
-rw-r--r--util/crossgcc/Makefile12
-rw-r--r--util/crossgcc/Makefile.inc6
-rwxr-xr-xutil/crossgcc/buildgcc24
-rw-r--r--util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum1
4 files changed, 36 insertions, 7 deletions
diff --git a/util/crossgcc/Makefile b/util/crossgcc/Makefile
index a8ea815165..c4f4262e87 100644
--- a/util/crossgcc/Makefile
+++ b/util/crossgcc/Makefile
@@ -10,12 +10,12 @@ DEST ?= $(CURDIR)/xgcc
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 @@ endif
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 @@ distclean: clean
.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 8f8257c2f2..0ef6b9c1e3 100644
--- a/util/crossgcc/Makefile.inc
+++ b/util/crossgcc/Makefile.inc
@@ -23,6 +23,7 @@ help_toolchain help::
@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: clean-for-update
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 @@ clang: clean-for-update
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 cb9838f97a..c7f63c3bee 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -61,6 +61,7 @@ EXPAT_VERSION=2.2.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 @@ 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"
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"
+NASM_ARCHIVE="https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2"
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 @@ CRT_DIR="compiler-rt-${CLANG_VERSION}.src"
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 @@ build_CMAKE() {
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 @@ print_supported() {
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 @@ case "$PACKAGE" in
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 0000000000..f3b9de9d29
--- /dev/null
+++ b/util/crossgcc/sum/nasm-2.14.02.tar.bz2.cksum
@@ -0,0 +1 @@
+fe098ee4dc9c4c983696c4948e64b23e4098b92b tarballs/nasm-2.14.02.tar.bz2