Skip to content

Commit

Permalink
toolchain: switch to v8.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Oct 26, 2019
1 parent d28f568 commit 7548d17
Show file tree
Hide file tree
Showing 81 changed files with 1,682 additions and 800 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ $(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt dir

world:

DISTRO_PKG_CONFIG:=$(shell which -a pkg-config | grep -E '\/usr' | head -n 1)
export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)

ifneq ($(OPENWRT_BUILD),1)
Expand Down Expand Up @@ -89,12 +90,21 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages
checksum: FORCE
$(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT))

buildversion: FORCE
$(SCRIPT_DIR)/getver.sh > $(BIN_DIR)/version.buildinfo

feedsversion: FORCE
$(SCRIPT_DIR)/feeds list -fs > $(BIN_DIR)/feeds.buildinfo

diffconfig: FORCE
mkdir -p $(BIN_DIR)
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.seed
$(SCRIPT_DIR)/diffconfig.sh > $(BIN_DIR)/config.buildinfo

buildinfo: FORCE
$(_SINGLE)$(SUBMAKE) -r diffconfig buildversion feedsversion

prepare: .config $(tools/stamp-compile) $(toolchain/stamp-compile)
$(_SINGLE)$(SUBMAKE) -r diffconfig
$(_SINGLE)$(SUBMAKE) -r buildinfo

world: prepare $(target/stamp-compile) $(package/stamp-compile) $(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index
Expand Down
28 changes: 6 additions & 22 deletions include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kmod-nf-nathelper kmod-nf-nathelper-extra kmod-ipt-raw wget libustream-openssl c
default-settings luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
luci-app-filetransfer luci-app-vsftpd ddns-scripts_aliyun luci-app-ssr-plus \
luci-app-pptp-server luci-app-arpbind luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-ramfree \
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-usb-printer luci-app-accesscontrol luci-app-zerotier luci-app-xlnetacc
luci-app-sfe luci-app-flowoffload luci-app-nlbwmon luci-app-usb-printer luci-app-accesscontrol luci-app-zerotier
# For nas targets
DEFAULT_PACKAGES.nas:=fdisk lsblk mdadm automount autosamba luci-app-usb-printer
# For router targets
Expand Down Expand Up @@ -56,7 +56,7 @@ else
endif
endif

ifneq ($(filter 3.18 4.9,$(KERNEL_PATCHVER)),)
ifneq ($(filter 4.9,$(KERNEL_PATCHVER)),)
DEFAULT_PACKAGES.router:=$(filter-out kmod-ipt-offload,$(DEFAULT_PACKAGES.router))
endif

Expand Down Expand Up @@ -188,26 +188,6 @@ ifeq ($(DUMP),1)
endif
ifneq ($(findstring arm,$(ARCH)),)
CPU_TYPE ?= xscale
CPU_CFLAGS_arm920t = -mcpu=arm920t
CPU_CFLAGS_arm926ej-s = -mcpu=arm926ej-s
CPU_CFLAGS_arm1136j-s = -mcpu=arm1136j-s
CPU_CFLAGS_arm1176jzf-s = -mcpu=arm1176jzf-s
CPU_CFLAGS_cortex-a5 = -mcpu=cortex-a5
CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7
CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8
CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9
CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15
CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53
CPU_CFLAGS_cortex-a72 = -mcpu=cortex-a72
CPU_CFLAGS_fa526 = -mcpu=fa526
CPU_CFLAGS_mpcore = -mcpu=mpcore
CPU_CFLAGS_xscale = -mcpu=xscale
ifeq ($(CONFIG_SOFT_FLOAT),)
CPU_CFLAGS_neon = -mfpu=neon
CPU_CFLAGS_vfp = -mfpu=vfp
CPU_CFLAGS_vfpv3 = -mfpu=vfpv3-d16
CPU_CFLAGS_neon-vfpv4 = -mfpu=neon-vfpv4
endif
endif
ifeq ($(ARCH),powerpc)
CPU_CFLAGS_603e:=-mcpu=603e
Expand Down Expand Up @@ -250,6 +230,9 @@ ifeq ($(DUMP),1)
.SILENT: $(TMP_CONFIG)
.PRECIOUS: $(TMP_CONFIG)

ifdef KERNEL_TESTING_PATCHVER
FEATURES += testing-kernel
endif
ifneq ($(CONFIG_OF),)
FEATURES += dt
endif
Expand Down Expand Up @@ -308,6 +291,7 @@ define BuildTargets/DumpCurrent
echo 'Target-Optimization: $(if $(CFLAGS),$(CFLAGS),$(DEFAULT_CFLAGS))'; \
echo 'CPU-Type: $(CPU_TYPE)$(if $(CPU_SUBTYPE),+$(CPU_SUBTYPE))'; \
echo 'Linux-Version: $(LINUX_VERSION)'; \
$(if $(LINUX_TESTING_VERSION),echo 'Linux-Testing-Version: $(LINUX_TESTING_VERSION)';) \
echo 'Linux-Release: $(LINUX_RELEASE)'; \
echo 'Linux-Kernel-Arch: $(LINUX_KARCH)'; \
$(if $(SUBTARGET),,$(if $(DEFAULT_SUBTARGET), echo 'Default-Subtarget: $(DEFAULT_SUBTARGET)'; )) \
Expand Down
13 changes: 6 additions & 7 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX))
SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
BUILD_SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
NPROC:=$(shell sysctl -n hw.ncpu 2>/dev/null || nproc)
export SHELL:=/usr/bin/env bash

IS_PACKAGE_BUILD := $(if $(filter package/%,$(BUILD_SUBDIR)),1)
Expand Down Expand Up @@ -139,11 +140,11 @@ else
TOOLCHAIN_DIR_NAME:=toolchain-$(GNU_TARGET_NAME)
endif

ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_GCC_VERSION_4_8),$(CONFIG_TARGET_uml)),)
ifeq ($(CONFIG_GCC_USE_EMBEDDED_PATH_REMAP),y)
iremap = -fmacro-prefix-map=$(1)=$(2)
else
ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_TARGET_uml)),)
ifeq ($(CONFIG_GCC_USE_IREMAP),y)
iremap = -iremap$(1):$(2)
else
iremap = -ffile-prefix-map=$(1)=$(2)
endif
endif

Expand All @@ -159,7 +160,7 @@ TARGET_ROOTFS_DIR?=$(if $(call qstrip,$(CONFIG_TARGET_ROOTFS_DIR)),$(call qstrip
TARGET_DIR:=$(TARGET_ROOTFS_DIR)/root-$(BOARD)
STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD)
STAGING_DIR_IMAGE:=$(STAGING_DIR)/image
BUILD_LOG_DIR:=$(TOPDIR)/logs
BUILD_LOG_DIR:=$(if $(call qstrip,$(CONFIG_BUILD_LOG_DIR)),$(call qstrip,$(CONFIG_BUILD_LOG_DIR)),$(TOPDIR)/logs)
PKG_INFO_DIR := $(STAGING_DIR)/pkginfo

BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR_BASE)/hostpkg,$(BUILD_DIR_BASE)/host)
Expand All @@ -183,8 +184,6 @@ else
LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.a))
LIBGCC_S=$(if $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so),-L$(TOOLCHAIN_DIR)/lib -lgcc_s,$(LIBGCC_A))
endif
LIBRPC=-lrpc
LIBRPC_DEPENDS=+librpc

ifeq ($(CONFIG_ARCH_64BIT),y)
LIB_SUFFIX:=64
Expand Down
14 changes: 6 additions & 8 deletions toolchain/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ menuconfig EXTERNAL_TOOLCHAIN
bool
prompt "Use external toolchain" if DEVEL
help
If enabled, LEDE will compile using an existing toolchain instead of
If enabled, the buildroot will compile using an existing toolchain instead of
compiling one.

config NATIVE_TOOLCHAIN
Expand All @@ -51,7 +51,7 @@ menuconfig EXTERNAL_TOOLCHAIN
depends on EXTERNAL_TOOLCHAIN
select NO_STRIP
help
If enabled, LEDE will compile using the native toolchain for your
If enabled, the buildroot will compile using the native toolchain for your
host instead of compiling one.

config TARGET_NAME
Expand Down Expand Up @@ -238,7 +238,6 @@ comment "C Library"
choice
prompt "C Library implementation" if TOOLCHAINOPTS
default LIBC_USE_UCLIBC if arc
default LIBC_USE_GLIBC if powerpc64
default LIBC_USE_MUSL
help
Select the C library implementation.
Expand All @@ -251,17 +250,17 @@ choice
config LIBC_USE_UCLIBC
select USE_UCLIBC
bool "Use uClibc"
depends on !(aarch64 || aarch64_be || powerpc64)
depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc)
depends on BROKEN || arc

config LIBC_USE_MUSL
select USE_MUSL
bool "Use musl"
depends on !(arc || powerpc64)
depends on !arc

endchoice

source "toolchain/uClibc/Config.in"
source "toolchain/musl/Config.in"

comment "Debuggers"
depends on TOOLCHAINOPTS
Expand All @@ -274,15 +273,14 @@ config GDB
Enable if you want to build the gdb.

config USE_GLIBC
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64)
bool

config USE_UCLIBC
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
bool

config USE_MUSL
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64)
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc)
bool

config SSP_SUPPORT
Expand Down
2 changes: 1 addition & 1 deletion toolchain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)

$(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile $(curdir)/kernel-headers/compile
$(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile
endif

Expand Down
16 changes: 5 additions & 11 deletions toolchain/binutils/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,24 @@
choice
prompt "Binutils Version" if TOOLCHAINOPTS
default BINUTILS_USE_VERSION_2_31_1 if !arc
default BINUTILS_USE_VERSION_2_29_ARC if arc
default BINUTILS_USE_VERSION_2_32 if arc
help
Select the version of binutils you wish to use.

config BINUTILS_USE_VERSION_2_29_ARC
depends on arc
bool "ARC binutils 2.29"
select BINUTILS_VERSION_2_29_ARC

config BINUTILS_USE_VERSION_2_29_1
depends on !arc
bool "Binutils 2.29.1"
select BINUTILS_VERSION_2_29_1

config BINUTILS_USE_VERSION_2_30
depends on !arc
bool "Binutils 2.30"
select BINUTILS_VERSION_2_30

config BINUTILS_USE_VERSION_2_31_1
depends on !arc
bool "Binutils 2.31.1"
select BINUTILS_VERSION_2_31_1

config BINUTILS_USE_VERSION_2_32
bool "Binutils 2.32"
select BINUTILS_VERSION_2_32

endchoice

config EXTRA_BINUTILS_CONFIG_OPTIONS
Expand Down
14 changes: 5 additions & 9 deletions toolchain/binutils/Config.version
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
config BINUTILS_VERSION_2_29_ARC
default y if (!TOOLCHAINOPTS && arc)
bool

config BINUTILS_VERSION_2_29_1
bool

config BINUTILS_VERSION_2_30
bool

config BINUTILS_VERSION_2_31_1
default y if (!TOOLCHAINOPTS && !arc)
bool

config BINUTILS_VERSION_2_32
default y if (!TOOLCHAINOPTS && arc)
bool

config BINUTILS_VERSION
string
default "2.29.1" if BINUTILS_VERSION_2_29_1
default "2.30" if BINUTILS_VERSION_2_30
default "2.31.1" if BINUTILS_VERSION_2_31_1
default "arc-2017.09" if BINUTILS_VERSION_2_29_ARC
default "2.32" if BINUTILS_VERSION_2_32
58 changes: 21 additions & 37 deletions toolchain/binutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,12 @@ ifeq ($(PKG_VERSION),2.29.1)
PKG_HASH:=e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577
endif

ifeq ($(PKG_VERSION),2.30)
PKG_HASH:=6e46b8aeae2f727a36f0bd9505e405768a72218f1796f0d09757d45209871ae6
endif

ifeq ($(PKG_VERSION),2.31.1)
PKG_HASH:=5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86
endif

ifneq ($(CONFIG_BINUTILS_VERSION_2_29_ARC),)
PKG_REV:=arc-2017.09-release
PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz
PKG_HASH:=2ea086fd5521e942926dd6ff6922ce31c29ee7ffc754fca3d06385e0f27600f8
BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV)
HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR)
ifeq ($(PKG_VERSION),2.32)
PKG_HASH:=0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04
endif

HOST_BUILD_PARALLEL:=1
Expand All @@ -42,34 +33,33 @@ PATCH_DIR:=./patches/$(PKG_VERSION)

include $(INCLUDE_DIR)/toolchain-build.mk

BINUTILS_CONFIGURE:= \
./configure \
--prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \
--enable-deterministic-archives \
--enable-plugins \
--disable-multilib \
--disable-werror \
--disable-nls \
--disable-sim \
--disable-gdb \
$(GRAPHITE_CONFIGURE) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))
HOST_CONFIGURE_ARGS = \
--prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \
--with-sysroot=$(TOOLCHAIN_DIR) \
--enable-deterministic-archives \
--enable-plugins \
--disable-multilib \
--disable-werror \
--disable-nls \
--disable-sim \
--disable-gdb \
$(GRAPHITE_CONFIGURE) \
$(SOFT_FLOAT_CONFIG_OPTION) \
$(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS))

ifneq ($(CONFIG_SSP_SUPPORT),)
BINUTILS_CONFIGURE+= \
HOST_CONFIGURE_ARGS+= \
--enable-libssp
else
BINUTILS_CONFIGURE+= \
HOST_CONFIGURE_ARGS+= \
--disable-libssp
endif

ifneq ($(CONFIG_EXTRA_TARGET_ARCH),)
BINUTILS_CONFIGURE+= \
HOST_CONFIGURE_ARGS+= \
--enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX)
endif

Expand All @@ -80,12 +70,6 @@ define Host/Prepare
$(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
endef

define Host/Configure
(cd $(HOST_BUILD_DIR); \
$(BINUTILS_CONFIGURE) \
);
endef

define Host/Compile
+$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all
endef
Expand Down
Loading

0 comments on commit 7548d17

Please sign in to comment.