From patchwork Thu May 16 19:32:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helge Deller X-Patchwork-Id: 2579721 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 344464020A for ; Thu, 16 May 2013 19:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753453Ab3EPTcY (ORCPT ); Thu, 16 May 2013 15:32:24 -0400 Received: from mout.gmx.net ([212.227.17.20]:58419 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753325Ab3EPTcY (ORCPT ); Thu, 16 May 2013 15:32:24 -0400 Received: from mailout-de.gmx.net ([10.1.76.28]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0LfUkZ-1UAHkd32S1-00p3Gb for ; Thu, 16 May 2013 21:32:22 +0200 Received: (qmail invoked by alias); 16 May 2013 19:32:22 -0000 Received: from p54AD4764.dip0.t-ipconnect.de (EHLO p100.box) [84.173.71.100] by mail.gmx.net (mp028) with SMTP; 16 May 2013 21:32:22 +0200 X-Authenticated: #1045983 X-Provags-ID: V01U2FsdGVkX18TMo9pXYUTbmtOn0zBVX5uf5zbezsa8W1aYCTHNo Xfwa7Lye3jaC9Z Date: Thu, 16 May 2013 21:32:20 +0200 From: Helge Deller To: stable@vger.kernel.org, linux-parisc@vger.kernel.org Subject: [PATCH] parisc: make default cross compiler search more robust Message-ID: <20130516193138.GA392@p100.box> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Y-GMX-Trusted: 0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org please add to stable kernel v3.9 this patch is a merge of upstream commits 93782eba49e23c3f311a6b05a19ba15927ec4e8b and 6880b0150a7c25fd75c5ece80abc49ebf53c38c1 People/distros vary how they prefix the toolchain name for 64bit builds. Rather than enforce one convention over another, add a for loop which does a search for all the general prefixes. For 64bit builds, we now search for (in order): hppa64-unknown-linux-gnu hppa64-linux-gnu hppa64-linux For 32bit builds, we look for: hppa-unknown-linux-gnu hppa-linux-gnu hppa-linux hppa2.0-unknown-linux-gnu hppa2.0-linux-gnu hppa2.0-linux hppa1.1-unknown-linux-gnu hppa1.1-linux-gnu hppa1.1-linux This patch was initiated by Mike Frysinger, with feedback from Jeroen Roovers, John David Anglin and Helge Deller. Signed-off-by: Mike Frysinger Signed-off-by: Jeroen Roovers Signed-off-by: John David Anglin Signed-off-by: Helge Deller --- To unsubscribe from this list: send the line "unsubscribe linux-parisc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile index 113e282..1976900 100644 --- a/arch/parisc/Makefile +++ b/arch/parisc/Makefile @@ -23,26 +23,21 @@ NM = sh $(srctree)/arch/parisc/nm CHECKFLAGS += -D__hppa__=1 LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) -MACHINE := $(shell uname -m) -ifeq ($(MACHINE),parisc*) -NATIVE := 1 -endif - ifdef CONFIG_64BIT UTS_MACHINE := parisc64 CHECKFLAGS += -D__LP64__=1 -m64 -WIDTH := 64 +CC_ARCHES = hppa64 else # 32-bit -WIDTH := +CC_ARCHES = hppa hppa2.0 hppa1.1 endif -# attempt to help out folks who are cross-compiling -ifeq ($(NATIVE),1) -CROSS_COMPILE := hppa$(WIDTH)-linux- -else - ifeq ($(CROSS_COMPILE),) - CROSS_COMPILE := hppa$(WIDTH)-linux-gnu- - endif +ifneq ($(SUBARCH),$(UTS_MACHINE)) + ifeq ($(CROSS_COMPILE),) + CC_SUFFIXES = linux linux-gnu unknown-linux-gnu + CROSS_COMPILE := $(call cc-cross-prefix, \ + $(foreach a,$(CC_ARCHES), \ + $(foreach s,$(CC_SUFFIXES),$(a)-$(s)-))) + endif endif OBJCOPY_FLAGS =-O binary -R .note -R .comment -S