1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
From https://github.com/akheron/jansson/pull/666/commits/1e2ac681e5f39fc7a7e8b8deb2162a93976d4622 Mon Sep 17 00:00:00 2001
From: Violet Purcell <vimproved@inventati.org>
Date: Wed, 11 Oct 2023 20:51:57 -0400
Subject: [PATCH] Port check for --default-symver to autoconf
This commit ports the configure check for -Wl,--default-symver that is
present in CMake to autoconf. This fixes building Jansson via autoconf
with non-bfd linkers on glibc systems.
Signed-off-by: Violet Purcell <vimproved@inventati.org>
--- a/configure.ac
+++ b/configure.ac
@@ -25,6 +25,9 @@ AC_TYPE_UINT16_T
AC_TYPE_UINT8_T
AC_TYPE_LONG_LONG_INT
+jansson_soversion="4"
+AC_SUBST([jansson_soversion])
+
AC_C_INLINE
case $ac_cv_c_inline in
yes) json_inline=inline;;
@@ -138,8 +141,12 @@ AS_IF([test "x$with_Bsymbolic" = "xyes"], [JSON_BSYMBOLIC_LDFLAGS=-Wl[,]-Bsymbol
AC_SUBST(JSON_BSYMBOLIC_LDFLAGS)
# Enable symbol versioning on GNU libc
+m4_pattern_forbid([^AX_CHECK_LINK_FLAG$])
JSON_SYMVER_LDFLAGS=
-AC_CHECK_DECL([__GLIBC__], [JSON_SYMVER_LDFLAGS=-Wl,--default-symver])
+AC_CHECK_DECL([__GLIBC__],
+ [AX_CHECK_LINK_FLAG([-Wl,--default-symver],
+ [JSON_SYMVER_LDFLAGS=-Wl,--default-symver],
+ [JSON_SYMVER_LDFLAGS=-Wl,--version-script,$ac_abs_confdir/jansson.sym])])
AC_SUBST([JSON_SYMVER_LDFLAGS])
AC_ARG_ENABLE([ossfuzzers],
@@ -168,6 +175,7 @@ AC_SUBST([AM_CFLAGS])
AC_CONFIG_FILES([
jansson.pc
+ jansson.sym
Makefile
doc/Makefile
src/Makefile
--- /dev/null
+++ b/jansson.sym.in
@@ -0,0 +1,5 @@
+JANSSON_@jansson_soversion@ {
+ global:
+ *;
+};
+
--
2.42.0
|