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: 3720041 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D94639F2F7 for ; Wed, 26 Feb 2014 01:11:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 00B5C200BE for ; Wed, 26 Feb 2014 01:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 075E120138 for ; Wed, 26 Feb 2014 01:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752317AbaBZBLJ (ORCPT ); Tue, 25 Feb 2014 20:11:09 -0500 Received: from mail-pb0-f44.google.com ([209.85.160.44]:34461 "EHLO mail-pb0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbaBZBJi (ORCPT ); Tue, 25 Feb 2014 20:09:38 -0500 Received: by mail-pb0-f44.google.com with SMTP id rp16so217263pbb.31 for ; Tue, 25 Feb 2014 17:09:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=converseincode.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pVlzc9xyiHqyvyEXIqF6fnIxE+GHUY4x8Y++25jgZUg=; b=a63Gj6m4GgcIdhVK+EpPkxjNeW0kS78dwGUOmcZAqqFC99Ps5SCWeJMkIse2iCGPYC vUVd5RsNH1/Pd8tdnCMWYYKunGEWUHEwGzMuBqbzjhH9rjm2B+eGrv8gyf54iL92mWtJ APO/K6HWnsdFZdtwNzxvkktXUUw337rKjKkk4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pVlzc9xyiHqyvyEXIqF6fnIxE+GHUY4x8Y++25jgZUg=; b=HbgA1iRMtDbhexoNYYqjU0At3KAcxVoQ9DpSsjDzLr8vLNXXbwxIVbiVHeYFaYNy0o ID1WwlTVtiyrRevXT9o5ksUuulpDyshVCgpggxxh4MWpl7fB4o5nJutvXxLic1Cj0myI 5FdjxBQEG3hhrWSsP6qBENb3/jwtMoAPTKbfqGNpI+Bk2wJEBkIW7GVi+DnyMJkYyHBG zBBWdZqxSX/dBmdIF+QSruJnDlZAijTFS9vhP9Oy6hruKeBqw3bMTrVBPQukVB32zi18 QoQ1PPpZDrfoPW3dfNlP+bTaB5oHhwRAdKo0zbVRF9lzXNed8ojGG/AooYSX+n28Bltr 7Ptg== X-Gm-Message-State: ALoCoQn43/Spuc9un6PpmW9YnoMFZaTcsxWnj0pOqYKf75FJ/suzhAwbqHJePBkewRsSGVBCvL5O 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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, KHOP_BIG_TO_CC,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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