svn commit: branches/uClibc-nptl: extra/Configs include libc/misc/internal etc...
carmelo at uclibc.org
carmelo at uclibc.org
Thu Nov 22 18:26:26 UTC 2007
Author: carmelo
Date: 2007-11-22 10:26:26 -0800 (Thu, 22 Nov 2007)
New Revision: 20479
Log:
Fix __uClibc_main.c to not create aliases to hidden variables
(like __progname). This patch has been already into the trunk
and it solves a segfault with openssh for example.
Further needed to fix the prototype of 'program_invocation_name;
into include/errno.h to avoid mismatch with definition within
libc/misc/internals/__uCLibc_main.c
Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
Modified:
branches/uClibc-nptl/extra/Configs/Config.in
branches/uClibc-nptl/include/errno.h
branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c
Changeset:
Modified: branches/uClibc-nptl/extra/Configs/Config.in
===================================================================
--- branches/uClibc-nptl/extra/Configs/Config.in 2007-11-22 17:28:22 UTC (rev 20478)
+++ branches/uClibc-nptl/extra/Configs/Config.in 2007-11-22 18:26:26 UTC (rev 20479)
@@ -535,6 +535,7 @@
config UCLIBC_HAS___PROGNAME
bool "Support for __progname"
default y
+ depends on UCLIBC_HAS_PROGRAM_INVOCATION_NAME
help
Some packages (like openssh) like to peek into internal libc
symbols to make their output a bit more user friendly.
Modified: branches/uClibc-nptl/include/errno.h
===================================================================
--- branches/uClibc-nptl/include/errno.h 2007-11-22 17:28:22 UTC (rev 20478)
+++ branches/uClibc-nptl/include/errno.h 2007-11-22 18:26:26 UTC (rev 20479)
@@ -52,7 +52,7 @@
/* The full and simple forms of the name with which the program was
invoked. These variables are set up automatically at startup based on
the value of ARGV[0] (this works only if you use GNU ld). */
-extern char *program_invocation_name, *program_invocation_short_name;
+const extern char *program_invocation_name, *program_invocation_short_name;
#endif /* __USE_GNU */
#endif /* _ERRNO_H */
Modified: branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c
===================================================================
--- branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c 2007-11-22 17:28:22 UTC (rev 20478)
+++ branches/uClibc-nptl/libc/misc/internals/__uClibc_main.c 2007-11-22 18:26:26 UTC (rev 20479)
@@ -122,15 +122,15 @@
# endif
#endif
-attribute_hidden const char *__uclibc_progname = NULL;
+attribute_hidden const char *__uclibc_progname = "";
+#ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
+const char *program_invocation_short_name = "";
+const char *program_invocation_name = "";
+#endif
#ifdef __UCLIBC_HAS___PROGNAME__
-strong_alias (__uclibc_progname, __progname)
+weak_alias (program_invocation_short_name, __progname)
+weak_alias (program_invocation_name, __progname_full)
#endif
-#ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
-attribute_hidden const char *__progname_full = NULL;
-strong_alias (__uclibc_progname, program_invocation_short_name)
-strong_alias (__progname_full, program_invocation_name)
-#endif
/*
* Declare the __environ global variable and create a weak alias environ.
@@ -138,7 +138,7 @@
*/
char **__environ = 0;
-weak_alias(__environ,environ)
+weak_alias(__environ, environ)
/* TODO: don't export __pagesize; we cant now because libpthread uses it */
size_t __pagesize = 0;
More information about the uClibc-cvs
mailing list