 Add a check for the -Bsymbolic-functions linker flag
The -Bsymbolic-functions linker flag reduces the amount of PLT jumps in
a shared object, and has a side effect of preventing symbol collisions
in libraries and applications linking against two different shared
objects exposing the same symbol.
While the former is (generally) a performance win, the latter is less
rare than expected. For instance, PulseAudio started linking against
json-c a while ago; now, every project linking against PulseAudio is
leaking json-c symbols. In the GNOME platform, this means that projects
linking against PulseAudio cannot be safely linked against other
libraries depending on the GLib-based JSON parsing libraries JSON-GLib,
because of a symbol conflict. Nominally, this conflict would not be an
issue: libraries and applications do not need to depend on two different
JSON parsing libraries; the symbol leakage, though, ends up causing
either segmentation faults, or weird errors. For further reference,
please see: https://bugzilla.gnome.org/show_bug.cgi?id=703734
JSON-GLib already switched to using -Bsymbolic-functions, but it would
be safe if json-c did the same, wherever the linker flag is available.
12 years ago |
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- include Makefile.am.inc
-
- EXTRA_DIST = README.html README-WIN32.html config.h.win32 doc json-c.vcproj
- SUBDIRS = . tests
-
- lib_LTLIBRARIES = libjson-c.la
-
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = json-c.pc
-
- libjson_cincludedir = $(includedir)/json-c
- libjson_cinclude_HEADERS = \
- arraylist.h \
- bits.h \
- debug.h \
- json.h \
- json_config.h \
- json_c_version.h \
- json_inttypes.h \
- json_object.h \
- json_object_iterator.h \
- json_object_private.h \
- json_tokener.h \
- json_util.h \
- linkhash.h \
- printbuf.h \
- random_seed.h
-
- #libjsonx_includedir = $(libdir)/json-c-@VERSION@
- #
- #libjsonx_include_HEADERS = \
- # json_config.h
-
- libjson_c_la_LDFLAGS = -version-info 2:0:0 -no-undefined @JSON_BSYMBOLIC_LDFLAGS@
-
- libjson_c_la_SOURCES = \
- arraylist.c \
- debug.c \
- json_c_version.c \
- json_object.c \
- json_object_iterator.c \
- json_tokener.c \
- json_util.c \
- linkhash.c \
- printbuf.c \
- random_seed.c
-
-
- distclean-local:
- -rm -rf $(testsubdir)
- -rm -rf config.h.in~ Makefile.in aclocal.m4 autom4te.cache/ config.guess config.sub depcomp install-sh ltmain.sh missing
- -rm -f INSTALL test-driver tests/Makefile.in compile
-
- maintainer-clean-local:
- -rm -rf configure
-
- uninstall-local:
- rm -rf "$(DESTDIR)@includedir@/json-c"
- rm -f "$(DESTDIR)@includedir@/json"
-
- ANDROID_CFLAGS = -I$(top_srcdir) -DHAVE_CONFIG_H
-
- Android.mk: Makefile.am
- androgenizer -:PROJECT json-c \
- -:SHARED libjson-c \
- -:TAGS eng debug \
- -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
- -:SOURCES $(libjson_c_la_SOURCES) $(nodist_libjson_c_la_SOURCES) \
- -:CFLAGS $(DEFS) $(ANDROID_CFLAGS) $(libjson_c_la_CFLAGS) \
- -:LDFLAGS $(libjson_c_la_LDFLAGS) $(libjson_c_la_LIBADD) \
- -:HEADER_TARGET json-c \
- -:HEADERS $(libjson_cinclude_HEADERS) \
- -:PASSTHROUGH LOCAL_ARM_MODE:=arm \
- > $@
|