From 08b8eb678a6cb74c118a32e75b880599e3ac4a7c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 31 Mar 2018 12:15:50 +0200 Subject: [PATCH] Another try at fixing linker issue Fixes https://github.com/harfbuzz/harfbuzz/issues/880 --- configure.ac | 11 +++++++++-- src/Makefile.am | 6 ------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index aca03bfaf..a8050d7c5 100644 --- a/configure.ac +++ b/configure.ac @@ -77,8 +77,7 @@ GTK_DOC_CHECK([1.15],[--flavour no-tmpl]) AM_CONDITIONAL([ENABLE_GTK_DOC], false) ]) -# Functions, and headers - +# Functions and headers AC_CHECK_FUNCS(atexit mprotect sysconf getpagesize mmap isatty newlocale strtod_l) save_libs="$LIBS" @@ -96,6 +95,14 @@ if test "x$GCC" = "xyes"; then # Make symbols link locally AX_CHECK_LINK_FLAG([[-Bsymbolic-functions]], [LDFLAGS="$LDFLAGS -Bsymbolic-functions"]) + # Make it possible to not link to libstdc++ + # No threadsafe statics in C++ as we do it ourselves. + # We don't use these features, so it's safe to disable them + # even in the cases where we DO link to libstdc++. + # Put -fno-rtti before $CXXFLAGS such that users can re-enable it + # by overriding CXXFLAGS. + CXXFLAGS="-fno-rtti $CXXFLAGS -fno-exceptions -fno-threadsafe-statics" + # Assorted warnings CXXFLAGS="$CXXFLAGS -Wcast-align" diff --git a/src/Makefile.am b/src/Makefile.am index db265e21b..c5a01e75d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,12 +28,6 @@ HBSOURCES = $(HB_BASE_sources) HBSOURCES += $(HB_BASE_RAGEL_GENERATED_sources) HBHEADERS = $(HB_BASE_headers) -# Make sure we don't link to libstdc++ -# No threadsafe statics in C++ as we do it ourselves -# We don't use these features, so it's safe to disable them -# even in the cases where we DO link to libstdc++. -AM_CXXFLAGS = -fno-exceptions -fno-threadsafe-statics -fno-rtti - if HAVE_OT HBSOURCES += $(HB_OT_sources) HBSOURCES += $(HB_OT_RAGEL_GENERATED_sources)