Skip to content

Commit

Permalink
update crosstool-ng to 1.21.0 and gcc-4.9.2
Browse files Browse the repository at this point in the history
Initial commit to upgrade the crosstool-ng package to 1.21.0 and move
to GCC version 4.9.2.  Previously the default GCC version was 4.7.3.

This entails adding new crosstool-ng configuration files for x86 and
powerpc that specify GCC 4.9.2.

In addition various libraries used to build GCC and related companion
utilities also moved forward, like gdb and strace.

Testing Done:

Compiled ONIE for kvm_x86_64 (x86) and fsl_p2020rdbpca
(powerpc-softfloat) and verified:

- everything compiles without errors

- resulting image sizes did not increase

- u-boot (powerpc only) continues to work properly

- ONIE installs and various programs continue to function normally

Signed-off-by: Curt Brune <[email protected]>
  • Loading branch information
Curt Brune committed Aug 31, 2015
1 parent 1225f97 commit d7be78c
Show file tree
Hide file tree
Showing 35 changed files with 2,714 additions and 444 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
# UCLIBC_HAS_PRINTF_M_SPEC is not set
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
Expand Down
2 changes: 1 addition & 1 deletion build-config/conf/uclibc/0.9.32.1/uclibc.x86_64.config
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ UCLIBC_HAS_STDIO_PUTC_MACRO=y
UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
# UCLIBC_HAS_PRINTF_M_SPEC is not set
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
# UCLIBC_HAS_PRINTF_M_SPEC is not set
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
Expand Down
2 changes: 1 addition & 1 deletion build-config/conf/uclibc/0.9.33.2/uclibc.x86_64.config
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set
# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
# UCLIBC_HAS_PRINTF_M_SPEC is not set
UCLIBC_HAS_ERRNO_MESSAGES=y
# UCLIBC_HAS_SYS_ERRLIST is not set
Expand Down
28 changes: 2 additions & 26 deletions build-config/make/crosstool-ng.make
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#

CROSSTOOL_NG_DESC = crosstool-NG
CROSSTOOL_NG_VERSION = 1.19.0
CROSSTOOL_NG_TARBALL = crosstool-ng-$(CROSSTOOL_NG_VERSION).tar.bz2
CROSSTOOL_NG_VERSION = 1.21.0
CROSSTOOL_NG_TARBALL = crosstool-ng-$(CROSSTOOL_NG_VERSION).tar.xz
CROSSTOOL_NG_URLS += $(ONIE_MIRROR) http://crosstool-ng.org/download/crosstool-ng
CROSSTOOL_NG_BUILD_DIR = $(BUILDDIR)/crosstool-ng
CROSSTOOL_NG_STAMP_DIR = $(CROSSTOOL_NG_BUILD_DIR)/stamp
Expand All @@ -28,26 +28,6 @@ CROSSTOOL_NG_STAMP = $(CROSSTOOL_NG_SOURCE_STAMP) \
$(CROSSTOOL_NG_CONFIGURE_STAMP) \
$(CROSSTOOL_NG_BUILD_STAMP)

# List of packages needed by crosstool-NG
CT_NG_COMPONENTS = \
make-3.81.tar.bz2 \
m4-1.4.13.tar.xz \
autoconf-2.65.tar.xz \
automake-1.11.1.tar.bz2 \
libtool-2.2.6b.tar.lzma \
gmp-4.3.2.tar.bz2 \
mpfr-2.4.2.tar.bz2 \
ppl-0.11.2.tar.lzma \
cloog-ppl-0.15.10.tar.gz \
mpc-1.0.1.tar.gz \
libelf-0.8.13.tar.gz \
binutils-2.22.tar.bz2 \
gcc-4.7.3.tar.bz2 \
duma_2_5_15.tar.gz \
gdb-7.4.1.tar.bz2 \
ltrace_0.5.3.orig.tar.gz \
strace-4.6.tar.xz

# Setup a mirror to use for packages needed by crosstool-NG
CROSSTOOL_ONIE_MIRROR ?= $(ONIE_MIRROR)/crosstool-NG
export CROSSTOOL_ONIE_MIRROR
Expand All @@ -65,10 +45,6 @@ $(CROSSTOOL_NG_DOWNLOAD_STAMP): $(PROJECT_STAMP)
$(Q) echo "==== Getting upstream $(CROSSTOOL_NG_DESC) ===="
$(Q) $(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \
$(CROSSTOOL_NG_TARBALL) $(CROSSTOOL_NG_URLS)
$(Q) for F in ${CT_NG_COMPONENTS} ; do echo "==== Getting upstream $${F} ====" ;\
$(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \
$${F} $(CROSSTOOL_ONIE_MIRROR) || exit 1 ; \
done
$(Q) touch $@

SOURCE += $(CROSSTOOL_NG_SOURCE_STAMP)
Expand Down
12 changes: 11 additions & 1 deletion build-config/make/images.make
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ SYSROOT_LIBS += \
endif

ifeq ($(REQUIRE_CXX_LIBS),yes)
SYSROOT_LIBS += libstdc++.so libstdc++.so.6 libstdc++.so.6.0.17
SYSROOT_LIBS += libstdc++.so libstdc++.so.6
ifeq ($(GCC_VERSION),4.9.2)
SYSROOT_LIBS += libstdc++.so.6.0.20
else ifeq ($(GCC_VERSION),4.7.3)
SYSROOT_LIBS += libstdc++.so.6.0.17
else
$(error C++ support: Unsupported GCC version: $(GCC_VERSION))
endif
endif

# Add librt if ACPI is enabled
Expand Down Expand Up @@ -160,6 +167,9 @@ endif
sysroot-check: $(SYSROOT_CHECK_STAMP)
$(SYSROOT_CHECK_STAMP): $(PACKAGES_INSTALL_STAMPS)
$(Q) for file in $(SYSROOT_LIBS) ; do \
[ -r "$(DEV_SYSROOT)/lib/$$file" ] || { \
echo "ERROR: Missing SYSROOT_LIB: $$file" ; \
exit 1; } ; \
find $(DEV_SYSROOT)/lib -name $$file | xargs -i \
cp -av {} $(SYSROOTDIR)/lib/ || exit 1 ; \
done
Expand Down
2 changes: 1 addition & 1 deletion build-config/make/u-boot.make
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ UBOOT_DIR = $(UBOOT_BUILD_DIR)/u-boot-$(UBOOT_VERSION)
UBOOT_SRCPATCHDIR = $(PATCHDIR)/u-boot/$(UBOOT_VERSION)
UBOOT_CMNPATCHDIR = $(PATCHDIR)/u-boot/common
UBOOT_PATCHDIR = $(UBOOT_BUILD_DIR)/patch
UBOOT_DOWNLOAD_STAMP = $(DOWNLOADDIR)/u-boot-download
UBOOT_DOWNLOAD_STAMP = $(DOWNLOADDIR)/u-boot-download-$(UBOOT_VERSION)
UBOOT_SOURCE_STAMP = $(STAMPDIR)/u-boot-source
UBOOT_PATCH_STAMP = $(STAMPDIR)/u-boot-patch
UBOOT_BUILD_STAMP = $(STAMPDIR)/u-boot-build
Expand Down
70 changes: 64 additions & 6 deletions build-config/make/xtools.make
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# toolchain using crosstool-NG.
#

# Default GCC version to build for the toolchain
GCC_VERSION ?= 4.9.2

# Note: To help debug problems with building a toolchain enable these
# options in $(XTOOLS_CONFIG)
#
Expand All @@ -18,44 +21,99 @@
# CT_DEBUG_CT_SAVE_STEPS_GZIP=y
#

XTOOLS_CONFIG = conf/crosstool/uClibc-$(UCLIBC_VERSION)/crosstool.$(ONIE_ARCH).config
XTOOLS_CONFIG = conf/crosstool/gcc-$(GCC_VERSION)/uClibc-$(UCLIBC_VERSION)/crosstool.$(ONIE_ARCH).config
XTOOLS_ROOT = $(BUILDDIR)/x-tools
XTOOLS_VERSION = $(ONIE_ARCH)-linux-$(LINUX_RELEASE)-uClibc-$(UCLIBC_VERSION)
XTOOLS_VERSION = $(ONIE_ARCH)-g$(GCC_VERSION)-lnx$(LINUX_RELEASE)-u$(UCLIBC_VERSION)
XTOOLS_DIR = $(XTOOLS_ROOT)/$(XTOOLS_VERSION)
XTOOLS_BUILD_DIR = $(XTOOLS_DIR)/build
XTOOLS_INSTALL_DIR = $(XTOOLS_DIR)/install
XTOOLS_DEBUG_ROOT = $(XTOOLS_INSTALL_DIR)/$(TARGET)/$(TARGET)/debug-root
XTOOLS_STAMP_DIR = $(XTOOLS_DIR)/stamp
XTOOLS_PREP_STAMP = $(XTOOLS_STAMP_DIR)/xtools-prep
XTOOLS_DOWNLOAD_STAMP = $(XTOOLS_STAMP_DIR)/xtools-download
XTOOLS_BUILD_STAMP = $(XTOOLS_STAMP_DIR)/xtools-build
XTOOLS_STAMP = $(XTOOLS_PREP_STAMP) \
$(XTOOLS_DOWNLOAD_STAMP) \
$(XTOOLS_BUILD_STAMP)

# The exported variables are used by the crosstool-NG configuration
# file.
export XTOOLS_INSTALL_DIR

PHONY += xtools xtools-prep xtools-config xtools-build xtools-clean xtools-distclean
PHONY += xtools xtools-prep xtools-download xtools-config \
xtools-build xtools-clean xtools-distclean

# List of common packages needed by crosstool-NG
CT_NG_COMPONENTS = \
make-3.81.tar.bz2 \
m4-1.4.13.tar.xz \
autoconf-2.65.tar.xz \
automake-1.11.1.tar.bz2 \
libelf-0.8.13.tar.gz \
duma_2_5_15.tar.gz \
libtool-2.2.6b.tar.lzma

ifeq ($(GCC_VERSION),4.9.2)
CT_NG_COMPONENTS += \
cloog-0.18.1.tar.gz \
gmp-6.0.0a.tar.xz \
isl-0.12.2.tar.bz2 \
mpfr-3.1.2.tar.xz \
mpc-1.0.2.tar.gz \
binutils-2.25.tar.bz2 \
binutils-2.24.tar.bz2 \
gcc-4.9.2.tar.bz2 \
gdb-7.7.1.tar.bz2 \
ltrace_0.7.3.orig.tar.bz2 \
strace-4.9.tar.xz
else ifeq ($(GCC_VERSION),4.7.3)
CT_NG_COMPONENTS += \
gmp-4.3.2.tar.bz2 \
mpfr-2.4.2.tar.bz2 \
ppl-0.11.2.tar.lzma \
cloog-ppl-0.15.10.tar.gz \
mpc-1.0.1.tar.gz \
binutils-2.22.tar.bz2 \
gcc-4.7.3.tar.bz2 \
gdb-7.4.1.tar.bz2 \
ltrace_0.5.3.orig.tar.gz \
strace-4.6.tar.xz
else
$(error CT_NG_COMPONENTS download: Unsupported GCC version: $(GCC_VERSION))
endif

xtools: $(XTOOLS_STAMP)

xtools-prep: $(XTOOLS_PREP_STAMP)
$(XTOOLS_PREP_STAMP): | $(KERNEL_DOWNLOAD_STAMP) $(UCLIBC_DOWNLOAD_STAMP)
$(XTOOLS_PREP_STAMP): $(PROJECT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Preparing xtools for $(XTOOLS_VERSION) ===="
$(Q) mkdir -p $(XTOOLS_BUILD_DIR) $(XTOOLS_INSTALL_DIR) $(XTOOLS_STAMP_DIR)
$(Q) touch $@

DOWNLOAD += $(XTOOLS_DOWNLOAD_STAMP)
xtools-download: $(XTOOLS_DOWNLOAD_STAMP)
$(XTOOLS_DOWNLOAD_STAMP): $(XTOOLS_PREP_STAMP) | $(KERNEL_DOWNLOAD_STAMP) $(UCLIBC_DOWNLOAD_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Getting upstream crosstool-NG component libraries ===="
$(Q) for F in ${CT_NG_COMPONENTS} ; do echo "==== Getting upstream $${F} ====" ;\
$(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \
$${F} $(CROSSTOOL_ONIE_MIRROR) || exit 1 ; \
done
$(Q) touch $@

$(XTOOLS_BUILD_DIR)/.config: $(XTOOLS_CONFIG) $(XTOOLS_PREP_STAMP)
$(Q) echo "==== Copying $(XTOOLS_CONFIG) to $@ ===="
$(Q) cp -v $< $@

xtools-config: $(XTOOLS_BUILD_DIR)/.config $(CROSSTOOL_NG_BUILD_STAMP)
$(Q) cd $(XTOOLS_BUILD_DIR) && $(CROSSTOOL_NG_DIR)/ct-ng menuconfig

xtools-download: $(XTOOLS_BUILD_DIR)/.config $(CROSSTOOL_NG_BUILD_STAMP)
xtools-download-only: $(XTOOLS_BUILD_DIR)/.config $(CROSSTOOL_NG_BUILD_STAMP)
$(Q) cd $(XTOOLS_BUILD_DIR) && $(CROSSTOOL_NG_DIR)/ct-ng build STOP=libc_check_config

xtools-build: $(XTOOLS_BUILD_STAMP)
$(XTOOLS_BUILD_STAMP): $(XTOOLS_BUILD_DIR)/.config $(CROSSTOOL_NG_BUILD_STAMP)
$(XTOOLS_BUILD_STAMP): $(XTOOLS_BUILD_DIR)/.config $(XTOOLS_DOWNLOAD_STAMP) $(CROSSTOOL_NG_BUILD_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Building xtools for $(XTOOLS_VERSION) ===="
$(Q) cd $(XTOOLS_BUILD_DIR) && \
Expand Down
Loading

0 comments on commit d7be78c

Please sign in to comment.