Added
Link Here
|
0 |
- |
1 |
--- intl/osdep.c.orig 2019-05-11 11:29:32 UTC |
|
|
2 |
+++ intl/osdep.c |
3 |
@@ -18,6 +18,24 @@ |
4 |
# include "intl-exports.c" |
5 |
#elif defined __EMX__ && !defined __KLIBC__ |
6 |
# include "os2compat.c" |
7 |
+#elif defined __FreeBSD__ |
8 |
+#include <config.h> |
9 |
+#include <sys/param.h> |
10 |
+#include <dlfcn.h> |
11 |
+#include <pthread.h> |
12 |
+static __attribute__((constructor)) void |
13 |
+libintl_init (void) |
14 |
+{ |
15 |
+#if __FreeBSD_version >= 1400094 |
16 |
+ /* We don't link with libpthread to avoid overhead for non-threaded |
17 |
+ programs. Instead we dlopen it with RTLD_NOLOAD here to ensure |
18 |
+ it is initialised when present. */ |
19 |
+ (void) dlopen ("libpthread.so", RTLD_LAZY | RTLD_GLOBAL | RTLD_NOLOAD); |
20 |
+#else |
21 |
+ /* This hack also triggers libpthread initialisation. */ |
22 |
+ (void) pthread_self (); |
23 |
+#endif |
24 |
+} |
25 |
#else |
26 |
/* Avoid AIX compiler warning. */ |
27 |
typedef int dummy; |