From fc06be3f71756ab695008854af0643e75c78999f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 9 Jun 2010 12:47:59 +0200 Subject: [PATCH] Avoid relocwrapper link errors due to gnulib replacement functions. --- ChangeLog | 12 ++++++++++++ lib/canonicalize-lgpl.c | 2 ++ lib/malloca.c | 3 +++ lib/progreloc.c | 4 ++++ lib/relocatable.c | 3 +++ lib/relocwrapper.c | 4 ++++ lib/setenv.c | 4 ++++ lib/strerror.c | 3 +++ 8 files changed, 35 insertions(+) diff --git a/ChangeLog b/ChangeLog index aa2ac1a0d..d8cafae3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2010-06-09 Bruno Haible + + Avoid relocwrapper link errors due to gnulib replacement functions. + * lib/canonicalize-lgpl.c: Use the system's malloc function. + * lib/malloca.c: Likewise. + * lib/relocatable.c: Likewise. + * lib/progreloc.c: Use the system's malloc, sprintf functions. + * lib/relocwrapper.c: Use the system's fprintf, malloc functions. + * lib/setenv.c: Use the system's malloc, realloc functions. + * lib/strerror.c: Use the system's sprintf function. + Reported by Ben Pfaff . + 2010-06-04 Bruno Haible Prefer documented low-level autoconf macro names. diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c index 939e3f114..c2164e07f 100644 --- a/lib/canonicalize-lgpl.c +++ b/lib/canonicalize-lgpl.c @@ -62,6 +62,8 @@ # endif # define __readlink readlink # define __set_errno(e) errno = (e) +/* Use the system functions, not the gnulib overrides in this file. */ +# undef malloc # ifndef MAXSYMLINKS # ifdef SYMLOOP_MAX # define MAXSYMLINKS SYMLOOP_MAX diff --git a/lib/malloca.c b/lib/malloca.c index b0e6ab6ed..226887849 100644 --- a/lib/malloca.c +++ b/lib/malloca.c @@ -21,6 +21,9 @@ /* Specification. */ #include "malloca.h" +/* Use the system functions, not the gnulib overrides in this file. */ +#undef malloc + /* The speed critical point in this file is freea() applied to an alloca() result: it must be fast, to match the speed of alloca(). The speed of mmalloca() and freea() in the other case are not critical, because they diff --git a/lib/progreloc.c b/lib/progreloc.c index 8aa33b750..1e27de72c 100644 --- a/lib/progreloc.c +++ b/lib/progreloc.c @@ -89,6 +89,10 @@ extern char * canonicalize_file_name (const char *name); #undef open #undef close +/* Use the system functions, not the gnulib overrides in this file. */ +#undef malloc +#undef sprintf + #undef set_program_name diff --git a/lib/relocatable.c b/lib/relocatable.c index 172e91c93..f0ac6d105 100644 --- a/lib/relocatable.c +++ b/lib/relocatable.c @@ -86,6 +86,9 @@ # define FILE_SYSTEM_PREFIX_LEN(P) 0 #endif +/* Use the system functions, not the gnulib overrides in this file. */ +#undef malloc + /* Original installation prefix. */ static char *orig_prefix; static size_t orig_prefix_len; diff --git a/lib/relocwrapper.c b/lib/relocwrapper.c index 19dfaa383..04f2258c9 100644 --- a/lib/relocwrapper.c +++ b/lib/relocwrapper.c @@ -55,6 +55,10 @@ #include "relocatable.h" #include "c-ctype.h" +/* Use the system functions, not the gnulib overrides in this file. */ +#undef fprintf +#undef malloc + /* Return a copy of the filename, with an extra ".bin" at the end. More generally, it replaces "${EXEEXT}" at the end with ".bin${EXEEXT}". */ static char * diff --git a/lib/setenv.c b/lib/setenv.c index 178191c61..ba760d6f2 100644 --- a/lib/setenv.c +++ b/lib/setenv.c @@ -64,6 +64,10 @@ __libc_lock_define_initialized (static, envlock) # define clearenv __clearenv # define tfind __tfind # define tsearch __tsearch +#else +/* Use the system functions, not the gnulib overrides in this file. */ +# undef malloc +# undef realloc #endif /* In the GNU C library implementation we try to be more clever and diff --git a/lib/strerror.c b/lib/strerror.c index b0df77848..46153abf5 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -32,6 +32,9 @@ # include "intprops.h" +/* Use the system functions, not the gnulib overrides in this file. */ +# undef sprintf + # undef strerror # if ! HAVE_DECL_STRERROR # define strerror(n) NULL -- 2.11.0