summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2014-11-19 10:34:32 +0100
committerWerner Koch <wk@gnupg.org>2014-11-20 12:17:50 +0100
commitcd2c6f36fe5d1d1d45546f5168aead5cbe6487e0 (patch)
treed30cd8eb517e4389495562de0bec273bc9d743fb /common
parentgpg-connect-agent: Add convenience option --uiserver. (diff)
downloadgnupg2-cd2c6f36fe5d1d1d45546f5168aead5cbe6487e0.tar.xz
gnupg2-cd2c6f36fe5d1d1d45546f5168aead5cbe6487e0.zip
Fix linker problem on OS X.
* common/init.c (default_errsource): Move to the .data segmemt. -- See mails starting at http://lists.gnupg.org/pipermail/gnupg-devel/2014-November/029089.html
Diffstat (limited to 'common')
-rw-r--r--common/init.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/init.c b/common/init.c
index 1cbd709d7..2d5d6301c 100644
--- a/common/init.c
+++ b/common/init.c
@@ -67,8 +67,11 @@ static mem_cleanup_item_t mem_cleanup_list;
/* The default error source of the application. This is different
from GPG_ERR_SOURCE_DEFAULT in that it does not depend on the
- source file and thus is usable in code shared by applications. */
-gpg_err_source_t default_errsource;
+ source file and thus is usable in code shared by applications.
+ Note that we need to initialize it because otherwise some linkers
+ (OS X at least) won't find the symbol when linking the t-*.c
+ files. */
+gpg_err_source_t default_errsource = 0;
#ifdef HAVE_W32CE_SYSTEM
@@ -145,7 +148,7 @@ writestring_via_estream (int mode, const char *string)
void
_init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp)
{
- /* Store the error source in a gloabl variable. */
+ /* Store the error source in a global variable. */
default_errsource = errsource;
atexit (run_mem_cleanup);