From patchwork Sat Nov 10 00:20:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Zankel X-Patchwork-Id: 198165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 3B8642C0087 for ; Sat, 10 Nov 2012 11:20:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1F49CA0206; Sat, 10 Nov 2012 00:20:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sbaz5Pk0CHTn; Sat, 10 Nov 2012 00:20:49 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 9A38DA058F; Sat, 10 Nov 2012 00:20:06 +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 7B0DB8F74A for ; Sat, 10 Nov 2012 00:20:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 577318F4AA for ; Sat, 10 Nov 2012 00:20:05 +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 hABA8DIXRJ4p for ; Sat, 10 Nov 2012 00:20:03 +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 BC24D8D1A4 for ; Sat, 10 Nov 2012 00:20:03 +0000 (UTC) Received: by mail-pb0-f43.google.com with SMTP id jt11so4623017pbb.16 for ; Fri, 09 Nov 2012 16:20:03 -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=hbNyuRITf4NojxanfjrG9G+6RTbjH14oRUqmrbn1lKoUlzDhWI3wLBGwswZz9HJrwR FnTWn+YIriyZ9wdkGNwgubDL0tiAkdpJRGUBucOE0euvfMHd3A4nKtxqLDuyt1qquZKc Msw0J4QDL9bqt3MWJ6YKecQ2RudqPHsIEcxXh3BDDSxA/CUqLaLNrht3sM2g93OEvFPv KlxMftnChmNEoNHTsgu+o1ArSKFth6UkCW1y+XZtIeaG0nCULmSUoG7rFF7vSnmn7Etx deYiQhbz02xNn9OPImHpskJBC96p7CYyN2A6sTVyiJnxLDvOLoX4gnq6jcYFsjpP/Les U0zA== Received: by 10.66.77.199 with SMTP id u7mr35996347paw.7.1352506803430; Fri, 09 Nov 2012 16:20:03 -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 ok8sm21784pbb.42.2012.11.09.16.20.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 09 Nov 2012 16:20:02 -0800 (PST) Message-ID: <509d9db2.4883440a.7065.016e@mx.google.com> Received: by localhost (sSMTP sendmail emulation); Fri, 09 Nov 2012 16:20:00 -0800 Date: Fri, 09 Nov 2012 16:20:00 -0800 To: buildroot@busybox.net From: Chris Zankel X-Gm-Message-State: ALoCoQmR7/inzjQ27RO5P/Eahu0R3sRaObfq8ixT59WYpnlTh8TKwqUbOP6uzJjWUVMpSkuRqCfw Subject: [Buildroot] [PATCH 2/2 v3] 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