From patchwork Thu Apr 23 09:27:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Neukirchen X-Patchwork-Id: 463920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 2CA9E14012F for ; Thu, 23 Apr 2015 19:27:47 +1000 (AEST) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 0C7A22803CC; Thu, 23 Apr 2015 11:26:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 13C082801B5 for ; Thu, 23 Apr 2015 11:26:36 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mout.web.de (mout.web.de [212.227.17.12]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Thu, 23 Apr 2015 11:26:35 +0200 (CEST) Received: from [192.168.3.157] ([91.64.206.248]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MHowb-1YkNwJ0Xld-003cdX for ; Thu, 23 Apr 2015 11:27:34 +0200 Message-ID: <5538BB09.1090809@web.de> Date: Thu, 23 Apr 2015 11:27:37 +0200 From: Dirk Neukirchen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: OpenWrt Development List X-Provags-ID: V03:K0:+VeYW/y9+aH7eCLKsafFGBYNMt0Gefn0ggOu5AGi0OVl86iBA4F Gmm2jKGaAHgFdrzridBZuWuppUPncY7lX8rwmcbq8CBVik3OCfEl8JwwPxnVRWyB47HiXkv /27ROlWBqDRJ78dCu0PsJgf7gEuACbeLuY/lQk3sZKSRUgVX3u9F00j3Hq0sQ+BdVzS3PmK brMfeEP1Nq7tBsfzP78uw== X-UI-Out-Filterresults: notjunk:1; Subject: [OpenWrt-Devel] [PATCH] tools/mkimage: backport gcc5 compatibility, patch X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Fedora 22 includes gcc5 by default build leads to error: include/linux/compiler-gcc.h:114:30: fatal error: linux/compiler-gcc5.h: No such file or directory backport upstream patch: "Add linux/compiler-gcc5.h to fix builds with gcc5" id: 478b02f1a7043b673565075ea5016376f3293b23 Issue was reported at https://forum.openwrt.org/viewtopic.php?id=56853 & replicated in a VM created, flashed and tested ar71xx image successfully as test Signed-off-by: Dirk Neukirchen --- tools/mkimage/patches/200-gcc5_compat.patch | 93 +++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 tools/mkimage/patches/200-gcc5_compat.patch diff --git a/tools/mkimage/patches/200-gcc5_compat.patch b/tools/mkimage/patches/200-gcc5_compat.patch new file mode 100644 index 0000000..4d55f00 --- /dev/null +++ b/tools/mkimage/patches/200-gcc5_compat.patch @@ -0,0 +1,93 @@ +From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sat, 7 Feb 2015 22:52:40 +0100 +Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5 + +Add linux/compiler-gcc5/h from the kernel sources at: + +commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b +Author: Steven Noonan +Date: Sat Oct 25 15:09:42 2014 -0700 + + compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles + +Signed-off-by: Hans de Goede +--- + include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 65 insertions(+) + create mode 100644 include/linux/compiler-gcc5.h + +diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h +new file mode 100644 +index 0000000..c8c5659 +--- /dev/null ++++ b/include/linux/compiler-gcc5.h +@@ -0,0 +1,65 @@ ++#ifndef __LINUX_COMPILER_H ++#error "Please don't include directly, include instead." ++#endif ++ ++#define __used __attribute__((__used__)) ++#define __must_check __attribute__((warn_unused_result)) ++#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) ++ ++/* Mark functions as cold. gcc will assume any path leading to a call ++ to them will be unlikely. This means a lot of manual unlikely()s ++ are unnecessary now for any paths leading to the usual suspects ++ like BUG(), printk(), panic() etc. [but let's keep them for now for ++ older compilers] ++ ++ Early snapshots of gcc 4.3 don't support this and we can't detect this ++ in the preprocessor, but we can live with this because they're unreleased. ++ Maketime probing would be overkill here. ++ ++ gcc also has a __attribute__((__hot__)) to move hot functions into ++ a special section, but I don't see any sense in this right now in ++ the kernel context */ ++#define __cold __attribute__((__cold__)) ++ ++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) ++ ++#ifndef __CHECKER__ ++# define __compiletime_warning(message) __attribute__((warning(message))) ++# define __compiletime_error(message) __attribute__((error(message))) ++#endif /* __CHECKER__ */ ++ ++/* ++ * Mark a position in code as unreachable. This can be used to ++ * suppress control flow warnings after asm blocks that transfer ++ * control elsewhere. ++ * ++ * Early snapshots of gcc 4.5 don't support this and we can't detect ++ * this in the preprocessor, but we can live with this because they're ++ * unreleased. Really, we need to have autoconf for the kernel. ++ */ ++#define unreachable() __builtin_unreachable() ++ ++/* Mark a function definition as prohibited from being cloned. */ ++#define __noclone __attribute__((__noclone__)) ++ ++/* ++ * Tell the optimizer that something else uses this function or variable. ++ */ ++#define __visible __attribute__((externally_visible)) ++ ++/* ++ * GCC 'asm goto' miscompiles certain code sequences: ++ * ++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 ++ * ++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. ++ * ++ * (asm goto is automatically volatile - the naming reflects this.) ++ */ ++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) ++ ++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP ++#define __HAVE_BUILTIN_BSWAP32__ ++#define __HAVE_BUILTIN_BSWAP64__ ++#define __HAVE_BUILTIN_BSWAP16__ ++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ +-- +1.7.10.4 +