Skip to contentSkip to conversation

sysvinit: Fix makefile bug found with clang

PATCH In review Khem Raj 2 participants 9 messages Aug 22, 2015 – Aug 24, 2015

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/6 sysvinit: Fix makefile bug found with clang

This is due to specifying .h files on linker cmdline clang driver is picky about it, and its not entirely correct either

---
 ...an-issue-that-clang-reports-about-mutlipl.patch | 52 ++++++++++++++++++++++
 meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb     |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch new file +52 -0
new file mode 100644
index 0000000..f35c15c
@@ -0,0 +1,52 @@
+From 36ac97bfe51797458442a6035219a504a42e703a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 21 Aug 2015 10:56:40 -0700
+Subject: [PATCH] This fixes an issue that clang reports about mutliple output
+ files
+
+Issue is that we are passing .h file to link step as seen below.
+
+| arm-oe-linux-gnueabi-clang  -march=armv7-a -mthumb  -mfloat-abi=hard
+-mfpu=neon-vfpv4 -mtune=cortex-a7 -D__extern_always_inline=inline
+-no-integrated-as
+--sysroot=/mnt/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-glibc/sysroots/raspberrypi2
+-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  halt.o ifdown.o hddown.o
+utmp.o reboot.h   -o halt
+| clang-3.7: error: cannot specify -o when generating multiple output
+files
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ src/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index e77ed5f..a6f9f40 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -103,9 +103,9 @@ all:		$(BIN) $(SBIN) $(USRBIN)
+ init:		LDLIBS += $(INITLIBS) $(STATIC)
+ init:		init.o init_utmp.o
+ 
+-halt:		halt.o ifdown.o hddown.o utmp.o reboot.h
++halt:		halt.o ifdown.o hddown.o utmp.o
+ 
+-last:		last.o oldutmp.h
++last:		last.o
+ 
+ mesg:		mesg.o
+ 
+@@ -120,7 +120,7 @@ sulogin:	sulogin.o
+ 
+ wall:		dowall.o wall.o
+ 
+-shutdown:	dowall.o shutdown.o utmp.o reboot.h
++shutdown:	dowall.o shutdown.o utmp.o
+ 
+ bootlogd:	LDLIBS += -lutil
+ bootlogd:	bootlogd.o
+-- 
+2.1.4
+
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb +1 -0
index 6709a9b..5dfe39e 100644
@@ -13,6 +13,7 @@ SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.bz2 \
            file://install.patch \
            file://crypt-lib.patch \
            file://pidof-add-m-option.patch \
+           file://0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch \
            file://rcS-default \
            file://rc \
            file://rcS \
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH 2/6 alsa-lib: Lift the limitation to use gcc only cross compiler

alsa-lib configure tries to see that if CC variabled doesnt contain 'gcc' then it tries to guess and redefine CC to be something gcc, which doesnt work with OE since we define CC to have sysroot and options attached to it. So all tests fail when configure constructs the CC for cross compiler like this. This portion is not needed at all

---
 ...build-Do-not-try-to-detect-cross-compiler.patch | 45 ++++++++++++++++++++++
 meta/recipes-multimedia/alsa/alsa-lib_1.0.29.bb    |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 meta/recipes-multimedia/alsa/alsa-lib/0001-build-Do-not-try-to-detect-cross-compiler.patch
meta/recipes-multimedia/alsa/alsa-lib/0001-build-Do-not-try-to-detect-cross-compiler.patch new file +45 -0
new file mode 100644
index 0000000..583bc3d
@@ -0,0 +1,45 @@
+From 17aeb3565f411e7796cabe403f92d15948a8ca95 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 21 Aug 2015 14:42:45 -0700
+Subject: [PATCH] build: Do not try to detect cross-compiler
+
+cross compilers are passed via path may not be a gcc based cross
+compiler in such cases this check fails and try's to force gcc based
+cross compiler detection, This code is a convenience that limits the
+build system
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ configure.ac | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3022cf8..9d77440 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,20 +27,6 @@ AC_PREFIX_DEFAULT(/usr)
+ 
+ dnl Checks for programs.
+ 
+-dnl try to gues cross-compiler if not set
+-if test "x$host" != "x$build" -a -z "`echo $CC | grep -e '-gcc'`";
+-then
+-  AC_MSG_CHECKING(for cross-compiler)
+-
+-  which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
+-  which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 \
+-  && CC=${host_cpu}-${host_os}-gcc
+-  which ${host_cpu}-${host_vendor}-${host_os}-gcc >/dev/null 2>&1 \
+-  && CC=${host_cpu}-${host_vendor}-${host_os}-gcc
+-
+-  AC_MSG_RESULT($CC)
+-fi
+-	    
+ CFLAGS="$CFLAGS -D_GNU_SOURCE"
+ 
+ 
+-- 
+2.1.4
+
meta/recipes-multimedia/alsa/alsa-lib_1.0.29.bb +1 -0
index fc6ba69..730f427 100644
@@ -16,6 +16,7 @@ ARM_INSTRUCTION_SET = "arm"
 
 SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2 \
            file://Check-if-wordexp-function-is-supported.patch \
+           file://0001-build-Do-not-try-to-detect-cross-compiler.patch \
 "
 SRC_URI[md5sum] = "de67e0eca72474d6b1121037dafe1024"
 SRC_URI[sha256sum] = "73043c35eb9636be0f4af6a240235c213f12a25feb1f04aeeac8cb7e30fcbdd0"
Signature · 1 line
2.1.4
author
#4 lore raw

PATCH 3/6 json-c: Include math_compat.c for NAN/INF values

In reply to Khem Raj

The backport patch also fixes the warning which was being work arounded by disabling unused-but-set-variable

---
 .../0001-json_tokener-requires-INF-and-NAN.patch   | 32 ++++++++++++++++++++++
 meta/recipes-devtools/json-c/json-c_0.12.bb        |  6 ++--
 2 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch new file +32 -0
new file mode 100644
index 0000000..58ccf7b
@@ -0,0 +1,32 @@
+From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
+From: James Myatt <[email protected]>
+Date: Thu, 5 Feb 2015 15:57:14 +0000
+Subject: [PATCH] json_tokener requires INF and NAN
+
+---
+Upstream-Status: Backport
+
+ json_tokener.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: json-c-0.12/json_tokener.c
+===================================================================
+--- json-c-0.12.orig/json_tokener.c
++++ json-c-0.12/json_tokener.c
+@@ -16,6 +16,7 @@
+ #include "config.h"
+ 
+ #include <math.h>
++#include "math_compat.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -353,7 +354,7 @@ struct json_object* json_tokener_parse_e
+     case json_tokener_state_inf: /* aka starts with 'i' */
+       {
+ 	int size;
+-	int size_inf;
++	size_t size_inf;
+ 	int is_negative = 0;
+ 
+ 	printbuf_memappend_fast(tok->pb, &c, 1);
meta/recipes-devtools/json-c/json-c_0.12.bb +3 -3
index e9c5b31..cfef03d 100644
@@ -4,7 +4,9 @@ HOMEPAGE = "https://github.com/json-c/json-c/wiki"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
 
-SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz"
+SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+           file://0001-json_tokener-requires-INF-and-NAN.patch \
+          "
 
 SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
 SRC_URI[sha256sum] = "000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f"
@@ -17,5 +19,3 @@ do_configure_prepend() {
     # Clean up autoconf cruft that should not be in the tarball
     rm -f ${S}/config.status
 }
-
-CFLAGS += "-Wno-error=unused-but-set-variable"
Signature · 1 line
2.1.4
author
#6 lore raw

PATCH 4/6 libvorbis: Update libvorbis_1.3.4.bb -> libvorbis_1.3.5.bb

In reply to Khem Raj

Licence years have changes causing checksum changes

-Copyright (c) 2002-2008 Xiph.org Foundation
+Copyright (c) 2002-2015 Xiph.org Foundation

---
 .../libvorbis/{libvorbis_1.3.4.bb => libvorbis_1.3.5.bb}           | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
 rename meta/recipes-multimedia/libvorbis/{libvorbis_1.3.4.bb => libvorbis_1.3.5.bb} (78%)
meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb renamed from meta/recipes-multimedia/libvorbis/libvorbis_1.3.4.bb +3 -4
similarity index 78%
rename from meta/recipes-multimedia/libvorbis/libvorbis_1.3.4.bb
rename to meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
index 0788c94..b7a0667 100644
@@ -6,14 +6,13 @@ HOMEPAGE = "http://www.vorbis.com/"
 BUGTRACKER = "https://trac.xiph.org"
 SECTION = "libs"
 LICENSE = "BSD"
-LIC_FILES_CHKSUM = "file://COPYING;md5=ca77c6c3ea4d29cb68dce8ef5ab0d897 \
+LIC_FILES_CHKSUM = "file://COPYING;md5=7d2c487d2fc7dd3e3c7c465a5b7f6217 \
                     file://include/vorbis/vorbisenc.h;beginline=1;endline=11;md5=d1c1d138863d6315131193d4046d81cb"
 DEPENDS = "libogg"
 
 SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz"
-
-SRC_URI[md5sum] = "55f2288055e44754275a17c9a2497391"
-SRC_URI[sha256sum] = "2f05497d29195dc23ee952a24ee3973a74e6277569c4c2eca0ec5968e541f372"
+SRC_URI[md5sum] = "28cb28097c07a735d6af56e598e1c90f"
+SRC_URI[sha256sum] = "54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1"
 
 inherit autotools pkgconfig
 
Signature · 1 line
2.1.4
author
#7 lore raw

PATCH 5/6 psplash: Turn psplash_fb_plot_pixel() into static inline

In reply to Khem Raj

This function is not used anywhere except psplash-fb.c so make it static inline function which is portable across compilers

Fixes issues like
psplash-fb.o: In function `psplash_fb_draw_rect':
| /mnt/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-glibc/work/i586-oe-linux/psplash/0.1+gitAUTOINC+14c8f7b705-r15/git/psplash-fb.c:363:
undefined reference to `psplash_fb_plot_pixel'

---
 ...Convert-psplash_fb_plot_pixel-to-a-static.patch | 53 ++++++++++++++++++++++
 meta/recipes-core/psplash/psplash_git.bb           |  1 +
 2 files changed, 54 insertions(+)
 create mode 100644 meta/recipes-core/psplash/files/0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch
meta/recipes-core/psplash/files/0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch new file +53 -0
new file mode 100644
index 0000000..93b3c6b
@@ -0,0 +1,53 @@
+From 8f5de12cc75bfaa8400adf32f30c015d8f813540 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 22 Aug 2015 07:12:20 -0700
+Subject: [PATCH] psplash-fb: Convert psplash_fb_plot_pixel() to a static
+ inline
+
+This function is not used outside psplash-fb.c and by making it
+static inline we keep the performance and also make it portable across
+multiple compilers and gcc versions
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+Upstream-Status: Pending
+
+ psplash-fb.c | 2 +-
+ psplash-fb.h | 8 --------
+ 2 files changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/psplash-fb.c b/psplash-fb.c
+index bd9cd9d..6d235db 100644
+--- a/psplash-fb.c
++++ b/psplash-fb.c
+@@ -260,7 +260,7 @@ psplash_fb_new (int angle)
+ 
+ #define OFFSET(fb,x,y) (((y) * (fb)->stride) + ((x) * ((fb)->bpp >> 3)))
+ 
+-inline void
++static inline void
+ psplash_fb_plot_pixel (PSplashFB    *fb,
+ 		       int          x,
+ 		       int          y,
+diff --git a/psplash-fb.h b/psplash-fb.h
+index 42592ed..c6c3144 100644
+--- a/psplash-fb.h
++++ b/psplash-fb.h
+@@ -57,14 +57,6 @@ psplash_fb_destroy (PSplashFB *fb);
+ PSplashFB*
+ psplash_fb_new (int angle);
+ 
+-inline void
+-psplash_fb_plot_pixel (PSplashFB    *fb, 
+-		       int          x, 
+-		       int          y, 
+-		       uint8        red,
+-		       uint8        green,
+-		       uint8        blue);
+-
+ void
+ psplash_fb_draw_rect (PSplashFB    *fb, 
+ 		      int          x, 
+-- 
+2.1.4
+
meta/recipes-core/psplash/psplash_git.bb +1 -0
index 7f0dc78..b3b6479 100644
@@ -10,6 +10,7 @@ PV = "0.1+git${SRCPV}"
 PR = "r15"
 
 SRC_URI = "git://git.yoctoproject.org/${BPN} \
+           file://0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch \
            file://psplash-init \
            ${SPLASH_IMAGES}"
 
Signature · 1 line
2.1.4
author
#8 lore raw

PATCH 6/6 mdadm: Upgrade mdadm_3.3.2.bb -> mdadm_3.3.4.bb

In reply to Khem Raj

Drop upstreamed patch for gcc5 compatibility
Forward port x32 patch

---
 meta/recipes-extended/mdadm/files/inline.patch     | 39 ----------------------
 .../mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch   | 23 ++++++-------
 .../mdadm/{mdadm_3.3.2.bb => mdadm_3.3.4.bb}       |  6 ++--
 3 files changed, 13 insertions(+), 55 deletions(-)
 delete mode 100644 meta/recipes-extended/mdadm/files/inline.patch
 rename meta/recipes-extended/mdadm/{mdadm_3.3.2.bb => mdadm_3.3.4.bb} (92%)
meta/recipes-extended/mdadm/files/inline.patch deleted +0 -39
deleted file mode 100644
index 9009f06..0000000
@@ -1,39 +0,0 @@
-with gnu11 turning on a default with gcc-5 we have to abide by new inline semantics
-using 'inline' and using is in same translation unit means an external definition has to exist
-same like "external inline" in gnu89, we simply make the functions static inline since they
-are just meant to be used in this file
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
-Index: mdadm-3.3.2/bitmap.c
-===================================================================
---- mdadm-3.3.2.orig/bitmap.c
-+++ mdadm-3.3.2/bitmap.c
-@@ -20,7 +20,7 @@
- 
- #include "mdadm.h"
- 
--inline void sb_le_to_cpu(bitmap_super_t *sb)
-+static inline void sb_le_to_cpu(bitmap_super_t *sb)
- {
- 	sb->magic = __le32_to_cpu(sb->magic);
- 	sb->version = __le32_to_cpu(sb->version);
-@@ -34,7 +34,7 @@ inline void sb_le_to_cpu(bitmap_super_t
- 	sb->write_behind = __le32_to_cpu(sb->write_behind);
- }
- 
--inline void sb_cpu_to_le(bitmap_super_t *sb)
-+static inline void sb_cpu_to_le(bitmap_super_t *sb)
- {
- 	sb_le_to_cpu(sb); /* these are really the same thing */
- }
-@@ -74,7 +74,7 @@ typedef struct bitmap_info_s {
- } bitmap_info_t;
- 
- /* count the dirty bits in the first num_bits of byte */
--inline int count_dirty_bits_byte(char byte, int num_bits)
-+static inline int count_dirty_bits_byte(char byte, int num_bits)
- {
- 	int num = 0;
- 
meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch +11 -12
index 143a8d9..c656d07 100644
@@ -5,22 +5,21 @@ Upstream-Status: Pending
 
 Signed-off-by: Aníbal Limón <[email protected]>
 
-diff --git a/monitor.c b/monitor.c
-index f81e707..19ea041 100644
---- a/monitor.c
-+++ b/monitor.c
-@@ -260,8 +260,13 @@ static int read_and_act(struct active_array *a)
+Index: mdadm-3.3.4/monitor.c
+===================================================================
+--- mdadm-3.3.4.orig/monitor.c
++++ mdadm-3.3.4/monitor.c
+@@ -257,9 +257,12 @@ static int read_and_act(struct active_ar
+ 			mdi->curr_state = read_dev_state(mdi->state_fd);
+ 		}
  	}
- 
+-
  	gettimeofday(&tv, NULL);
 +#if defined(__x86_64__) && defined(__ILP32__)
-+	dprintf("%s(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
++	dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
 +#else
- 	dprintf("%s(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
--		__func__, a->info.container_member,
+ 	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
 +#endif
-+		__func__,
-+		a->info.container_member,
+ 		a->info.container_member,
  		tv.tv_sec, tv.tv_usec,
  		array_states[a->curr_state],
- 		array_states[a->prev_state],
meta/recipes-extended/mdadm/mdadm_3.3.4.bb renamed from meta/recipes-extended/mdadm/mdadm_3.3.2.bb +2 -4
similarity index 92%
rename from meta/recipes-extended/mdadm/mdadm_3.3.2.bb
rename to meta/recipes-extended/mdadm/mdadm_3.3.4.bb
index b2fbe4a..460a430 100644
@@ -12,12 +12,10 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
            file://mdadm-3.2.2_fix_for_x32.patch \
            file://gcc-4.9.patch \
            file://mdadm-3.3.2_x32_abi_time_t.patch \
-           file://inline.patch \
            file://run-ptest \
 	  "
-
-SRC_URI[md5sum] = "44698d351501cac6a89072dc877eb220"
-SRC_URI[sha256sum] = "0f3a7e1a76b13892b79f9fceaf99ecb23513260389a768ac644ffa3ae06e5b8c"
+SRC_URI[md5sum] = "7ca8b114710f98f53f20c5787b674a09"
+SRC_URI[sha256sum] = "8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68"
 
 CFLAGS += "-fno-strict-aliasing"
 
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH 2/6] alsa-lib: Lift the limitation to use gcc only cross compiler

In reply to Khem Raj
Quoted 4 lines · Khem Raj

alsa-lib configure tries to see that if CC variabled doesnt contain 'gcc' then it tries to guess and redefine CC to be something gcc, which doesnt work with OE since we define CC to have sysroot and options attached to it.

Can you give an example of a CC value that you've seen failing? If you don't plan to send this to upstream yourself, it's probably me who's going to do that, and I'd like to be able to point out a concrete example where the removed code has been failing.

Signature · 1 line
Tanu
author
#3 lore raw

Re: [PATCH 2/6] alsa-lib: Lift the limitation to use gcc only cross compiler

Quoted 10 lines · Tanu Kaskinen
Quoted 4 lines · Khem Raj

alsa-lib configure tries to see that if CC variabled doesnt contain 'gcc' then it tries to guess and redefine CC to be something gcc, which doesnt work with OE since we define CC to have sysroot and options attached to it.

Can you give an example of a CC value that you've seen failing? If you don't plan to send this to upstream yourself, it's probably me who's going to do that, and I'd like to be able to point out a concrete example where the removed code has been failing.

CC = "arm-oe-linux-clang"

author
#5 lore raw

Re: [PATCH 3/6] json-c: Include math_compat.c for NAN/INF values

In reply to Khem Raj
Quoted 6 lines · Khem Raj

The backport patch also fixes the warning which was being work arounded by disabling unused-but-set-variable

Just saw it fail with gcc 5.2 in local builder, sent a v2 with the fix.

Quoted 69 lines

---
.../0001-json_tokener-requires-INF-and-NAN.patch | 32 ++++++++++++++++++++++
meta/recipes-devtools/json-c/json-c_0.12.bb | 6 ++--

2 files changed, 35 insertions(+), 3 deletions(-)

create mode 100644 meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch

meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch new file +32 -0
new file mode 100644
index 0000000..58ccf7b
@@ -0,0 +1,32 @@
+From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
+From: James Myatt <[email protected]>
+Date: Thu, 5 Feb 2015 15:57:14 +0000
+Subject: [PATCH] json_tokener requires INF and NAN
+
+---
+Upstream-Status: Backport
+
+ json_tokener.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: json-c-0.12/json_tokener.c
+===================================================================
+--- json-c-0.12.orig/json_tokener.c
++++ json-c-0.12/json_tokener.c
+@@ -16,6 +16,7 @@
+ #include "config.h"
+
+ #include <math.h>
++#include "math_compat.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -353,7 +354,7 @@ struct json_object* json_tokener_parse_e
+     case json_tokener_state_inf: /* aka starts with 'i' */
+       {
+ 	int size;
+-	int size_inf;
++	size_t size_inf;
+ 	int is_negative = 0;
+
+ 	printbuf_memappend_fast(tok->pb, &c, 1);
meta/recipes-devtools/json-c/json-c_0.12.bb +0 -0
index e9c5b31..cfef03d 100644
@@ -4,7 +4,9 @@ HOMEPAGE = "https://github.com/json-c/json-c/wiki"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"

meta/recipes-devtools/json-c/json-c_0.12.bb +3 -1
-SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz"
+SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+           file://0001-json_tokener-requires-INF-and-NAN.patch \
+          "

SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
SRC_URI[sha256sum] = "000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f"

meta/recipes-devtools/json-c/json-c_0.12.bb +0 -3
@@ -17,5 +19,3 @@ do_configure_prepend() {
    # Clean up autoconf cruft that should not be in the tarball
    rm -f ${S}/config.status
 }
-
-CFLAGS += "-Wno-error=unused-but-set-variable"
--

2.1.4