Try fixing unixODBC deadlock with -Bsymbolic-functions

This flag compels the dynamic library to prefer its own function symbols
to those in the global symbol table. This behavior should let us
directly call SQL* functions from inside other SQL* functions without
fear of interference by the host program.
This commit is contained in:
Evan Miller 2020-08-13 21:52:03 -04:00
parent 4f330ea6be
commit dfd41f2283
2 changed files with 2 additions and 4 deletions

View File

@ -70,9 +70,7 @@ AC_SUBST(LFLAGS)
CFLAGS="$CFLAGS -Wall -Werror"
AS_CASE([$host],
[*mingw*|*cygwin*], [LDFLAGS="$LDFLAGS -no-undefined"],
[*darwin*], [],
[LDFLAGS="$LDFLAGS -Wl,--no-undefined"])
[*mingw*|*cygwin*], [LDFLAGS="$LDFLAGS -no-undefined"], [])
AS_CASE([$host],
[*mingw*], [LDFLAGS="$LDFLAGS -lWs2_32"], [])
dnl Enable -Wl,--as-needed by default to prevent overlinking

View File

@ -4,7 +4,7 @@ lib_LTLIBRARIES = libmdbodbc.la
AM_CFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(ODBC_CFLAGS)
libmdbodbc_la_SOURCES = odbc.c connectparams.c
libmdbodbc_la_LIBADD = ../libmdb/libmdb.la ../sql/libmdbsql.la $(ODBC_LIBS)
libmdbodbc_la_LDFLAGS = -avoid-version -export-symbols-regex '^(SQL|ODBCINST)'
libmdbodbc_la_LDFLAGS = -avoid-version -export-symbols-regex '^(SQL|ODBCINST)' -Bsymbolic-functions
if FAKE_GLIB
libmdbodbc_la_SOURCES += ../libmdb/fakeglib.c
endif