From patchwork Wed Feb 26 01:08:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Behan Webster X-Patchwork-Id: 25337 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC1CB20143 for ; Wed, 26 Feb 2014 01:11:19 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 131sf1236426ykp.1 for ; Tue, 25 Feb 2014 17:11:19 -0800 (PST) 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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=GvzXlNFlkrqZqJNKTLu4xhwq6OkS7pjkN/ImF3mMks4=; b=PuaLQhxHrWDJ10NaLd/EeDrrcHa7aBjArIPmeqRF7sF1kSlZFhPeuvtgJXxkji9er/ NvCxbnfaUKFxm0Pe69N6n9dflfvXsvRy2wOHQUM8beh81NF1UHvGWMrJi2nY+bGJwyMc zgz1ImeRGIyuwfhkSWMqy1m2ExcL6sdVdw/PsEaxo1hs7qPpIWSaeiGc+TI6xxO4VXPY FrhxYcnXexXoIayqNVWukupmVwROXwjLaLySZ5K0T7flqh7KK9ZPs+hYCvo7DdUFTLu9 8Umpg0MDejHglqjMPOCUNFur5tI41VL1j2bVXhuxMJpLhmxT6LUy5n63t2zhJ4tYHgH4 59Ww== X-Gm-Message-State: ALoCoQlGF4TyUBA0EOf5SoIM4LXEkUZOT93l6h9CR1xvTtsmQyozSZ1lApPSJbHXlCgSziibtne8 X-Received: by 10.236.94.48 with SMTP id m36mr1176999yhf.47.1393377079108; Tue, 25 Feb 2014 17:11:19 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.135 with SMTP id r7ls29381qgr.25.gmail; Tue, 25 Feb 2014 17:11:19 -0800 (PST) X-Received: by 10.52.186.230 with SMTP id fn6mr3104604vdc.14.1393377078990; Tue, 25 Feb 2014 17:11:18 -0800 (PST) Received: from mail-vc0-x231.google.com (mail-vc0-x231.google.com [2607:f8b0:400c:c03::231]) by mx.google.com with ESMTPS id f7si7278980vcz.132.2014.02.25.17.11.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 17:11:18 -0800 (PST) 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 if11so213834vcb.36 for ; Tue, 25 Feb 2014 17:11:18 -0800 (PST) X-Received: by 10.58.200.168 with SMTP id jt8mr3623900vec.30.1393377078893; Tue, 25 Feb 2014 17:11:18 -0800 (PST) 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.174.196 with SMTP id u4csp179612vcz; Tue, 25 Feb 2014 17:11:18 -0800 (PST) X-Received: by 10.68.239.70 with SMTP id vq6mr3047610pbc.152.1393377078018; Tue, 25 Feb 2014 17:11:18 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tu2si5347959pbc.159.2014.02.25.17.11.17; Tue, 25 Feb 2014 17:11:17 -0800 (PST) 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 S1751442AbaBZBLJ (ORCPT + 26 others); Tue, 25 Feb 2014 20:11:09 -0500 Received: from mail-pb0-f52.google.com ([209.85.160.52]:40669 "EHLO mail-pb0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751962AbaBZBJi (ORCPT ); Tue, 25 Feb 2014 20:09:38 -0500 Received: by mail-pb0-f52.google.com with SMTP id rr13so221778pbb.11 for ; Tue, 25 Feb 2014 17:09:38 -0800 (PST) X-Received: by 10.66.123.5 with SMTP id lw5mr5005165pab.83.1393376977994; Tue, 25 Feb 2014 17:09:37 -0800 (PST) Received: from galdor.websterwood.com ([207.6.123.58]) by mx.google.com with ESMTPSA id un5sm154425478pab.3.2014.02.25.17.09.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Feb 2014 17:09:35 -0800 (PST) From: behanw@converseincode.com To: mmarek@suse.cz, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, sparse@chrisli.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, torvalds@linux-foundation.org, dwmw2@infradead.org, pageexec@freemail.hu, Mark Charlebois , Behan Webster Subject: [PATCH 4/5] LLVMLinux: Add support for clang to compiler.h and new compiler-clang.h Date: Tue, 25 Feb 2014 17:08:42 -0800 Message-Id: <1393376923-21892-5-git-send-email-behanw@converseincode.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393376923-21892-1-git-send-email-behanw@converseincode.com> References: <1393376923-21892-1-git-send-email-behanw@converseincode.com> 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 (bad format) 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: Mark Charlebois Add a compiler-clang.h file to add specific macros needed for compiling the kernel with clang. Initially the only override required is the macro for silencing the compiler for a purposefully uninintialized variable. Author: Mark Charlebois Signed-off-by: Mark Charlebois Signed-off-by: Behan Webster --- include/linux/compiler-clang.h | 12 ++++++++++++ include/linux/compiler.h | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 include/linux/compiler-clang.h diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h new file mode 100644 index 0000000..d1e49d5 --- /dev/null +++ b/include/linux/compiler-clang.h @@ -0,0 +1,12 @@ +#ifndef __LINUX_COMPILER_H +#error "Please don't include directly, include instead." +#endif + +/* Some compiler specific definitions are overwritten here + * for Clang compiler + */ + +#ifdef uninitialized_var +#undef uninitialized_var +#define uninitialized_var(x) x = *(&(x)) +#endif diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 2472740..ee7239e 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -63,6 +63,13 @@ extern void __chk_io_ptr(const volatile void __iomem *); # include #endif +/* Clang compiler defines __GNUC__. So we will overwrite implementations + * coming from above header files here + */ +#ifdef __clang__ +#include +#endif + /* * Generic compiler-dependent macros required for kernel * build go below this comment. Actual compiler/compiler version