Blame SOURCES/json-c-0.14-versioned-symbols.patch

e8eb8f
diff --git a/CMakeLists.txt b/CMakeLists.txt
e8eb8f
index 21e395ed3c..da0af963ed 100644
e8eb8f
--- a/CMakeLists.txt
e8eb8f
+++ b/CMakeLists.txt
e8eb8f
@@ -325,6 +325,22 @@ if (NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC"))
e8eb8f
 		# XXX need cmake>=3.13 for this:
e8eb8f
 		#add_link_options("-Wl,-Bsymbolic-functions")
e8eb8f
 	endif()
e8eb8f
+
e8eb8f
+	file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym" "TEST { global: *; };")
e8eb8f
+	list(APPEND CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym")
e8eb8f
+	check_c_source_compiles(
e8eb8f
+	"
e8eb8f
+	int main (void)
e8eb8f
+	{
e8eb8f
+	  return 0;
e8eb8f
+	}
e8eb8f
+	"
e8eb8f
+	VERSION_SCRIPT_WORKS
e8eb8f
+	)
e8eb8f
+	list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "-Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/check-version-script.sym")
e8eb8f
+	if (VERSION_SCRIPT_WORKS)
e8eb8f
+		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/json-c.sym")
e8eb8f
+	endif()
e8eb8f
 endif()
e8eb8f
 
e8eb8f
 if ($ENV{VALGRIND})
e8eb8f
diff --git a/json-c.sym b/json-c.sym
e8eb8f
new file mode 100644
e8eb8f
index 0000000000..bf78792b7e
e8eb8f
--- /dev/null
e8eb8f
+++ b/json-c.sym
e8eb8f
@@ -0,0 +1,153 @@
e8eb8f
+JSONC_0.14 {
e8eb8f
+  global:
e8eb8f
+    _json_c_set_last_err;
e8eb8f
+    _json_c_strerror;
e8eb8f
+    _json_c_strerror_enable;
e8eb8f
+    array_list_add;
e8eb8f
+    array_list_bsearch;
e8eb8f
+    array_list_del_idx;
e8eb8f
+    array_list_free;
e8eb8f
+    array_list_get_idx;
e8eb8f
+    array_list_length;
e8eb8f
+    array_list_new;
e8eb8f
+    array_list_put_idx;
e8eb8f
+    array_list_sort;
e8eb8f
+    json_c_get_random_seed;
e8eb8f
+    json_c_object_sizeof;
e8eb8f
+    json_c_set_serialization_double_format;
e8eb8f
+    json_c_shallow_copy_default;
e8eb8f
+    json_c_version;
e8eb8f
+    json_c_version_num;
e8eb8f
+    json_c_visit;
e8eb8f
+    json_global_set_string_hash;
e8eb8f
+    json_hex_chars;
e8eb8f
+    json_number_chars;
e8eb8f
+    json_object_array_add;
e8eb8f
+    json_object_array_bsearch;
e8eb8f
+    json_object_array_del_idx;
e8eb8f
+    json_object_array_get_idx;
e8eb8f
+    json_object_array_length;
e8eb8f
+    json_object_array_put_idx;
e8eb8f
+    json_object_array_sort;
e8eb8f
+    json_object_deep_copy;
e8eb8f
+    json_object_double_to_json_string;
e8eb8f
+    json_object_equal;
e8eb8f
+    json_object_free_userdata;
e8eb8f
+    json_object_from_fd;
e8eb8f
+    json_object_from_fd_ex;
e8eb8f
+    json_object_from_file;
e8eb8f
+    json_object_get;
e8eb8f
+    json_object_get_array;
e8eb8f
+    json_object_get_boolean;
e8eb8f
+    json_object_get_double;
e8eb8f
+    json_object_get_int64;
e8eb8f
+    json_object_get_int;
e8eb8f
+    json_object_get_object;
e8eb8f
+    json_object_get_string;
e8eb8f
+    json_object_get_string_len;
e8eb8f
+    json_object_get_type;
e8eb8f
+    json_object_get_uint64;
e8eb8f
+    json_object_get_userdata;
e8eb8f
+    json_object_int_inc;
e8eb8f
+    json_object_is_type;
e8eb8f
+    json_object_iter_begin;
e8eb8f
+    json_object_iter_end;
e8eb8f
+    json_object_iter_equal;
e8eb8f
+    json_object_iter_init_default;
e8eb8f
+    json_object_iter_next;
e8eb8f
+    json_object_iter_peek_name;
e8eb8f
+    json_object_iter_peek_value;
e8eb8f
+    json_object_new_array;
e8eb8f
+    json_object_new_boolean;
e8eb8f
+    json_object_new_double;
e8eb8f
+    json_object_new_double_s;
e8eb8f
+    json_object_new_int64;
e8eb8f
+    json_object_new_int;
e8eb8f
+    json_object_new_null;
e8eb8f
+    json_object_new_object;
e8eb8f
+    json_object_new_string;
e8eb8f
+    json_object_new_string_len;
e8eb8f
+    json_object_new_uint64;
e8eb8f
+    json_object_object_add;
e8eb8f
+    json_object_object_add_ex;
e8eb8f
+    json_object_object_del;
e8eb8f
+    json_object_object_get;
e8eb8f
+    json_object_object_get_ex;
e8eb8f
+    json_object_object_length;
e8eb8f
+    json_object_put;
e8eb8f
+    json_object_set_boolean;
e8eb8f
+    json_object_set_double;
e8eb8f
+    json_object_set_int64;
e8eb8f
+    json_object_set_int;
e8eb8f
+    json_object_set_serializer;
e8eb8f
+    json_object_set_string;
e8eb8f
+    json_object_set_string_len;
e8eb8f
+    json_object_set_uint64;
e8eb8f
+    json_object_set_userdata;
e8eb8f
+    json_object_to_fd;
e8eb8f
+    json_object_to_file;
e8eb8f
+    json_object_to_file_ext;
e8eb8f
+    json_object_to_json_string;
e8eb8f
+    json_object_to_json_string_ext;
e8eb8f
+    json_object_to_json_string_length;
e8eb8f
+    json_object_userdata_to_json_string;
e8eb8f
+    json_parse_double;
e8eb8f
+    json_parse_int64;
e8eb8f
+    json_parse_uint64;
e8eb8f
+    json_pointer_get;
e8eb8f
+    json_pointer_getf;
e8eb8f
+    json_pointer_set;
e8eb8f
+    json_pointer_setf;
e8eb8f
+    json_tokener_error_desc;
e8eb8f
+    json_tokener_free;
e8eb8f
+    json_tokener_get_error;
e8eb8f
+    json_tokener_get_parse_end;
e8eb8f
+    json_tokener_new;
e8eb8f
+    json_tokener_new_ex;
e8eb8f
+    json_tokener_parse;
e8eb8f
+    json_tokener_parse_ex;
e8eb8f
+    json_tokener_parse_verbose;
e8eb8f
+    json_tokener_reset;
e8eb8f
+    json_tokener_set_flags;
e8eb8f
+    json_type_to_name;
e8eb8f
+    json_util_get_last_err;
e8eb8f
+    lh_char_equal;
e8eb8f
+    lh_kchar_table_new;
e8eb8f
+    lh_kptr_table_new;
e8eb8f
+    lh_ptr_equal;
e8eb8f
+    lh_table_delete;
e8eb8f
+    lh_table_delete_entry;
e8eb8f
+    lh_table_free;
e8eb8f
+    lh_table_insert;
e8eb8f
+    lh_table_insert_w_hash;
e8eb8f
+    lh_table_length;
e8eb8f
+    lh_table_lookup;
e8eb8f
+    lh_table_lookup_entry;
e8eb8f
+    lh_table_lookup_entry_w_hash;
e8eb8f
+    lh_table_lookup_ex;
e8eb8f
+    lh_table_new;
e8eb8f
+    lh_table_resize;
e8eb8f
+    mc_debug;
e8eb8f
+    mc_error;
e8eb8f
+    mc_get_debug;
e8eb8f
+    mc_info;
e8eb8f
+    mc_set_debug;
e8eb8f
+    mc_set_syslog;
e8eb8f
+    printbuf_free;
e8eb8f
+    printbuf_memappend;
e8eb8f
+    printbuf_memset;
e8eb8f
+    printbuf_new;
e8eb8f
+    printbuf_reset;
e8eb8f
+    sprintbuf;
e8eb8f
+
e8eb8f
+  local:
e8eb8f
+    *;
e8eb8f
+};
e8eb8f
+
e8eb8f
+JSONC_0.15 {
e8eb8f
+  global:
e8eb8f
+    array_list_new2;
e8eb8f
+    array_list_shrink;
e8eb8f
+    json_object_array_shrink;
e8eb8f
+    json_object_new_array_ext;
e8eb8f
+} JSONC_0.14;
e8eb8f