From patchwork Tue Apr 22 06:08:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 28763 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 579C720341 for ; Tue, 22 Apr 2014 06:09:05 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f10sf26462687yha.7 for ; Mon, 21 Apr 2014 23:09:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=lQhVyVbZz5MTNG817trl7nrXEgUbCOyVNZKo8J41GoM=; b=JiM8HxVRgGtRY/dvR3JYq8dHqbejsCqm1CNK9z0PhV3QZNL/LY8qhd9mqf/xaj+TlH gjqgQqqmTCet86FljHA00b8Y5arirF2RY8Z6w6UE4izUpm8zMU8hQYzfSa/MCxNKSp1w Keq0jBCJ1GrGBc5DTDxeXhkTH4b38G+VmIM8OW6XinRCYuThCz4SR7sWYQm9hsXIJ72M Knsi5xTRASGQ19n/aXj8BmABhLxND89YM4nYBI8xO3SYSQSsjZIVT8l1qyTMGs88kYU0 VMWOHV49WeLgLpxIi+RokRk+PdQRFW78PEHqQGGlvxgR7SnDWX7Ih4cHkQ2FEgvep/lt ZeNA== X-Gm-Message-State: ALoCoQnR63ewSuHKVfd4OuQEhJf8NItVgVe7S1CyxdS/UKJqr1qUN9l7BWydquMRjSyc1orEb35H X-Received: by 10.236.109.169 with SMTP id s29mr19195539yhg.43.1398146944850; Mon, 21 Apr 2014 23:09:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.208 with SMTP id 74ls2221623qgn.18.gmail; Mon, 21 Apr 2014 23:09:04 -0700 (PDT) X-Received: by 10.58.230.103 with SMTP id sx7mr133465vec.28.1398146944759; Mon, 21 Apr 2014 23:09:04 -0700 (PDT) Received: from mail-vc0-x231.google.com (mail-vc0-x231.google.com [2607:f8b0:400c:c03::231]) by mx.google.com with ESMTPS id dm2si6705451vec.165.2014.04.21.23.09.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 23:09:04 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c03::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c03::231; Received: by mail-vc0-f177.google.com with SMTP id if17so2025720vcb.36 for ; Mon, 21 Apr 2014 23:09:04 -0700 (PDT) X-Received: by 10.58.126.4 with SMTP id mu4mr38974400veb.0.1398146944621; Mon, 21 Apr 2014 23:09:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp345272vcb; Mon, 21 Apr 2014 23:09:02 -0700 (PDT) X-Received: by 10.68.225.74 with SMTP id ri10mr12724516pbc.116.1398146941909; Mon, 21 Apr 2014 23:09:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id py5si16056282pbc.357.2014.04.21.23.09.00; Mon, 21 Apr 2014 23:09:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752260AbaDVGIw (ORCPT + 26 others); Tue, 22 Apr 2014 02:08:52 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:60375 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750756AbaDVGIt (ORCPT ); Tue, 22 Apr 2014 02:08:49 -0400 Received: by mail-pa0-f53.google.com with SMTP id ld10so4563211pab.12 for ; Mon, 21 Apr 2014 23:08:49 -0700 (PDT) X-Received: by 10.68.100.1 with SMTP id eu1mr42287280pbb.36.1398146928970; Mon, 21 Apr 2014 23:08:48 -0700 (PDT) Received: from galdor.hil-sanbegi.snd.wayport.net (ip-64-134-224-141.public.wayport.net. [64.134.224.141]) by mx.google.com with ESMTPSA id pe3sm82277032pbc.23.2014.04.21.23.08.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 23:08:47 -0700 (PDT) From: behanw@converseincode.com To: linux@arm.linux.org.uk, damm@opensource.se, kim.phillips@freescale.com, laurent.pinchart+renesas@ideasonboard.com, kyungsik.lee@lge.com, linus.walleij@linaro.org Cc: horms+renesas@verge.net.au, akpm@linux-foundation.org, geert@linux-m68k.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Behan Webster , Mark Charlebois Subject: [PATCH] Kbuild arm: LLVMLinux: Add Kbuild support for building arch arm with Clang Date: Mon, 21 Apr 2014 23:08:18 -0700 Message-Id: <1398146898-15009-1-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Original-Sender: behanw@converseincode.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c03::231 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@converseincode.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Behan Webster Protect more options for arm with cc-option so that we don't get errors when using clang instead of gcc. Add more or different options when using clang as well. Author: Behan Webster Signed-off-by: Mark Charlebois Signed-off-by: Behan Webster --- arch/arm/Makefile | 16 ++++++++++++---- arch/arm/boot/compressed/Makefile | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 41c1931..60412ce 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -23,6 +23,14 @@ OBJCOPYFLAGS :=-O binary -R .comment -S GZFLAGS :=-9 #KBUILD_CFLAGS +=-pipe +ifeq ($(COMPILER),clang) +# Clang options +ifneq ($(CROSS_COMPILE),) +KBUILD_CPPFLAGS += -target $(CROSS_COMPILE:-=) +endif +KBUILD_CFLAGS += -fno-builtin -Wno-asm-operand-widths -Xassembler -mno-warn-deprecated +endif + # Never generate .eh_frame KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) @@ -41,11 +49,11 @@ KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog endif ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) -KBUILD_CPPFLAGS += -mbig-endian +KBUILD_CPPFLAGS += $(call cc-option,-mbig-endian,) AS += -EB LD += -EB else -KBUILD_CPPFLAGS += -mlittle-endian +KBUILD_CPPFLAGS += $(call cc-option,-mlittle-endian,) AS += -EL LD += -EL endif @@ -96,7 +104,7 @@ tune-$(CONFIG_CPU_V6K) =$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm) tune-y := $(tune-y) ifeq ($(CONFIG_AEABI),y) -CFLAGS_ABI :=-mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp +CFLAGS_ABI :=-mabi=aapcs-linux $(call cc-option,-mno-thumb-interwork,) -mfpu=vfp else CFLAGS_ABI :=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,) endif @@ -120,7 +128,7 @@ AFLAGS_ISA :=$(CFLAGS_ISA) endif # Need -Uarm for gcc < 3.x -KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm +KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float $(call cc-option, -Uarm,) KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float CHECKFLAGS += -D__arm__ diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 68c9183..9aee36e 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -121,7 +121,7 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) endif -ccflags-y := -fpic -mno-single-pic-base -fno-builtin -I$(obj) +ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin -I$(obj) asflags-y := -DZIMAGE # Supply kernel BSS size to the decompressor via a linker symbol.