From c00c889e625164fc9507f84e57f40c9962e650bb Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 17 May 2018 14:19:36 +0100 Subject: [PATCH] Use -Bsymbolic-functions instead of -Bsymbolic Epoxy updates the function pointers in order to avoid calling the resolver multiple times, but with -Bsymbolic we're going to update the copy inside libepoxy, instead of the relocated copy in the code using libepoxy. This leads to libepoxy constantly querying the function resolver code instead of just once. We still want to avoid intra-library relocations for our functions, but we need to live with them for our global function pointers. See issue #171 --- src/Makefile.am | 2 +- src/meson.build | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 419fbb4..73f7435 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -116,7 +116,7 @@ libepoxy_la_SOURCES = \ libepoxy_la_LDFLAGS = \ -no-undefined \ - -Bsymbolic \ + -Bsymbolic-functions \ $() libepoxy_la_LIBADD = \ diff --git a/src/meson.build b/src/meson.build index 49907fa..466fc0d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -51,9 +51,9 @@ common_ldflags = [] if host_system == 'linux' and cc.get_id() == 'gcc' if meson.version().version_compare('>= 0.46.0') - common_ldflags += cc.get_supported_link_arguments([ '-Wl,-Bsymbolic', '-Wl,-z,relro' ]) + common_ldflags += cc.get_supported_link_arguments([ '-Wl,-Bsymbolic-functions', '-Wl,-z,relro' ]) else - common_ldflags += [ '-Wl,-Bsymbolic', '-Wl,-z,relro', ] + common_ldflags += [ '-Wl,-Bsymbolic-functions', '-Wl,-z,relro', ] endif endif