Package Details: libfastjson 1.2304.0-1

Git Clone URL: https://aur.archlinux.org/libfastjson.git (read-only, click to copy)
Package Base: libfastjson
Description: A performance-focused json library for C
Upstream URL: https://github.com/rsyslog/libfastjson
Licenses: GPL
Submitter: Barthalion
Maintainer: fordprefect
Last Packager: fordprefect
Votes: 8
Popularity: 0.94
First Submitted: 2018-01-07 12:39 (UTC)
Last Updated: 2023-07-22 08:47 (UTC)

Latest Comments

thx1138 commented on 2026-07-01 01:17 (UTC) (edited on 2026-07-01 01:20 (UTC) by thx1138)

With a little help from Google AI, and running updpkgsums, it is not necessary, and better to not use, the libfastjson.pc.in.patch file in fixing the rsyslog seg fault. Just add the configure.ac.patch. The resulting PKGBUILD is:

pkgname=libfastjson
pkgver=1.2304.0
pkgrel=1
pkgdesc="A performance-focused json library for C"
arch=('x86_64' 'i686' 'aarch64' 'armv7h')
url="https://github.com/rsyslog/libfastjson"
license=('GPL')
source=("$pkgname-$pkgver.tar.gz::https://github.com/rsyslog/$pkgname/archive/v$pkgver.tar.gz"
                "configure.ac.patch")
sha256sums=('6c18848c75b179108429fc2818273551c68ffe6ddd5e414c20c071c844befbc1'
            'a853d4d09ffcdd62fb60521d4f6f08080ac7f05873e858de82f9099ba6ee60b4')

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i "$srcdir/configure.ac.patch"
  autoreconf -fiv
}

build() {
  cd "$pkgname-$pkgver"
  autoreconf -fvi
  ./configure --prefix=/usr
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
}

The prepare() section, especially with the autoreconf -fvi is essential.

Verify the new libfastjson package with:

$ objdump -x /usr/lib/libfastjson.so.4 | grep NEEDED | grep libm
  NEEDED               libm.so.6

You may need to rebuild the rsyslog package. Then run $ rsyslogd -dn, which should no longer seg fault.

Many thanks to @Network_Jack!

Network_Jack commented on 2026-06-30 06:11 (UTC)

This was fixed in this branch here:

https://github.com/rsyslog/libfastjson/pull/171

libfastjson.pc.in.patch

@@ -8,5 +8,5 @@
 Version: @VERSION@
 Requires:
 Libs.private: @LIBS@
-Libs:  -L${libdir} -lfastjson
+Libs:  -L${libdir} -lfastjson -lm
 Cflags: -I${includedir}/libfastjson

configure.ac.patch

@@ -105,9 +105,8 @@ AC_FUNC_VPRINTF
 AC_FUNC_MEMCMP
 AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp setlocale)

-if test "$ac_cv_have_decl_isnan" = "yes" ; then
-   AC_TRY_LINK([#include <math.h>], [float f = 0.0; return isnan(f)], [], [LIBS="$LIBS -lm"])
-fi
+# Force linking against libm (needed for modf on glibc >= 2.42)
+AC_CHECK_LIB([m], [modf], [LIBS="$LIBS -lm"],[AC_MSG_ERROR([libm (math library) is required for modf()])])

 #check if .section.gnu.warning accepts long strings (for __warn_references)
 AC_LANG_PUSH([C])

Add to PKGBUILD

sha256sums=('6c18848c75b179108429fc2818273551c68ffe6ddd5e414c20c071c844befbc1'
            'ed19a261247da18763f2b7b3064c538894a6fd82b74cc713f984594776db289a'
            'f4d4312a0a03fc39eb8acf1b4d633386c2de18b1229c72ce93b591f62b6f0ea2')

prepare(){
  cd "$pkgname-$pkgver"
  patch -N libfastjson.pc.in ../libfastjson.pc.in.patch
  patch -N configure.ac ../configure.ac.patch
}

IOAOI commented on 2025-08-20 14:14 (UTC)

$ sudo rc-service rsyslogd restart rsyslogd | * Starting rsyslogd ... rsyslogd |/usr/bin/rsyslogd: Relink /usr/lib/libfastjson.so.4' with/usr/lib/libm.so.6' for IFUNC symbol modf' rsyslogd | * start-stop-daemon: failed to start/usr/bin/rsyslogd' rsyslogd | * Failed to start rsyslogd [ !! ] rsyslogd | * ERROR: rsyslogd failed to start

Aaronjamt commented on 2025-03-19 18:24 (UTC)

Hi, looks like this package requires autoconf, automake, and libtool to build. Can these be added to the build dependencies?

vinibali commented on 2023-07-21 20:41 (UTC)

Hi! Can you please add the armv7h architecture? It's tested and working. Thanks

chowbok commented on 2019-01-27 06:08 (UTC)

Hi, can you add "aarch64" to the supported architectures in the PKGBUILD? I tested it on there, it compiles fine.

Network_Jack commented on 2018-03-22 05:02 (UTC)

woefe you cannot do that. If you set arch=any compiled packages will have arch=any as their metadata, allowing installation on any system, even if its the wrong time. If its compiled to machine code like any compiled app, it needs to list all the archs in an array which will be chosen at compile time

woefe commented on 2018-01-17 12:48 (UTC)

Please consider using arch=('any') instead of x86_64. I was able to build and run it successfully on my Raspberry Pi after setting arch to any