From 76979e1714b6fe8dc6939c3f0b725c0b78b80d5b Mon Sep 17 00:00:00 2001 From: kmos Date: Thu, 21 Jul 2022 17:33:51 +0000 Subject: [PATCH] json-c uses the attribute 'cold' in one place for optimization. ports-gcc doesn't know it so warns. So we need to disable using -Werror in order to fix the build on sparc64 ok jca@ --- devel/json-c/Makefile | 2 ++ devel/json-c/patches/patch-json_object_c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 devel/json-c/patches/patch-json_object_c diff --git a/devel/json-c/Makefile b/devel/json-c/Makefile index 0d86ab0e466..59cd8b2281e 100644 --- a/devel/json-c/Makefile +++ b/devel/json-c/Makefile @@ -14,4 +14,6 @@ MASTER_SITES = https://s3.amazonaws.com/json-c_releases/releases/ MODULES= devel/cmake +CONFIGURE_ARGS= -DDISABLE_WERROR=ON + .include diff --git a/devel/json-c/patches/patch-json_object_c b/devel/json-c/patches/patch-json_object_c new file mode 100644 index 00000000000..9514aee1283 --- /dev/null +++ b/devel/json-c/patches/patch-json_object_c @@ -0,0 +1,17 @@ +This optimization breaks for ports-gcc. Patch it out. + +Index: json_object.c +--- json_object.c.orig ++++ json_object.c +@@ -145,10 +145,7 @@ static json_object_to_json_string_fn _json_object_user + #elif defined(__OS400__) + #define JSON_NORETURN + #else +-/* 'cold' attribute is for optimization, telling the computer this code +- * path is unlikely. +- */ +-#define JSON_NORETURN __attribute__((noreturn, cold)) ++#define JSON_NORETURN __attribute__((noreturn)) + #endif + #endif + /**