diff options
| author | Khem Raj <raj.khem@gmail.com> | 2017-08-08 14:47:59 -0700 |
|---|---|---|
| committer | Martin Jansa <Martin.Jansa@gmail.com> | 2017-08-13 13:21:02 +0200 |
| commit | 4febf0dafb3fc7aac007198046cfe0731fc5be5b (patch) | |
| tree | d37ea723169d7a7bc405c97796d437157339ecfa | |
| parent | 2d07918e9cc6e03f8f864605c84290b66b81e998 (diff) | |
| download | meta-openembedded-4febf0dafb3fc7aac007198046cfe0731fc5be5b.tar.gz | |
collectd: Fix build with clang
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
| -rw-r--r-- | meta-oe/recipes-extended/collectd/collectd/0001-configure-Check-for-Wno-error-format-truncation-comp.patch | 12 |
1 files changed, 8 insertions, 4 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 index 70b0983e4f..5069a639c1 100644 --- 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 | |||
| @@ -1,14 +1,18 @@ | |||
| 1 | From 14d469bc82c758116aef7d549abd49c131b4170f Mon Sep 17 00:00:00 2001 | 1 | From b459c55e4968321e5a82272cb39aa69d4054990f Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Sat, 22 Apr 2017 11:54:57 -0700 | 3 | Date: Sat, 22 Apr 2017 11:54:57 -0700 |
| 4 | Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler | 4 | Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler |
| 5 | option | 5 | option |
| 6 | 6 | ||
| 7 | If this option is supported by compiler then disable it ( gcc7+) | 7 | If this option is supported by compiler then disable it ( gcc7+) |
| 8 | Use -Werror to elevate the warning to an error in case compiler like clang | ||
| 9 | which warn about unknown options but not error out unless asked for | ||
| 10 | |||
| 8 | Fixes | 11 | 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=] | 12 | 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 | 13 | ||
| 11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | |||
| 12 | --- | 16 | --- |
| 13 | configure.ac | 3 +- | 17 | configure.ac | 3 +- |
| 14 | m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++ | 18 | m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++++++++++ |
| @@ -16,7 +20,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com> | |||
| 16 | create mode 100644 m4/ax_check_compile_flag.m4 | 20 | create mode 100644 m4/ax_check_compile_flag.m4 |
| 17 | 21 | ||
| 18 | diff --git a/configure.ac b/configure.ac | 22 | diff --git a/configure.ac b/configure.ac |
| 19 | index 8854542..f3a6b57 100644 | 23 | index 8854542..edb8cfb 100644 |
| 20 | --- a/configure.ac | 24 | --- a/configure.ac |
| 21 | +++ b/configure.ac | 25 | +++ b/configure.ac |
| 22 | @@ -4,7 +4,6 @@ AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)]) | 26 | @@ -4,7 +4,6 @@ AC_INIT([collectd],[m4_esyscmd(./version-gen.sh)]) |
| @@ -31,7 +35,7 @@ index 8854542..f3a6b57 100644 | |||
| 31 | AM_CFLAGS="$AM_CFLAGS -Werror" | 35 | AM_CFLAGS="$AM_CFLAGS -Werror" |
| 32 | AM_CXXFLAGS="$AM_CXXFLAGS -Werror" | 36 | AM_CXXFLAGS="$AM_CXXFLAGS -Werror" |
| 33 | fi | 37 | 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"]) | 38 | +AX_CHECK_COMPILE_FLAG([-Werror -Werror=format-truncation],[AM_CFLAGS="$AM_CFLAGS -Wno-error=format-truncation" AM_CXXFLAGS="$AM_CXXFLAGS -Wno-error=format-truncation"]) |
| 35 | + | 39 | + |
| 36 | AC_SUBST([AM_CFLAGS]) | 40 | AC_SUBST([AM_CFLAGS]) |
| 37 | AC_SUBST([AM_CXXFLAGS]) | 41 | AC_SUBST([AM_CXXFLAGS]) |
| @@ -117,5 +121,5 @@ index 0000000..dcabb92 | |||
| 117 | +AS_VAR_POPDEF([CACHEVAR])dnl | 121 | +AS_VAR_POPDEF([CACHEVAR])dnl |
| 118 | +])dnl AX_CHECK_COMPILE_FLAGS | 122 | +])dnl AX_CHECK_COMPILE_FLAGS |
| 119 | -- | 123 | -- |
| 120 | 2.12.2 | 124 | 2.13.4 |
| 121 | 125 | ||
