From patchwork Thu Nov 8 03:38:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zankel X-Patchwork-Id: 197750 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B18562C00BF for ; Thu, 8 Nov 2012 14:39:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id F20B4103BB6; Thu, 8 Nov 2012 03:39:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8pwnfL1qe6ao; Thu, 8 Nov 2012 03:38:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 54526103AE5; Thu, 8 Nov 2012 03:38:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BE9AC8F74A for ; Thu, 8 Nov 2012 03:38:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B859A8BB7D for ; Thu, 8 Nov 2012 03:38:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cjnuJPSsQt+u for ; Thu, 8 Nov 2012 03:38:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pb0-f43.google.com (mail-pb0-f43.google.com [209.85.160.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id 7D47D8B9D6 for ; Thu, 8 Nov 2012 03:38:54 +0000 (UTC) Received: by mail-pb0-f43.google.com with SMTP id jt11so2351310pbb.16 for ; Wed, 07 Nov 2012 19:38:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:to:from:subject:x-gm-message-state; bh=1VpKMQAMqzY0i5O5gGw/h4xCU1il4pfRKsX4Flg4CJc=; b=YenxErtGzsYFVwT1OXuNcomitTtiUuOzj8+aof/MS0gdsMASgtArrv9KrK5Bpr3AJc ANDQY3/aHTxvg85PvPWCxe/VWmBSv6E87I1Vr6Go903AjfPwt4G0lTuRJgZ75EUGKoht 9ysmdiDaKWOwIXa9F02rLmkQ6ZNFeOUl17Sr/CnWtwODKe2BqELZFOmWGtrm8/LOAFwY jSV7lWyth7Ive8vDNcXBMauBe61CgiQQ/5vZcHA8fuEqZ9y4i0Ai5p3pA23Qhgf1UKQS a+jD4UinghWFySfZT6JH4IfDPEHa+/co+rn+rySOvLeaT5aUl4QgtiHPDTNrdgUv6v5k V6nQ== Received: by 10.68.253.102 with SMTP id zz6mr19839908pbc.99.1352345934285; Wed, 07 Nov 2012 19:38:54 -0800 (PST) Received: from localhost (c-67-161-9-61.hsd1.ca.comcast.net. [67.161.9.61]) by mx.google.com with ESMTPS id uk9sm15161147pbc.63.2012.11.07.19.38.52 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 07 Nov 2012 19:38:53 -0800 (PST) Message-ID: <509b294d.49eb440a.3492.7475@mx.google.com> Received: by localhost (sSMTP sendmail emulation); Wed, 07 Nov 2012 19:38:52 -0800 Date: Wed, 07 Nov 2012 19:38:52 -0800 To: buildroot@busybox.net From: Chris Zankel X-Gm-Message-State: ALoCoQmZT+KdwhbpfDHMSQY6pJEUBgZ2A8Ak6eypZ9b5wHSVaEgGDGfRaAuDLShHxUIg1OasGJhC Subject: [Buildroot] [PATCH 2/2] xtensa: support configurable processor configurations X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Xtensa is a configurable processor architecture, which allows to define additional instructions and registers. The required variant specific information for the toolchain is delivered in an 'overlay' file, which needs to be 'untarred' to the corresponding directories after the source is installed and patched. This patch provides support for binutils, gcc, and gdb with a very limited changes to the build scripts. These additions are only executed for the Xtensa architecture and have no effect on other architectures. Signed-off-by: Chris Zankel diff --git a/arch/Config.in.xtensa b/arch/Config.in.xtensa new file mode 100644 index 0000000..61c0235 --- /dev/null +++ b/arch/Config.in.xtensa @@ -0,0 +1,30 @@ +choice + prompt "Target ABI" + depends on BR2_xtensa + default BR2_xtensa_fsf +config BR2_xtensa_custom + bool "Custom Xtensa processor configuration" +config BR2_xtensa_fsf + bool "fsf - Default configuration" +endchoice + +config BR2_xtensa_custom_name + string "Custom Xtensa processor configuration anme" + depends on BR2_xtensa_custom + default "" + help + Name given to a custom Xtensa processor configuration. + +config BR2_xtensa_core_name + string + default BR2_xtensa_custom_name if BR2_xtensa_custom + default "" if BR2_xtensa_fsf + +config BR2_xtensa_overlay_dir + string "Overlay directory for custom configuration" + depends on BR2_xtensa_custom + default "" + help + Provide a directory path that contains the overlay files + for the custom configuration. The path is based on the + buildroot top directory. diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk index e1aac9b..0c69cb5 100644 --- a/package/binutils/binutils.mk +++ b/package/binutils/binutils.mk @@ -66,5 +66,14 @@ define BINUTILS_INSTALL_TARGET_CMDS endef endif +XTENSA_CORE_NAME = $(call qstrip, $(BR2_xtensa_core_name)) +ifneq ($(XTENSA_CORE_NAME),) +define BINUTILS_XTENSA_PRE_PATCH + tar xf $(BR2_xtensa_overlay_dir)/xtensa_$(XTENSA_CORE_NAME).tar \ + -C $(@D) bfd include ld +endef +HOST_BINUTILS_PRE_PATCH_HOOKS += BINUTILS_XTENSA_PRE_PATCH +endif + $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/toolchain/gcc/gcc-uclibc-4.x.mk b/toolchain/gcc/gcc-uclibc-4.x.mk index 1a075cc..1710070 100644 --- a/toolchain/gcc/gcc-uclibc-4.x.mk +++ b/toolchain/gcc/gcc-uclibc-4.x.mk @@ -251,6 +251,10 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE) rm -rf $(GCC_DIR) $(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) - $(call CONFIG_UPDATE,$(@D)) +ifneq ($(call qstrip, $(BR2_xtensa_core_name)),) + tar xf $(BR2_xtensa_overlay_dir)/xtensa_$(call qstrip,\ + $(BR2_xtensa_core_name)).tar -C $(@D) include +endif touch $@ gcc-patched: $(GCC_DIR)/.patched diff --git a/toolchain/gdb/gdb.mk b/toolchain/gdb/gdb.mk index 6b029a8..dc305a6 100644 --- a/toolchain/gdb/gdb.mk +++ b/toolchain/gdb/gdb.mk @@ -25,6 +25,10 @@ gdb-unpacked: $(GDB_DIR)/.unpacked $(GDB_DIR)/.unpacked: $(DL_DIR)/$(GDB_SOURCE) mkdir -p $(GDB_DIR) $(GDB_CAT) $(DL_DIR)/$(GDB_SOURCE) | tar -C $(GDB_DIR) $(TAR_STRIP_COMPONENTS)=1 $(TAR_OPTIONS) - +ifneq ($(call qstrip, $(BR2_xtensa_core_name)),) + tar xf $(BR2_xtensa_overlay_dir)/xtensa_$(call qstrip, \ + $(BR2_xtensa_core_name)).tar -C $(@D) bfd include gdb +endif ifneq ($(wildcard $(GDB_PATCH_DIR)),) support/scripts/apply-patches.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch endif