From patchwork Thu Sep 8 16:04:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 3984 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3EA6923F9F for ; Thu, 8 Sep 2011 16:04:26 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 34417A18306 for ; Thu, 8 Sep 2011 16:04:26 +0000 (UTC) Received: by fxd18 with SMTP id 18so2451879fxd.11 for ; Thu, 08 Sep 2011 09:04:26 -0700 (PDT) Received: by 10.223.76.201 with SMTP id d9mr500999fak.119.1315497866033; Thu, 08 Sep 2011 09:04:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.11.8 with SMTP id m8cs180664lab; Thu, 8 Sep 2011 09:04:25 -0700 (PDT) Received: by 10.216.71.76 with SMTP id q54mr9563wed.83.1315497865211; Thu, 08 Sep 2011 09:04:25 -0700 (PDT) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id v7si3939442wec.34.2011.09.08.09.04.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Sep 2011 09:04:25 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by wwi36 with SMTP id 36so38191wwi.31 for ; Thu, 08 Sep 2011 09:04:24 -0700 (PDT) Received: by 10.216.134.155 with SMTP id s27mr900498wei.53.1315497864752; Thu, 08 Sep 2011 09:04:24 -0700 (PDT) Received: from e103592.peterhouse.linaro.org (fw-lnat.cambridge.arm.com [217.140.96.63]) by mx.google.com with ESMTPS id ft2sm4663505wbb.18.2011.09.08.09.04.22 (version=SSLv3 cipher=OTHER); Thu, 08 Sep 2011 09:04:23 -0700 (PDT) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Haojian Zhuang , Eric Miao , Arnd Bergmann Subject: [PATCH v2 1/3] ARM: iwmmxt: Fix Makefile rules for building iwmmxt for Thumb-2 Date: Thu, 8 Sep 2011 17:04:12 +0100 Message-Id: <1315497854-13311-2-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315497854-13311-1-git-send-email-dave.martin@linaro.org> References: <1315497854-13311-1-git-send-email-dave.martin@linaro.org> Because gcc/gas have no sane way to turn on individual CPU extensions from the command-line, iwmmxt.S was previously built with -mcpu=iwmmxt. Unfortunately, this also downgrades the CPU to v5, with the result that this file fails to build for a Thumb-2 kernel. New versions of the tools support -march=+iwmmxt, and it seems reasonable to require up-to-date tools when building in Thumb-2. So, this patch uses -march=armv7-a+iwmmxt for CONFIG_THUMB2_KERNEL=y. Signed-off-by: Dave Martin Acked-by: Arnd Bergmann Acked-by: Nicolas Pitre --- arch/arm/kernel/Makefile | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index f7887dc..e03691e 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -66,6 +66,18 @@ obj-$(CONFIG_IWMMXT) += iwmmxt.o obj-$(CONFIG_CPU_HAS_PMU) += pmu.o obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt +ifdef CONFIG_CPU_V7 +AFLAGS_iwmmxt.o := $(call cc-option,-Wa$(comma)-march=armv7-a+iwmmxt,-DIWMMXT_LEGACY_ASSEMBLER) +ifeq ($(AFLAGS_iwmmxt.o),-DIWMMXT_LEGACY_ASSEMBLER) +ifdef CONFIG_THUMB2_KERNEL +$(error Newer binutils is needed to build iwmmxt support for Thumb-2 kernels.) +else +$(warning Warning: Building legacy pre-v7 iwmmxt code for a v7 target.\ + This is inadvisable. Please upgrade to newer binutils.) +AFLAGS_iwmmxt.o += -Wa,-mcpu=iwmmxt +endif +endif +endif # CONFIG_CPU_V7 ifneq ($(CONFIG_ARCH_EBSA110),y) obj-y += io.o