diff options
Diffstat (limited to 'meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch')
-rw-r--r-- | meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch b/meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch new file mode 100644 index 000000000..70b0983e4 --- /dev/null +++ b/meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | From 14d469bc82c758116aef7d549abd49c131b4170f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 22 Apr 2017 11:54:57 -0700 | ||
4 | Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler | ||
5 | option | ||
6 | |||
7 | If this option is supported by compiler then disable it ( gcc7+) | ||
8 | Fixes | ||
9 | client.c:834:23: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Werror=format-truncation=] | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | configure.ac | 3 +- | ||
14 | m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++ | ||
15 | 2 files changed, 76 insertions(+), 1 deletion(-) | ||
16 | create mode 100644 m4/ax_check_compile_flag.m4 | ||
17 | |||
18 | diff --git a/configure.ac b/configure.ac | ||
19 | index 8854542..f3a6b57 100644 | ||
20 | --- a/configure.ac | ||
21 | +++ b/configure.ac | ||
22 | @@ -4,7 +4,6 @@ AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)]) | ||
23 | AC_CONFIG_SRCDIR(src/target_set.c) | ||
24 | AC_CONFIG_HEADERS(src/config.h) | ||
25 | AC_CONFIG_AUX_DIR([libltdl/config]) | ||
26 | - | ||
27 | dnl older automake's default of ARFLAGS=cru is noisy on newer binutils; | ||
28 | dnl we don't really need the 'u' even in older toolchains. Then there is | ||
29 | dnl older libtool, which spelled it AR_FLAGS | ||
30 | @@ -6688,6 +6687,8 @@ then | ||
31 | AM_CFLAGS="$AM_CFLAGS -Werror" | ||
32 | AM_CXXFLAGS="$AM_CXXFLAGS -Werror" | ||
33 | fi | ||
34 | +AX_CHECK_COMPILE_FLAG([-Werror=format-truncation],[AM_CFLAGS="$AM_CFLAGS -Wno-error=format-truncation" AM_CXXFLAGS="$AM_CXXFLAGS -Wno-error=format-truncation"]) | ||
35 | + | ||
36 | AC_SUBST([AM_CFLAGS]) | ||
37 | AC_SUBST([AM_CXXFLAGS]) | ||
38 | |||
39 | diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 | ||
40 | new file mode 100644 | ||
41 | index 0000000..dcabb92 | ||
42 | --- /dev/null | ||
43 | +++ b/m4/ax_check_compile_flag.m4 | ||
44 | @@ -0,0 +1,74 @@ | ||
45 | +# =========================================================================== | ||
46 | +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html | ||
47 | +# =========================================================================== | ||
48 | +# | ||
49 | +# SYNOPSIS | ||
50 | +# | ||
51 | +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) | ||
52 | +# | ||
53 | +# DESCRIPTION | ||
54 | +# | ||
55 | +# Check whether the given FLAG works with the current language's compiler | ||
56 | +# or gives an error. (Warnings, however, are ignored) | ||
57 | +# | ||
58 | +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on | ||
59 | +# success/failure. | ||
60 | +# | ||
61 | +# If EXTRA-FLAGS is defined, it is added to the current language's default | ||
62 | +# flags (e.g. CFLAGS) when the check is done. The check is thus made with | ||
63 | +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to | ||
64 | +# force the compiler to issue an error when a bad flag is given. | ||
65 | +# | ||
66 | +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. | ||
67 | +# | ||
68 | +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this | ||
69 | +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. | ||
70 | +# | ||
71 | +# LICENSE | ||
72 | +# | ||
73 | +# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> | ||
74 | +# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> | ||
75 | +# | ||
76 | +# This program is free software: you can redistribute it and/or modify it | ||
77 | +# under the terms of the GNU General Public License as published by the | ||
78 | +# Free Software Foundation, either version 3 of the License, or (at your | ||
79 | +# option) any later version. | ||
80 | +# | ||
81 | +# This program is distributed in the hope that it will be useful, but | ||
82 | +# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
83 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
84 | +# Public License for more details. | ||
85 | +# | ||
86 | +# You should have received a copy of the GNU General Public License along | ||
87 | +# with this program. If not, see <https://www.gnu.org/licenses/>. | ||
88 | +# | ||
89 | +# As a special exception, the respective Autoconf Macro's copyright owner | ||
90 | +# gives unlimited permission to copy, distribute and modify the configure | ||
91 | +# scripts that are the output of Autoconf when processing the Macro. You | ||
92 | +# need not follow the terms of the GNU General Public License when using | ||
93 | +# or distributing such scripts, even though portions of the text of the | ||
94 | +# Macro appear in them. The GNU General Public License (GPL) does govern | ||
95 | +# all other use of the material that constitutes the Autoconf Macro. | ||
96 | +# | ||
97 | +# This special exception to the GPL applies to versions of the Autoconf | ||
98 | +# Macro released by the Autoconf Archive. When you make and distribute a | ||
99 | +# modified version of the Autoconf Macro, you may extend this special | ||
100 | +# exception to the GPL to apply to your modified version as well. | ||
101 | + | ||
102 | +#serial 5 | ||
103 | + | ||
104 | +AC_DEFUN([AX_CHECK_COMPILE_FLAG], | ||
105 | +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF | ||
106 | +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl | ||
107 | +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ | ||
108 | + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS | ||
109 | + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" | ||
110 | + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], | ||
111 | + [AS_VAR_SET(CACHEVAR,[yes])], | ||
112 | + [AS_VAR_SET(CACHEVAR,[no])]) | ||
113 | + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) | ||
114 | +AS_VAR_IF(CACHEVAR,yes, | ||
115 | + [m4_default([$2], :)], | ||
116 | + [m4_default([$3], :)]) | ||
117 | +AS_VAR_POPDEF([CACHEVAR])dnl | ||
118 | +])dnl AX_CHECK_COMPILE_FLAGS | ||
119 | -- | ||
120 | 2.12.2 | ||
121 | |||