From patchwork Tue Nov 24 09:49:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 1405389 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=wKWHEXzZ; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=E9CK/rCT; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CgK611P2Cz9s1l for ; Tue, 24 Nov 2020 20:51:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe :List-Id:MIME-Version:Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=zuOr8D3tPuSinjQQVR0VHHAMrRGpgmZJVcNCtsbUV/Y=; b=wKWHEXzZTUK+R18A+eqVNd6YH8 yClmkaaL9z72OV9FNMrpJMjpGjAUihs1rxNUnBTZ1OR/Imz6xJA8a1Svl5RWjm0RljNkhZPvZJkzw wmMHq8hNpPIhu1Eu8UVE3Ev2Q1OidQ19gRM82ZJHENkzA3ksTw7UdEyMRmPruQz9a6PQyoHCKaw64 2BbyZ+EqugNRKp9XzKnnrrV7QeS0L/73KWVGv9+6uVWwGZq5/awbXee/2vu8kXkJ2k0f3Mpn4qSrf KnOmtuaiAFAcbGnTSPvqeNDEwWfaVAfpakYUFXVyLafavGekqG7HlB3umQwWCpKUQuUbWZFSC85zC SxR+eXTw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khUwu-0002JM-Jp; Tue, 24 Nov 2020 09:49:24 +0000 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khUws-0002Ht-Gt for openwrt-devel@lists.openwrt.org; Tue, 24 Nov 2020 09:49:23 +0000 Received: by mail-pf1-x430.google.com with SMTP id n137so7938535pfd.3 for ; Tue, 24 Nov 2020 01:49:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=EVAqt3Kn7/yR+HCjGx0pj3KCsUt8TbhHAi6rjf3WzfQ=; b=E9CK/rCTvE8/h5FnbKcxbV8t+9pylHk8RD0zN+boFSZcJOZhlhlQWb0Za6lnGdBd+3 V73r7gl6BEbNBJWPxtGB7D6N6+i5oj3RKdTt2XBPtBVMlVOXjbval6kFIMJj/Q1+alaw nZs4SjCgtgnJIXG9MVQHG4zX25p3YHVlXVm4EetZ6GcFj+XUJEnRwDpiVbhNjXkj939N ws0r2J5puq7SU5iRbqwl21HAZZvkvyETJtfpEz8OmS8K4p9FU5Fq6NrmCsKffJDcfcZy WekUKq65wkV4vbPMc2aQgXkdG9Gb80RiLkdBVpQo5GBahA1NPg32ItSsYJ/6hAsGdGQq LU/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=EVAqt3Kn7/yR+HCjGx0pj3KCsUt8TbhHAi6rjf3WzfQ=; b=oLJeDX009y7dACDaU7Hetax+dY3ByPQANRCXjLsk/NwIk6dBD0HyEN098kb4VpQs8L Y2wbww+rwKD30QLn486N1YkeYfFPNL6zD2f2vvD/qf1+fITQPQIk+HwYKzavuWdXt5/B blJaoUVVbimNqX5Btpc3qVo/Z+us4nDJC1T8NLnQ0buR09unqONJTV8us9bFTYR9Pai8 zgwEIEnVM8Ah74qZ8CX3VPivguE8h3VlaCv7PgtsC4LdQefxsdr4avKEAXGwqLC+RO9U e+tqSSFUMBgKjOha5HbVxDVA898HgT8aFefJ6XwFTU3HhhnBdbgVWg6X68+Lqazjhl7G ho4w== X-Gm-Message-State: AOAM533OWRGlpbhF82FIpB/7l2/QcnoO+TnVX6R/aGHPS0+frj1dKoYp PUqs6vngOiYBVPfXXMa12QFq/fgZZQGTIA== X-Google-Smtp-Source: ABdhPJzahezeZBQreiV2Wc4TkX+xz5sx2RfzXc0D2SwdrgvIlk6AuAvRRg7Ryf5ainKH9W3E0THnhQ== X-Received: by 2002:aa7:8e02:0:b029:198:188b:13c0 with SMTP id c2-20020aa78e020000b0290198188b13c0mr3399306pfr.17.1606211359306; Tue, 24 Nov 2020 01:49:19 -0800 (PST) Received: from mangix-trapnet.lan ([2001:470:1f05:79e::a89]) by smtp.gmail.com with ESMTPSA id y23sm2606613pje.41.2020.11.24.01.49.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 01:49:18 -0800 (PST) From: Rosen Penev To: openwrt-devel@lists.openwrt.org Subject: [PATCH] libjson-c: fix compilation with clang Date: Tue, 24 Nov 2020 01:49:17 -0800 Message-Id: <20201124094917.410344-1-rosenp@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_044922_621848_098287A5 X-CRM114-Status: GOOD ( 13.83 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:430 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rosenp[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org json_pointer.c:230:7: warning: implicit declaration of function 'vasprintf' is invalid in C99 [-Wimplicit-function-declaration] rc = vasprintf(&path_copy, path_fmt, args); ^ json_pointer.c:317:7: warning: implicit declaration of function 'vasprintf' is invalid in C99 [-Wimplicit-function-declaration] rc = vasprintf(&path_copy, path_fmt, args); ^ /usr/include/bits/mathcalls.h:177:23: error: cannot redeclare builtin function '__builtin_isinf' __MATHDECL_ALIAS (int,isinf,, (_Mdouble_ __value), isinf) ^ /usr/include/bits/mathcalls.h:177:23: note: '__builtin_isinf' is a builtin with type 'int ()' /usr/include/bits/mathcalls.h:213:23: error: cannot redeclare builtin function '__builtin_isnan' __MATHDECL_ALIAS (int,isnan,, (_Mdouble_ __value), isnan) ^ Signed-off-by: Rosen Penev --- package/libs/libjson-c/Makefile | 4 +- package/libs/libjson-c/patches/000-libm.patch | 45 ------------------- 2 files changed, 3 insertions(+), 46 deletions(-) delete mode 100644 package/libs/libjson-c/patches/000-libm.patch diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 13cf955960..2c24df0bd5 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=json-c PKG_VERSION:=0.15 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/ @@ -32,6 +32,8 @@ CMAKE_HOST_OPTIONS += \ -DCMAKE_MACOSX_RPATH=1 \ -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOST}/lib" +HOST_CFLAGS += -D_GNU_SOURCE + define Package/libjson-c SECTION:=libs CATEGORY:=Libraries diff --git a/package/libs/libjson-c/patches/000-libm.patch b/package/libs/libjson-c/patches/000-libm.patch deleted file mode 100644 index c6ff5f4766..0000000000 --- a/package/libs/libjson-c/patches/000-libm.patch +++ /dev/null @@ -1,45 +0,0 @@ ---- a/math_compat.h -+++ b/math_compat.h -@@ -6,38 +6,9 @@ - * @brief Do not use, json-c internal, may be changed or removed at any time. - */ - --/* Define isnan, isinf, infinity and nan on Windows/MSVC */ -- --#ifndef HAVE_DECL_ISNAN --#ifdef HAVE_DECL__ISNAN --#include --#define isnan(x) _isnan(x) --#else --/* On platforms like AIX and "IBM i" we need to provide our own isnan */ --#define isnan(x) ((x) != (x)) --#endif --#endif -- --#ifndef HAVE_DECL_ISINF --#ifdef HAVE_DECL__FINITE --#include --#define isinf(x) (!_finite(x)) --#else --#include --/* On platforms like AIX and "IBM i" we need to provide our own isinf */ --#define isinf(x) ((x) < -DBL_MAX || (x) > DBL_MAX) --#endif --#endif -- --#ifndef HAVE_DECL_INFINITY --#include --#define INFINITY (DBL_MAX + DBL_MAX) --#define HAVE_DECL_INFINITY --#endif -- --#ifndef HAVE_DECL_NAN --#define NAN (INFINITY - INFINITY) --#define HAVE_DECL_NAN --#endif -+#undef isnan -+#define isnan(x) __builtin_isnan(x) -+#undef isinf -+#define isinf(x) __builtin_isinf(x) - - #endif