summaryrefslogtreecommitdiffstats
path: root/toolchain/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain/gcc')
-rw-r--r--toolchain/gcc/Config.in2
-rw-r--r--toolchain/gcc/gcc-uclibc-3.x.mk36
-rw-r--r--toolchain/gcc/gcc-uclibc-4.x.mk34
3 files changed, 50 insertions, 22 deletions
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index c7b258095..51934d9d9 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -119,7 +119,7 @@ config BR2_GCC_VERSION
config BR2_TOOLCHAIN_SYSROOT
bool "Enable toolchain with --sysroot support"
- depends on !BR2_GCC_VERSION_3_3_5 && !BR2_GCC_VERSION_3_3_6 && !BR2_GCC_VERSION_3_4_2 && !BR2_GCC_VERSION_3_4_3 && !BR2_GCC_VERSION_3_4_4 && !BR2_GCC_VERSION_3_4_5 && !BR2_GCC_VERSION_3_4_6
+ depends on !BR2_GCC_VERSION_3_3_5 && !BR2_GCC_VERSION_3_3_6 && !BR2_GCC_VERSION_3_4_2 && !BR2_GCC_VERSION_3_4_3 && !BR2_GCC_VERSION_3_4_4 && !BR2_GCC_VERSION_3_4_5 && !BR2_GCC_VERSION_3_4_6 && !BR2_GCC_VERSION_4_1_2
default y
help
Enables --sysroot=dir for binutils and gcc.
diff --git a/toolchain/gcc/gcc-uclibc-3.x.mk b/toolchain/gcc/gcc-uclibc-3.x.mk
index cd736371f..798ba25b9 100644
--- a/toolchain/gcc/gcc-uclibc-3.x.mk
+++ b/toolchain/gcc/gcc-uclibc-3.x.mk
@@ -31,8 +31,31 @@ GCC_OFFICIAL_VER:=$(GCC_VERSION)-$(GCC_SNAP_DATE)
GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_OFFICIAL_VER)
endif
+
+# redefine if using an external prepatched gcc source
+ifeq ($(BR2_TOOLCHAIN_NORMAL),)
+GCC_SITE:=$(VENDOR_SITE)
+GCC_OFFICIAL_VER:=$(GCC_VERSION)$(VENDOR_SUFFIX)$(VENDOR_GCC_RELEASE)
+endif
+
GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER)
+
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y)
+ifeq ($(GCC_SNAP_DATE),)
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+else
+ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),)
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_OFFICIAL_VER)
+else
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+endif
+endif
+else
+GCC_PATCH_DIR:=$(VENDOR_PATCH_DIR)/gcc-$(GCC_OFFICIAL_VER)
+endif
+
+
GCC_CAT:=$(BZCAT)
GCC_STRIP_HOST_BINARIES:=true
@@ -109,7 +132,7 @@ $(DL_DIR)/$(GCC_SOURCE):
mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-gcc-unpacked: $(GCC_DIR)/.unpacked
+gcc-unpacked: $(GCC_DIR)/.patched
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
@@ -119,16 +142,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
gcc-patched: $(GCC_DIR)/.patched
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
-ifeq ($(GCC_SNAP_DATE),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-else
-ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_OFFICIAL_VER) \*.patch
-else
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-endif
-endif
-
+ toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch
# Note: The soft float situation has improved considerably with gcc 3.4.x.
# We can dispense with the custom spec files, as well as libfloat for the arm case.
# However, we still need a patch for arm. There's a similar patch for gcc 3.3.x
diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk
index 2274811b3..fb8cb6908 100644
--- a/toolchain/gcc/gcc-uclibc-4.x.mk
+++ b/toolchain/gcc/gcc-uclibc-4.x.mk
@@ -29,6 +29,28 @@ GCC_OFFICIAL_VER:=$(GCC_VERSION)-$(GCC_SNAP_DATE)
GCC_SITE:=ftp://sources.redhat.com/pub/gcc/snapshots/$(GCC_OFFICIAL_VER)
endif
+# redefine if using an external prepatched gcc source
+ifeq ($(BR2_TOOLCHAIN_NORMAL),)
+GCC_SITE:=$(VENDOR_SITE)
+GCC_OFFICIAL_VER:=$(GCC_VERSION)$(VENDOR_SUFFIX)$(VENDOR_GCC_RELEASE)
+endif
+
+# define patch location
+ifeq ($(BR2_TOOLCHAIN_NORMAL),y) # Normal toolchain
+ifeq ($(GCC_SNAP_DATE),) # Not a snapshot
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+else # Is a snapshot
+ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),) # Snapshot patch?
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_OFFICIAL_VER)
+else # Normal patch to snapshot
+# Use the normal location, if the dedicated location does not exist
+GCC_PATCH_DIR:=toolchain/gcc/$(GCC_VERSION)
+endif # Snapshot patch
+endif # Not a snapshot
+else # Prepatched toolchain
+GCC_PATCH_DIR:=$(VENDOR_PATCH_DIR)/gcc-$(GCC_OFFICIAL_VER)
+endif # Normal toolchain
+
GCC_SOURCE:=gcc-$(GCC_OFFICIAL_VER).tar.bz2
GCC_DIR:=$(TOOL_BUILD_DIR)/gcc-$(GCC_OFFICIAL_VER)
GCC_CAT:=$(BZCAT)
@@ -97,7 +119,7 @@ $(DL_DIR)/$(GCC_SOURCE):
mkdir -p $(DL_DIR)
$(WGET) -P $(DL_DIR) $(GCC_SITE)/$(GCC_SOURCE)
-gcc-unpacked: $(GCC_DIR)/.unpacked
+gcc-unpacked: $(GCC_DIR)/.patched
$(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
mkdir -p $(TOOL_BUILD_DIR)
rm -rf $(GCC_DIR)
@@ -108,15 +130,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
gcc-patched: $(GCC_DIR)/.patched
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
-ifeq ($(GCC_SNAP_DATE),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-else
-ifneq ($(wildcard toolchain/gcc/$(GCC_OFFICIAL_VER)),)
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_OFFICIAL_VER) \*.patch
-else
- toolchain/patch-kernel.sh $(GCC_DIR) toolchain/gcc/$(GCC_VERSION) \*.patch
-endif
-endif
+ toolchain/patch-kernel.sh $(GCC_DIR) $(GCC_PATCH_DIR) \*.patch
# Note: The soft float situation has improved considerably with gcc 3.4.x.
# We can dispense with the custom spec files, as well as libfloat for the arm case.