Add GCC-5.1 as a build toolchain
GCC 5.1 is now the oldest supported GCC by Linux. Add it as a
toolchain (TOOLCHAIN=gcc-5.1).
Keep 4.9 for the time being, but add a warning that it's
deprecated and will be dropped soon.
Change-Id: I0a6629a0f88d6f6b123542fc10ba087791a93630
Signed-off-by: Fuad Tabba <tabba@google.com>
diff --git a/Makefile b/Makefile
index a9b3745..485e979 100644
--- a/Makefile
+++ b/Makefile
@@ -51,19 +51,25 @@
##
# Specifies which toolchain of the prebuilt toolchains to use.
-# Can be either clang, gcc-4.9, or gcc-9.2.
+# Can be either clang, gcc-4.9 (deprecated), gcc-5.1, or gcc-9.2.
TOOLCHAIN ?= clang
# Find the toolchain path for the current OS.
UNNAME_S := $(shell uname -s | tr '[:upper:]' '[:lower:]')
TOOLCHAIN_CLANG := $(ROOT_DIR)/toolchains/$(UNNAME_S)-x86/clang/clang-r383902/
TOOLCHAIN_GCC_49 := $(ROOT_DIR)/toolchains/$(UNNAME_S)-x86/gcc/aarch64-linux-gnu-4.9/
+TOOLCHAIN_GCC_51 := $(ROOT_DIR)/toolchains/$(UNNAME_S)-x86/gcc/aarch64-linux-gnu-5.1/
TOOLCHAIN_GCC_92 := $(ROOT_DIR)/toolchains/$(UNNAME_S)-x86/gcc/aarch64-linux-gnu-9.2/
# Set the toolchain build binary paths and prefixes.
ifeq ($(TOOLCHAIN), gcc-4.9)
TOOLCHAIN_BIN := $(TOOLCHAIN_GCC_49)/bin
TARGET = aarch64-linux-gnu
+$(warning "The gcc-4.9 toolchain is deprecated and will be removed soon.")
+$(warning "The gcc-5.1 toolchain is the oldest version Linux needs to support.")
+else ifeq ($(TOOLCHAIN), gcc-5.1)
+TOOLCHAIN_BIN := $(TOOLCHAIN_GCC_51)/bin
+TARGET = aarch64-linux-gnu
else ifeq ($(TOOLCHAIN), gcc-9.2)
TOOLCHAIN_BIN := $(TOOLCHAIN_GCC_92)/bin
TARGET = aarch64-none-linux-gnu
@@ -76,7 +82,7 @@
TARGET = aarch64-linux-gnu
# The GCC toolchain is needed when building kvm-unit-tests as well as Linux
# with Clang, because of lack of support for the LLVM integrated assembler.
-GCC_TOOLCHAIN_DIR = $(TOOLCHAIN_GCC_49)
+GCC_TOOLCHAIN_DIR = $(TOOLCHAIN_GCC_51)
GCC_TOOLCHAIN_BIN = $(GCC_TOOLCHAIN_DIR)/bin/
LLVM = "LLVM=1"
# Some targets require additional flags to build with Clang.