From bugs at busybox.net Mon Mar 3 14:52:23 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Mon, 3 Mar 2008 14:52:23 -0800 Subject: [uClibc 0002414]: Order of linking libraries can causes application not to run Message-ID: <94d968a0122151144013c51213c0fcab@bugs.uclibc.org> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=2414 ====================================================================== Reported By: pqa Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2414 Category: Posix Threads Reproducibility: always Severity: major Priority: normal Status: assigned ====================================================================== Date Submitted: 03-03-2008 14:52 PST Last Modified: 03-03-2008 14:52 PST ====================================================================== Summary: Order of linking libraries can causes application not to run Description: Using uClibc version 0.9.29, linking with -nodefaultlibs -lc -lpthreads causes the application to consume 100% CPU time indefinitely, before main() is called. Linking with -nodefaultlibs -lpthreads -lc allows the application to run. Application is cross compiled to run on bcrm47xx mipsel processor, using gcc 4.1.2 and is using libpthreads.old. I can provide further information if needed, but I am not sure what other information would be helpful. Attached file builds example application in form that works and form that doesn't. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 03-03-08 14:52 pqa New Issue 03-03-08 14:52 pqa Status new => assigned 03-03-08 14:52 pqa Assigned To => uClibc 03-03-08 14:52 pqa File Added: pthread.proc ====================================================================== From carmelo at uclibc.org Wed Mar 5 02:35:57 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 02:35:57 -0800 (PST) Subject: svn commit: branches/uClibc-nptl: include/netinet libc/inet test/inet Message-ID: <20080305103557.CA6F212C658@busybox.net> Author: carmelo Date: 2008-03-05 02:35:56 -0800 (Wed, 05 Mar 2008) New Revision: 21164 Log: Added support for ether_line, ether_ntohost and ether_hostton. Added related test cases. Signed-off-by: Matthew Wilcox Hacked-by: Carmelo Amoroso Added: branches/uClibc-nptl/libc/inet/ethers.c branches/uClibc-nptl/test/inet/tst-ethers-line.c branches/uClibc-nptl/test/inet/tst-ethers.c Modified: branches/uClibc-nptl/include/netinet/ether.h Changeset: Modified: branches/uClibc-nptl/include/netinet/ether.h =================================================================== --- branches/uClibc-nptl/include/netinet/ether.h 2008-03-04 12:19:19 UTC (rev 21163) +++ branches/uClibc-nptl/include/netinet/ether.h 2008-03-05 10:35:56 UTC (rev 21164) @@ -25,6 +25,8 @@ /* Get definition of `struct ether_addr'. */ #include +#define ETHER_FILE_NAME "/etc/ethers" + __BEGIN_DECLS /* Convert 48 bit Ethernet ADDRess to ASCII. */ Added: branches/uClibc-nptl/libc/inet/ethers.c =================================================================== --- branches/uClibc-nptl/libc/inet/ethers.c (rev 0) +++ branches/uClibc-nptl/libc/inet/ethers.c 2008-03-05 10:35:56 UTC (rev 21164) @@ -0,0 +1,122 @@ +/* + * libc/inet/ethers.c + * + * Programmatic interface for the /etc/ethers file + * + * Copyright 2007 by Matthew Wilcox + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#include +#include +#include + +#define ETHER_LINE_LEN 256 + +/* + * Internal function which returns a pointer to the part of the line + * with the start of the hostname, or NULL if we couldn't parse the line. + * Note that this line may have a comment symbol on it somewhere; if so + * it will return NULL if the # is before or within the ether_addr, and + * succeed if the # is before or within the host. It's up to the callers + * to be aware of this. + * + * I would have preferred to write a NUL to the location of the comment + * character, but ether_line takes a const argument. See __ether_line_w. + */ +static const char *__ether_line(const char *line, struct ether_addr *addr) +{ + struct ether_addr *res = ether_aton_r(line, addr); + if (!res) + return NULL; + + while (*line && (*line != ' ') && (*line != '\t')) + line++; + while (*line && ((*line == ' ') || (*line == '\t'))) + line++; + return (*line) ? line : NULL; +} + +/* + * Strips out the comment before calling __ether_line. We can do this, + * since we know the buffer is writable. + */ +static const char *__ether_line_w(char *line, struct ether_addr *addr) +{ + char *end = strchr(line, '#'); + if (!end) + end = strchr(line, '\n'); + if (end) + *end = '\0'; + return __ether_line(line, addr); +} + +int ether_line(const char *line, struct ether_addr *addr, char *hostname) +{ + const char *name = __ether_line(line, addr); + if (!name) + return -1; + + while (*name) { + if ((*name == '#') || isspace(*name)) + break; + *hostname++ = *name++; + } + *hostname = '\0'; + + return 0; +} + +int ether_ntohost(char *hostname, const struct ether_addr *addr) +{ + int res = -1; + FILE *fp; + char buf[ETHER_LINE_LEN]; + + fp = fopen(ETHER_FILE_NAME, "r"); + if (!fp) + return -1; + + while (fgets(buf, sizeof(buf), fp)) { + struct ether_addr tmp_addr; + const char *cp = __ether_line_w(buf, &tmp_addr); + if (!cp) + continue; + if (memcmp(addr, &tmp_addr, sizeof(tmp_addr))) + continue; + + strcpy(hostname, cp); + res = 0; + break; + } + + fclose(fp); + return res; +} + +int ether_hostton(const char *hostname, struct ether_addr *addr) +{ + int res = -1; + FILE *fp; + char buf[ETHER_LINE_LEN]; + + fp = fopen(ETHER_FILE_NAME, "r"); + if (!fp) + return -1; + + while (fgets(buf, sizeof(buf), fp)) { + const char *cp = __ether_line_w(buf, addr); + if (!cp) + continue; + if (strcasecmp(hostname, cp)) + continue; + + res = 0; + break; + } + + fclose(fp); + return res; +} Added: branches/uClibc-nptl/test/inet/tst-ethers-line.c =================================================================== --- branches/uClibc-nptl/test/inet/tst-ethers-line.c (rev 0) +++ branches/uClibc-nptl/test/inet/tst-ethers-line.c 2008-03-05 10:35:56 UTC (rev 21164) @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include +#include +#include + +#define ETHER_LINE_LEN 256 + +int main(void) +{ + struct ether_addr addr; + char hostname[ETHER_LINE_LEN]; + int fd, i; + const char *ethers; + struct stat statb; + + if ((fd = open(ETHER_FILE_NAME, O_RDONLY)) == -1) { + perror ("Cannot open file"); + exit(1); + } + + if (fstat(fd, &statb)) { + perror("Stat failed"); + exit(1); + } + ethers = mmap(NULL, statb.st_size, PROT_READ, MAP_SHARED, fd, 0); + + if (ethers == MAP_FAILED) { + perror("File mapping failed"); + exit(1); + } + + ether_line(ethers, &addr, hostname); + + for (i = 0; i < 6; i++) { + printf("%02x", addr.ether_addr_octet[i]); + if (i < 5) + printf(":"); + } + printf(" %s\n", hostname); + + return 0; +} Added: branches/uClibc-nptl/test/inet/tst-ethers.c =================================================================== --- branches/uClibc-nptl/test/inet/tst-ethers.c (rev 0) +++ branches/uClibc-nptl/test/inet/tst-ethers.c 2008-03-05 10:35:56 UTC (rev 21164) @@ -0,0 +1,28 @@ +#include +#include + +#define ETHER_LINE_LEN 256 + +int main(void) +{ + struct ether_addr addr; + char host[ETHER_LINE_LEN]; + int i; + int res = ether_hostton("teeth", &addr); + + if (res) + return 1; + + for (i = 0; i < 6; i++) { + printf("%02x", addr.ether_addr_octet[i]); + if (i < 5) + printf(":"); + } + + res = ether_ntohost(host, &addr); + if (res) + return 1; + printf(" %s\n", host); + + return 0; +} From carmelo at uclibc.org Wed Mar 5 06:13:35 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 06:13:35 -0800 (PST) Subject: svn commit: branches/uClibc-nptl: extra/locale libpthread/nptl/sysdeps/pth etc... Message-ID: <20080305141335.45521120129@busybox.net> Author: carmelo Date: 2008-03-05 06:13:34 -0800 (Wed, 05 Mar 2008) New Revision: 21166 Log: Remove extra / from directory name Signed-off-by: Carmelo Amoroso Modified: branches/uClibc-nptl/extra/locale/Makefile.in branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile.in branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in Changeset: Modified: branches/uClibc-nptl/extra/locale/Makefile.in =================================================================== --- branches/uClibc-nptl/extra/locale/Makefile.in 2008-03-05 13:35:23 UTC (rev 21165) +++ branches/uClibc-nptl/extra/locale/Makefile.in 2008-03-05 14:13:34 UTC (rev 21166) @@ -12,7 +12,7 @@ BUILD_CFLAGS-locale-common := \ -D__UCLIBC_GEN_LOCALE \ - -DUCLIBC_CTYPE_HEADER='"$(top_builddir)/include/bits/uClibc_ctype.h"' + -DUCLIBC_CTYPE_HEADER='"$(top_builddir)include/bits/uClibc_ctype.h"' BUILD_CFLAGS-gen_wc8bit := $(BUILD_CFLAGS-locale-common) -DCTYPE_PACKED=1 Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile.in =================================================================== --- branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile.in 2008-03-05 13:35:23 UTC (rev 21165) +++ branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/Makefile.in 2008-03-05 14:13:34 UTC (rev 21166) @@ -76,8 +76,8 @@ #CFLAGS:=$(CFLAGS:-O1=-O2) -pthread_DIR := $(top_srcdir)/libpthread/nptl/sysdeps/pthread -pthread_OUT := $(top_builddir)/libpthread/nptl/sysdeps/pthread +pthread_DIR := $(top_srcdir)libpthread/nptl/sysdeps/pthread +pthread_OUT := $(top_builddir)libpthread/nptl/sysdeps/pthread pthread_SRC = $(patsubst %.c, $(pthread_DIR)/%.c, $(libpthread_CSRC)) pthread_OBJ = $(patsubst %.c, $(pthread_OUT)/%.o, $(libpthread_CSRC)) Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in =================================================================== --- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in 2008-03-05 13:35:23 UTC (rev 21165) +++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/Makefile.in 2008-03-05 14:13:34 UTC (rev 21166) @@ -97,8 +97,8 @@ CFLAGS-OMIT-timer_routines.c = -DIS_IN_libpthread=1 CFLAGS-OMIT-timer_settime.c = -DIS_IN_libpthread=1 -PTHREAD_LINUX_DIR := $(top_srcdir)/libpthread/nptl/sysdeps/unix/sysv/linux -PTHREAD_LINUX_OUT := $(top_builddir)/libpthread/nptl/sysdeps/unix/sysv/linux +PTHREAD_LINUX_DIR := $(top_srcdir)libpthread/nptl/sysdeps/unix/sysv/linux +PTHREAD_LINUX_OUT := $(top_builddir)libpthread/nptl/sysdeps/unix/sysv/linux PTHREAD_LINUX_OBJ := $(patsubst %.c,$(PTHREAD_LINUX_OUT)/%.o,$(libpthread_CSRC)) PTHREAD_LINUX_OBJ += $(patsubst %.S,$(PTHREAD_LINUX_OUT)/%.o,$(libpthread_SSRC)) From carmelo at uclibc.org Wed Mar 5 06:29:50 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 06:29:50 -0800 (PST) Subject: svn commit: branches/uClibc-nptl/libc/inet Message-ID: <20080305142950.4F01F12C625@busybox.net> Author: carmelo Date: 2008-03-05 06:29:49 -0800 (Wed, 05 Mar 2008) New Revision: 21167 Log: Synch with trunk adding latest changes: - Added AI_NUMERICSERV flag and check if the string is not just a number when AI_NUMERICSERV flag set. Signed-off-by: Filippo Arcidiacono - Ricard Wanderlof writes: The following definitions in getaddrinfo.c seem redundant as they _are_ defined in the public netdb.h header, contrary to the comment. AI_DEFAULT is not, however it is not used in the file either so can be safely removed. Signed-off-by: Carmelo Amoroso Modified: branches/uClibc-nptl/libc/inet/getaddrinfo.c Changeset: Modified: branches/uClibc-nptl/libc/inet/getaddrinfo.c =================================================================== --- branches/uClibc-nptl/libc/inet/getaddrinfo.c 2008-03-05 14:13:34 UTC (rev 21166) +++ branches/uClibc-nptl/libc/inet/getaddrinfo.c 2008-03-05 14:29:49 UTC (rev 21167) @@ -90,15 +90,6 @@ libc_hidden_proto(in6addr_loopback) #endif -/* The following declarations and definitions have been removed from - * the public header since we don't want people to use them. */ -#define AI_V4MAPPED 0x0008 /* IPv4-mapped addresses are acceptable. */ -#define AI_ALL 0x0010 /* Return both IPv4 and IPv6 addresses. */ -#define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose - returned address type. */ -#define AI_DEFAULT (AI_V4MAPPED | AI_ADDRCONFIG) - - #define GAIH_OKIFUNSPEC 0x0100 #define GAIH_EAI ~(GAIH_OKIFUNSPEC) @@ -823,7 +814,7 @@ hints = &default_hints; if (hints->ai_flags & ~(AI_PASSIVE|AI_CANONNAME|AI_NUMERICHOST| - AI_ADDRCONFIG|AI_V4MAPPED|AI_ALL)) + AI_ADDRCONFIG|AI_V4MAPPED|AI_NUMERICSERV|AI_ALL)) return EAI_BADFLAGS; if ((hints->ai_flags & AI_CANONNAME) && name == NULL) @@ -834,8 +825,12 @@ char *c; gaih_service.name = service; gaih_service.num = strtoul (gaih_service.name, &c, 10); - if (*c) + if (*c != '\0') { + if (hints->ai_flags & AI_NUMERICSERV) + return EAI_NONAME; + gaih_service.num = -1; + } else /* * Can't specify a numerical socket unless a protocol From carmelo at uclibc.org Wed Mar 5 06:37:51 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 06:37:51 -0800 (PST) Subject: svn commit: branches/uClibc-nptl: extra/scripts Message-ID: <20080305143751.6593312C714@busybox.net> Author: carmelo Date: 2008-03-05 06:37:50 -0800 (Wed, 05 Mar 2008) New Revision: 21168 Log: Synch with trunk. Signed-off-by: Carmelo Amoroso include/bits/uClibc_config.h + # For the moment, we have to keep re-running this target # because the fix includes scripts rely on pre-processers # in order to generate the headers correctly :(. That @@ -52,7 +54,8 @@ endif HEADERS_BITS_COMMON := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/common/bits/*.h)) HEADERS_BITS_ARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h)) -HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH),$(HEADERS_BITS_COMMON)) +HEADERS_BITS_SUBARCH := $(notdir $(wildcard $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/*.h)) +HEADERS_BITS_COMMON := $(filter-out $(HEADERS_BITS_ARCH) $(HEADERS_BITS_SUBARCH),$(HEADERS_BITS_COMMON)) headers_sysnum: $(Q)\ @@ -72,7 +75,7 @@ $(Q)$(MAKE) headers-y $(Q)\ set -e; \ - if [ -f libc/sysdeps/linux/$(TARGET_ARCH)/fpu_control.h ] ; then \ + if [ -e libc/sysdeps/linux/$(TARGET_ARCH)/fpu_control.h ] ; then \ $(LN) -fs ../libc/sysdeps/linux/$(TARGET_ARCH)/fpu_control.h include/ ; \ else \ $(LN) -fs ../libc/sysdeps/linux/common/fpu_control.h include/ ; \ @@ -88,6 +91,9 @@ done; \ for i in $(HEADERS_BITS_ARCH) ; do \ $(LN) -fs ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$$i .; \ + done; \ + for i in $(HEADERS_BITS_SUBARCH) ; do \ + $(LN) -fs ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$(TARGET_SUBARCH)/$$i .; \ done $(Q)\ cd include/sys; \ @@ -128,7 +134,7 @@ RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib) # Installs header files. -install_headers: +install_headers: headers $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \ $(TAR) -chf - -X tar_exclude include \ @@ -136,6 +142,8 @@ rm -f tar_exclude printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' > \ $(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h + echo '/* Dont use _syscall#() macros; use the syscall() function */' > \ + $(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/_lfs_64.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_uintmaxtostr.h @@ -150,6 +158,11 @@ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tgmath.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_fpmax.h endif +ifneq ($(UCLIBC_HAS_FENV),y) + $(RM) $(PREFIX)$(DEVEL_PREFIX)include/fenv.h \ + $(PREFIX)$(DEVEL_PREFIX)include/bits/fenv.h \ + $(PREFIX)$(DEVEL_PREFIX)include/bits/fenvinline.h +endif ifneq ($(UCLIBC_HAS_WCHAR),y) # Remove wide char headers since wide char support is disabled. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/wctype.h @@ -208,6 +221,11 @@ $(RM) $(PREFIX)$(DEVEL_PREFIX)include/semaphore.h $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/*thread*.h endif +ifneq ($(HAVE_SHARED),y) + # Remove dlfcn header if we don't have shared libraries. + $(RM) $(PREFIX)$(DEVEL_PREFIX)include/dlfcn.h + $(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/dlfcn.h +endif ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) # Remove this as it is only used internally. $(RM) $(PREFIX)$(DEVEL_PREFIX)include/tls.h @@ -301,24 +319,30 @@ endif # ifeq ($(HAVE_DOT_CONFIG),y) +include/bits: + $(INSTALL) -d include/bits + # configuration # --------------------------------------------------------------------------- -extra/config/conf extra/config/mconf: - $(MAKE) -C extra/config $(notdir $@) +extra/config/conf extra/config/mconf: include/bits + $(Q)$(MAKE) -C extra/config $(notdir $@) -menuconfig: extra/config/mconf +menuconfig: extra/config/mconf include/bits $(Q)./extra/config/mconf extra/Configs/Config.in -config: extra/config/conf +config: extra/config/conf include/bits $(Q)./extra/config/conf extra/Configs/Config.in -oldconfig: extra/config/conf +oldconfig: extra/config/conf include/bits $(Q)./extra/config/conf -o extra/Configs/Config.in -randconfig: extra/config/conf +silentoldconfig: extra/config/conf include/bits + $(Q)./extra/config/conf -s extra/Configs/Config.in + +randconfig: extra/config/conf include/bits $(Q)./extra/config/conf -r extra/Configs/Config.in -allyesconfig: extra/config/conf +allyesconfig: extra/config/conf include/bits $(Q)./extra/config/conf -y extra/Configs/Config.in sed -i -e "s/^DODEBUG=.*/# DODEBUG is not set/" .config sed -i -e "s/^DOASSERTS=.*/# DOASSERTS is not set/" .config @@ -327,18 +351,17 @@ sed -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config $(Q)./extra/config/conf -o extra/Configs/Config.in -allnoconfig: extra/config/conf +allnoconfig: extra/config/conf include/bits $(Q)./extra/config/conf -n extra/Configs/Config.in -defconfig: extra/config/conf +defconfig: extra/config/conf include/bits $(Q)./extra/config/conf -d extra/Configs/Config.in clean: $(Q)$(RM) -r lib include/bits $(RM) lib*/*.a ldso/*/*.a libpthread/*/*.a $(RM) include/fpu_control.h include/dl-osinfo.h include/hp-timing.h - $(MAKE) -C extra/locale locale_clean - $(MAKE) headers_clean-y + $(MAKE) objclean-y headers_clean-y $(MAKE) -s -C test clean $(MAKE) -C utils utils_clean @set -e; \ @@ -351,20 +374,18 @@ done; \ fi @$(RM) include/linux include/asm* - -find . \( -name \*.o -o -name \*.os -o -name \*.oS \) -exec $(RM) {} \; distclean: clean -find . \( -name core -o -name \*.orig -o -name \*~ \) -exec $(RM) {} \; $(RM) .config .config.old .config.cmd $(RM) extra/locale/*.tgz - $(MAKE) -C extra/config config_clean + $(MAKE) -C extra/config distclean dist release: - $(MAKE) -s distclean - $(RM) -r ../uClibc-$(VERSION) ../uClibc-$(VERSION).tar.gz + $(RM) -r ../uClibc-$(VERSION) ../uClibc-$(VERSION).tar.bz2 svn -q export . ../uClibc-$(VERSION) - $(TAR) czf ../uClibc-$(VERSION).tar.gz -C .. uClibc-$(VERSION) - du -b ../uClibc-$(VERSION).tar.gz + $(TAR) cjf ../uClibc-$(VERSION).tar.bz2 -C .. uClibc-$(VERSION) + du -b ../uClibc-$(VERSION).tar.bz2 test check: $(Q)$(MAKE) -C test Modified: branches/uClibc-nptl/README =================================================================== --- branches/uClibc-nptl/README 2008-03-05 14:29:49 UTC (rev 21167) +++ branches/uClibc-nptl/README 2008-03-05 14:37:50 UTC (rev 21168) @@ -21,7 +21,7 @@ you plan to burn Linux into the system's firmware... uClibc is maintained by Erik Andersen and is licensed under the -GNU LIBRARY GENERAL PUBLIC LICENSE. This license allows you to +GNU LESSER GENERAL PUBLIC LICENSE. This license allows you to make closed source commercial applications using an unmodified version of uClibc (Please consider sharing some of the money you make ;-). You do not need to give away all your source code just @@ -44,7 +44,7 @@ etc.) can be found at http://www.uclibc.org/. uClibc may be freely modified and distributed under the terms of -the GNU Library General Public License, which can be found in the +the GNU Lesser General Public License, which can be found in the file COPYING.LIB. Please Note: Added: branches/uClibc-nptl/extra/scripts/conf-header.sh =================================================================== --- branches/uClibc-nptl/extra/scripts/conf-header.sh (rev 0) +++ branches/uClibc-nptl/extra/scripts/conf-header.sh 2008-03-05 14:37:50 UTC (rev 21168) @@ -0,0 +1,27 @@ +#!/bin/sh -e + +# Turn .config into a header file + +if [ -z "$1" ] ; then + echo "Usage: conf-header.sh <.config>" + exit 1 +fi + +cat < directly; use instead +#endif + +#define __UCLIBC_MAJOR__ ${MAJOR_VERSION} +#define __UCLIBC_MINOR__ ${MINOR_VERSION} +#define __UCLIBC_SUBLEVEL__ ${SUBLEVEL} +EOF + +exec \ +sed \ + -e '/^#$/d' \ + -e '/^[^#]/s:^\([^=]*\)=\(.*\):#define __\1__ \2:' \ + -e '/^#define /s: y$: 1:' \ + -e '/^# .* is not set$/s:^# \(.*\) is not set$:#undef __\1__:' \ + -e 's:^# \(.*\)$:/* \1 */:' \ + $1 Property changes on: branches/uClibc-nptl/extra/scripts/conf-header.sh ___________________________________________________________________ Name: svn:executable + * From carmelo at uclibc.org Wed Mar 5 06:37:57 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 06:37:57 -0800 (PST) Subject: svn commit: trunk/uClibc Message-ID: <20080305143757.9BBC012C723@busybox.net> Author: carmelo Date: 2008-03-05 06:37:55 -0800 (Wed, 05 Mar 2008) New Revision: 21169 Log: Call explicitely objclean-y when doing build cleanup. Remove 'find' command. It makes cleanup faster too. Signed-off-by: Carmelo Amoroso Modified: trunk/uClibc/Makefile.in Changeset: Modified: trunk/uClibc/Makefile.in =================================================================== --- trunk/uClibc/Makefile.in 2008-03-05 14:37:50 UTC (rev 21168) +++ trunk/uClibc/Makefile.in 2008-03-05 14:37:55 UTC (rev 21169) @@ -343,8 +343,7 @@ $(Q)$(RM) -r lib include/bits $(RM) lib*/*.a ldso/*/*.a libpthread/*/*.a $(RM) include/fpu_control.h include/dl-osinfo.h include/hp-timing.h - $(MAKE) -C extra/locale locale_clean - $(MAKE) headers_clean-y + $(MAKE) objclean-y headers_clean-y $(MAKE) -s -C test clean $(MAKE) -C utils utils_clean @set -e; \ @@ -357,7 +356,6 @@ done; \ fi @$(RM) include/linux include/asm* - -find . \( -name \*.o -o -name \*.os -o -name \*.oS \) -exec $(RM) {} \; distclean: clean -find . \( -name core -o -name \*.orig -o -name \*~ \) -exec $(RM) {} \; From carmelo at uclibc.org Wed Mar 5 08:20:26 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 08:20:26 -0800 (PST) Subject: svn commit: branches/uClibc-nptl/ldso/ldso: bfin i386 powerpc sparc x86_64 Message-ID: <20080305162026.2D92B12C7BD@busybox.net> Author: carmelo Date: 2008-03-05 08:20:24 -0800 (Wed, 05 Mar 2008) New Revision: 21170 Log: Synchronize ldso tree with trunk. Only architectures that don't support TLS yet in the nptl branch. Just to speed-up final merge. Signed-off-by: Carmelo Amoroso Modified: branches/uClibc-nptl/ldso/ldso/bfin/dl-inlines.h branches/uClibc-nptl/ldso/ldso/bfin/dl-startup.h branches/uClibc-nptl/ldso/ldso/bfin/dl-sysdep.h branches/uClibc-nptl/ldso/ldso/bfin/elfinterp.c branches/uClibc-nptl/ldso/ldso/i386/dl-startup.h branches/uClibc-nptl/ldso/ldso/i386/dl-sysdep.h branches/uClibc-nptl/ldso/ldso/i386/resolve.S branches/uClibc-nptl/ldso/ldso/powerpc/elfinterp.c branches/uClibc-nptl/ldso/ldso/sparc/dl-startup.h branches/uClibc-nptl/ldso/ldso/sparc/dl-sysdep.h branches/uClibc-nptl/ldso/ldso/x86_64/dl-startup.h branches/uClibc-nptl/ldso/ldso/x86_64/resolve.S Changeset: Modified: branches/uClibc-nptl/ldso/ldso/bfin/dl-inlines.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/bfin/dl-inlines.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/bfin/dl-inlines.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -18,7 +18,7 @@ the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include +#include #ifndef _dl_assert # define _dl_assert(expr) @@ -463,6 +463,17 @@ struct elf32_fdpic_loadseg *segdata; ssize_t offs; segdata = loadaddr.map->segs + i; + + /* FIXME: + A more cleaner way is to add type for struct elf32_fdpic_loadseg, + and release the memory according to the type. + Currently, we hardcode the memory address of L1 SRAM. */ + if ((segdata->addr & 0xff800000) == 0xff800000) + { + _dl_sram_free ((void *)segdata->addr); + continue; + } + offs = (segdata->p_vaddr & ADDR_ALIGN); _dl_munmap ((void*)segdata->addr - offs, segdata->p_memsz + offs); @@ -493,7 +504,15 @@ && !(ppnt->p_flags & PF_X)) return 1; - return 0; + /* 0xff700000, 0xff800000, 0xff900000 and 0xffa00000 are also used in + GNU ld and linux kernel. They need to be keep synchronized. */ + if (ppnt->p_vaddr == 0xff700000 + || ppnt->p_vaddr == 0xff800000 + || ppnt->p_vaddr == 0xff900000 + || ppnt->p_vaddr == 0xffa00000) + return 1; + + return 0; } inline static char * @@ -505,7 +524,7 @@ char *status, *tryaddr, *l1addr; size_t size; - if ((epnt->e_flags & EF_BFIN_CODE_IN_L1) + if (((epnt->e_flags & EF_BFIN_CODE_IN_L1) || ppnt->p_vaddr == 0xffa00000) && !(ppnt->p_flags & PF_W) && (ppnt->p_flags & PF_X)) { status = (char *) _dl_mmap @@ -522,20 +541,32 @@ _dl_dma_memcpy (l1addr, status + (ppnt->p_vaddr & ADDR_ALIGN), ppnt->p_filesz); _dl_munmap (status, size); if (l1addr == NULL) - return NULL; + _dl_dprintf(2, "%s:%i: L1 allocation failed\n", _dl_progname, __LINE__); return l1addr; } - if ((epnt->e_flags & EF_BFIN_DATA_IN_L1) + if (((epnt->e_flags & EF_BFIN_DATA_IN_L1) + || ppnt->p_vaddr == 0xff700000 + || ppnt->p_vaddr == 0xff800000 + || ppnt->p_vaddr == 0xff900000) && (ppnt->p_flags & PF_W) && !(ppnt->p_flags & PF_X)) { - l1addr = (char *) _dl_sram_alloc (ppnt->p_memsz, L1_DATA_SRAM); - if (l1addr == NULL - || (_DL_PREAD (infile, l1addr, ppnt->p_filesz, ppnt->p_offset) - != ppnt->p_filesz)) - return NULL; - if (ppnt->p_filesz < ppnt->p_memsz) - _dl_memset (l1addr + ppnt->p_filesz, 0, ppnt->p_memsz - ppnt->p_filesz); + if (ppnt->p_vaddr == 0xff800000) + l1addr = (char *) _dl_sram_alloc (ppnt->p_memsz, L1_DATA_A_SRAM); + else if (ppnt->p_vaddr == 0xff900000) + l1addr = (char *) _dl_sram_alloc (ppnt->p_memsz, L1_DATA_B_SRAM); + else + l1addr = (char *) _dl_sram_alloc (ppnt->p_memsz, L1_DATA_SRAM); + if (l1addr == NULL) { + _dl_dprintf(2, "%s:%i: L1 allocation failed\n", _dl_progname, __LINE__); + } else { + if (_DL_PREAD (infile, l1addr, ppnt->p_filesz, ppnt->p_offset) != ppnt->p_filesz) { + _dl_sram_free (l1addr); + return NULL; + } + if (ppnt->p_filesz < ppnt->p_memsz) + _dl_memset (l1addr + ppnt->p_filesz, 0, ppnt->p_memsz - ppnt->p_filesz); + } return l1addr; } Modified: branches/uClibc-nptl/ldso/ldso/bfin/dl-startup.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/bfin/dl-startup.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/bfin/dl-startup.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -86,7 +86,8 @@ " .size __dl_boot,.-__dl_boot\n" ); -#define DL_BOOT(X) \ +#undef DL_START +#define DL_START(X) \ static void __attribute__ ((used)) \ _dl_start (Elf32_Addr dl_boot_got_pointer, \ struct elf32_fdpic_loadmap *dl_boot_progmap, \ @@ -105,17 +106,6 @@ #define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long*) ARGS) + 1) /* - * Compute the GOT address. On several platforms, we use assembly - * here. on FR-V FDPIC, there's no way to compute the GOT address, - * since the offset between text and data is not fixed, so we arrange - * for the assembly _dl_boot to pass this value as an argument to - * _dl_boot. */ -#define DL_BOOT_COMPUTE_GOT(got) ((got) = dl_boot_got_pointer) - -#define DL_BOOT_COMPUTE_DYN(dpnt, got, load_addr) \ - ((dpnt) = dl_boot_ldso_dyn_pointer) - -/* * Here is a macro to perform a relocation. This is only used when * bootstrapping the dynamic loader. RELP is the relocation that we * are performing, REL is the pointer to the address we are relocating. Modified: branches/uClibc-nptl/ldso/ldso/bfin/dl-sysdep.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/bfin/dl-sysdep.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/bfin/dl-sysdep.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -34,6 +34,8 @@ #define DL_NO_COPY_RELOCS +#define HAVE_DL_INLINES_H + /* * Initialization sequence for a GOT. Copy the resolver function * descriptor and the pointer to the elf_resolve/link_map data @@ -93,7 +95,7 @@ #define DL_LOADADDR_TYPE struct elf32_fdpic_loadaddr #define DL_RELOC_ADDR(LOADADDR, ADDR) \ - (__reloc_pointer ((void*)(ADDR), (LOADADDR).map)) + ((ElfW(Addr))__reloc_pointer ((void*)(ADDR), (LOADADDR).map)) #define DL_ADDR_TO_FUNC_PTR(ADDR, LOADADDR) \ ((void(*)(void)) _dl_funcdesc_for ((void*)(ADDR), (LOADADDR).got_value)) @@ -136,6 +138,17 @@ #define DL_ADDR_IN_LOADADDR(ADDR, TPNT, TFROM) \ (! (TFROM) && __dl_addr_in_loadaddr ((void*)(ADDR), (TPNT)->loadaddr)) +/* + * Compute the GOT address. On several platforms, we use assembly + * here. on FR-V FDPIC, there's no way to compute the GOT address, + * since the offset between text and data is not fixed, so we arrange + * for the assembly _dl_boot to pass this value as an argument to + * _dl_boot. */ +#define DL_BOOT_COMPUTE_GOT(got) ((got) = dl_boot_got_pointer) + +#define DL_BOOT_COMPUTE_DYN(dpnt, got, load_addr) \ + ((dpnt) = dl_boot_ldso_dyn_pointer) + /* We only support loading FDPIC independently-relocatable shared libraries. It probably wouldn't be too hard to support loading shared libraries that require relocation by the same amount, but we @@ -176,7 +189,7 @@ #define DL_FIND_HASH_VALUE(TPNT, TYPE_CLASS, SYM) \ (((TYPE_CLASS) & ELF_RTYPE_CLASS_DLSYM) \ && ELF32_ST_TYPE((SYM)->st_info) == STT_FUNC \ - ? _dl_funcdesc_for (DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value), \ + ? _dl_funcdesc_for ((void *)DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value), \ (TPNT)->loadaddr.got_value) \ : DL_RELOC_ADDR ((TPNT)->loadaddr, (SYM)->st_value)) Modified: branches/uClibc-nptl/ldso/ldso/bfin/elfinterp.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/bfin/elfinterp.c 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/bfin/elfinterp.c 2008-03-05 16:20:24 UTC (rev 21170) @@ -72,11 +72,9 @@ got_entry = (struct funcdesc_value *) DL_RELOC_ADDR(tpnt->loadaddr, this_reloc->r_offset); /* Get the address to be used to fill in the GOT entry. */ - new_addr = _dl_find_hash_mod(symname, tpnt->symbol_scope, NULL, 0, - &new_tpnt); + new_addr = _dl_lookup_hash(symname, tpnt->symbol_scope, NULL, 0, &new_tpnt); if (!new_addr) { - new_addr = _dl_find_hash_mod(symname, NULL, NULL, 0, - &new_tpnt); + new_addr = _dl_lookup_hash(symname, NULL, NULL, 0, &new_tpnt); if (!new_addr) { _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", _dl_progname, symname); @@ -188,7 +186,7 @@ } else { symbol_addr = (unsigned long) - _dl_find_hash_mod(symname, scope, NULL, 0, &symbol_tpnt); + _dl_lookup_hash(symname, scope, NULL, 0, &symbol_tpnt); /* * We want to allow undefined references to weak symbols - this might @@ -346,7 +344,7 @@ return 0; } -#ifndef LIBDL +#ifndef IS_IN_libdl # include "../../libc/sysdeps/linux/bfin/crtreloc.c" #endif Modified: branches/uClibc-nptl/ldso/ldso/i386/dl-startup.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/i386/dl-startup.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/i386/dl-startup.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -5,7 +5,6 @@ */ __asm__ ( " .text\n" - " .align 16\n" " .globl _start\n" " .type _start, at function\n" "_start:\n" Modified: branches/uClibc-nptl/ldso/ldso/i386/dl-sysdep.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/i386/dl-sysdep.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/i386/dl-sysdep.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -59,7 +59,6 @@ /* It doesn't matter what variable this is, the reference never makes it to assembly. We need a dummy reference to some global variable via the GOT to make sure the compiler initialized %ebx in time. */ - extern int _dl_errno; Elf32_Addr addr; __asm__ ("leal _dl_start at GOTOFF(%%ebx), %0\n" "subl _dl_start at GOT(%%ebx), %0" @@ -79,62 +78,3 @@ *reloc_addr += load_off; } while (--relative_count); } - -/* - * These were taken from the 'dl-sysdep.h' files in the 'nptl' directory - * in glibc. - */ -#if USE_TLS -# ifdef CONFIG_686 -/* Traditionally system calls have been made using int $0x80. A - second method was introduced which, if possible, will use the - sysenter/syscall instructions. To signal the presence and where to - find the code the kernel passes an AT_SYSINFO value in the - auxiliary vector to the application. */ -# define NEED_DL_SYSINFO 1 -# define USE_DL_SYSINFO 1 - -# if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__ -extern void _dl_sysinfo_int80 (void) attribute_hidden; -# define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80 -# define DL_SYSINFO_IMPLEMENTATION \ - asm (".text\n\t" \ - ".type _dl_sysinfo_int80, at function\n\t" \ - ".hidden _dl_sysinfo_int80\n" \ - CFI_STARTPROC "\n" \ - "_dl_sysinfo_int80:\n\t" \ - "int $0x80;\n\t" \ - "ret;\n\t" \ - CFI_ENDPROC "\n" \ - ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t" \ - ".previous"); -# endif -# else -/* Traditionally system calls have been made using int $0x80. A - second method was introduced which, if possible, will use the - sysenter/syscall instructions. To signal the presence and where to - find the code the kernel passes an AT_SYSINFO value in the - auxiliary vector to the application. - sysenter/syscall is not useful on i386 through i586, but the dynamic - linker and dl code in libc.a has to be able to load i686 compiled - libraries. */ -# define NEED_DL_SYSINFO 1 -# undef USE_DL_SYSINFO - -# if defined NEED_DL_SYSINFO && !defined __ASSEMBLER__ -extern void _dl_sysinfo_int80 (void) attribute_hidden; -# define DL_SYSINFO_DEFAULT (uintptr_t) _dl_sysinfo_int80 -# define DL_SYSINFO_IMPLEMENTATION \ - asm (".text\n\t" \ - ".type _dl_sysinfo_int80, at function\n\t" \ - ".hidden _dl_sysinfo_int80\n\t" \ - CFI_STARTPROC "\n" \ - "_dl_sysinfo_int80:\n\t" \ - "int $0x80;\n\t" \ - "ret;\n\t" \ - CFI_ENDPROC "\n" \ - ".size _dl_sysinfo_int80,.-_dl_sysinfo_int80\n\t" \ - ".previous;"); -# endif -# endif /* CONFIG_686 */ -#endif /* USE_TLS */ Modified: branches/uClibc-nptl/ldso/ldso/i386/resolve.S =================================================================== --- branches/uClibc-nptl/ldso/ldso/i386/resolve.S 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/i386/resolve.S 2008-03-05 16:20:24 UTC (rev 21170) @@ -21,7 +21,6 @@ */ .text -.align 4 .globl _dl_linux_resolve .type _dl_linux_resolve, at function Modified: branches/uClibc-nptl/ldso/ldso/powerpc/elfinterp.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/powerpc/elfinterp.c 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/powerpc/elfinterp.c 2008-03-05 16:20:24 UTC (rev 21170) @@ -213,7 +213,7 @@ * here, so all bases should be covered. */ if (unlikely(!symbol_addr && ELF32_ST_BIND(symtab[symtab_index].st_info) != STB_WEAK)) - return -1; + return 1; } #if defined (__SUPPORT_LD_DEBUG__) old_val = *reloc_addr; Modified: branches/uClibc-nptl/ldso/ldso/sparc/dl-startup.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/sparc/dl-startup.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/sparc/dl-startup.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -9,6 +9,7 @@ .global _start\n\ .type _start,%function\n\ .align 32\n\ + .register %g2, #scratch\n\ _start:\n\ /* Allocate space for functions to drop their arguments. */\n\ sub %sp, 6*4, %sp\n\ Modified: branches/uClibc-nptl/ldso/ldso/sparc/dl-sysdep.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/sparc/dl-sysdep.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/sparc/dl-sysdep.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -83,10 +83,16 @@ #endif /* 4096 bytes alignment */ +#if defined(__sparc_v9__) /* ...but 8192 is required for mmap() on sparc64 kernel */ #define PAGE_ALIGN 0xffffe000 #define ADDR_ALIGN 0x1fff #define OFFS_ALIGN 0x7fffe000 +#elif defined(__sparc_v8__) +#define PAGE_ALIGN 0xfffff000 +#define ADDR_ALIGN 0xfff +#define OFFS_ALIGN 0x7ffff000 +#endif /* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so PLT entries should not be allowed to define the value. Modified: branches/uClibc-nptl/ldso/ldso/x86_64/dl-startup.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/x86_64/dl-startup.h 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/x86_64/dl-startup.h 2008-03-05 16:20:24 UTC (rev 21170) @@ -8,7 +8,6 @@ */ __asm__ ( " .text\n" - " .align 16\n" " .global _start\n" " .type _start,%function\n" "_start:\n" Modified: branches/uClibc-nptl/ldso/ldso/x86_64/resolve.S =================================================================== --- branches/uClibc-nptl/ldso/ldso/x86_64/resolve.S 2008-03-05 14:37:55 UTC (rev 21169) +++ branches/uClibc-nptl/ldso/ldso/x86_64/resolve.S 2008-03-05 16:20:24 UTC (rev 21170) @@ -26,7 +26,6 @@ .global _dl_linux_resolve .type _dl_linux_resolve,%function -.align 16 _dl_linux_resolve: subq $56,%rsp From carmelo at uclibc.org Wed Mar 5 09:54:18 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Wed, 5 Mar 2008 09:54:18 -0800 (PST) Subject: svn commit: branches/uClibc-nptl/ldso: include ldso ldso/sh libdl Message-ID: <20080305175418.573AB120129@busybox.net> Author: carmelo Date: 2008-03-05 09:54:17 -0800 (Wed, 05 Mar 2008) New Revision: 21172 Log: Merge ldso tree with trunk. Step 1: basically code formatting and minor changes Signed-off-by: Carmelo Amoroso Modified: branches/uClibc-nptl/ldso/include/dl-hash.h branches/uClibc-nptl/ldso/include/dl-syscall.h branches/uClibc-nptl/ldso/include/ldso.h branches/uClibc-nptl/ldso/include/unsecvars.h branches/uClibc-nptl/ldso/ldso/dl-hash.c branches/uClibc-nptl/ldso/ldso/dl-startup.c branches/uClibc-nptl/ldso/ldso/dl-tls.c branches/uClibc-nptl/ldso/ldso/ldso.c branches/uClibc-nptl/ldso/ldso/sh/dl-syscalls.h branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c branches/uClibc-nptl/ldso/libdl/Makefile.in branches/uClibc-nptl/ldso/libdl/libdl.c Changeset: Modified: branches/uClibc-nptl/ldso/include/dl-hash.h =================================================================== --- branches/uClibc-nptl/ldso/include/dl-hash.h 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/include/dl-hash.h 2008-03-05 17:54:17 UTC (rev 21172) @@ -66,7 +66,7 @@ unsigned short int init_flag; unsigned long rtld_flags; /* RTLD_GLOBAL, RTLD_NOW etc. */ Elf_Symndx nbucket; - + #ifdef __LDSO_GNU_HASH_SUPPORT__ /* Data needed to support GNU hash style */ Elf32_Word l_gnu_bitmask_idxbits; @@ -81,7 +81,7 @@ #else Elf_Symndx *elf_buckets; #endif - + struct init_fini_list *init_fini; struct init_fini_list *rtld_local; /* keep tack of RTLD_LOCAL libs in same group */ /* @@ -95,10 +95,9 @@ const Elf32_Word *l_gnu_buckets; const Elf_Symndx *chains; }; -#else +#else Elf_Symndx *chains; -#endif - +#endif unsigned long dynamic_info[DYNAMIC_SIZE]; unsigned long n_phent; @@ -148,7 +147,6 @@ #endif } - extern int _dl_linux_dynamic_link(void); extern char * _dl_library_path; @@ -156,12 +154,11 @@ static inline int _dl_symbol(char * name) { - if(name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_') + if (name[0] != '_' || name[1] != 'd' || name[2] != 'l' || name[3] != '_') return 0; return 1; } - #define LD_ERROR_NOFILE 1 #define LD_ERROR_NOZERO 2 #define LD_ERROR_NOTELF 3 @@ -177,5 +174,3 @@ #endif /* _LD_HASH_H_ */ - - Modified: branches/uClibc-nptl/ldso/include/dl-syscall.h =================================================================== --- branches/uClibc-nptl/ldso/include/dl-syscall.h 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/include/dl-syscall.h 2008-03-05 17:54:17 UTC (rev 21172) @@ -11,11 +11,16 @@ /* Pull in the arch specific syscall implementation */ #include /* For MAP_ANONYMOUS -- differs between platforms */ -#include +#define _SYS_MMAN_H 1 +#include /* Pull in whatever this particular arch's kernel thinks the kernel version of * struct stat should look like. It turns out that each arch has a different * opinion on the subject, and different kernel revs use different names... */ +#if defined(__sparc_v9__) && (__WORDSIZE == 64) +#define kernel_stat64 stat +#else #define kernel_stat stat +#endif #include #include @@ -54,69 +59,69 @@ dynamic linking at all, so we cannot return any error codes. We just punt if there is an error. */ #define __NR__dl_exit __NR_exit -static inline _syscall1(void, _dl_exit, int, status); +static __always_inline _syscall1(void, _dl_exit, int, status); #define __NR__dl_close __NR_close -static inline _syscall1(int, _dl_close, int, fd); +static __always_inline _syscall1(int, _dl_close, int, fd); #define __NR__dl_open __NR_open -static inline _syscall3(int, _dl_open, const char *, fn, int, flags, +static __always_inline _syscall3(int, _dl_open, const char *, fn, int, flags, __kernel_mode_t, mode); #define __NR__dl_write __NR_write -static inline _syscall3(unsigned long, _dl_write, int, fd, +static __always_inline _syscall3(unsigned long, _dl_write, int, fd, const void *, buf, unsigned long, count); #define __NR__dl_read __NR_read -static inline _syscall3(unsigned long, _dl_read, int, fd, +static __always_inline _syscall3(unsigned long, _dl_read, int, fd, const void *, buf, unsigned long, count); #define __NR__dl_mprotect __NR_mprotect -static inline _syscall3(int, _dl_mprotect, const void *, addr, +static __always_inline _syscall3(int, _dl_mprotect, const void *, addr, unsigned long, len, int, prot); #define __NR__dl_stat __NR_stat -static inline _syscall2(int, _dl_stat, const char *, file_name, +static __always_inline _syscall2(int, _dl_stat, const char *, file_name, struct stat *, buf); #define __NR__dl_fstat __NR_fstat -static inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf); +static __always_inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf); #define __NR__dl_munmap __NR_munmap -static inline _syscall2(int, _dl_munmap, void *, start, unsigned long, length); +static __always_inline _syscall2(int, _dl_munmap, void *, start, unsigned long, length); #ifdef __NR_getxuid # define __NR_getuid __NR_getxuid #endif #define __NR__dl_getuid __NR_getuid -static inline _syscall0(uid_t, _dl_getuid); +static __always_inline _syscall0(uid_t, _dl_getuid); #ifndef __NR_geteuid # define __NR_geteuid __NR_getuid #endif #define __NR__dl_geteuid __NR_geteuid -static inline _syscall0(uid_t, _dl_geteuid); +static __always_inline _syscall0(uid_t, _dl_geteuid); #ifdef __NR_getxgid # define __NR_getgid __NR_getxgid #endif #define __NR__dl_getgid __NR_getgid -static inline _syscall0(gid_t, _dl_getgid); +static __always_inline _syscall0(gid_t, _dl_getgid); #ifndef __NR_getegid # define __NR_getegid __NR_getgid #endif #define __NR__dl_getegid __NR_getegid -static inline _syscall0(gid_t, _dl_getegid); +static __always_inline _syscall0(gid_t, _dl_getegid); #ifdef __NR_getxpid # define __NR_getpid __NR_getxpid #endif #define __NR__dl_getpid __NR_getpid -static inline _syscall0(gid_t, _dl_getpid); +static __always_inline _syscall0(gid_t, _dl_getpid); #define __NR__dl_readlink __NR_readlink -static inline _syscall3(int, _dl_readlink, const char *, path, char *, buf, +static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf, size_t, bufsiz); #ifdef __UCLIBC_HAS_SSP__ @@ -145,14 +150,14 @@ #if defined(__UCLIBC_MMAP_HAS_6_ARGS__) && defined(__NR_mmap) # define __NR__dl_mmap __NR_mmap -static inline _syscall6(void *, _dl_mmap, void *, start, size_t, length, +static __always_inline _syscall6(void *, _dl_mmap, void *, start, size_t, length, int, prot, int, flags, int, fd, off_t, offset); /* then try mmap2() */ #elif defined(__NR_mmap2) # define __NR___syscall_mmap2 __NR_mmap2 -static inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, +static __always_inline _syscall6(__ptr_t, __syscall_mmap2, __ptr_t, addr, size_t, len, int, prot, int, flags, int, fd, off_t, offset); /* Some architectures always use 12 as page shift for mmap2() eventhough the @@ -163,7 +168,7 @@ # define MMAP2_PAGE_SHIFT 12 #endif -static inline void * _dl_mmap(void * addr, unsigned long size, int prot, +static __always_inline void * _dl_mmap(void * addr, unsigned long size, int prot, int flags, int fd, unsigned long offset) { if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1)) @@ -176,8 +181,8 @@ #elif defined(__NR_mmap) # define __NR__dl_mmap_real __NR_mmap -static inline _syscall1(void *, _dl_mmap_real, unsigned long *, buffer); -static inline void * _dl_mmap(void * addr, unsigned long size, int prot, +static __always_inline _syscall1(void *, _dl_mmap_real, unsigned long *, buffer); +static __always_inline void * _dl_mmap(void * addr, unsigned long size, int prot, int flags, int fd, unsigned long offset) { unsigned long buffer[6]; Modified: branches/uClibc-nptl/ldso/include/ldso.h =================================================================== --- branches/uClibc-nptl/ldso/include/ldso.h 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/include/ldso.h 2008-03-05 17:54:17 UTC (rev 21172) @@ -11,7 +11,7 @@ #include /* Prepare for the case that `__builtin_expect' is not available. */ -#if __GNUC__ == 2 && __GNUC_MINOR__ < 96 +#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96 #define __builtin_expect(x, expected_value) (x) #endif #ifndef likely @@ -70,19 +70,28 @@ _dl_dprintf(_dl_debug_file, "%s:%i: " fmt, __FUNCTION__, __LINE__, ## args); # define _dl_if_debug_dprint(fmt, args...) \ do { if (_dl_debug) __dl_debug_dprint(fmt, ## args); } while (0) -# define _dl_assert(expr) \ +#else +# define __dl_debug_dprint(fmt, args...) +# define _dl_if_debug_dprint(fmt, args...) +# define _dl_debug_file 2 +#endif /* __SUPPORT_LD_DEBUG__ */ + +#ifdef IS_IN_rtld +# ifdef __SUPPORT_LD_DEBUG__ +# define _dl_assert(expr) \ do { \ if (!(expr)) { \ __dl_debug_dprint("assert(%s)\n", #expr); \ _dl_exit(45); \ } \ } while (0) +# else +# define _dl_assert(expr) ((void)0) +# endif #else -# define __dl_debug_dprint(fmt, args...) -# define _dl_if_debug_dprint(fmt, args...) -# define _dl_assert(expr) -# define _dl_debug_file 2 -#endif /* __SUPPORT_LD_DEBUG__ */ +# include +# define _dl_assert(expr) assert(expr) +#endif #ifdef __SUPPORT_LD_DEBUG_EARLY__ # define _dl_debug_early(fmt, args...) __dl_debug_dprint(fmt, ## args) Modified: branches/uClibc-nptl/ldso/include/unsecvars.h =================================================================== --- branches/uClibc-nptl/ldso/include/unsecvars.h 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/include/unsecvars.h 2008-03-05 17:54:17 UTC (rev 21172) @@ -5,7 +5,7 @@ * GNU Lesser General Public License version 2.1 or later. */ -/* +/* * Environment variable to be removed for SUID programs. The names are all * stuffed in a single string which means they have to be terminated with a * '\0' explicitly. @@ -19,7 +19,7 @@ "LD_TRACE_LOADED_OBJECTS\0" \ "TMPDIR\0" -/* +/* * LD_TRACE_LOADED_OBJECTS is not in glibc-2.3.5's unsecvars.h * though used by ldd * Modified: branches/uClibc-nptl/ldso/ldso/dl-hash.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/dl-hash.c 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/ldso/dl-hash.c 2008-03-05 17:54:17 UTC (rev 21172) @@ -4,7 +4,7 @@ * after resolving ELF shared library symbols * * Copyright (C) 2004 by Joakim Tjernlund - * Copyright (C) 2000-2004 by Erik Andersen + * Copyright (C) 2000-2006 by Erik Andersen * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, * David Engel, Hongjiu Lu and Mitch D'Souza * @@ -114,33 +114,32 @@ _dl_memset(tpnt->next, 0, sizeof(struct elf_resolve)); tpnt->next->prev = tpnt; tpnt = tpnt->next; - }; + } tpnt->next = NULL; tpnt->init_flag = 0; tpnt->libname = _dl_strdup(libname); tpnt->dynamic_addr = (ElfW(Dyn) *)dynamic_addr; tpnt->libtype = loaded_file; - + #ifdef __LDSO_GNU_HASH_SUPPORT__ if (dynamic_info[DT_GNU_HASH_IDX] != 0) { - - Elf32_Word *hash32 = (Elf_Symndx*)dynamic_info[DT_GNU_HASH_IDX]; - - tpnt->nbucket = *hash32++; - Elf32_Word symbias = *hash32++; - Elf32_Word bitmask_nwords = *hash32++; - /* Must be a power of two. */ - _dl_assert ((bitmask_nwords & (bitmask_nwords - 1)) == 0); - tpnt->l_gnu_bitmask_idxbits = bitmask_nwords - 1; - tpnt->l_gnu_shift = *hash32++; + Elf32_Word *hash32 = (Elf_Symndx*)dynamic_info[DT_GNU_HASH_IDX]; - tpnt->l_gnu_bitmask = (ElfW(Addr) *) hash32; - hash32 += __ELF_NATIVE_CLASS / 32 * bitmask_nwords; + tpnt->nbucket = *hash32++; + Elf32_Word symbias = *hash32++; + Elf32_Word bitmask_nwords = *hash32++; + /* Must be a power of two. */ + _dl_assert ((bitmask_nwords & (bitmask_nwords - 1)) == 0); + tpnt->l_gnu_bitmask_idxbits = bitmask_nwords - 1; + tpnt->l_gnu_shift = *hash32++; - tpnt->l_gnu_buckets = hash32; - hash32 += tpnt->nbucket; - tpnt->l_gnu_chain_zero = hash32 - symbias; + tpnt->l_gnu_bitmask = (ElfW(Addr) *) hash32; + hash32 += __ELF_NATIVE_CLASS / 32 * bitmask_nwords; + + tpnt->l_gnu_buckets = hash32; + hash32 += tpnt->nbucket; + tpnt->l_gnu_chain_zero = hash32 - symbias; } else /* Fall using old SysV hash table if GNU hash is not present */ #endif @@ -162,7 +161,8 @@ /* Routine to check whether the symbol matches. */ static __attribute_noinline__ const ElfW(Sym) * -check_match (const ElfW(Sym) *sym, char *strtab, const char* undef_name, int type_class) { +check_match (const ElfW(Sym) *sym, char *strtab, const char* undef_name, int type_class) +{ #if USE_TLS if((sym->st_value == 0 && (ELF_ST_TYPE(sym->st_info) != STT_TLS)) @@ -182,48 +182,49 @@ if (type_class & (sym->st_shndx == SHN_UNDEF)) /* undefined symbol itself */ return NULL; - + if (sym->st_value == 0) /* No value */ return NULL; - - if (ELF_ST_TYPE(sym->st_info) > STT_FUNC) - /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC - * entries since these are no code/data definitions. - */ - return NULL; + + if (ELF_ST_TYPE(sym->st_info) > STT_FUNC + && ELF_ST_TYPE(sym->st_info) != STT_COMMON) + /* Ignore all but STT_NOTYPE, STT_OBJECT, STT_FUNC + * and STT_COMMON entries since these are no + * code/data definitions + */ + return NULL; #endif - if (_dl_strcmp(strtab + sym->st_name, undef_name) != 0) - return NULL; + if (_dl_strcmp(strtab + sym->st_name, undef_name) != 0) + return NULL; - /* This is the matching symbol */ - return sym; + /* This is the matching symbol */ + return sym; } #ifdef __LDSO_GNU_HASH_SUPPORT__ -static __always_inline const ElfW(Sym) * -_dl_lookup_gnu_hash(struct elf_resolve *tpnt, ElfW(Sym) *symtab, unsigned long hash, - const char* undef_name, int type_class) { - +static __always_inline const ElfW(Sym) * +_dl_lookup_gnu_hash(struct elf_resolve *tpnt, ElfW(Sym) *symtab, unsigned long hash, + const char* undef_name, int type_class) +{ Elf_Symndx symidx; const ElfW(Sym) *sym; char *strtab; - + const ElfW(Addr) *bitmask = tpnt->l_gnu_bitmask; - ElfW(Addr) bitmask_word = bitmask[(hash / __ELF_NATIVE_CLASS) & tpnt->l_gnu_bitmask_idxbits]; + ElfW(Addr) bitmask_word = bitmask[(hash / __ELF_NATIVE_CLASS) & tpnt->l_gnu_bitmask_idxbits]; unsigned int hashbit1 = hash & (__ELF_NATIVE_CLASS - 1); unsigned int hashbit2 = ((hash >> tpnt->l_gnu_shift) & (__ELF_NATIVE_CLASS - 1)); _dl_assert (bitmask != NULL); - if (__builtin_expect ((bitmask_word >> hashbit1) & (bitmask_word >> hashbit2) & 1, 0)) { - + if (unlikely((bitmask_word >> hashbit1) & (bitmask_word >> hashbit2) & 1)) { Elf32_Word bucket = tpnt->l_gnu_buckets[hash % tpnt->nbucket]; - + if (bucket != 0) { const Elf32_Word *hasharr = &tpnt->l_gnu_chain_zero[bucket]; do { @@ -242,20 +243,20 @@ } #endif -static __always_inline const ElfW(Sym) * -_dl_lookup_sysv_hash(struct elf_resolve *tpnt, ElfW(Sym) *symtab, unsigned long hash, const char* undef_name, int type_class) { - +static __always_inline const ElfW(Sym) * +_dl_lookup_sysv_hash(struct elf_resolve *tpnt, ElfW(Sym) *symtab, unsigned long hash, const char* undef_name, int type_class) +{ unsigned long hn; char *strtab; const ElfW(Sym) *sym; Elf_Symndx symidx; - + /* Avoid calling .urem here. */ do_rem(hn, hash, tpnt->nbucket); strtab = (char *) (tpnt->dynamic_info[DT_STRTAB]); - + _dl_assert(tpnt->elf_buckets != NULL); - + for (symidx = tpnt->elf_buckets[hn]; symidx != STN_UNDEF; symidx = tpnt->chains[symidx]) { sym = check_match (&symtab[symidx], strtab, undef_name, type_class); if (sym != NULL) @@ -264,7 +265,7 @@ } /* No symbol found into the current module*/ return NULL; -} +} /* * This function resolves externals, and this is either called when we process @@ -287,7 +288,7 @@ #ifdef __LDSO_GNU_HASH_SUPPORT__ unsigned long gnu_hash_number = _dl_gnu_hash((const unsigned char *)name); #endif - + for (; rpnt; rpnt = rpnt->next) { tpnt = rpnt->dyn; @@ -308,36 +309,37 @@ /* Don't search the executable when resolving a copy reloc. */ if ((type_class & ELF_RTYPE_CLASS_COPY) && tpnt->libtype == elf_executable) continue; - + /* If the hash table is empty there is nothing to do here. */ if (tpnt->nbucket == 0) continue; - - symtab = (ElfW(Sym) *) (intptr_t) (tpnt->dynamic_info[DT_SYMTAB]); - + + symtab = (ElfW(Sym) *) (intptr_t) (tpnt->dynamic_info[DT_SYMTAB]); + #ifdef __LDSO_GNU_HASH_SUPPORT__ /* Prefer GNU hash style, if any */ - if(tpnt->l_gnu_bitmask) { - if((sym = _dl_lookup_gnu_hash(tpnt, symtab, gnu_hash_number, name, type_class)) != NULL) + if (tpnt->l_gnu_bitmask) { + sym = _dl_lookup_gnu_hash(tpnt, symtab, gnu_hash_number, name, type_class); + if (sym != NULL) /* If sym has been found, do not search further */ - break; + break; } else { -#endif +#endif /* Use the old SysV-style hash table */ - + /* Calculate the old sysv hash number only once */ - if(elf_hash_number == 0xffffffff) + if (elf_hash_number == 0xffffffff) elf_hash_number = _dl_elf_hash((const unsigned char *)name); - - if((sym = _dl_lookup_sysv_hash(tpnt, symtab, elf_hash_number, name, type_class)) != NULL ) + + sym = _dl_lookup_sysv_hash(tpnt, symtab, elf_hash_number, name, type_class); + if (sym != NULL) break; - -#ifdef __LDSO_GNU_HASH_SUPPORT__ +#ifdef __LDSO_GNU_HASH_SUPPORT__ } -#endif +#endif } /* end of for (; rpnt; rpnt = rpnt->next) { */ - - if(sym) { + + if (sym) { /* At this point we have found the requested symbol, do binding */ #if USE_TLS if(ELF_ST_TYPE(sym->st_info) == STT_TLS) { @@ -356,7 +358,6 @@ if (!weak_result) weak_result = (char *)tpnt->loadaddr + sym->st_value; break; - #endif case STB_GLOBAL: return (char*)tpnt->loadaddr + sym->st_value; Modified: branches/uClibc-nptl/ldso/ldso/dl-startup.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/dl-startup.c 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/ldso/dl-startup.c 2008-03-05 17:54:17 UTC (rev 21172) @@ -4,7 +4,7 @@ * after resolving ELF shared library symbols * * Copyright (C) 2005 by Joakim Tjernlund - * Copyright (C) 2000-2004 by Erik Andersen + * Copyright (C) 2000-2006 by Erik Andersen * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, * David Engel, Hongjiu Lu and Mitch D'Souza * @@ -270,7 +270,7 @@ if (!indx && relative_count) { rel_size -= relative_count * sizeof(ELF_RELOC); elf_machine_relative(load_addr, rel_addr, relative_count); - rel_addr += relative_count * sizeof(ELF_RELOC);; + rel_addr += relative_count * sizeof(ELF_RELOC); } rpnt = (ELF_RELOC *) (rel_addr + load_addr); Modified: branches/uClibc-nptl/ldso/ldso/dl-tls.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/dl-tls.c 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/ldso/dl-tls.c 2008-03-05 17:54:17 UTC (rev 21172) @@ -33,7 +33,7 @@ void *(*_dl_calloc_function) (size_t __nmemb, size_t __size) = NULL; void *(*_dl_realloc_function) (void *__ptr, size_t __size) = NULL; void *(*_dl_memalign_function) (size_t __boundary, size_t __size) = NULL; -void (*_dl_free_function) (void *__ptr) = NULL; +extern void (*_dl_free_function) (void *__ptr); void *_dl_memalign (size_t __boundary, size_t __size); struct link_map *_dl_update_slotinfo (unsigned long int req_modid); Modified: branches/uClibc-nptl/ldso/ldso/ldso.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/ldso.c 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/ldso/ldso.c 2008-03-05 17:54:17 UTC (rev 21172) @@ -4,7 +4,7 @@ * after resolving ELF shared library symbols * * Copyright (C) 2005 by Joakim Tjernlund - * Copyright (C) 2000-2004 by Erik Andersen + * Copyright (C) 2000-2006 by Erik Andersen * Copyright (c) 1994-2000 Eric Youngdale, Peter MacDonald, * David Engel, Hongjiu Lu and Mitch D'Souza * @@ -54,6 +54,7 @@ size_t _dl_pagesize = 0; /* Store the page size for use later */ struct r_debug *_dl_debug_addr = NULL; /* Used to communicate with the gdb debugger */ void *(*_dl_malloc_function) (size_t size) = NULL; +void (*_dl_free_function) (void *p) = NULL; #ifdef __SUPPORT_LD_DEBUG__ char *_dl_debug = 0; @@ -79,9 +80,15 @@ * address mapping is changed in some way. */ void _dl_debug_state(void); -void _dl_debug_state() +rtld_hidden_proto(_dl_debug_state, noinline); +void _dl_debug_state(void) { + /* Make sure GCC doesn't recognize this function as pure, to avoid + * having the calls optimized away. + */ + __asm__(""); } +rtld_hidden_def(_dl_debug_state); static unsigned char *_dl_malloc_addr = 0; /* Lets _dl_malloc use the already allocated memory page */ static unsigned char *_dl_mmap_zero = 0; /* Also used by _dl_malloc */ @@ -181,7 +188,7 @@ ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv) { - ElfW(Addr) app_loadaddr = NULL; + ElfW(Addr) app_mapaddr = 0; ElfW(Phdr) *ppnt; ElfW(Dyn) *dpnt; char *lpntstr; @@ -197,6 +204,7 @@ unsigned long *_dl_envp; /* The environment address */ ElfW(Addr) relro_addr = 0; size_t relro_size = 0; + struct stat st; #if USE_TLS void *tcbp = NULL; #endif @@ -330,8 +338,8 @@ relro_addr = ppnt->p_vaddr; relro_size = ppnt->p_memsz; } - if (!app_loadaddr && (ppnt->p_type == PT_LOAD)) { - app_loadaddr = ppnt->p_vaddr; + if (!app_mapaddr && (ppnt->p_type == PT_LOAD)) { + app_mapaddr = ppnt->p_vaddr; } if (ppnt->p_type == PT_DYNAMIC) { dpnt = (ElfW(Dyn) *) (ppnt->p_vaddr + app_tpnt->loadaddr); @@ -345,6 +353,7 @@ _dl_debug_early("calling mprotect on the application program\n"); /* Now cover the application program. */ if (app_tpnt->dynamic_info[DT_TEXTREL]) { + ElfW(Phdr) *ppnt_outer = ppnt; ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_val; for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++) { if (ppnt->p_type == PT_LOAD && !(ppnt->p_flags & PF_W)) @@ -353,7 +362,13 @@ (unsigned long) ppnt->p_filesz, PROT_READ | PROT_WRITE | PROT_EXEC); } + ppnt = ppnt_outer; } +#else + if (app_tpnt->dynamic_info[DT_TEXTREL]) { + _dl_dprintf(_dl_debug_file, "Can't modify application's text section; use the GCC option -fPIE for position-independent executables.\n"); + _dl_exit(1); + } #endif #ifndef ALLOW_ZERO_PLTGOT @@ -370,7 +385,7 @@ _dl_symbol_tables = rpnt = (struct dyn_elf *) _dl_malloc(sizeof(struct dyn_elf)); _dl_memset(rpnt, 0, sizeof(struct dyn_elf)); rpnt->dyn = _dl_loaded_modules; - app_tpnt->mapaddr = app_loadaddr; + app_tpnt->mapaddr = app_mapaddr; app_tpnt->rtld_flags = unlazy | RTLD_GLOBAL; app_tpnt->usage_count++; app_tpnt->symbol_scope = _dl_symbol_tables; @@ -514,9 +529,7 @@ debug_addr->r_brk = (unsigned long) &_dl_debug_state; _dl_debug_addr = debug_addr; - /* Notify the debugger we are in a consistant state */ - _dl_debug_addr->r_state = RT_CONSISTENT; - _dl_debug_state(); + /* Do not notify the debugger until the interpreter is in the list */ /* OK, we now have the application in the list, and we have some * basic stuff in place. Now search through the list for other shared @@ -783,6 +796,10 @@ (unsigned long)tpnt->dynamic_addr, 0); + if (_dl_stat(tpnt->libname, &st) >= 0) { + tpnt->st_dev = st.st_dev; + tpnt->st_ino = st.st_ino; + } tpnt->n_phent = epnt->e_phnum; tpnt->ppnt = myppnt; for (j = 0; j < epnt->e_phnum; j++, myppnt++) { Modified: branches/uClibc-nptl/ldso/ldso/sh/dl-syscalls.h =================================================================== --- branches/uClibc-nptl/ldso/ldso/sh/dl-syscalls.h 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/ldso/sh/dl-syscalls.h 2008-03-05 17:54:17 UTC (rev 21172) @@ -4,3 +4,11 @@ extern int _dl_errno; #undef __set_errno #define __set_errno(X) {(_dl_errno) = (X);} + +#if __GNUC_PREREQ (4, 1) +#warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline +# ifdef __always_inline +# undef __always_inline +# define __always_inline inline +# endif +#endif Modified: branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c =================================================================== --- branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/ldso/sh/elfinterp.c 2008-03-05 17:54:17 UTC (rev 21172) @@ -252,7 +252,7 @@ } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); #endif return 0; @@ -289,7 +289,7 @@ } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); #endif return 0; Modified: branches/uClibc-nptl/ldso/libdl/Makefile.in =================================================================== --- branches/uClibc-nptl/ldso/libdl/Makefile.in 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/libdl/Makefile.in 2008-03-05 17:54:17 UTC (rev 21172) @@ -1,7 +1,6 @@ # Makefile.in for uClibc # -# Copyright (C) 2000 by Lineo, inc. -# Copyright (C) 2000-2005 Erik Andersen +# Copyright (C) 2000-2006 Erik Andersen # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # Modified: branches/uClibc-nptl/ldso/libdl/libdl.c =================================================================== --- branches/uClibc-nptl/ldso/libdl/libdl.c 2008-03-05 16:44:02 UTC (rev 21171) +++ branches/uClibc-nptl/ldso/libdl/libdl.c 2008-03-05 17:54:17 UTC (rev 21172) @@ -59,24 +59,30 @@ extern struct r_debug *_dl_debug_addr; extern unsigned long _dl_error_number; extern void *(*_dl_malloc_function)(size_t); +extern void (*_dl_free_function) (void *p); extern void _dl_run_init_array(struct elf_resolve *); extern void _dl_run_fini_array(struct elf_resolve *); -# ifdef __LDSO_CACHE_SUPPORT__ +#ifdef __LDSO_CACHE_SUPPORT__ int _dl_map_cache(void); int _dl_unmap_cache(void); -# endif -# ifdef __mips__ +#endif +#ifdef __mips__ extern void _dl_perform_mips_global_got_relocations(struct elf_resolve *tpnt, int lazy); -# endif -# ifdef __SUPPORT_LD_DEBUG__ +#endif +#ifdef __SUPPORT_LD_DEBUG__ extern char *_dl_debug; -# endif +#endif + + #else /* SHARED */ +#define _dl_malloc malloc +#define _dl_free free + /* When libdl is linked as a static library, we need to replace all * the symbols that otherwise would have been loaded in from ldso... */ -# ifdef __SUPPORT_LD_DEBUG__ +#ifdef __SUPPORT_LD_DEBUG__ /* Needed for 'strstr' prototype' */ #include char *_dl_debug = 0; @@ -87,16 +93,17 @@ char *_dl_debug_nofixups = 0; char *_dl_debug_bindings = 0; int _dl_debug_file = 2; -# endif +#endif const char *_dl_progname = ""; /* Program name */ +void *(*_dl_malloc_function)(size_t); +void (*_dl_free_function) (void *p); char *_dl_library_path = 0; /* Where we look for libraries */ char *_dl_ldsopath = 0; /* Location of the shared lib loader */ int _dl_errno = 0; /* We can't use the real errno in ldso */ size_t _dl_pagesize = PAGE_SIZE; /* Store the page size for use later */ /* This global variable is also to communicate with debuggers such as gdb. */ struct r_debug *_dl_debug_addr = NULL; -#define _dl_malloc malloc -#define _dl_free free + #include "../ldso/dl-debug.c" @@ -278,6 +285,7 @@ struct init_fini_list *tmp, *runp, *runp2, *dep_list; unsigned int nlist, i; struct elf_resolve **init_fini_list; + static int _dl_init = 0; #if USE_TLS bool any_tls = false; #endif @@ -290,6 +298,11 @@ from = (ElfW(Addr)) __builtin_return_address(0); + if (!_dl_init) { + _dl_init++; + _dl_malloc_function = malloc; + _dl_free_function = free; + } /* Cover the trivial case first */ if (!libname) return _dl_symbol_tables; @@ -310,7 +323,7 @@ _dl_debug_bindings = strstr(_dl_debug, "bind"); } } -# endif +# endif #endif _dl_map_cache(); @@ -333,7 +346,7 @@ tfrom = tpnt; } } - for(rpnt = _dl_symbol_tables; rpnt && rpnt->next; rpnt=rpnt->next); + for (rpnt = _dl_symbol_tables; rpnt && rpnt->next; rpnt=rpnt->next); relro_ptr = rpnt; now_flag = (flag & RTLD_NOW) ? RTLD_NOW : 0; @@ -343,8 +356,8 @@ #ifndef SHARED /* When statically linked, the _dl_library_path is not yet initialized */ _dl_library_path = getenv("LD_LIBRARY_PATH"); -#endif - +#endif + /* Try to load the specified library */ _dl_if_debug_print("Trying to dlopen '%s', RTLD_GLOBAL:%d RTLD_NOW:%d\n", (char*)libname, (flag & RTLD_GLOBAL ? 1:0), (now_flag & RTLD_NOW ? 1:0)); @@ -369,7 +382,7 @@ if (handle->dyn == tpnt) { dyn_chain->init_fini.init_fini = handle->init_fini.init_fini; dyn_chain->init_fini.nlist = handle->init_fini.nlist; - for(i=0; i < dyn_chain->init_fini.nlist; i++) + for (i = 0; i < dyn_chain->init_fini.nlist; i++) dyn_chain->init_fini.init_fini[i]->rtld_flags |= (flag & RTLD_GLOBAL); dyn_chain->next = handle->next; break; @@ -419,7 +432,7 @@ for (tmp=dep_list; tmp; tmp = tmp->next) { if (tpnt1 == tmp->tpnt) { /* if match => cirular dependency, drop it */ _dl_if_debug_print("Circular dependency, skipping '%s',\n", - tmp->tpnt->libname); + tmp->tpnt->libname); tpnt1->usage_count--; break; } @@ -439,7 +452,7 @@ i = 0; for (runp2 = dep_list; runp2; runp2 = runp2->next) { init_fini_list[i++] = runp2->tpnt; - for(runp = runp2->tpnt->init_fini; runp; runp = runp->next){ + for (runp = runp2->tpnt->init_fini; runp; runp = runp->next) { if (!(runp->tpnt->rtld_flags & RTLD_GLOBAL)) { tmp = malloc(sizeof(struct init_fini_list)); tmp->tpnt = runp->tpnt; @@ -471,9 +484,9 @@ } } #ifdef __SUPPORT_LD_DEBUG__ - if(_dl_debug) { + if (_dl_debug) { fprintf(stderr, "\nINIT/FINI order and dependencies:\n"); - for (i=0;i < nlist;i++) { + for (i = 0; i < nlist; i++) { fprintf(stderr, "lib: %s has deps:\n", init_fini_list[i]->libname); runp = init_fini_list[i]->init_fini; for (; runp; runp = runp->next) @@ -1033,6 +1046,7 @@ strtab = (char *) (pelf->dynamic_info[DT_STRTAB]); sf = sn = 0; + #ifdef __LDSO_GNU_HASH_SUPPORT__ if (pelf->l_gnu_bitmask) { for (hn = 0; hn < pelf->nbucket; hn++) { @@ -1050,9 +1064,7 @@ sn = si; sf = 1; } - - _dl_if_debug_print("Symbol \"%s\" at %p\n", - strtab + symtab[si].st_name, symbol_addr); + _dl_if_debug_print("Symbol \"%s\" at %p\n", strtab + symtab[si].st_name, symbol_addr); ++si; } while ((*hasharr++ & 1u) == 0); } @@ -1070,7 +1082,7 @@ } _dl_if_debug_print("Symbol \"%s\" at %p\n", - strtab + symtab[si].st_name, symbol_addr); + strtab + symtab[si].st_name, symbol_addr); } } From bugs at busybox.net Thu Mar 6 04:12:20 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 6 Mar 2008 04:12:20 -0800 Subject: [uClibc 0002454]: Fixing ARM EABI support bug in syscall() Message-ID: <425626fc8946be3dbeae9b6b4dd0bf27@bugs.uclibc.org> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=2454 ====================================================================== Reported By: Joe Lin Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2454 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: assigned ====================================================================== Date Submitted: 03-06-2008 04:12 PST Last Modified: 03-06-2008 04:12 PST ====================================================================== Summary: Fixing ARM EABI support bug in syscall() Description: When making an EABI syscall() system call, the library does not correctly pass requesting system number to the Linux kernel. For example, the ping facility in Busybox will issue a syscall() to get monotonic time (see monotonic_us() in libbb/time.c). The syscall() in syscall-eabi.S passes R7 value verbatim. But the kernel (see linux's vector_swi routine in arch/arm/kernel/entry-common.S) expects R7 a number without __NR_SYSCALL_BASE. This bug caused a Segmentation Fault. Below is the patch. -------------------------------------------------------------- diff -Naurd uClibc-0.9.29/libc/sysdeps/linux/arm/syscall-eabi.S uClibc-0.9.29-p1/libc/sysdeps/linux/arm/syscall-eabi.S --- uClibc-0.9.29/libc/sysdeps/linux/arm/syscall-eabi.S 2006-02-11 12:29:52.000000000 +0800 +++ uClibc-0.9.29-p1/libc/sysdeps/linux/arm/syscall-eabi.S 2008-03-06 19:53:15.000000000 +0800 @@ -29,7 +29,7 @@ syscall: mov ip, sp stmfd sp!, {r4, r5, r6, r7} - mov r7, r0 + sub r7, r0, #SYS_SYSCALL_BASE mov r0, r1 mov r1, r2 mov r2, r3 -------------------------------------------------------------- ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 03-06-08 04:12 Joe Lin New Issue 03-06-08 04:12 Joe Lin Status new => assigned 03-06-08 04:12 Joe Lin Assigned To => uClibc ====================================================================== From Blog at busybox.net Sat Mar 8 13:42:41 2008 From: Blog at busybox.net (Blog at busybox.net) Date: 09 Mar 2008 05:42:41 +0800 Subject: How would you like to have your ad on 2 Million Websites ? Message-ID: <20080309054241.FE170297965D3CC4@from.header.has.no.domain> An HTML attachment was scrubbed... URL: http://busybox.net/lists/uclibc-cvs/attachments/20080309/632951ea/attachment.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/uclibc-cvs/attachments/20080309/632951ea/attachment-0001.htm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Unsubscribe email.txt Url: http://busybox.net/lists/uclibc-cvs/attachments/20080309/632951ea/attachment.txt From carmelo at uclibc.org Sat Mar 8 23:07:20 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Sat, 8 Mar 2008 23:07:20 -0800 (PST) Subject: svn commit: trunk/uClibc/ldso/ldso Message-ID: <20080309070720.B1CE512C823@busybox.net> Author: carmelo Date: 2008-03-08 23:07:20 -0800 (Sat, 08 Mar 2008) New Revision: 21278 Log: Khem Raj writes: While compiling trunk on ARM with GCC 4.2 and enabling LDSO_GNU_HASH_SUPPORT I stumbled upon this problem. GCC made a call to libgcc function __aeabi_uidivmod()->__div0()->__raise() and raise is not yet compiled in at the time of compiling ldso so I got well known undefined symbol __raise problem This patch uses the do_rem () macro to do the same operation. Modified: trunk/uClibc/ldso/ldso/dl-hash.c Changeset: Modified: trunk/uClibc/ldso/ldso/dl-hash.c =================================================================== --- trunk/uClibc/ldso/ldso/dl-hash.c 2008-03-08 21:33:40 UTC (rev 21277) +++ trunk/uClibc/ldso/ldso/dl-hash.c 2008-03-09 07:07:20 UTC (rev 21278) @@ -204,11 +204,12 @@ unsigned int hashbit1 = hash & (__ELF_NATIVE_CLASS - 1); unsigned int hashbit2 = ((hash >> tpnt->l_gnu_shift) & (__ELF_NATIVE_CLASS - 1)); - + unsigned long rem; + do_rem (rem, hash, tpnt->nbucket); _dl_assert (bitmask != NULL); if (unlikely((bitmask_word >> hashbit1) & (bitmask_word >> hashbit2) & 1)) { - Elf32_Word bucket = tpnt->l_gnu_buckets[hash % tpnt->nbucket]; + Elf32_Word bucket = tpnt->l_gnu_buckets[rem]; if (bucket != 0) { const Elf32_Word *hasharr = &tpnt->l_gnu_chain_zero[bucket]; From carmelo at uclibc.org Sat Mar 8 23:30:43 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Sat, 8 Mar 2008 23:30:43 -0800 (PST) Subject: svn commit: branches/uClibc-nptl Message-ID: <20080309073043.BEB4A12011E@busybox.net> Author: carmelo Date: 2008-03-08 23:30:43 -0800 (Sat, 08 Mar 2008) New Revision: 21279 Log: Merge nptl branch tree with trunk. Step 2: remove debian directory Signed-off-by: Carmelo Amoroso Removed: branches/uClibc-nptl/debian/ Changeset: From Feed at busybox.net Sun Mar 9 13:20:04 2008 From: Feed at busybox.net (Feed at busybox.net) Date: 10 Mar 2008 04:20:04 +0800 Subject: Receive hundreds of targeted hits to your website every day from the links in the feeds! Message-ID: <20080310042004.6FC6B3873DC04456@from.header.has.no.domain> An HTML attachment was scrubbed... URL: http://busybox.net/lists/uclibc-cvs/attachments/20080310/ac29c3af/attachment.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://busybox.net/lists/uclibc-cvs/attachments/20080310/ac29c3af/attachment-0001.htm -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Unsubscribe email.txt Url: http://busybox.net/lists/uclibc-cvs/attachments/20080310/ac29c3af/attachment.txt From tzungder at gmail.com Sun Mar 9 18:24:42 2008 From: tzungder at gmail.com (Tzungder Lin) Date: Mon, 10 Mar 2008 09:24:42 +0800 Subject: [uclibc]Can stdlibc++ be compiled with ARM EABI? Message-ID: <528f811a0803091824s373aa4bcw146e9b9e49736687@mail.gmail.com> Hi All, I try to build a ARM EABI toolchain with g++ supported. I have try gcc 4.1/4.2 with binutils 2.17.x / 2.18, uclibc0.9.27/28 But it keeps fail at compiling stdlibc++, the error message is come from the assembler: libstdc++-v3/libsupc++/eh_alloc.cc Error: duplicate .personality directive I have do some google searching but no useful result. Any response is welcome, I have been stuck in this for more than 6 months... Thanks a lot ! Regards jonathan From carmelo at uclibc.org Tue Mar 11 03:25:43 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Tue, 11 Mar 2008 03:25:43 -0700 (PDT) Subject: svn commit: trunk/uClibc/ldso/ldso Message-ID: <20080311102543.0468E12C802@busybox.net> Author: carmelo Date: 2008-03-11 03:25:42 -0700 (Tue, 11 Mar 2008) New Revision: 21288 Log: Move calculation of rem within if (unlikely statement Signed-off-by: Peter Kjellerstedt SIgned-off-by: Carmelo Amoroso Modified: trunk/uClibc/ldso/ldso/dl-hash.c Changeset: Modified: trunk/uClibc/ldso/ldso/dl-hash.c =================================================================== --- trunk/uClibc/ldso/ldso/dl-hash.c 2008-03-11 08:49:45 UTC (rev 21287) +++ trunk/uClibc/ldso/ldso/dl-hash.c 2008-03-11 10:25:42 UTC (rev 21288) @@ -204,13 +204,15 @@ unsigned int hashbit1 = hash & (__ELF_NATIVE_CLASS - 1); unsigned int hashbit2 = ((hash >> tpnt->l_gnu_shift) & (__ELF_NATIVE_CLASS - 1)); - unsigned long rem; - do_rem (rem, hash, tpnt->nbucket); _dl_assert (bitmask != NULL); if (unlikely((bitmask_word >> hashbit1) & (bitmask_word >> hashbit2) & 1)) { - Elf32_Word bucket = tpnt->l_gnu_buckets[rem]; + unsigned long rem; + Elf32_Word bucket; + do_rem (rem, hash, tpnt->nbucket); + bucket = tpnt->l_gnu_buckets[rem]; + if (bucket != 0) { const Elf32_Word *hasharr = &tpnt->l_gnu_chain_zero[bucket]; do { From bugs at busybox.net Wed Mar 12 10:21:04 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Wed, 12 Mar 2008 10:21:04 -0700 Subject: [uClibc 0002544]: Can't make a target system for X86_64 Message-ID: <807818ec8a99f92fb54e70168d77c806@bugs.uclibc.org> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=2544 ====================================================================== Reported By: kickinz1 Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2544 Category: Architecture Specific Reproducibility: always Severity: major Priority: normal Status: assigned ====================================================================== Date Submitted: 03-12-2008 10:21 PDT Last Modified: 03-12-2008 10:21 PDT ====================================================================== Summary: Can't make a target system for X86_64 Description: If I choose to make a x86_64 target, I can't achieve to have a working system. It can't compile uclibc 0.9.29. throwing the following error message: CC libc/stdlib/strtol_l.os In file included from ../../libc/stdlib/strtol_l.c:8: ../../libc/stdlib/stdlib.c:346: error: conflicting types for 'strtoll_l' ../../include/stdlib.h:266: error: previous declaration of 'strtoll_l' was here ../../libc/stdlib/stdlib.c:347: error: conflicting types for 'strtoll_l' ../../include/stdlib.h:266: error: previous declaration of 'strtoll_l' was here ../../libc/stdlib/stdlib.c:348: error: conflicting types for 'strtoll_l' ../../include/stdlib.h:266: error: previous declaration of 'strtoll_l' was here make: *** [../../libc/stdlib/strtol_l.os ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 03-12-08 10:21 kickinz1 New Issue 03-12-08 10:21 kickinz1 Status new => assigned 03-12-08 10:21 kickinz1 Assigned To => uClibc ====================================================================== From bugs at busybox.net Thu Mar 13 05:14:01 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 13 Mar 2008 05:14:01 -0700 Subject: [uClibc 0002064]: Library assumes presence of several syscalls Message-ID: <72a5bebbd6d2f9a10e6a74f17ee8ba2c@bugs.uclibc.org> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=2064 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2064 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 02-07-2008 19:30 PST Last Modified: 03-13-2008 05:14 PDT ====================================================================== Summary: Library assumes presence of several syscalls Description: When compiled against unmodified Linux-2.0.40 headers, uClibc fails to compile because it assumes several 2.2+ syscalls are present. The syscalls in question are __NR_lchown, __NR_prctl, __NR_sendfile, __NR_setresuid, __NR_setresgid, __NR_sched_getaffinity, and __NR_sched_setaffinity. (I'm aware there's already a patch in buildroot for the last two.) It looks like there was an attempt to conditionally include setresuid() and setresgid(). But it doesn't work, as compilation fails with "'__EI_setresuid' aliased to undefined symbol '__GI_setresuid'". I've worked around the problem by modifying before building uClibc. For all syscalls except lchown(), letting them fail with ENOSYS produces results no more broken than glibc on the same kernel. lchown() wasn't a problem for me, as I've privately backported syscall 182 to my kernel. Note that problem http://busybox.net/bugs/view.php?id=1874 also needs to be fixed before compilation on Linux 2.0.40 can complete. ====================================================================== ---------------------------------------------------------------------- vapier - 02-15-08 15:35 ---------------------------------------------------------------------- ive updated the FAQ to cover our policy for things older than linux-2.4 is: we dont care that is to say, we arent going to fix it ourselves. if you can post a nice patch that works for you, we'll look at merging it. ---------------------------------------------------------------------- michael_d - 03-13-08 05:14 ---------------------------------------------------------------------- I've uploaded a patch to make most of the syscalls conditional. Left out are lchown(), which I've addressed locally at the kernel side, and sched_*(), which are already handled in a buildroot patch. Note that this patch isn't enough to make a threaded build on a setresuid()-less platform -- there are functions in libpthread that use setresuid() and setresgid() unconditionally. Issue History Date Modified Username Field Change ====================================================================== 02-07-08 19:30 michael_d New Issue 02-07-08 19:30 michael_d Status new => assigned 02-07-08 19:30 michael_d Assigned To => uClibc 02-15-08 15:35 vapier Note Added: 0004914 03-13-08 05:09 michael_d File Added: uClibc-0.9.29-condcalls.diff 03-13-08 05:14 michael_d Note Added: 0005694 ====================================================================== From bugs at busybox.net Thu Mar 13 05:18:55 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 13 Mar 2008 05:18:55 -0700 Subject: [uClibc 0002074]: poll() does not work on Linux 2.0.40 Message-ID: <1e0b920959f9e8209356b05f981f1fce@bugs.uclibc.org> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=2074 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2074 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 02-07-2008 19:49 PST Last Modified: 03-13-2008 05:18 PDT ====================================================================== Summary: poll() does not work on Linux 2.0.40 Description: When compiled for Linux 2.0.40, the poll() function will not work, always returning ENOSYS. While that kernel does not implement the poll syscall, there is a complete emulation within uClibc's source, which works fine but is not normally compiled in. The problem is that this kernel's defines __NR_poll, even though it does not implement the syscall. uClibc blindly assumes that the call will work if its number is defined, and discards the emulation to save space. To fix this, the library needs to check for the presence of the header, rather than just seeing if the syscall number is defined. I've worked around this locally by editing to remove __NR_poll. (Note that fixes for issues http://busybox.net/bugs/view.php?id=1874 and http://busybox.net/bugs/view.php?id=2064 must be applied before compilation of uClibc is possible on this platform.) ====================================================================== ---------------------------------------------------------------------- vapier - 02-15-08 15:39 ---------------------------------------------------------------------- please see the FAQ: http://uclibc.org/FAQ.html#upstream_versions in other words, please post a patch that addresses the issue for you ---------------------------------------------------------------------- michael_d - 03-13-08 05:18 ---------------------------------------------------------------------- I've uploaded a patch, which checks whether the kernel headers include . If that header is not present, it's unlikely the kernel really supports the syscall. Issue History Date Modified Username Field Change ====================================================================== 02-07-08 19:49 michael_d New Issue 02-07-08 19:49 michael_d Status new => assigned 02-07-08 19:49 michael_d Assigned To => uClibc 02-15-08 15:39 vapier Note Added: 0004924 03-13-08 05:15 michael_d File Added: uClibc-0.9.29-pollfix.diff 03-13-08 05:18 michael_d Note Added: 0005704 ====================================================================== From bugs at busybox.net Thu Mar 13 05:22:30 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Thu, 13 Mar 2008 05:22:30 -0700 Subject: [uClibc 0002084]: SysVIPC does not work on old kernels Message-ID: A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=2084 ====================================================================== Reported By: michael_d Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2084 Category: Other Reproducibility: always Severity: minor Priority: normal Status: assigned ====================================================================== Date Submitted: 02-07-2008 20:00 PST Last Modified: 03-13-2008 05:22 PDT ====================================================================== Summary: SysVIPC does not work on old kernels Description: The functions shmctl(), semctl(), and msgctl() unconditionally or their subcommand argument with __IPC_64. That flag was only added in Linux 2.4, so they will always fail on older kernels. I've prepared a patch to allow IPC to work on old kernels. Since __IPC_64 signals a different format of the syscall arguments and I haven't changed the userspace structures, a significant amount of marshalling code needed to be added. The patch does need some adaptation before it can go into the mainline. Since it is not safe to include , I cannot probe whether the current kernel supports __IPC_64 or not. Thus, this patch will unconditionally use old kernel structures. I've left a "#if 0" in libc/misc/sysvipc/ipc.h that can be flipped to produce a library for 2.4+. ====================================================================== ---------------------------------------------------------------------- vapier - 02-15-08 15:41 ---------------------------------------------------------------------- make the code conditional on the versions of the kernel headers being compiled against ---------------------------------------------------------------------- michael_d - 03-13-08 05:22 ---------------------------------------------------------------------- I don't like using kernel version numbers, since stuff gets backported occasionally. However, I've submitted a new version of the patch. This one checks the presence of the header to detect an IPC64-supporting kernel. Issue History Date Modified Username Field Change ====================================================================== 02-07-08 20:00 michael_d New Issue 02-07-08 20:00 michael_d Status new => assigned 02-07-08 20:00 michael_d Assigned To => uClibc 02-07-08 20:00 michael_d File Added: uClibc-0.9.29-ipc32.diff 02-15-08 15:41 vapier Note Added: 0004934 03-13-08 05:20 michael_d File Added: uClibc-0.9.29-ipc32-newer.diff 03-13-08 05:22 michael_d Note Added: 0005714 ====================================================================== From hskinnemoen at uclibc.org Thu Mar 13 11:41:47 2008 From: hskinnemoen at uclibc.org (hskinnemoen at uclibc.org) Date: Thu, 13 Mar 2008 11:41:47 -0700 (PDT) Subject: svn commit: trunk/uClibc Message-ID: <20080313184147.049C712011A@busybox.net> Author: hskinnemoen Date: 2008-03-13 11:41:46 -0700 (Thu, 13 Mar 2008) New Revision: 21327 Log: Add myself as co-maintainer for the AVR32 architecture Modified: trunk/uClibc/MAINTAINERS Changeset: Modified: trunk/uClibc/MAINTAINERS =================================================================== --- trunk/uClibc/MAINTAINERS 2008-03-13 17:16:30 UTC (rev 21326) +++ trunk/uClibc/MAINTAINERS 2008-03-13 18:41:46 UTC (rev 21327) @@ -35,6 +35,8 @@ AVR32 N: Hans-Christian Egtvedt E: hcegtvedt at atmel.com +N: Haavard Skinnemoen +E: haavard.skinnemoen at atmel.com W: http://avr32linux.org/ S: Maintained From hskinnemoen at uclibc.org Thu Mar 13 12:04:17 2008 From: hskinnemoen at uclibc.org (hskinnemoen at uclibc.org) Date: Thu, 13 Mar 2008 12:04:17 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/string/avr32 Message-ID: <20080313190417.7287C12011A@busybox.net> Author: hskinnemoen Date: 2008-03-13 12:04:16 -0700 (Thu, 13 Mar 2008) New Revision: 21328 Log: From: Geoffrey Wossum Found a problem with the AVR32 optimized bzero() code. Due to a missing #include, it actually generated no code. Modified: trunk/uClibc/libc/string/avr32/bzero.S Changeset: Modified: trunk/uClibc/libc/string/avr32/bzero.S =================================================================== --- trunk/uClibc/libc/string/avr32/bzero.S 2008-03-13 18:41:46 UTC (rev 21327) +++ trunk/uClibc/libc/string/avr32/bzero.S 2008-03-13 19:04:16 UTC (rev 21328) @@ -6,6 +6,8 @@ * archive for more details. */ +#include + #ifdef __UCLIBC_SUSV3_LEGACY__ .text From hskinnemoen at uclibc.org Thu Mar 13 13:12:09 2008 From: hskinnemoen at uclibc.org (hskinnemoen at uclibc.org) Date: Thu, 13 Mar 2008 13:12:09 -0700 (PDT) Subject: svn commit: trunk/uClibc/libc/string/avr32 Message-ID: <20080313201209.8E72312011A@busybox.net> Author: hskinnemoen Date: 2008-03-13 13:12:08 -0700 (Thu, 13 Mar 2008) New Revision: 21329 Log: avr32: Use HIDDEN_JUMPTARGET() macro in bzero.S Also, remove the hidden __memset symbol from memset.S Modified: trunk/uClibc/libc/string/avr32/bzero.S trunk/uClibc/libc/string/avr32/memset.S Changeset: Modified: trunk/uClibc/libc/string/avr32/bzero.S =================================================================== --- trunk/uClibc/libc/string/avr32/bzero.S 2008-03-13 19:04:16 UTC (rev 21328) +++ trunk/uClibc/libc/string/avr32/bzero.S 2008-03-13 20:12:08 UTC (rev 21329) @@ -17,7 +17,7 @@ bzero: mov r10, r11 mov r11, 0 - rjmp __memset + rjmp HIDDEN_JUMPTARGET(memset) .size bzero, . - bzero Modified: trunk/uClibc/libc/string/avr32/memset.S =================================================================== --- trunk/uClibc/libc/string/avr32/memset.S 2008-03-13 19:04:16 UTC (rev 21328) +++ trunk/uClibc/libc/string/avr32/memset.S 2008-03-13 20:12:08 UTC (rev 21329) @@ -16,13 +16,8 @@ .global memset .type memset, @function - .global __memset - .hidden __memset - .type __memset, @function - .align 1 memset: -__memset: cp.w n, 32 mov r9, s brge .Llarge_memset From bugs at busybox.net Fri Mar 14 09:07:04 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 14 Mar 2008 09:07:04 -0700 Subject: [uClibc 0002584]: Can't compile uClibc in x86_64 arch Message-ID: <79caeff59d25d8a1a0c05a615dbf33ec@bugs.uclibc.org> The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=2584 ====================================================================== Reported By: Graol Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2584 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 03-14-2008 09:07 PDT Last Modified: 03-14-2008 09:07 PDT ====================================================================== Summary: Can't compile uClibc in x86_64 arch Description: Hi, I'm running a virtual machine with Debain 32 bits installed. I need to install uClibc in x86_64 arch but it seems I always get a problem which makes the compile fail. The best result I got by changing options is the following: In file included from ./libpthread/linuxthreads.old/sysdeps/x86_64/pt-machine.h:27, from ./libpthread/linuxthreads.old/sysdeps/x86_64/tls.h:25, from ./include/bits/uClibc_errno.h:14, from ./include/errno.h:62, from libutil/login.c:1: /usr/include/asm/prctl.h:8:3: error: #error This header is not available for i386 make: *** [libutil/login.o] Error 1 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 03-14-08 09:07 Graol New Issue 03-14-08 09:07 Graol Status new => assigned 03-14-08 09:07 Graol Assigned To => uClibc ====================================================================== From bugs at busybox.net Fri Mar 14 09:07:27 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 14 Mar 2008 09:07:27 -0700 Subject: [uClibc 0002594]: Can't compile uClibc in x86_64 arch Message-ID: The following issue has been SUBMITTED. ====================================================================== http://busybox.net/bugs/view.php?id=2594 ====================================================================== Reported By: Graol Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2594 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 03-14-2008 09:07 PDT Last Modified: 03-14-2008 09:07 PDT ====================================================================== Summary: Can't compile uClibc in x86_64 arch Description: Hi, I'm running a virtual machine with Debain 32 bits installed. I need to install uClibc in x86_64 arch but it seems I always get a problem which makes the compile fail. The best result I got by changing options is the following: In file included from ./libpthread/linuxthreads.old/sysdeps/x86_64/pt-machine.h:27, from ./libpthread/linuxthreads.old/sysdeps/x86_64/tls.h:25, from ./include/bits/uClibc_errno.h:14, from ./include/errno.h:62, from libutil/login.c:1: /usr/include/asm/prctl.h:8:3: error: #error This header is not available for i386 make: *** [libutil/login.o] Error 1 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 03-14-08 09:07 Graol New Issue 03-14-08 09:07 Graol Status new => assigned 03-14-08 09:07 Graol Assigned To => uClibc ====================================================================== From bugs at busybox.net Fri Mar 14 09:09:12 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 14 Mar 2008 09:09:12 -0700 Subject: [uClibc 0002594]: Can't compile uClibc in x86_64 arch Message-ID: A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=2594 ====================================================================== Reported By: Graol Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2594 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 03-14-2008 09:07 PDT Last Modified: 03-14-2008 09:09 PDT ====================================================================== Summary: Can't compile uClibc in x86_64 arch Description: Hi, I'm running a virtual machine with Debain 32 bits installed. I need to install uClibc in x86_64 arch but it seems I always get a problem which makes the compile fail. The best result I got by changing options is the following: In file included from ./libpthread/linuxthreads.old/sysdeps/x86_64/pt-machine.h:27, from ./libpthread/linuxthreads.old/sysdeps/x86_64/tls.h:25, from ./include/bits/uClibc_errno.h:14, from ./include/errno.h:62, from libutil/login.c:1: /usr/include/asm/prctl.h:8:3: error: #error This header is not available for i386 make: *** [libutil/login.o] Error 1 ====================================================================== ---------------------------------------------------------------------- Graol - 03-14-08 09:09 ---------------------------------------------------------------------- Sorry for the spam. Please remove this entry. Issue History Date Modified Username Field Change ====================================================================== 03-14-08 09:07 Graol New Issue 03-14-08 09:07 Graol Status new => assigned 03-14-08 09:07 Graol Assigned To => uClibc 03-14-08 09:09 Graol Note Added: 0005744 ====================================================================== From bugs at busybox.net Fri Mar 14 09:10:16 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 14 Mar 2008 09:10:16 -0700 Subject: [uClibc 0002584]: Can't compile uClibc in x86_64 arch Message-ID: <7e42fbbf5099e5094adf2abb65724a8a@bugs.uclibc.org> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=2584 ====================================================================== Reported By: Graol Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2584 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 03-14-2008 09:07 PDT Last Modified: 03-14-2008 09:10 PDT ====================================================================== Summary: Can't compile uClibc in x86_64 arch Description: Hi, I'm running a virtual machine with Debain 32 bits installed. I need to install uClibc in x86_64 arch but it seems I always get a problem which makes the compile fail. The best result I got by changing options is the following: In file included from ./libpthread/linuxthreads.old/sysdeps/x86_64/pt-machine.h:27, from ./libpthread/linuxthreads.old/sysdeps/x86_64/tls.h:25, from ./include/bits/uClibc_errno.h:14, from ./include/errno.h:62, from libutil/login.c:1: /usr/include/asm/prctl.h:8:3: error: #error This header is not available for i386 make: *** [libutil/login.o] Error 1 ====================================================================== ---------------------------------------------------------------------- Graol - 03-14-08 09:10 ---------------------------------------------------------------------- uClibc version used is 0.9.29 Issue History Date Modified Username Field Change ====================================================================== 03-14-08 09:07 Graol New Issue 03-14-08 09:07 Graol Status new => assigned 03-14-08 09:07 Graol Assigned To => uClibc 03-14-08 09:10 Graol Note Added: 0005754 ====================================================================== From bugs at busybox.net Fri Mar 14 09:14:11 2008 From: bugs at busybox.net (bugs at busybox.net) Date: Fri, 14 Mar 2008 09:14:11 -0700 Subject: [uClibc 0002584]: Can't compile uClibc in x86_64 arch Message-ID: <871167b11cd0bc7ea842207ea86346f6@bugs.uclibc.org> A NOTE has been added to this issue. ====================================================================== http://busybox.net/bugs/view.php?id=2584 ====================================================================== Reported By: Graol Assigned To: uClibc ====================================================================== Project: uClibc Issue ID: 2584 Category: Architecture Specific Reproducibility: always Severity: block Priority: normal Status: assigned ====================================================================== Date Submitted: 03-14-2008 09:07 PDT Last Modified: 03-14-2008 09:14 PDT ====================================================================== Summary: Can't compile uClibc in x86_64 arch Description: Hi, I'm running a virtual machine with Debain 32 bits installed. I need to install uClibc in x86_64 arch but it seems I always get a problem which makes the compile fail. The best result I got by changing options is the following: In file included from ./libpthread/linuxthreads.old/sysdeps/x86_64/pt-machine.h:27, from ./libpthread/linuxthreads.old/sysdeps/x86_64/tls.h:25, from ./include/bits/uClibc_errno.h:14, from ./include/errno.h:62, from libutil/login.c:1: /usr/include/asm/prctl.h:8:3: error: #error This header is not available for i386 make: *** [libutil/login.o] Error 1 ====================================================================== ---------------------------------------------------------------------- Graol - 03-14-08 09:10 ---------------------------------------------------------------------- uClibc version used is 0.9.29 ---------------------------------------------------------------------- Graol - 03-14-08 09:14 ---------------------------------------------------------------------- Virtual machine is running on a 64 bits Core2 Xeon server. Issue History Date Modified Username Field Change ====================================================================== 03-14-08 09:07 Graol New Issue 03-14-08 09:07 Graol Status new => assigned 03-14-08 09:07 Graol Assigned To => uClibc 03-14-08 09:10 Graol Note Added: 0005754 03-14-08 09:13 Graol Issue Monitored: Graol 03-14-08 09:14 Graol Note Added: 0005764 ====================================================================== From carmelo at uclibc.org Sun Mar 16 00:34:25 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Sun, 16 Mar 2008 00:34:25 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl/docs Message-ID: <20080316073425.AB8F212011B@busybox.net> Author: carmelo Date: 2008-03-16 00:34:24 -0700 (Sun, 16 Mar 2008) New Revision: 21331 Log: Merge nptl branch tree with trunk. Step 3: remove uclibc.org folder and merges docs Signed-off-by: Carmelo Amoroso Removed: branches/uClibc-nptl/docs/uclibc.org/ Modified: branches/uClibc-nptl/docs/PORTING Changeset: Modified: branches/uClibc-nptl/docs/PORTING =================================================================== --- branches/uClibc-nptl/docs/PORTING 2008-03-15 05:07:26 UTC (rev 21330) +++ branches/uClibc-nptl/docs/PORTING 2008-03-16 07:34:24 UTC (rev 21331) @@ -65,6 +65,11 @@ ==================== === ldso sysdeps === ==================== +- elf.h - presumably you've already taught binutils all about the random ELF + relocations your arch needs, so now you need to make sure the defines exist + for uClibc. make sure the EM_### define exists and all of the R_###_### + reloc defines. + - enable ldso/shared options in your extra/Configs/Config.ARCH file - you will need to create the following files in ldso/ldso/ARCH/ dl-debug.h dl-startup.h dl-syscalls.h dl-sysdep.h elfinterp.c resolve.S @@ -115,3 +120,19 @@ - clean up after call - jump to function address now stored in PLT glibc stores this function in libc/sysdeps/ARCH/dl-trampoline.S + +- utils/ldd.c - if you want support for ldso cache files (spoiler: you do), + then you'll need to teach ldd a little. generally, the fallback code + should be smart and "just work", but you should be explicit. just pop + it open and add an appropriate ifdef for your arch and set MATCH_MACHINE() + and ELFCLASSM. there are plenty examples and you're (hopefully) smart. + +==================== +=== Misc Cruft === +==================== +- utils/readelf.c - not really needed generally speaking, but might as well + add your arch to the giant EM_* list (describe_elf_hdr) + +- MAINTAINERS - presumably you're going to submit this code back to mainline + and since you're the only one who cares about this arch (right now), you + should add yourself to the toplevel MAINTAINERS file. do it. From carmelo at uclibc.org Sun Mar 16 00:35:05 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Sun, 16 Mar 2008 00:35:05 -0700 (PDT) Subject: svn commit: trunk/uClibc/extra/locale Message-ID: <20080316073505.20B3212011B@busybox.net> Author: carmelo Date: 2008-03-16 00:35:04 -0700 (Sun, 16 Mar 2008) New Revision: 21332 Log: Remove extra file separator Modified: trunk/uClibc/extra/locale/Makefile.in Changeset: Modified: trunk/uClibc/extra/locale/Makefile.in =================================================================== --- trunk/uClibc/extra/locale/Makefile.in 2008-03-16 07:34:24 UTC (rev 21331) +++ trunk/uClibc/extra/locale/Makefile.in 2008-03-16 07:35:04 UTC (rev 21332) @@ -12,7 +12,7 @@ BUILD_CFLAGS-locale-common := \ -D__UCLIBC_GEN_LOCALE \ - -DUCLIBC_CTYPE_HEADER='"$(top_builddir)/include/bits/uClibc_ctype.h"' + -DUCLIBC_CTYPE_HEADER='"$(top_builddir)include/bits/uClibc_ctype.h"' BUILD_CFLAGS-gen_wc8bit := $(BUILD_CFLAGS-locale-common) -DCTYPE_PACKED=1 From carmelo at uclibc.org Sun Mar 16 00:39:52 2008 From: carmelo at uclibc.org (carmelo at uclibc.org) Date: Sun, 16 Mar 2008 00:39:52 -0700 (PDT) Subject: svn commit: branches/uClibc-nptl/extra/Configs: defconfigs Message-ID: <20080316073952.5345B12011B@busybox.net> Author: carmelo Date: 2008-03-16 00:39:51 -0700 (Sun, 16 Mar 2008) New Revision: 21333 Log: Merge nptl branch tree with trunk. Step 4: merge extra/Configs folder Signed-off-by: Carmelo Amoroso Added: branches/uClibc-nptl/extra/Configs/Config.avr32 branches/uClibc-nptl/extra/Configs/Config.xtensa branches/uClibc-nptl/extra/Configs/defconfigs/ branches/uClibc-nptl/extra/Configs/defconfigs/alpha branches/uClibc-nptl/extra/Configs/defconfigs/arm branches/uClibc-nptl/extra/Configs/defconfigs/avr32 branches/uClibc-nptl/extra/Configs/defconfigs/bfin branches/uClibc-nptl/extra/Configs/defconfigs/cris branches/uClibc-nptl/extra/Configs/defconfigs/e1 branches/uClibc-nptl/extra/Configs/defconfigs/frv branches/uClibc-nptl/extra/Configs/defconfigs/h8300 branches/uClibc-nptl/extra/Configs/defconfigs/hppa branches/uClibc-nptl/extra/Configs/defconfigs/i386 branches/uClibc-nptl/extra/Configs/defconfigs/i960 branches/uClibc-nptl/extra/Configs/defconfigs/ia64 branches/uClibc-nptl/extra/Configs/defconfigs/m68k branches/uClibc-nptl/extra/Configs/defconfigs/microblaze branches/uClibc-nptl/extra/Configs/defconfigs/mips branches/uClibc-nptl/extra/Configs/defconfigs/nios branches/uClibc-nptl/extra/Configs/defconfigs/nios2 branches/uClibc-nptl/extra/Configs/defconfigs/powerpc branches/uClibc-nptl/extra/Configs/defconfigs/sh branches/uClibc-nptl/extra/Configs/defconfigs/sh64 branches/uClibc-nptl/extra/Configs/defconfigs/sparc branches/uClibc-nptl/extra/Configs/defconfigs/v850 branches/uClibc-nptl/extra/Configs/defconfigs/vax branches/uClibc-nptl/extra/Configs/defconfigs/x86_64 Removed: branches/uClibc-nptl/extra/Configs/Config.default Modified: branches/uClibc-nptl/extra/Configs/Config.alpha branches/uClibc-nptl/extra/Configs/Config.arm branches/uClibc-nptl/extra/Configs/Config.bfin branches/uClibc-nptl/extra/Configs/Config.cris branches/uClibc-nptl/extra/Configs/Config.e1 branches/uClibc-nptl/extra/Configs/Config.frv branches/uClibc-nptl/extra/Configs/Config.h8300 branches/uClibc-nptl/extra/Configs/Config.hppa branches/uClibc-nptl/extra/Configs/Config.i386 branches/uClibc-nptl/extra/Configs/Config.i960 branches/uClibc-nptl/extra/Configs/Config.ia64 branches/uClibc-nptl/extra/Configs/Config.in branches/uClibc-nptl/extra/Configs/Config.in.arch branches/uClibc-nptl/extra/Configs/Config.m68k branches/uClibc-nptl/extra/Configs/Config.microblaze branches/uClibc-nptl/extra/Configs/Config.mips branches/uClibc-nptl/extra/Configs/Config.nios branches/uClibc-nptl/extra/Configs/Config.nios2 branches/uClibc-nptl/extra/Configs/Config.powerpc branches/uClibc-nptl/extra/Configs/Config.sh branches/uClibc-nptl/extra/Configs/Config.sh64 branches/uClibc-nptl/extra/Configs/Config.sparc branches/uClibc-nptl/extra/Configs/Config.v850 branches/uClibc-nptl/extra/Configs/Config.vax branches/uClibc-nptl/extra/Configs/Config.x86_64 Changeset: Modified: branches/uClibc-nptl/extra/Configs/Config.alpha =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.alpha 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.alpha 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "alpha" config FORCE_OPTIONS_FOR_ARCH @@ -16,6 +17,3 @@ config ARCH_CFLAGS string - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.arm =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.arm 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.arm 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "arm" config FORCE_OPTIONS_FOR_ARCH @@ -14,9 +15,6 @@ config ARCH_CFLAGS string -config LIBGCC_CFLAGS - string - choice prompt "Target ABI" default CONFIG_ARM_OABI @@ -101,6 +99,14 @@ bool "Arm 1136JF-S" select ARCH_HAS_MMU +config CONFIG_ARM1176JZ_S + bool "Arm 1176JZ-S" + select ARCH_HAS_MMU + +config CONFIG_ARM1176JZF_S + bool "Arm 1176JZF-S" + select ARCH_HAS_MMU + config CONFIG_ARM_SA110 bool "Intel StrongArm SA-110" select ARCH_HAS_MMU Added: branches/uClibc-nptl/extra/Configs/Config.avr32 =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.avr32 (rev 0) +++ branches/uClibc-nptl/extra/Configs/Config.avr32 2008-03-16 07:39:51 UTC (rev 21333) @@ -0,0 +1,31 @@ +# +# For a description of the syntax of this configuration file, +# see extra/config/Kconfig-language.txt +# + +config TARGET_ARCH + string + default "avr32" + +config FORCE_OPTIONS_FOR_ARCH + bool + default y + select ARCH_BIG_ENDIAN + select FORCE_SHAREABLE_TEXT_SEGMENTS + +config ARCH_CFLAGS + string + +choice + prompt "Target CPU Type" + default CONFIG_AVR32_AP7 + +config CONFIG_AVR32_AP7 + bool "AVR32 AP7" + select ARCH_HAS_MMU + +endchoice + +config LINKRELAX + bool "Enable linker optimizations" + default y Modified: branches/uClibc-nptl/extra/Configs/Config.bfin =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.bfin 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.bfin 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "bfin" config FORCE_OPTIONS_FOR_ARCH @@ -15,6 +16,3 @@ config ARCH_CFLAGS string - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.cris =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.cris 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.cris 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "cris" config FORCE_OPTIONS_FOR_ARCH @@ -14,9 +15,6 @@ config ARCH_CFLAGS string -config LIBGCC_CFLAGS - string - choice prompt "Target Architecture Type" default CONFIG_CRIS Deleted: branches/uClibc-nptl/extra/Configs/Config.default =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.default 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.default 2008-03-16 07:39:51 UTC (rev 21333) @@ -1,2 +0,0 @@ -# This file is empty to let people select their own -# build options however they like.... Modified: branches/uClibc-nptl/extra/Configs/Config.e1 =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.e1 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.e1 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "e1" config FORCE_OPTIONS_FOR_ARCH @@ -20,6 +21,3 @@ config ARCH_CFLAGS string default "-mgnu-param" - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.frv =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.frv 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.frv 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "frv" config FORCE_OPTIONS_FOR_ARCH @@ -15,6 +16,3 @@ config ARCH_CFLAGS string - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.h8300 =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.h8300 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.h8300 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "h8300" config FORCE_OPTIONS_FOR_ARCH @@ -28,6 +29,3 @@ config ARCH_CFLAGS string - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.hppa =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.hppa 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.hppa 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "hppa" config FORCE_OPTIONS_FOR_ARCH @@ -17,6 +18,3 @@ config ARCH_CFLAGS string - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.i386 =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.i386 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.i386 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "i386" config FORCE_OPTIONS_FOR_ARCH @@ -12,12 +13,6 @@ select ARCH_LITTLE_ENDIAN select ARCH_HAS_MMU -config ARCH_CFLAGS - string - -config LIBGCC_CFLAGS - string - choice prompt "Target x86 Processor Family" default CONFIG_GENERIC_386 Modified: branches/uClibc-nptl/extra/Configs/Config.i960 =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.i960 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.i960 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "i960" config FORCE_OPTIONS_FOR_ARCH @@ -16,6 +17,3 @@ config ARCH_CFLAGS string default "-mh -mint32 -fsigned-char" - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.ia64 =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.ia64 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.ia64 2008-03-16 07:39:51 UTC (rev 21333) @@ -4,6 +4,7 @@ # config TARGET_ARCH + string default "ia64" config FORCE_OPTIONS_FOR_ARCH @@ -15,6 +16,3 @@ config ARCH_CFLAGS string - -config LIBGCC_CFLAGS - string Modified: branches/uClibc-nptl/extra/Configs/Config.in =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.in 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.in 2008-03-16 07:39:51 UTC (rev 21333) @@ -16,6 +16,9 @@ config TARGET_arm bool "arm" +config TARGET_avr32 + bool "avr32" + config TARGET_bfin bool "bfin" @@ -79,6 +82,9 @@ config TARGET_x86_64 bool "x86_64" +config TARGET_xtensa + bool "xtensa" + endchoice @@ -92,6 +98,10 @@ source "extra/Configs/Config.arm" endif +if TARGET_avr32 +source "extra/Configs/Config.avr32" +endif + if TARGET_bfin source "extra/Configs/Config.bfin" endif @@ -176,6 +186,10 @@ source "extra/Configs/Config.x86_64" endif +if TARGET_xtensa +source "extra/Configs/Config.xtensa" +endif + config TARGET_SUBARCH string default "e500" if CONFIG_E500 @@ -460,7 +474,7 @@ help The behavior of malloc(0) is listed as implementation-defined by SuSv3. Glibc returns a valid pointer to something, while uClibc - normally return a NULL. I personally feel glibc's behavior is + normally returns NULL. I personally feel glibc's behavior is not particularly safe, and allows buggy applications to hide very serious problems. @@ -468,7 +482,7 @@ return a live pointer when someone calls malloc(0). This pointer provides a malloc'ed area with a size of 1 byte. This feature is mostly useful when dealing with applications using autoconf's broken - AC_FUNC_MALLOC macro (which redefines malloc as rpl_malloc if it + AC_FUNC_MALLOC macro (which redefines malloc as rpl_malloc if it does not detect glibc style returning-a-valid-pointer-for-malloc(0) behavior). Most people can safely answer N. @@ -634,6 +648,30 @@ endmenu +menu "Advanced Library Settings" + +config UCLIBC_PWD_BUFFER_SIZE + int "Buffer size for getpwnam() and friends" + default 256 + range 12 1024 + help + This sets the value of the buffer size for getpwnam() and friends. + By default, this is 256. (For reference, glibc uses 1024). + The value can be found using sysconf() with the _SC_GETPW_R_SIZE_MAX + parameter. + +config UCLIBC_GRP_BUFFER_SIZE + int "Buffer size for getgrnam() and friends" + default 256 + range 256 1024 + help + This sets the value of the buffer size for getgrnam() and friends. + By default, this is 256. (For reference, glibc uses 1024). + The value can be found using sysconf() with the _SC_GETGR_R_SIZE_MAX + parameter. + +endmenu + menu "Networking Support" config UCLIBC_HAS_IPV6 @@ -686,6 +724,15 @@ Most people can safely answer N. +config UCLIBC_HAS_BSD_RES_CLOSE + bool "Support res_close() (bsd-compat)" + default n + help + Answer Y if you desperately want to support BSD compatibility in + the network code. + + Most people will say N. + endmenu @@ -1097,6 +1144,8 @@ Most people will answer N. + Application writers: use the strerror(3) function. + config UCLIBC_HAS_SIGNUM_MESSAGES bool "Include the signum message text in the library" default y Modified: branches/uClibc-nptl/extra/Configs/Config.in.arch =================================================================== --- branches/uClibc-nptl/extra/Configs/Config.in.arch 2008-03-16 07:35:04 UTC (rev 21332) +++ branches/uClibc-nptl/extra/Configs/Config.in.arch 2008-03-16 07:39:51 UTC (rev 21333) @@ -123,8 +123,8 @@ such as printf() and scanf() will still be included in the library, but will not contain support for floating point numbers. - Answering N to this option can reduce the size of uClibc. Most people - will answer Y. + Answering N to this option can reduce the size of uClibc. + Most people will answer Y. config UC