From: Bruno Haible Date: Fri, 7 Aug 2009 07:06:45 +0000 (+0200) Subject: Avoid link error on MacOS X 10.3 and 10.4. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f1bf576817ce91c69f6a9ae5b96980229760df;p=pspp Avoid link error on MacOS X 10.3 and 10.4. --- diff --git a/ChangeLog b/ChangeLog index 33eb3249b5..1ce6194543 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-07 Bruno Haible + + Avoid link error on MacOS X 10.3 and 10.4. + * lib/argp-ba.c (argp_program_bug_address): Explicitly zero-initialize + on non-ELF systems. + * lib/argp-pv.c (argp_program_version): Likewise. + Reported by Simon Josefsson. + 2009-08-07 Simon Josefsson * tests/test-version-etc.sh: Use $EXEEXT. diff --git a/lib/argp-ba.c b/lib/argp-ba.c index 3e8bb96220..5da64e6f43 100644 --- a/lib/argp-ba.c +++ b/lib/argp-ba.c @@ -1,5 +1,5 @@ /* Default definition for ARGP_PROGRAM_BUG_ADDRESS. - Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -21,4 +21,14 @@ the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help messages), embedded in a sentence that says something like `Report bugs to ADDR.'. */ -const char *argp_program_bug_address; +const char *argp_program_bug_address +/* This variable should be zero-initialized. On most systems, putting it into + BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see + + . */ +#if defined __ELF__ + /* On ELF systems, variables in BSS behave well. */ +#else + = (const char *) 0 +#endif + ; diff --git a/lib/argp-pv.c b/lib/argp-pv.c index 411f6ede70..8add4b0232 100644 --- a/lib/argp-pv.c +++ b/lib/argp-pv.c @@ -1,5 +1,5 @@ /* Default definition for ARGP_PROGRAM_VERSION. - Copyright (C) 1996, 1997, 1999, 2006 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1999, 2006, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -20,4 +20,14 @@ --version is added (unless the ARGP_NO_HELP flag is used), which will print this string followed by a newline and exit (unless the ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */ -const char *argp_program_version; +const char *argp_program_version +/* This variable should be zero-initialized. On most systems, putting it into + BSS is sufficient. Not so on MacOS X 10.3 and 10.4, see + + . */ +#if defined __ELF__ + /* On ELF systems, variables in BSS behave well. */ +#else + = (const char *) 0 +#endif + ;