mirror of
https://gitlab.freedesktop.org/freetype/freetype.git
synced 2025-12-29 00:20:08 +01:00
* src/autofit/ft-hb.c: Fix usage of RTLD_DEFAULT.
Using `RTLD_DEFAULT` we see whether the process already has HarfBuzz linked in, and reuse it. If this symbol is not defined it is tempting to use `RTLD_GLOBAL` instead, which would make the library available to the whole process. However, without `RTLD_DEFAULT`, we would risk loading a second HarfBuzz library, and if the linker mixes them up, probably giving symbols from the new library to other clients, we might get into trouble. For this reason, we do not pass `RTLD_GLOBAL` to `dlopen`; the default is `RTLD_LOCAL`, and the rest of the process won't see the loaded HarfBuzz and hopefully all be happy.
This commit is contained in:
parent
5a07f41d0e
commit
43ec023e1a
1 changed files with 5 additions and 1 deletions
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
#else /* !_WIN32 */
|
||||
|
||||
# define _GNU_SOURCE 1 /* for RTLD_DEFAULT */
|
||||
# include <dlfcn.h>
|
||||
|
||||
/* The GCC pragma suppresses the warning "ISO C forbids */
|
||||
|
|
@ -96,8 +97,11 @@
|
|||
|
||||
#else /* !_WIN32 */
|
||||
|
||||
lib = RTLD_DEFAULT;
|
||||
# ifdef RTLD_DEFAULT
|
||||
lib = RTLD_DEFAULT;
|
||||
version_atleast = DLSYM( lib, hb_version_atleast );
|
||||
# endif
|
||||
|
||||
if ( !version_atleast )
|
||||
{
|
||||
/* Load the HarfBuzz library.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue