[autofit] Really fix handling of RTLD_DEFAULT.

This commit actually implements what commit 43ec023e1a describes.

* src/autofit/ft-hb.c (FT_RTLD_FLAGS): New macro for `dlopen`; it uses
  `RTLD_GLOBAL` only if `RTLD_DEFAULT` is available.
This commit is contained in:
Behdad Esfahbod
2025-06-19 08:06:53 +02:00
committed by Werner Lemberg
parent 738905b34b
commit 3ccc27dc52

View File

@@ -101,8 +101,11 @@
#else /* !_WIN32 */
# ifdef RTLD_DEFAULT
# define FT_RTLD_FLAGS RTLD_LAZY | RTLD_GLOBAL
lib = RTLD_DEFAULT;
version_atleast = DLSYM( lib, hb_version_atleast );
# else
# define FT_RTLD_FLAGS RTLD_LAZY
# endif
if ( !version_atleast )
@@ -116,7 +119,7 @@
* variables, and closing the library will cause them to be
* invalidated.
*/
lib = dlopen( FT_LIBHARFBUZZ, RTLD_LAZY | RTLD_GLOBAL );
lib = dlopen( FT_LIBHARFBUZZ, FT_RTLD_FLAGS );
if ( !lib )
goto Fail;
version_atleast = DLSYM( lib, hb_version_atleast );