From patchwork Tue Mar 20 23:02:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 10298155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14141602B3 for ; Tue, 20 Mar 2018 23:05:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06E492874B for ; Tue, 20 Mar 2018 23:05:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE3AA28914; Tue, 20 Mar 2018 23:05:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 922082874B for ; Tue, 20 Mar 2018 23:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=UpNOjafUK95aq03sDtHWeqe6wuuzKKm2ubQkFteKn/g=; b=BJF4KP5wMlK8CnqPfPxWIcFJO9 C/Eb1XQA8ZQo+TvIjongz08XkQfHE2L+8Vxi7P7UjEm9ODm9Cb77d9PTeTxDA434Xvwmw4ZHlpgMT 0bJtco7sbtuIu17lqG1yksU/afGswKJAwYLZLZwmm0HNFq1Ndr818906Olfd6P4My5gMlWgLFbN6X MaTQlyoRKcIUsPbWihFvNKB1uJeu6jFWvJ/pIfnvG6xf5KtRnXvIKeDvhDlMrCGt90vMvGNJ/biMv LDjtJFoGeQwQz7iaVS+HSX8KvqD4+/YmSlOl8Ozv6hmwJL1YBeoaES6eWUGHzf5oJjBHdpIXIj2fz 13Lc70Vg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyQJO-0002OP-Cq; Tue, 20 Mar 2018 23:04:58 +0000 Received: from mail.kmu-office.ch ([2a02:418:6a02::a2]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyQHG-00016L-J7 for linux-arm-kernel@lists.infradead.org; Tue, 20 Mar 2018 23:02:53 +0000 Received: from trochilidae.lan (unknown [IPv6:2001:1620:c6e::587]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 577115C1EA5; Wed, 21 Mar 2018 00:01:58 +0100 (CET) From: Stefan Agner To: linux@armlinux.org.uk, ard.biesheuvel@linaro.org, arnd@arndb.de Subject: [PATCH 5/5] ARM: add support for building ARM kernel with clang Date: Wed, 21 Mar 2018 00:02:06 +0100 Message-Id: <20180320230206.25289-6-stefan@agner.ch> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180320230206.25289-1-stefan@agner.ch> References: <20180320230206.25289-1-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1521586918; bh=yqfGwtX7pL1JP/IuZ5fVxzR+zr83B5Kmv5gHF41iO0w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=JO5xtQtyZCp8ZeKp7kHj0r4Pco0bPj3bTD2c68jIkb0lODrqQcWpvEpjKC970BuTLgY3OCWjNrX/87uXEQgv4SzSL+/QXkuAPmMEVv0pHGg1Ve2GoPBXIT994pb0ree0Ty90qsu4GngAVifUwjuLJ17pPPwM2fW+V65qaIpHrwY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180320_160247_415443_E4B89E04 X-CRM114-Status: GOOD ( 14.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, keescook@chromium.org, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, Stefan Agner , mka@chromium.org, linux-arm-kernel@lists.infradead.org, Bernhard.Rosenkranzer@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Use cc-options call for compiler options which are not available in clang. With this patch an ARMv7 multi platform kernel can be successfully build using clang (tested with version 5.0.1). Based-on-patches-by: Behan Webster Signed-off-by: Stefan Agner --- arch/arm/Makefile | 2 +- arch/arm/boot/compressed/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index e9e3fde3c657..20e9fee1ccc5 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -39,7 +39,7 @@ KBUILD_CFLAGS += $(call cc-option,-mno-unaligned-access) endif ifeq ($(CONFIG_FRAME_POINTER),y) -KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog +KBUILD_CFLAGS +=-fno-omit-frame-pointer $(call cc-option,-mapcs,) $(call cc-option,-mno-sched-prolog,) endif ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 45a6b9b7af2a..6a5c4ac97703 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -113,7 +113,7 @@ CFLAGS_fdt_ro.o := $(nossp_flags) CFLAGS_fdt_rw.o := $(nossp_flags) CFLAGS_fdt_wip.o := $(nossp_flags) -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.