summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MAINTAINERS13
-rw-r--r--Makefile.in110
-rw-r--r--Makerules70
-rw-r--r--Rules.mak118
-rw-r--r--TODO43
-rw-r--r--debian/config2
-rw-r--r--docs/PORTING117
-rw-r--r--docs/uclibc.org/copyright.txt2
-rw-r--r--docs/uclibc.org/footer.html2
-rw-r--r--docs/uclibc.org/lists.html31
-rw-r--r--libpthread/linuxthreads.old/Makefile.in41
-rw-r--r--libpthread/linuxthreads.old/attr.c8
-rw-r--r--libpthread/linuxthreads.old/condvar.c14
-rw-r--r--libpthread/linuxthreads.old/forward.c20
-rw-r--r--libpthread/linuxthreads.old/internals.h42
-rw-r--r--libpthread/linuxthreads.old/join.c1
-rw-r--r--libpthread/linuxthreads.old/libc_pthread_init.c9
-rw-r--r--libpthread/linuxthreads.old/locale.c1
-rw-r--r--libpthread/linuxthreads.old/lockfile.c14
-rw-r--r--libpthread/linuxthreads.old/manager.c35
-rw-r--r--libpthread/linuxthreads.old/mutex.c58
-rw-r--r--libpthread/linuxthreads.old/oldsemaphore.c6
-rw-r--r--libpthread/linuxthreads.old/ptfork.c18
-rw-r--r--libpthread/linuxthreads.old/pthread.c41
-rw-r--r--libpthread/linuxthreads.old/ptlongjmp.c13
-rw-r--r--libpthread/linuxthreads.old/semaphore.c7
-rw-r--r--libpthread/linuxthreads.old/signals.c11
-rw-r--r--libpthread/linuxthreads.old/specific.c13
-rw-r--r--libpthread/linuxthreads.old/spinlock.c4
-rw-r--r--libpthread/linuxthreads.old/sysdeps/h8300/pt-machine.h58
-rw-r--r--libpthread/linuxthreads.old/wrapsyscall.c4
-rw-r--r--libpthread/linuxthreads.old_db/Makefile.in25
-rw-r--r--libpthread/linuxthreads.old_db/td_init.c3
-rw-r--r--libpthread/linuxthreads.old_db/thread_dbP.h10
-rw-r--r--libpthread/linuxthreads_db/Makefile.in26
-rw-r--r--libpthread/linuxthreads_db/td_init.c3
-rw-r--r--libpthread/linuxthreads_db/thread_dbP.h8
-rw-r--r--utils/Makefile.in6
-rw-r--r--utils/ldconfig.c6
-rw-r--r--utils/ldd.c3
40 files changed, 657 insertions, 359 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index a76dc8d05..76315d3ff 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -40,8 +40,8 @@ S: Maintained
CRIS
-P: Tobias Anderberg
-M: tobias.anderberg@axis.com
+P: Ricard Wanderlof
+M: ricard.wanderlof@axis.com
W: http://developer.axis.com
S: Maintained
@@ -62,6 +62,10 @@ HPPA
S: Unmaintained
+IA64
+S: Unmaintained
+
+
I386
N: Erik Andersen
E: andersen@codepoet.org
@@ -108,6 +112,11 @@ S: Maintained
SPARC
S: Unmaintained
+VAX
+P: Jan-Benedict Glaw
+E: jbglaw@lug-owl.de (personal), linux-vax@pergamentum.com (mailing list)
+W: http://linux-vax.sourceforge.net/
+S: Maintained
V850
S: Unmaintained
diff --git a/Makefile.in b/Makefile.in
index 9529c9261..7188f5c82 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -13,6 +13,7 @@ noconfig_targets := menuconfig config oldconfig randconfig \
release dist tags
include $(top_builddir)Rules.mak
+sub_headers := headers
ifeq ($(HAVE_DOT_CONFIG),y)
@@ -44,36 +45,41 @@ include/bits/uClibc_config.h: extra/config/conf .config
# in order to generate the headers correctly :(. That
# means we can't use the $(HOSTCC) in order to get the
# correct output.
-ifeq ($(ARCH_HAS_MMU),y)
+ifeq ($(ARCH_USE_MMU),y)
export header_extra_args =
else
export header_extra_args = -n
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: include/bits/uClibc_config.h
- $(MAKE) headers-y
- @$(SHELL_SET_X); \
+ $(Q)$(MAKE) headers-y
+ $(Q)\
$(SHELL) $(top_srcdir)extra/scripts/fix_includes.sh \
-k $(KERNEL_SOURCE) -t $(TARGET_ARCH) \
$(header_extra_args)
+ $(Q)\
+ set -e; \
if [ -f 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/ ; \
- fi
+ fi; \
for f in dl-osinfo.h hp-timing.h ; do \
$(LN) -fs ../libc/sysdeps/linux/common/$$f include/ ; \
done
- @cd include/bits; \
+ $(Q)\
+ cd include/bits; \
set -e; \
- for i in `ls ../../libc/sysdeps/linux/common/bits/*.h` ; do \
- $(LN) -fs $$i .; \
+ for i in $(HEADERS_BITS_COMMON) ; do \
+ $(LN) -fs ../../libc/sysdeps/linux/common/bits/$$i .; \
done; \
- if [ -d ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits ] ; then \
- for i in `ls ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/*.h` ; do \
- $(LN) -fs $$i .; \
- done; \
- fi
- @cd include/sys; \
+ for i in $(HEADERS_BITS_ARCH) ; do \
+ $(LN) -fs ../../libc/sysdeps/linux/$(TARGET_ARCH)/bits/$$i .; \
+ done
+ $(Q)\
+ cd include/sys; \
set -e; \
for i in `ls ../../libc/sysdeps/linux/common/sys/*.h` ; do \
$(LN) -fs $$i .; \
@@ -83,15 +89,16 @@ headers: include/bits/uClibc_config.h
$(LN) -fs $$i .; \
done; \
fi
- @cd $(top_builddir); \
+ $(Q)\
set -e; \
- $(SHELL_SET_X); \
- top_builddir=. CC="$(CC)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > include/bits/sysnum.h.new; \
- if cmp include/bits/sysnum.h include/bits/sysnum.h.new >/dev/null 2>&1; then \
- $(RM) include/bits/sysnum.h.new; \
+ cd $(top_builddir); \
+ tmp=`mktemp include/bits/sysnum.h.XXXXXX 2>/dev/null`; \
+ [ -z "$$tmp" ] && tmp='include/bits/sysnum.h.new'; \
+ top_builddir=. CC="$(CC)" $(SHELL) extra/scripts/gen_bits_syscall_h.sh > $$tmp; \
+ if cmp include/bits/sysnum.h $$tmp >/dev/null 2>&1; then \
+ $(RM) $$tmp; \
else \
- $(RM) include/bits/sysnum.h; \
- mv -f include/bits/sysnum.h.new include/bits/sysnum.h; \
+ mv -f $$tmp include/bits/sysnum.h; \
fi
ifeq ($(UCLIBC_HAS_LOCALE),y)
$(MAKE) locale_headers
@@ -112,14 +119,14 @@ RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/rela
# Installs header files.
install_headers:
$(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include
- if [ "$(KERNEL_SOURCE)" = "$(DEVEL_PREFIX)" ] ; then \
- extra_exclude="--exclude include/linux --exclude include/asm'*'" ; \
- else \
- extra_exclude="" ; \
+ printf ".svn\n.cvsignore\nCVS\n" > tar_exclude ; \
+ if [ "$(KERNEL_SOURCE)" = "$(PREFIX)$(DEVEL_PREFIX)" ] ; then \
+ ls -1d include/linux include/asm* >> tar_exclude ; \
fi ; \
- $(TAR) -chf - --exclude .svn $$extra_exclude include \
+ $(TAR) -chf - -X tar_exclude include \
| $(TAR) -xf - -C $(PREFIX)$(DEVEL_PREFIX)
- echo -e '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' > \
+ 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
$(RM) $(PREFIX)$(DEVEL_PREFIX)include/dl-osinfo.h
$(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/uClibc_uintmaxtostr.h
@@ -189,13 +196,13 @@ ifneq ($(UCLIBC_HAS_THREADS),y)
$(RM) $(PREFIX)$(DEVEL_PREFIX)include/bits/*thread*.h
endif
ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y)
- # Remove this as it is only used internally.
+ # Remove this as it is only used for building.
$(RM) $(PREFIX)$(DEVEL_PREFIX)include/tls.h
endif
- -@for i in `find $(PREFIX)$(DEVEL_PREFIX) -type d` ; do \
+ -@for i in `find $(PREFIX)$(DEVEL_PREFIX)include -type d` ; do \
chmod 755 $$i; chmod 644 $$i/*.h > /dev/null 2>&1; \
done
- -chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$$/\1:\2/'` $(PREFIX)$(DEVEL_PREFIX)
+ -chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$$/\1:\2/'` $(PREFIX)$(DEVEL_PREFIX)include
# Installs development library links.
install_dev: install_headers
@@ -237,16 +244,16 @@ ifeq ($(HAVE_SHARED),y)
$(INSTALL) -m 644 lib/lib*-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
$(PREFIX)$(RUNTIME_PREFIX)lib
cp -dRf lib/*.so.* $(PREFIX)$(RUNTIME_PREFIX)lib
- @if [ -x lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
+ @if [ -x lib/$(UCLIBC_LDSO_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so ] ; then \
set -e; \
$(SHELL_SET_X); \
- $(INSTALL) -m 755 lib/ld-uClibc-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
+ $(INSTALL) -m 755 lib/$(UCLIBC_LDSO_NAME)-$(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL).so \
$(PREFIX)$(RUNTIME_PREFIX)lib; \
fi
endif
utils:
- $(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils
+ $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" -C utils
# Installs helper applications, such as 'ldd' and 'ldconfig'
install_utils: utils
@@ -268,54 +275,39 @@ extra/config/conf extra/config/mconf:
$(MAKE) -C extra/config $(notdir $@)
menuconfig: extra/config/mconf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/mconf extra/Configs/Config.in
- $(MAKE) headers
+ $(Q)./extra/config/mconf extra/Configs/Config.in
config: extra/config/conf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/conf extra/Configs/Config.in
+ $(Q)./extra/config/conf extra/Configs/Config.in
oldconfig: extra/config/conf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/conf -o extra/Configs/Config.in
+ $(Q)./extra/config/conf -o extra/Configs/Config.in
randconfig: extra/config/conf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/conf -r extra/Configs/Config.in
+ $(Q)./extra/config/conf -r extra/Configs/Config.in
allyesconfig: extra/config/conf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/conf -y extra/Configs/Config.in
+ $(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
sed -i -e "s/^SUPPORT_LD_DEBUG_EARLY=.*/# SUPPORT_LD_DEBUG_EARLY is not set/" .config
sed -i -e "s/^SUPPORT_LD_DEBUG=.*/# SUPPORT_LD_DEBUG is not set/" .config
sed -i -e "s/^UCLIBC_MJN3_ONLY=.*/# UCLIBC_MJN3_ONLY is not set/" .config
- @./extra/config/conf -o extra/Configs/Config.in
+ $(Q)./extra/config/conf -o extra/Configs/Config.in
allnoconfig: extra/config/conf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/conf -n extra/Configs/Config.in
+ $(Q)./extra/config/conf -n extra/Configs/Config.in
defconfig: extra/config/conf
- $(RM) -r include/bits
- $(INSTALL) -d include/bits
- @./extra/config/conf -d extra/Configs/Config.in
+ $(Q)./extra/config/conf -d extra/Configs/Config.in
clean:
- @$(RM) -r lib include/bits
+ $(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) -C test clean
+ $(MAKE) -s -C test clean
$(MAKE) -C utils utils_clean
@set -e; \
for i in `(cd libc/sysdeps/linux/common/sys; ls *.h)` ; do \
@@ -342,5 +334,5 @@ dist release:
$(TAR) czf ../uClibc-$(VERSION).tar.gz -C .. uClibc-$(VERSION)
du -b ../uClibc-$(VERSION).tar.gz
-check:
- $(MAKE) -C test
+test check:
+ $(Q)$(MAKE) -C test
diff --git a/Makerules b/Makerules
index 76dc79b43..d5e864145 100644
--- a/Makerules
+++ b/Makerules
@@ -8,16 +8,17 @@
ifeq ($(HAVE_SHARED),y)
.LIBPATTERNS: "lib%.so"
libs: $(lib-so-y) $(lib-a-y)
+$(lib-so-y): $(interp)
else
.LIBPATTERNS: "lib%.a"
libs: $(lib-a-y)
endif
objs: all_objs
-shared_objs = $(ld-uClibc-so-y) $(libc-so-y) $(libc-nonshared-y) $(libdl-so-y)
+shared_objs = $(ldso-y) $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) $(libdl-so-y)
shared_objs += $(libcrypt-so-y) $(libintl-so-y) $(libm-so-y) $(libnsl-so-y) $(libpthread-so-y)
shared_objs += $(libthread_db-so-y) $(libresolv-so-y) $(librt-so-y) $(libutil-so-y)
-ar_objs = $(libc-a-y) $(libdl-a-y) $(libcrypt-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y)
+ar_objs = $(libc-y) $(libc-static-y) $(libdl-a-y) $(libcrypt-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y)
ar_objs += $(libpthread-a-y) $(libthread_db-a-y) $(libresolv-a-y) $(librt-a-y) $(libutil-a-y)
ifeq ($(DOPIC),y)
ar_objs := $(ar_objs:.o=.os)
@@ -28,14 +29,23 @@ all_objs: $(sort $(shared_objs) $(ar_objs))
else
all_objs: $(ar_objs)
endif
+$(shared_objs) $(ar_objs): | $(sub_headers)
headers-y: $(headers-y)
+ @true
+MAKEFLAGS += --no-print-directory
+SHELL_SET_X := set +x
ifneq ($(findstring s,$(MAKEFLAGS)),)
+export MAKE_IS_SILENT := y
+SECHO := -@false
DISP := sil
Q := @
else
+export MAKE_IS_SILENT := n
+SECHO := @echo
ifneq ($(V)$(VERBOSE),)
+SHELL_SET_X := set -x
DISP := ver
Q :=
else
@@ -51,6 +61,7 @@ pur_disp_compile.S = echo " "AS $(show_objs)
pur_disp_compile.m = $(pur_disp_compile.c)
pur_disp_compile-m = echo " "CC-m $(show_objs)
pur_disp_strip = echo " "STRIP $(STRIP_FLAGS) $@
+pur_disp_t_strip = echo " "STRIP $(STRIP_FLAGS) $@
pur_disp_ar = echo " "AR $(ARFLAGS) $@
pur_disp_ld = echo " "LD $(1)
@@ -59,6 +70,7 @@ sil_disp_compile.S = true
sil_disp_compile.m = true
sil_disp_compile-m = true
sil_disp_strip = true
+sil_disp_t_strip = true
sil_disp_ar = true
sil_disp_ld = true
@@ -67,6 +79,7 @@ ver_disp_compile.S = echo $(cmd_compile.S)
ver_disp_compile.m = echo $(cmd_compile.m)
ver_disp_compile-m = echo $(cmd_compile-m)
ver_disp_strip = echo $(cmd_strip)
+ver_disp_t_strip = echo $(cmd_t_strip)
ver_disp_ar = echo $(cmd_ar)
ver_disp_ld =
@@ -75,14 +88,17 @@ disp_compile.S = $($(DISP)_disp_compile.S)
disp_compile.m = $($(DISP)_disp_compile.m)
disp_compile-m = $($(DISP)_disp_compile-m)
disp_strip = $($(DISP)_disp_strip)
+disp_t_strip = $($(DISP)_disp_t_strip)
disp_ar = $($(DISP)_disp_ar)
disp_ld = $($(DISP)_disp_ld)
cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(filter-out $(CFLAGS-OMIT-$(notdir $<)), $(CFLAGS-$(notdir $(^D)))) $(CFLAGS-$(subst $(top_srcdir),,$(dir $<))) $(CFLAGS-$(notdir $<)) $(CFLAGS-$(notdir $@))
cmd_compile.S = $(cmd_compile.c) $(ASFLAGS) $(ARCH_ASFLAGS) $(ASFLAGS-$(suffix $@)) $(ASFLAGS-$(notdir $<)) $(ASFLAGS-$(notdir $@))
cmd_compile.m = $(cmd_compile.c) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
-cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $@)) $(CFLAGS-multi-y)
+cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@))
+#cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(ARCH_CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(CFLAGS-multi-y)
cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
+cmd_t_strip = $(STRIPTOOL) $(STRIP_FLAGS) $@
cmd_ar = $(AR) $(ARFLAGS) $@ $^
compile.c = @$(disp_compile.c) ; $(cmd_compile.c)
@@ -92,6 +108,7 @@ compile.S = @$(disp_compile.S) ; $(cmd_compile.S)
compile.m = @$(disp_compile.m) ; $(cmd_compile.m)
compile-m = @$(disp_compile-m) ; $(cmd_compile-m)
do_strip = @$(disp_strip) ; $(cmd_strip)
+do_t_strip= @$(disp_t_strip) ; $(cmd_t_strip)
do_ar = @$(disp_ar) ; $(cmd_ar)
define compile.u
@@ -115,6 +132,17 @@ define link.so
$(Q)$(LN) -sf $(1) $@
endef
+define linkm.so
+ $(Q)$(INSTALL) -d $(dir $@)
+ $(Q)$(RM) $@ $@.$(2) $(dir $@)$(1)
+ @$(disp_ld)
+ $(Q)$(LD) $(LDFLAGS-$(notdir $@)) -soname=$(notdir $@).$(2) \
+ -o $(dir $@)$(1) $(START_FILE-$(notdir $@)) $^ \
+ $(LIBS-$(notdir $@)) $(LIBGCC) $(END_FILE-$(notdir $@))
+ $(Q)$(LN) -sf $(1) $@.$(2)
+ $(Q)$(LN) -sf $(1) $@
+endef
+
CFLAGS-.os+=$(PICFLAG)
CFLAGS-.oS+=$(PICFLAG) -DSHARED
@@ -129,17 +157,17 @@ CFLAGS-.oS+=$(PICFLAG) -DSHARED
%.oS: %.s ; $(compile.S)
%.E: %.c ; $(compile.E)
%.E: %.S ; $(compile.E)
+%.i: %.c ; $(compile.E)
+%.i: %.S ; $(compile.E)
%.s: %.c ; $(compile.s)
%.s: %.S ; $(compile.s)
-$(top_builddir)lib/interp.c:
+$(top_builddir)lib/interp.c: | $(sub_headers)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)echo "/* Force shared libraries to know about the correct library loader */" > $@
$(Q)echo "#include <features.h>" >> $@
- $(Q)echo "#ifdef __HAVE_ELF__" >> $@
$(Q)echo "const char __dl_ldso__[] __attribute__ ((section " \
"(\".interp\"))) =\""$(SHARED_LIB_LOADER_PREFIX)/$(UCLIBC_LDSO)"\";" >> $@
- $(Q)echo "#endif" >> $@
$(interp): $(top_builddir)lib/interp.c
$(compile.c)
@@ -152,13 +180,9 @@ $(libc):
@cd $(top_builddir); $(MAKE) lib/$(patsubst %.$(MAJOR_VERSION),%,$(notdir $@))
$(headers_dep):
- @cd $(top_builddir); $(MAKE) headers
+ $(Q)cd $(top_builddir); $(MAKE) headers
-#ifeq ($(HAVE_ELF),y)
-CRT=crt1
-#else
-#CRT=crt0
-#endif
+CRT := crt1
ifeq ($(HAVE_SHARED),y)
CRTS=$(top_builddir)lib/$(CRT).o $(top_builddir)lib/S$(CRT).o
@@ -166,14 +190,11 @@ else
CRTS=$(top_builddir)lib/$(CRT).o
endif
-$(top_builddir)lib/$(CRT).o: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
- $(Q)$(INSTALL) -d $(dir $@)
- $(compile.S) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
- $(Q)$(STRIPTOOL) -x -R .note -R .comment $@
-
-$(top_builddir)lib/S$(CRT).o: $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
+ASFLAGS-$(CRT).o := -DL_$(CRT)
+ASFLAGS-S$(CRT).o := $(PIEFLAG) -DL_S$(CRT)
+$(CRTS): $(top_srcdir)libc/sysdeps/linux/$(TARGET_ARCH)/$(CRT).S
$(Q)$(INSTALL) -d $(dir $@)
- $(compile.S) $(PIEFLAG) -DL_$(patsubst %$(suffix $(notdir $@)),%,$(notdir $@))
+ $(compile.S)
$(Q)$(STRIPTOOL) -x -R .note -R .comment $@
CTOR_TARGETS=$(top_builddir)lib/crti.o $(top_builddir)lib/crtn.o
@@ -188,7 +209,16 @@ $(CTOR_TARGETS):
$(do_ar)
endif
-$(crt-y): $(CRTS) $(CTOR_TARGETS)
+#ifeq ($(TARGET_ARCH),nios)
+#CRTS_COMPAT := $(top_builddir)lib/crt0.o
+#$(CRTS_COMPAT):
+# ln -fs crt1.o $(top_builddir)lib/crt0.o
+#else
+CRTS_COMPAT :=
+#endif
+
+$(crt-y): $(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT)
+$(CRTS) $(CTOR_TARGETS) $(CRTS_COMPAT): | headers
$(top_builddir)lib/$(NONSHARED_LIBNAME): $(libc-nonshared-y)
$(Q)$(INSTALL) -d $(dir $@)
diff --git a/Rules.mak b/Rules.mak
index ad36d6749..d3fc95706 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -1,7 +1,7 @@
# Rules.make for uClibc
#
# Copyright (C) 2000 by Lineo, inc.
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
@@ -49,6 +49,22 @@ BUILD_CFLAGS = -O2 -Wall
# Nothing beyond this point should ever be touched by mere
# mortals. Unless you hang out with the gods, you should
# probably leave all this stuff alone.
+
+# Pull in the user's uClibc configuration
+ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
+-include $(top_builddir).config
+endif
+
+# Make certain these contain a final "/", but no "//"s.
+TARGET_ARCH:=$(shell grep -s '^TARGET_ARCH' $(top_builddir)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g')
+TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH))))
+RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
+DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX))))))
+KERNEL_SOURCE:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(KERNEL_SOURCE))))))
+export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_SOURCE
+
+
+# Now config hard core
MAJOR_VERSION := 0
MINOR_VERSION := 9
SUBLEVEL := 28
@@ -59,12 +75,18 @@ export MAJOR_VERSION MINOR_VERSION SUBLEVEL VERSION LC_ALL
LIBC := libc
SHARED_MAJORNAME := $(LIBC).so.$(MAJOR_VERSION)
-UCLIBC_LDSO := ld-uClibc.so.$(MAJOR_VERSION)
+ifneq ($(findstring $(TARGET_ARCH) , hppa64 ia64 mips64 powerpc64 s390x sh64 sparc64 x86_64 ),)
+UCLIBC_LDSO_NAME := ld64-uClibc
+else
+UCLIBC_LDSO_NAME := ld-uClibc
+endif
+UCLIBC_LDSO := $(UCLIBC_LDSO_NAME).so.$(MAJOR_VERSION)
NONSHARED_LIBNAME := uclibc_nonshared.a
libc := $(top_builddir)lib/$(SHARED_MAJORNAME)
interp := $(top_builddir)lib/interp.os
ldso := $(top_builddir)lib/$(UCLIBC_LDSO)
headers_dep := $(top_builddir)include/bits/sysnum.h
+sub_headers := $(headers_dep)
#LIBS :=$(interp) -L$(top_builddir)lib -lc
LIBS := $(interp) -L$(top_builddir)lib $(libc:.$(MAJOR_VERSION)=)
@@ -75,9 +97,10 @@ ifndef PREFIX
PREFIX = $(DESTDIR)
endif
-# Pull in the user's uClibc configuration
-ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
--include $(top_builddir).config
+ifneq ($(HAVE_SHARED),y)
+libc :=
+interp :=
+ldso :=
endif
ifndef CROSS
@@ -91,25 +114,9 @@ check_gcc=$(shell \
check_as=$(shell \
if $(CC) -Wa,$(1) -Wa,-Z -c -o /dev/null -xassembler /dev/null > /dev/null 2>&1; \
then echo "-Wa,$(1)"; fi)
-
-# Setup some shortcuts so that silent mode is silent like it should be
-ifeq ($(findstring s,$(MAKEFLAGS)),)
-export MAKE_IS_SILENT=n
-SECHO=@echo
-SHELL_SET_X=set -x
-else
-export MAKE_IS_SILENT=y
-SECHO=-@false
-SHELL_SET_X=set +x
-endif
-
-# Make certain these contain a final "/", but no "//"s.
-TARGET_ARCH:=$(shell grep -s '^TARGET_ARCH' $(top_builddir)/.config | sed -e 's/^TARGET_ARCH=//' -e 's/"//g')
-TARGET_ARCH:=$(strip $(subst ",, $(strip $(TARGET_ARCH))))
-RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(RUNTIME_PREFIX))))))
-DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(DEVEL_PREFIX))))))
-KERNEL_SOURCE:=$(strip $(subst //,/, $(subst ,/, $(subst ",, $(strip $(KERNEL_SOURCE))))))
-export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_SOURCE
+check_ld=$(shell \
+ if $(LD) $(1) -o /dev/null -b binary /dev/null > /dev/null 2>&1; \
+ then echo "$(1)"; fi)
ARFLAGS:=cr
@@ -155,6 +162,7 @@ ifeq ($(TARGET_ARCH),arm)
CPU_CFLAGS-$(CONFIG_GENERIC_ARM)+=
CPU_CFLAGS-$(CONFIG_ARM610)+=-mtune=arm610 -march=armv3
CPU_CFLAGS-$(CONFIG_ARM710)+=-mtune=arm710 -march=armv3
+ CPU_CFLAGS-$(CONFIG_ARM7TDMI)+=-mtune=arm7tdmi -march=armv4
CPU_CFLAGS-$(CONFIG_ARM720T)+=-mtune=arm7tdmi -march=armv4
CPU_CFLAGS-$(CONFIG_ARM920T)+=-mtune=arm9tdmi -march=armv4
CPU_CFLAGS-$(CONFIG_ARM922T)+=-mtune=arm9tdmi -march=armv4
@@ -212,8 +220,8 @@ endif
ifeq ($(TARGET_ARCH),h8300)
CPU_LDFLAGS-$(CONFIG_H8300H)+= -ms8300h
CPU_LDFLAGS-$(CONFIG_H8S) += -ms8300s
- CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32 -fsigned-char
- CPU_CFLAGS-$(CONFIG_H8S) += -ms -mint32 -fsigned-char
+ CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32
+ CPU_CFLAGS-$(CONFIG_H8S) += -ms -mint32
endif
ifeq ($(TARGET_ARCH),cris)
@@ -284,18 +292,37 @@ OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,)
# Add a bunch of extra pedantic annoyingly strict checks
XWARNINGS=$(subst ",, $(strip $(WARNINGS))) -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
+ifeq ($(EXTRA_WARNINGS),y)
+XWARNINGS+=-Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2
+XWARNINGS+=-Wmissing-prototypes -Wmissing-declarations
+# works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
+#XWARNINGS+=-Wdeclaration-after-statement
+endif
XARCH_CFLAGS=$(subst ",, $(strip $(ARCH_CFLAGS)))
CPU_CFLAGS=$(subst ",, $(strip $(CPU_CFLAGS-y)))
+SSP_DISABLE_FLAGS ?= $(call check_gcc,-fno-stack-protector,)
+ifeq ($(UCLIBC_BUILD_SSP),y)
+SSP_CFLAGS := $(call check_gcc,-fno-stack-protector-all,)
+SSP_CFLAGS += $(call check_gcc,-fstack-protector,)
+SSP_ALL_CFLAGS ?= $(call check_gcc,-fstack-protector-all,)
+else
+SSP_CFLAGS := $(SSP_DISABLE_FLAGS)
+endif
+
+# Some nice CFLAGS to work with
+CFLAGS := -include $(top_builddir)include/libc-symbols.h \
+ $(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
+ -fno-builtin -nostdinc -I$(top_builddir)include -I.
+
LDADD_LIBFLOAT=
ifeq ($(UCLIBC_HAS_SOFT_FLOAT),y)
-# Add -msoft-float to the CPU_FLAGS since ldso and libdl ignore CFLAGS.
# If -msoft-float isn't supported, we want an error anyway.
# Hmm... might need to revisit this for arm since it has 2 different
# soft float encodings.
ifneq ($(TARGET_ARCH),nios)
ifneq ($(TARGET_ARCH),nios2)
- CPU_CFLAGS += -msoft-float
+CFLAGS += -msoft-float
endif
endif
ifeq ($(TARGET_ARCH),arm)
@@ -305,18 +332,16 @@ ifeq ($(TARGET_ARCH),arm)
endif
endif
-SSP_DISABLE_FLAGS?=$(call check_gcc,-fno-stack-protector,)
-ifeq ($(UCLIBC_BUILD_SSP),y)
-SSP_CFLAGS:=$(call check_gcc,-fno-stack-protector-all,)
-SSP_CFLAGS+=$(call check_gcc,-fstack-protector,)
-SSP_ALL_CFLAGS?=$(call check_gcc,-fstack-protector-all,)
-else
-SSP_CFLAGS:=$(SSP_DISABLE_FLAGS)
+# Make sure "char" behavior is the same everywhere
+CFLAGS += -fsigned-char
+
+# We need this to be checked within libc-symbols.h
+ifneq ($(HAVE_SHARED),y)
+CFLAGS += -DSTATIC
endif
-# Some nice CFLAGS to work with
-CFLAGS:=$(XWARNINGS) $(CPU_CFLAGS) $(SSP_CFLAGS) \
- -fno-builtin -nostdinc -D_LIBC -I$(top_builddir)include -I.
+# only i386 is known to work if compile.S gets -D__ASSEMBLER__
+#CFLAGS += $(call check_gcc,-std=c99,)
LDFLAGS_NOSTRIP:=$(CPU_LDFLAGS-y) -shared --warn-common --warn-once -z combreloc
@@ -330,12 +355,15 @@ endif
LDFLAGS:=$(LDFLAGS_NOSTRIP) -z defs
ifeq ($(DODEBUG),y)
- #CFLAGS += -g3
- CFLAGS += -O0 -g3
- STRIPTOOL:= true -Since_we_are_debugging
+#CFLAGS += -g3
+CFLAGS += -O0 -g3
+else
+CFLAGS += $(OPTIMIZATION) $(XARCH_CFLAGS)
+endif
+ifeq ($(NOSTRIP),y)
+STRIPTOOL := true -Stripping_disabled
else
- CFLAGS += $(OPTIMIZATION) $(XARCH_CFLAGS)
- LDFLAGS += -s
+LDFLAGS += -s
endif
ifeq ($(DOMULTI),y)
@@ -417,10 +445,6 @@ ifneq ($(DOASSERTS),y)
CFLAGS+=-DNDEBUG
endif
-ifneq ($(strip $(C_SYMBOL_PREFIX)),"")
-CFLAGS+=-D__SYMBOL_PREFIX=1
-endif
-
# moved from ldso/{ldso,libdl}
# BEWARE!!! At least mips* will die if -O0 is used!!!
ifeq ($(TARGET_ARCH),mips)
diff --git a/TODO b/TODO
index c4c30529d..e39467c8c 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
-TODO list for the uClibc 0.9.28 release:
+TODO list for every uClibc release:
-------------------------------------------------
*) Audit header files. Remove prototypes for all functions that
are not supported -- especially needed for the libm headers.
@@ -12,16 +12,26 @@ TODO list for the uClibc 0.9.28 release:
and used by ldso. Currently it whines on basically about virtually
every function call when doing default lazy binding, which makes its
output virtually useless due to the excess noise.
+
+
+TODO list for the uClibc 0.9.29 release:
+-------------------------------------------------
+ *) misc stdio bugs:
+ http://bugs.uclibc.org/view.php?id=420
+ http://bugs.uclibc.org/view.php?id=539
+ *) bug in getopt handling:
+ http://bugs.uclibc.org/view.php?id=61
+ http://www.uclibc.org/lists/uclibc/2006-January/013851.html
*) Change all references to the older "Library GPL" to the "Lesser GPL"
and update COPYING.LIB to LGPL version 2.1.
-
+ *) fold NPTL branch back into trunk
+ *) as many of the arch-specific issues as possible
TODO list for the uClibc 1.0.0 release:
-------------------------------------------------
-
- *) Hide uClibc internal symbols from our exported namespace.
+ *) Finish hiding uClibc internal symbols from our exported namespace.
*) Explicity add some sortof CONFIG_LINUX_2_2_ABI, CONFIG_LINUX_2_4_ABI
and CONFIG_LINUX_2_6_ABI type options, rather than having the abi
depend on the selected set of kernel headers. This will likely also
@@ -57,9 +67,6 @@ TODO list for the uClibc 1.0.0 release:
*) poll emulation using select() for old 2.0.x uClinux kernels
in libc/sysdeps/linux/common/poll.c fails some python self-tests.
Of course, modern systems using the actuall poll() syscall work fine.
- *) Rework the build system Makefile to eliminate recursive make.
- *) Build both pic and non-pic objects where appropriate, so that
- static libs need not pay the pic size penalty.
*) Cleanup/scrub all the Makefile copyright junk
*) Fix dlopen, for both static and dynamic cases, and make it
fully comply with SuSv3
@@ -75,7 +82,6 @@ TODO list for the uClibc 1.0.0 release:
TODO list for AFTER the uClibc 1.0.0 release:
-------------------------------------------------
- *) Add support for Linux 2.6.x NPTL pthreads, futexes, etc
*) Add support for Linux 2.6.x fast vsyscalls
*) Enable pristine source tree builds
*) Fix regex so it isn't so stinking big
@@ -92,17 +98,24 @@ Arch specific TODO:
_init/_fini hangs signal-ed (assert test)
output from cloned children seems funky (unistd/clone test)
ldso is not implemented
+ arm:
+ update crt1 code again for nommu (http://bugs.uclibc.org/view.php?id=538)
+ recruit jbowler and integrate thumb support
+ hppa:
+ errno.c test segfaults causes segfault in clone.S (seems to be in glibc too)
+ ia64:
+ ldso is not implemented
m68k:
- need to verify libc again
- ldso needs to be updated since it's totally broken atm
+ ldso lazy relocation doesnt work
+ mips:
+ brk/pipe fixes: http://bugs.uclibc.org/view.php?id=469
sparc:
need a sigaction.c since common one doesnt work (signal tests)
ldso needs to be updated since it's totally broken atm
- x86_64:
- ldso needs to have lazy bindings checked
- pthread isn't working really at all (pthreads tests)
-
- cris rfv nios nios2 sh64:
+ vax:
+ pthread support, linktime warning support (implies GAS patches),
+ general touchups, testing, ldso.
+ bfin cris rfv sh64:
need to be updated to new ldso changes and unification of the
two uClibc_main funcs (__uClibc_start_main doesnt exist anymore)
diff --git a/debian/config b/debian/config
index 8ec73e231..301f7b31b 100644
--- a/debian/config
+++ b/debian/config
@@ -25,7 +25,6 @@
#
# Target Architecture Features and Options
#
-HAVE_ELF=y
# ARCH_SUPPORTS_LITTLE_ENDIAN is not set
TARGET_ARCH="none"
# ARCH_LITTLE_ENDIAN is not set
@@ -53,7 +52,6 @@ UCLIBC_HAS_FLOATS=y
HAS_FPU=y
DO_C99_MATH=y
KERNEL_SOURCE="/usr/src/linux"
-C_SYMBOL_PREFIX=""
HAVE_DOT_CONFIG=y
#
diff --git a/docs/PORTING b/docs/PORTING
new file mode 100644
index 000000000..5c1a3989a
--- /dev/null
+++ b/docs/PORTING
@@ -0,0 +1,117 @@
+Some notes to help future porters. Replace 'ARCH' with whatever arch
+you are hacking on.
+
+====================
+=== Config Files ===
+====================
+- create extra/Configs/Config.ARCH
+ See the other arch files for some good examples. powerpc/sparc/alpha
+ should be pretty simple templates.
+- add ARCH to the 'Target Architecture' list in extra/Configs/Config.in
+- Initially you will want to disable shared libraries, since making
+ the shared library loader work requires you first have basic architecture
+ support working. Thus you should add HAVE_NO_SHARED and ARCH_HAS_NO_LDSO
+ to Config.ARCH's TARGET_ARCH
+
+====================
+=== libc sysdeps ===
+====================
+(note: if glibc has already been ported to your arch, you can usually just
+ copy a lot of files from them rather than coding from scratch)
+- create libc/sysdeps/linux/ARCH
+- copy Makefile and Makefile.arch from libc/sysdeps/linux/i386/
+- set CSRC and SSRC to nothing in Makefile.arch for now
+
+- create crt1.S which defines the _start function ... you will probably want
+ to clear the frame pointer to make gdb happy, and then you will want to call
+ the funcion __uClibc_main() which takes these parameters:
+ __uClibc_main(main(), argc, argv, _init(), _fini())
+ Initially if you wish to make things easier on yourself, you can disable the
+ UCLIBC_CTOR_DTOR option and just set those two arguments to NULL
+ glibc generally stores this function in libc/sysdeps/ARCH/elf/start.S
+
+- create these additional files in ARCH/bits/
+
+ (template versions can be found in common/bits/ for you to tweak)
+ endian.h fcntl.h setjmp.h stackinfo.h uClibc_arch_features.h wordsize.h
+
+ kernel_types.h should be created based upon linux asm-ARCH/posix_types.h
+
+ copy linux asm-ARCH/stat.h to bits/kernel_stat.h
+
+ create syscalls.h based upon linux's unistd.h / glibc's sysdeps.h ... really
+ you just want to define the _syscall[0-6] macros. It is important that
+ these syscalls should be PIC safe (or you should provide a PIC and non-PIC
+ version) if you wish to properly support shared libraries.
+
+- at this point, you should have enough to generate a working HELLO WORLD
+ static binary (see test/silly/*.c files)
+
+- if you want UCLIBC_CTOR_DTOR support, you will need to create crti.S and
+ crtn.S files which define function prologues/epilogues.
+
+- for a more stable static port, you will need to create these files (and
+ update the Makefile.arch values accordingly)
+ __longjmp bsd-_setjmp bsd-setjmp brk clone setjmp syscall vfork
+ usually these are written in assembler, but you may be able to cheat and
+ write them in C ... see other ports for more information
+
+====================
+=== pthread deps ===
+====================
+
+TODO: nptl / linuxthreads / linuxthreads.old
+
+====================
+=== ldso sysdeps ===
+====================
+- 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
+
+- dl-debug.h: define string versions of all the relocations of your arch in the
+ _dl_reltypes_tab array ... the index should match the actual reloc type, so
+ if the value of say R_X86_64_PC16 is 13, then "R_X86_64_PC16" better be at
+ index 13 of the array
+
+- dl-startup.h:
+ - define the _start function which should call _dl_start which takes just one
+ parameter ... a pointer to argc (usually on the stack)
+ glibc stores this function in libc/sysdeps/ARCH/dl-machine.h as RTLD_START
+ - define the GET_ARGV() macro which calculates the value of argv based upon
+ the parameter passed to _dl_start (usually it's simply just ARGS+1)
+ - define PERFORM_BOOTSTRAP_RELOC() macro which will handle just the relocs
+ that the ldso itself will generate
+
+- dl-syscalls.h:
+ if you wrote your bits/syscalls.h file correctly in the libc step above, you
+ can simply copy this file from another arch and be done ... otherwise you
+ will have to define the syscall[0-6] macros again, but this time setting
+ _dl_errno instead of just errno
+
+- dl-sysdep.h:
+ misc cruft goes in here ... you want to:
+ - either define or undefine ELF_USES_RELOCA
+ - define the INIT_GOT macro
+ - define MAGIC1 to the EM_### value your ELF arch uses
+ - define ELF_TARGET to a string name for your arch
+ - define the do_rem() macro
+ - define misc ALIGN macro's
+ - define elf_machine_type_class() macro
+ - define the inline functions elf_machine_dynamic, elf_machine_load_address,
+ and elf_machine_relative
+ glibc stores a bunch of these values in libc/sysdeps/ARCH/dl-machine.h
+
+- elfinterp.c:
+ define all the relocation functions ... it's best if you just copy from
+ another arch which uses the same type of relocations (REL or RELA) and
+ start from there.
+
+- resolve.S:
+ front end of lazy relocation ... define the _dl_linux_resolve symbol which
+ is called by a PLT entry which has yet to be setup ... you will want to:
+ - set up arguments for _dl_linux_resolver()
+ - call _dl_linux_resolver()
+ - clean up after call
+ - jump to function address now stored in PLT
+ glibc stores this function in libc/sysdeps/ARCH/dl-trampoline.S
diff --git a/docs/uclibc.org/copyright.txt b/docs/uclibc.org/copyright.txt
index 7fde029ac..b872ee743 100644
--- a/docs/uclibc.org/copyright.txt
+++ b/docs/uclibc.org/copyright.txt
@@ -1,6 +1,6 @@
The code and graphics on this website (and it's mirror sites, if any) are
-Copyright (c) 1999-2005 by Erik Andersen. All rights reserved.
+Copyright (c) 1999-2006 by Erik Andersen. All rights reserved.
Documents on this Web site including their graphical elements, design, and
layout are protected by trade dress and other laws and MAY BE COPIED OR
diff --git a/docs/uclibc.org/footer.html b/docs/uclibc.org/footer.html
index c6a449dff..5e173db38 100644
--- a/docs/uclibc.org/footer.html
+++ b/docs/uclibc.org/footer.html
@@ -12,7 +12,7 @@
<tr>
<td width="60%">
<font face="arial, helvetica, sans-serif" size="-1">
- <a href="/copyright.txt">Copyright &copy; 1999-2005 Erik Andersen</a>
+ <a href="/copyright.txt">Copyright &copy; 1999-2006 Erik Andersen</a>
<br>
Mail all comments, insults, suggestions and bribes to
<br>
diff --git a/docs/uclibc.org/lists.html b/docs/uclibc.org/lists.html
index 826a0a769..1fbea3bc9 100644
--- a/docs/uclibc.org/lists.html
+++ b/docs/uclibc.org/lists.html
@@ -3,23 +3,25 @@
<!-- Begin Introduction section -->
-<h3>Mailing List Information</h3>
+<h3>uClibc Dev Mailing List</h3>
+<p>
uClibc has a <a href="/lists/uclibc/">mailing list</a> for discussion and
development. You can subscribe by visiting
-<a href="http://uclibc.org/mailman/listinfo/uclibc">this page</a>.
-Only subscribers to the uClibc mailing list are allowed to post
-to this list.
-
-<p>
-There is also a mailing list for <a href="/lists/uclibc-cvs/">active developers</a>
-wishing to read the complete diff of each and every change to uClibc -- not for the
-faint of heart. Active developers can subscribe by visiting
-<a href="http://uclibc.org/mailman/listinfo/uclibc-cvs">this page</a>.
-The Subversion server is the only one permtted to post to this list. And yes,
-this list name uses the word 'cvs' even though we don't use that anymore...
+<a href="http://uclibc.org/mailman/listinfo/uclibc">this page</a>. There is
+also an <a href="/lists/uclibc/">online archive</a>.
+Only subscribers to the uClibc mailing list are allowed to post to this list.
+</p>
+<h3>uClibc SVN Commits Mailing List</h3>
<p>
-
+There is also a mailing list for <a href="/lists/uclibc-cvs/">svn commits</a>
+for people wishing to read the complete diff of each and every change to
+uClibc -- not for the faint of heart. Active developers can subscribe by
+visiting <a href="http://uclibc.org/mailman/listinfo/uclibc-cvs">this
+page</a>. The Subversion server is the only one permtted to post to this
+list. And yes, this list name uses the word 'cvs' even though we don't use
+that anymore ...
+</p>
<h3>Search the List Archives</h3>
Please search the mailing list archives before asking questions on the mailing
@@ -30,7 +32,6 @@ list with frequently asked questions... You should also check the
you need may very well be listed there.
<p>
-
<center>
<form method="GET" action="http://www.google.com/custom">
<input type="hidden" name="domains" value="uclibc.org">
@@ -43,7 +44,7 @@ you need may very well be listed there.
<br>
</form>
</center>
-
+</p>
<!--#include file="footer.html" -->
diff --git a/libpthread/linuxthreads.old/Makefile.in b/libpthread/linuxthreads.old/Makefile.in
index 47a4f8d98..249e2f6cb 100644
--- a/libpthread/linuxthreads.old/Makefile.in
+++ b/libpthread/linuxthreads.old/Makefile.in
@@ -1,12 +1,12 @@
# Makefile for uClibc
#
# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.org>
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-linuxthreads.old := -DNOT_IN_libc $(SSP_ALL_CFLAGS)
+CFLAGS-linuxthreads.old := -DNOT_IN_libc -DIS_IN_libpthread $(SSP_ALL_CFLAGS)
CFLAGS-libpthread/linuxthreads.old/sysdeps/$(TARGET_ARCH)/ := $(CFLAGS-linuxthreads.old)
@@ -21,7 +21,7 @@ else
LDFLAGS-libpthread.so := $(LDFLAGS)
endif
-LIBS-libpthread.so := $(LIBS)
+LIBS-libpthread.so := $(LIBS) $(ldso)
START_FILE-libpthread.so := $(SHARED_START_FILES)
END_FILE-libpthread.so := $(SHARED_END_FILES)
@@ -40,12 +40,9 @@ libpthread_SRC := \
ifeq ($(UCLIBC_HAS_XLOCALE),y)
libpthread_SRC += locale.c
endif
-ifneq ($(DOMULTI),n)
-libpthread_NO_MULTI := manager.c pt-machine.c
-libpthread_SRC := $(filter-out $(libpthread_NO_MULTI),$(libpthread_SRC))
-endif
libpthread_SPEC_SRC := pthread.c
+libpthread_SPEC_SRC := $(patsubst %.c,$(libpthread_DIR)/%.c,$(libpthread_SPEC_SRC))
# remove generic sources, if arch specific version is present
ifneq ($(strip $(libpthread_ARCH_SRC)),)
@@ -63,10 +60,11 @@ CFLAGS-forward.c := -DIS_IN_libc
CFLAGS-libc_pthread_init.c := -DIS_IN_libc
libpthread_libc_CSRC := forward.c libc_pthread_init.c
libpthread_libc_OBJ := $(patsubst %.c, $(libpthread_OUT)/%.o,$(libpthread_libc_CSRC))
+libc-static-y += $(libpthread_OUT)/libc_pthread_init.o
libc-shared-y += $(libpthread_libc_OBJ:.o=.oS)
-libpthread-static-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
-libpthread-shared-y += $(patsubst %.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
+libpthread-static-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.o,$(libpthread_SPEC_SRC))
+libpthread-shared-y += $(patsubst $(libpthread_DIR)/%.c,$(libpthread_OUT)/%.oS,$(libpthread_SPEC_SRC))
ifeq ($(DOPIC),y)
libpthread-a-y += $(libpthread_OBJ:.o=.os) $(libpthread-static-y:.o=.os)
@@ -75,17 +73,19 @@ libpthread-a-y += $(libpthread_OBJ) $(libpthread-static-y)
endif
libpthread-so-y += $(libpthread_OBJ:.o=.os) $(libpthread-shared-y)
-libpthread-multi-y += $(libpthread_SRC)
-libpthread-nomulti-y += $(patsubst %.c,$(libpthread_OUT)/%.o,$(libpthread_NO_MULTI))
-
lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
objclean-y += libpthread_clean
headers-$(UCLIBC_HAS_THREADS) += linuxthreads_headers
headers_clean-y += linuxthreads_headers_clean
+#ifeq ($(DOMULTI),n)
$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc)
$(call link.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+#else
+#$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread.oS | $(libc)
+# $(call linkm.so,$(libpthread_FULL_NAME),$(MAJOR_VERSION))
+#endif
$(libpthread_OUT)/libpthread_so.a: $(libpthread-so-y)
$(Q)$(RM) $@
@@ -96,6 +96,15 @@ else
endif
$(do_ar)
+$(libpthread_OUT)/libpthread.oS: $(libpthread_SRC) $(libpthread_SPEC_SRC)
+ $(Q)$(RM) $@
+ $(compile-m)
+ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
+ $(do_t_strip:-x=-X --strip-debug)
+else
+ $(do_t_strip)
+endif
+
$(top_builddir)lib/libpthread.a: $(libpthread-a-y)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $@
@@ -107,10 +116,10 @@ endif
$(do_ar)
linuxthreads_headers:
- $(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
- $(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
- $(INSTALL) -d $(top_builddir)include/bits
- $(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
+ $(Q)$(LN) -sf ../$(PTDIR)/sysdeps/pthread/pthread.h $(top_builddir)include/
+ $(Q)$(LN) -sf ../$(PTDIR)/semaphore.h $(top_builddir)include/
+ $(Q)$(INSTALL) -d $(top_builddir)include/bits
+ $(Q)$(LN) -sf ../../$(PTDIR)/sysdeps/pthread/bits/pthreadtypes.h $(top_builddir)include/bits/
linuxthreads_headers_clean:
$(RM) $(top_builddir)include/pthread.h $(top_builddir)include/semaphore.h \
diff --git a/libpthread/linuxthreads.old/attr.c b/libpthread/linuxthreads.old/attr.c
index a8dfb335e..9deeee0ef 100644
--- a/libpthread/linuxthreads.old/attr.c
+++ b/libpthread/linuxthreads.old/attr.c
@@ -25,8 +25,6 @@
#include "pthread.h"
#include "internals.h"
-extern int __getpagesize(void);
-
/* NOTE: With uClibc I don't think we need this versioning stuff.
* Therefore, define the function pthread_attr_init() here using
* a strong symbol. */
@@ -34,7 +32,7 @@ extern int __getpagesize(void);
//int __pthread_attr_init_2_1(pthread_attr_t *attr)
int pthread_attr_init(pthread_attr_t *attr)
{
- size_t ps = __getpagesize ();
+ size_t ps = getpagesize ();
attr->__detachstate = PTHREAD_CREATE_JOINABLE;
attr->__schedpolicy = SCHED_OTHER;
@@ -50,7 +48,7 @@ int pthread_attr_init(pthread_attr_t *attr)
/* uClibc: leave out this for now. */
#if DO_PTHREAD_VERSIONING_WITH_UCLIBC
-#if defined __HAVE_ELF__ && defined __PIC__ && defined DO_VERSIONING
+#if defined __PIC__ && defined DO_VERSIONING
default_symbol_version (__pthread_attr_init_2_1, pthread_attr_init, GLIBC_2.1);
int __pthread_attr_init_2_0(pthread_attr_t *attr)
@@ -156,7 +154,7 @@ int pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
int __pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
{
- size_t ps = __getpagesize ();
+ size_t ps = getpagesize ();
/* First round up the guard size. */
guardsize = roundup (guardsize, ps);
diff --git a/libpthread/linuxthreads.old/condvar.c b/libpthread/linuxthreads.old/condvar.c
index c5a4f81da..62df907c1 100644
--- a/libpthread/linuxthreads.old/condvar.c
+++ b/libpthread/linuxthreads.old/condvar.c
@@ -96,7 +96,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
pthread_exit(PTHREAD_CANCELED);
}
- pthread_mutex_unlock(mutex);
+ __pthread_mutex_unlock(mutex);
spurious_wakeup_count = 0;
while (1)
@@ -121,7 +121,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
if (THREAD_GETMEM(self, p_woken_by_cancel)
&& THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {
THREAD_SETMEM(self, p_woken_by_cancel, 0);
- pthread_mutex_lock(mutex);
+ __pthread_mutex_lock(mutex);
pthread_exit(PTHREAD_CANCELED);
}
@@ -129,7 +129,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
while (spurious_wakeup_count--)
restart(self);
- pthread_mutex_lock(mutex);
+ __pthread_mutex_lock(mutex);
return 0;
}
@@ -171,7 +171,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
pthread_exit(PTHREAD_CANCELED);
}
- pthread_mutex_unlock(mutex);
+ __pthread_mutex_unlock(mutex);
spurious_wakeup_count = 0;
while (1)
@@ -188,7 +188,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
if (was_on_queue) {
__pthread_set_own_extricate_if(self, 0);
- pthread_mutex_lock(mutex);
+ __pthread_mutex_lock(mutex);
return ETIMEDOUT;
}
@@ -215,7 +215,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
if (THREAD_GETMEM(self, p_woken_by_cancel)
&& THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {
THREAD_SETMEM(self, p_woken_by_cancel, 0);
- pthread_mutex_lock(mutex);
+ __pthread_mutex_lock(mutex);
pthread_exit(PTHREAD_CANCELED);
}
@@ -223,7 +223,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond,
while (spurious_wakeup_count--)
restart(self);
- pthread_mutex_lock(mutex);
+ __pthread_mutex_lock(mutex);
return 0;
}
diff --git a/libpthread/linuxthreads.old/forward.c b/libpthread/linuxthreads.old/forward.c
index 90ec6ef3a..87101a15b 100644
--- a/libpthread/linuxthreads.old/forward.c
+++ b/libpthread/linuxthreads.old/forward.c
@@ -17,12 +17,14 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#include <dlfcn.h>
-#include "internals.h"
+#include <features.h>
#include <stdlib.h>
+#include <dlfcn.h>
-#include <libc-internal.h>
+/* psm: keep this before internals.h */
+libc_hidden_proto(exit)
+#include "internals.h"
/* Pointers to the libc functions. */
struct pthread_functions __libc_pthread_functions attribute_hidden;
@@ -101,8 +103,8 @@ FORWARD (pthread_equal, (pthread_t thread1, pthread_t thread2),
/* Use an alias to avoid warning, as pthread_exit is declared noreturn. */
-FORWARD2 (__pthread_exit, void, (void *retval), (retval), __exit (EXIT_SUCCESS))
-strong_alias (__pthread_exit, pthread_exit);
+FORWARD2 (__pthread_exit, void, (void *retval), (retval), exit (EXIT_SUCCESS))
+strong_alias (__pthread_exit, pthread_exit)
FORWARD (pthread_getschedparam,
@@ -118,16 +120,16 @@ FORWARD (pthread_mutex_destroy, (pthread_mutex_t *mutex), (mutex), 0)
FORWARD (pthread_mutex_init,
(pthread_mutex_t *mutex, const pthread_mutexattr_t *mutexattr),
(mutex, mutexattr), 0)
-hidden_strong_alias(pthread_mutex_init, __pthread_mutex_init)
+strong_alias(pthread_mutex_init, __pthread_mutex_init)
FORWARD (pthread_mutex_lock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_lock, __pthread_mutex_lock)
+strong_alias(pthread_mutex_lock, __pthread_mutex_lock)
FORWARD (pthread_mutex_trylock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_trylock, __pthread_mutex_trylock)
+strong_alias(pthread_mutex_trylock, __pthread_mutex_trylock)
FORWARD (pthread_mutex_unlock, (pthread_mutex_t *mutex), (mutex), 0)
-hidden_strong_alias(pthread_mutex_unlock, __pthread_mutex_unlock)
+strong_alias(pthread_mutex_unlock, __pthread_mutex_unlock)
FORWARD2 (pthread_self, pthread_t, (void), (), return 0)
diff --git a/libpthread/linuxthreads.old/internals.h b/libpthread/linuxthreads.old/internals.h
index 8422db58f..17b724e64 100644
--- a/libpthread/linuxthreads.old/internals.h
+++ b/libpthread/linuxthreads.old/internals.h
@@ -25,6 +25,7 @@
#include <signal.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include "pt-machine.h"
#include "semaphore.h"
#include "../linuxthreads.old_db/thread_dbP.h"
@@ -257,7 +258,7 @@ extern pthread_descr __pthread_main_thread;
* the bounds a-priori. -StS */
extern char *__pthread_initial_thread_bos;
-#ifndef __ARCH_HAS_MMU__
+#ifndef __ARCH_USE_MMU__
extern char *__pthread_initial_thread_tos;
#define NOMMU_INITIAL_THREAD_BOUNDS(tos,bos) \
if ((tos)>=__pthread_initial_thread_bos \
@@ -265,7 +266,7 @@ extern char *__pthread_initial_thread_tos;
__pthread_initial_thread_bos = (tos)+1
#else
#define NOMMU_INITIAL_THREAD_BOUNDS(tos,bos) /* empty */
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
/* Indicate whether at least one thread has a user-defined stack (if 1),
@@ -329,7 +330,7 @@ extern size_t __pagesize;
THREAD_SELF implementation is used, this must be a power of two and
a multiple of PAGE_SIZE. */
#ifndef STACK_SIZE
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
#define STACK_SIZE (2 * 1024 * 1024)
#else
#define STACK_SIZE (4 * __pagesize)
@@ -366,7 +367,7 @@ extern size_t __pagesize;
all outstanding operations which modify memory. Some architectures
distinguish between full, read and write barriers. */
#ifndef MEMORY_BARRIER
-#define MEMORY_BARRIER() asm ("" : : : "memory")
+#define MEMORY_BARRIER() __asm__ ("" : : : "memory")
#endif
#ifndef READ_MEMORY_BARRIER
#define READ_MEMORY_BARRIER() MEMORY_BARRIER()
@@ -386,7 +387,7 @@ static inline pthread_descr thread_self (void)
return THREAD_SELF;
#else
char *sp = CURRENT_STACK_FRAME;
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
if (sp >= __pthread_initial_thread_bos)
return &__pthread_initial_thread;
else if (sp >= __pthread_manager_thread_bos
@@ -419,7 +420,7 @@ static inline pthread_descr thread_self (void)
else {
return __pthread_find_self();
}
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
#endif
}
@@ -469,6 +470,12 @@ void __fresetlockfiles(void);
void __pthread_manager_adjust_prio(int thread_prio);
void __pthread_initialize_minimal (void);
+extern void __pthread_exit (void *retval)
+#if defined NOT_IN_libc && defined IS_IN_libpthread
+ attribute_noreturn
+#endif
+ ;
+
extern int __pthread_attr_setguardsize __P ((pthread_attr_t *__attr,
size_t __guardsize));
extern int __pthread_attr_getguardsize __P ((__const pthread_attr_t *__attr,
@@ -483,17 +490,15 @@ extern int __pthread_attr_getstacksize __P ((__const pthread_attr_t *__attr,
size_t *__stacksize));
extern int __pthread_getconcurrency __P ((void));
extern int __pthread_setconcurrency __P ((int __level));
-extern int __pthread_mutexattr_gettype __P ((__const pthread_mutexattr_t *__attr,
- int *__kind));
extern void __pthread_kill_other_threads_np __P ((void));
extern void __pthread_restart_old(pthread_descr th);
extern void __pthread_suspend_old(pthread_descr self);
-extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abs);
+extern int __pthread_timedsuspend_old(pthread_descr self, const struct timespec *abstime);
extern void __pthread_restart_new(pthread_descr th);
extern void __pthread_suspend_new(pthread_descr self);
-extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abs);
+extern int __pthread_timedsuspend_new(pthread_descr self, const struct timespec *abstime);
extern void __pthread_wait_for_restart_signal(pthread_descr self);
@@ -504,12 +509,17 @@ extern void (*__pthread_suspend)(pthread_descr);
/* Prototypes for the function without cancelation support when the
normal version has it. */
-extern int __libc_close (int fd);
-extern int __libc_nanosleep (const struct timespec *requested_time,
- struct timespec *remaining);
-extern ssize_t __libc_read (int fd, void *buf, size_t count);
-extern pid_t __libc_waitpid (pid_t pid, int *stat_loc, int options);
-extern ssize_t __libc_write (int fd, const void *buf, size_t count);
+extern __typeof(close) __libc_close;
+extern __typeof(nanosleep) __libc_nanosleep;
+extern __typeof(read) __libc_read;
+extern __typeof(waitpid) __libc_waitpid;
+extern __typeof(write) __libc_write;
+
+extern __typeof(pthread_mutex_init) __pthread_mutex_init attribute_hidden;
+extern __typeof(pthread_mutex_destroy) __pthread_mutex_destroy attribute_hidden;
+extern __typeof(pthread_mutex_lock) __pthread_mutex_lock attribute_hidden;
+extern __typeof(pthread_mutex_trylock) __pthread_mutex_trylock attribute_hidden;
+extern __typeof(pthread_mutex_unlock) __pthread_mutex_attribute_hidden;
/* Prototypes for some of the new semaphore functions. */
extern int __new_sem_post (sem_t * sem);
diff --git a/libpthread/linuxthreads.old/join.c b/libpthread/linuxthreads.old/join.c
index a1172fa34..6a8a9d982 100644
--- a/libpthread/linuxthreads.old/join.c
+++ b/libpthread/linuxthreads.old/join.c
@@ -15,7 +15,6 @@
/* Thread termination and joining */
#include <features.h>
-#define __USE_GNU
#include <errno.h>
#include <sched.h>
#include <unistd.h>
diff --git a/libpthread/linuxthreads.old/libc_pthread_init.c b/libpthread/linuxthreads.old/libc_pthread_init.c
index 647a19323..0ef3b47fc 100644
--- a/libpthread/linuxthreads.old/libc_pthread_init.c
+++ b/libpthread/linuxthreads.old/libc_pthread_init.c
@@ -17,7 +17,6 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define _GNU_SOURCE
#include <features.h>
#include <locale.h>
#include <stdlib.h>
@@ -25,8 +24,10 @@
#include "internals.h"
#include "sysdeps/pthread/pthread-functions.h"
+libc_hidden_proto(memcpy)
+
#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
-extern __locale_t __uselocale (__locale_t __dataset) __THROW attribute_hidden;
+libc_hidden_proto(uselocale)
#endif
int __libc_multiple_threads attribute_hidden __attribute__((nocommon));
@@ -39,14 +40,14 @@ __libc_pthread_init (functions)
/* We copy the content of the variable pointed to by the FUNCTIONS
parameter to one in libc.so since this means access to the array
can be done with one memory access instead of two. */
- __memcpy (&__libc_pthread_functions, functions,
+ memcpy (&__libc_pthread_functions, functions,
sizeof (__libc_pthread_functions));
#endif
#if !(USE_TLS && HAVE___THREAD) && defined __UCLIBC_HAS_XLOCALE__
/* Initialize thread-locale current locale to point to the global one.
With __thread support, the variable's initializer takes care of this. */
- __uselocale (LC_GLOBAL_LOCALE);
+ uselocale (LC_GLOBAL_LOCALE);
#endif
return &__libc_multiple_threads;
diff --git a/libpthread/linuxthreads.old/locale.c b/libpthread/linuxthreads.old/locale.c
index c3ebbc285..c0879d0ce 100644
--- a/libpthread/linuxthreads.old/locale.c
+++ b/libpthread/linuxthreads.old/locale.c
@@ -15,7 +15,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define _GNU_SOURCE
#include <features.h>
#include "pthread.h"
#include "internals.h"
diff --git a/libpthread/linuxthreads.old/lockfile.c b/libpthread/linuxthreads.old/lockfile.c
index 7bd2155ac..d054b62cb 100644
--- a/libpthread/linuxthreads.old/lockfile.c
+++ b/libpthread/linuxthreads.old/lockfile.c
@@ -20,20 +20,24 @@
#include <stdio.h>
#include <pthread.h>
+extern __typeof(pthread_mutexattr_init) __pthread_mutexattr_init attribute_hidden;
+extern __typeof(pthread_mutexattr_settype) __pthread_mutexattr_settype attribute_hidden;
+extern __typeof(pthread_mutexattr_destroy) __pthread_mutexattr_destroy attribute_hidden;
+
/* Note: glibc puts flockfile, funlockfile, and ftrylockfile in both
* libc and libpthread. In uClibc, they are now in libc only. */
-void
-__fresetlockfiles (void)
+void __fresetlockfiles (void);
+void __fresetlockfiles (void)
{
FILE *fp;
pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ __pthread_mutexattr_init(&attr);
+ __pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen)
__pthread_mutex_init(&fp->__lock, &attr);
- pthread_mutexattr_destroy(&attr);
+ __pthread_mutexattr_destroy(&attr);
}
diff --git a/libpthread/linuxthreads.old/manager.c b/libpthread/linuxthreads.old/manager.c
index 3e42ccb85..df26344e7 100644
--- a/libpthread/linuxthreads.old/manager.c
+++ b/libpthread/linuxthreads.old/manager.c
@@ -14,12 +14,7 @@
/* The "thread manager" thread: manages creation and termination of threads */
-/* mods for uClibc: getpwd and getpagesize are the syscalls */
-#define __getpid getpid
-#define __getpagesize getpagesize
-
#include <features.h>
-#define __USE_GNU
#include <errno.h>
#include <sched.h>
#include <stddef.h>
@@ -49,6 +44,8 @@
# define USE_SELECT
#endif
+libpthread_hidden_proto(waitpid)
+libpthread_hidden_proto(raise)
/* Array of active threads. Entry 0 is reserved for the initial thread. */
struct pthread_handle_struct __pthread_handles[PTHREAD_THREADS_MAX] =
@@ -107,13 +104,13 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
int report_events,
td_thr_events_t *event_maskp);
static void pthread_handle_free(pthread_t th_id);
-static void pthread_handle_exit(pthread_descr issuing_thread, int exitcode);
+static void pthread_handle_exit(pthread_descr issuing_thread, int exitcode) attribute_noreturn;
static void pthread_reap_children(void);
static void pthread_kill_all_threads(int sig, int main_thread_also);
/* The server thread managing requests for thread creation and termination */
-int __pthread_manager(void *arg)
+int attribute_noreturn __pthread_manager(void *arg)
{
int reqfd = (int) (long int) arg;
#ifdef USE_SELECT
@@ -270,7 +267,7 @@ int __pthread_manager_event(void *arg)
/* Process creation */
static int
-__attribute__ ((noreturn))
+attribute_noreturn
pthread_start_thread(void *arg)
{
pthread_descr self = (pthread_descr) arg;
@@ -283,7 +280,7 @@ pthread_start_thread(void *arg)
PDEBUG("\n");
/* Make sure our pid field is initialized, just in case we get there
before our father has initialized it. */
- THREAD_SETMEM(self, p_pid, __getpid());
+ THREAD_SETMEM(self, p_pid, getpid());
/* Initial signal mask is that of the creating thread. (Otherwise,
we'd just inherit the mask of the thread manager.) */
sigprocmask(SIG_SETMASK, &self->p_start_args.mask, NULL);
@@ -318,7 +315,7 @@ pthread_start_thread(void *arg)
}
static int
-__attribute__ ((noreturn))
+attribute_noreturn
pthread_start_thread_event(void *arg)
{
pthread_descr self = (pthread_descr) arg;
@@ -328,7 +325,7 @@ pthread_start_thread_event(void *arg)
#endif
/* Make sure our pid field is initialized, just in case we get there
before our father has initialized it. */
- THREAD_SETMEM(self, p_pid, __getpid());
+ THREAD_SETMEM(self, p_pid, getpid());
/* Get the lock the manager will free once all is correctly set up. */
__pthread_lock (THREAD_GETMEM(self, p_lock), NULL);
/* Free it immediately. */
@@ -363,7 +360,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
}
else
{
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
stacksize = STACK_SIZE - pagesize;
if (attr != NULL)
stacksize = MIN (stacksize, roundup(attr->__stacksize, pagesize));
@@ -453,7 +450,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
/* on non-MMU systems we always have non-standard stack frames */
__pthread_nonstandard_stacks = 1;
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
}
/* Clear the thread data structure. */
@@ -478,7 +475,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
pthread_t new_thread_id;
char *guardaddr = NULL;
size_t guardsize = 0;
- int pagesize = __getpagesize();
+ int pagesize = getpagesize();
int saved_errno = 0;
/* First check whether we have to change the policy and if yes, whether
@@ -498,7 +495,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
&new_thread, &new_thread_bottom,
&guardaddr, &guardsize) == 0)
break;
-#ifndef __ARCH_HAS_MMU__
+#ifndef __ARCH_USE_MMU__
else
/* When there is MMU, mmap () is used to allocate the stack. If one
* segment is already mapped, we should continue to see if we can
@@ -635,14 +632,14 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
/* Free the stack if we allocated it */
if (attr == NULL || !attr->__stackaddr_set)
{
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
if (new_thread->p_guardsize != 0)
munmap(new_thread->p_guardaddr, new_thread->p_guardsize);
munmap((caddr_t)((char *)(new_thread+1) - INITIAL_STACK_SIZE),
INITIAL_STACK_SIZE);
#else
free(new_thread_bottom);
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
}
__pthread_handles[sseg].h_descr = NULL;
__pthread_handles[sseg].h_bottom = NULL;
@@ -719,7 +716,7 @@ static void pthread_free(pthread_descr th)
/* If initial thread, nothing to free */
if (th == &__pthread_initial_thread) return;
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
if (!th->p_userstack)
{
/* Free the stack and thread descriptor area */
@@ -732,7 +729,7 @@ static void pthread_free(pthread_descr th)
if (!th->p_userstack) {
free(h_bottom_save);
}
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
}
/* Handle threads that have exited */
diff --git a/libpthread/linuxthreads.old/mutex.c b/libpthread/linuxthreads.old/mutex.c
index ca470cd75..890841452 100644
--- a/libpthread/linuxthreads.old/mutex.c
+++ b/libpthread/linuxthreads.old/mutex.c
@@ -24,7 +24,7 @@
#include "queue.h"
#include "restart.h"
-int __pthread_mutex_init(pthread_mutex_t * mutex,
+int attribute_hidden __pthread_mutex_init(pthread_mutex_t * mutex,
const pthread_mutexattr_t * mutex_attr)
{
__pthread_init_lock(&mutex->__m_lock);
@@ -35,9 +35,8 @@ int __pthread_mutex_init(pthread_mutex_t * mutex,
return 0;
}
strong_alias (__pthread_mutex_init, pthread_mutex_init)
-hidden_def (__pthread_mutex_init)
-int __pthread_mutex_destroy(pthread_mutex_t * mutex)
+int attribute_hidden __pthread_mutex_destroy(pthread_mutex_t * mutex)
{
switch (mutex->__m_kind) {
case PTHREAD_MUTEX_ADAPTIVE_NP:
@@ -55,9 +54,8 @@ int __pthread_mutex_destroy(pthread_mutex_t * mutex)
}
}
strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)
-hidden_def (__pthread_mutex_destroy)
-int __pthread_mutex_trylock(pthread_mutex_t * mutex)
+int attribute_hidden __pthread_mutex_trylock(pthread_mutex_t * mutex)
{
pthread_descr self;
int retcode;
@@ -92,9 +90,8 @@ int __pthread_mutex_trylock(pthread_mutex_t * mutex)
}
}
strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock)
-hidden_def (__pthread_mutex_trylock)
-int __pthread_mutex_lock(pthread_mutex_t * mutex)
+int attribute_hidden __pthread_mutex_lock(pthread_mutex_t * mutex)
{
pthread_descr self;
@@ -126,9 +123,8 @@ int __pthread_mutex_lock(pthread_mutex_t * mutex)
}
}
strong_alias (__pthread_mutex_lock, pthread_mutex_lock)
-hidden_def (__pthread_mutex_lock)
-int __pthread_mutex_timedlock (pthread_mutex_t *mutex,
+int pthread_mutex_timedlock (pthread_mutex_t *mutex,
const struct timespec *abstime)
{
pthread_descr self;
@@ -170,10 +166,8 @@ int __pthread_mutex_timedlock (pthread_mutex_t *mutex,
return EINVAL;
}
}
-strong_alias (__pthread_mutex_timedlock, pthread_mutex_timedlock)
-hidden_def (__pthread_mutex_timedlock)
-int __pthread_mutex_unlock(pthread_mutex_t * mutex)
+int attribute_hidden __pthread_mutex_unlock(pthread_mutex_t * mutex)
{
switch (mutex->__m_kind) {
case PTHREAD_MUTEX_ADAPTIVE_NP:
@@ -203,22 +197,21 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex)
}
}
strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock)
-hidden_def (__pthread_mutex_unlock)
-int __pthread_mutexattr_init(pthread_mutexattr_t *attr)
+int attribute_hidden __pthread_mutexattr_init(pthread_mutexattr_t *attr)
{
attr->__mutexkind = PTHREAD_MUTEX_TIMED_NP;
return 0;
}
-strong_alias (__pthread_mutexattr_init, pthread_mutexattr_init)
+strong_alias(__pthread_mutexattr_init,pthread_mutexattr_init)
-int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr attribute_unused)
+int attribute_hidden __pthread_mutexattr_destroy(pthread_mutexattr_t *attr attribute_unused)
{
return 0;
}
-strong_alias (__pthread_mutexattr_destroy, pthread_mutexattr_destroy)
+strong_alias(__pthread_mutexattr_destroy,pthread_mutexattr_destroy)
-int __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind)
+int attribute_hidden __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind)
{
if (kind != PTHREAD_MUTEX_ADAPTIVE_NP
&& kind != PTHREAD_MUTEX_RECURSIVE_NP
@@ -228,10 +221,11 @@ int __pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind)
attr->__mutexkind = kind;
return 0;
}
-weak_alias (__pthread_mutexattr_settype, pthread_mutexattr_settype)
-strong_alias ( __pthread_mutexattr_settype, __pthread_mutexattr_setkind_np)
+strong_alias(__pthread_mutexattr_settype,pthread_mutexattr_settype)
+strong_alias (__pthread_mutexattr_settype, __pthread_mutexattr_setkind_np)
weak_alias (__pthread_mutexattr_setkind_np, pthread_mutexattr_setkind_np)
+int __pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind) attribute_hidden;
int __pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind)
{
*kind = attr->__mutexkind;
@@ -242,6 +236,8 @@ strong_alias (__pthread_mutexattr_gettype, __pthread_mutexattr_getkind_np)
weak_alias (__pthread_mutexattr_getkind_np, pthread_mutexattr_getkind_np)
int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr attribute_unused,
+ int *pshared) attribute_hidden;
+int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr attribute_unused,
int *pshared)
{
*pshared = PTHREAD_PROCESS_PRIVATE;
@@ -249,6 +245,7 @@ int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *attr attribute_un
}
weak_alias (__pthread_mutexattr_getpshared, pthread_mutexattr_getpshared)
+int __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr attribute_unused, int pshared) attribute_hidden;
int __pthread_mutexattr_setpshared (pthread_mutexattr_t *attr attribute_unused, int pshared)
{
if (pshared != PTHREAD_PROCESS_PRIVATE && pshared != PTHREAD_PROCESS_SHARED)
@@ -278,9 +275,9 @@ static void pthread_once_cancelhandler(void *arg)
{
pthread_once_t *once_control = arg;
- pthread_mutex_lock(&once_masterlock);
+ __pthread_mutex_lock(&once_masterlock);
*once_control = NEVER;
- pthread_mutex_unlock(&once_masterlock);
+ __pthread_mutex_unlock(&once_masterlock);
pthread_cond_broadcast(&once_finished);
}
@@ -298,7 +295,7 @@ int __pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
state_changed = 0;
- pthread_mutex_lock(&once_masterlock);
+ __pthread_mutex_lock(&once_masterlock);
/* If this object was left in an IN_PROGRESS state in a parent
process (indicated by stale generation field), reset it to NEVER. */
@@ -313,16 +310,16 @@ int __pthread_once(pthread_once_t * once_control, void (*init_routine)(void))
/* Here *once_control is stable and either NEVER or DONE. */
if (*once_control == NEVER) {
*once_control = IN_PROGRESS | fork_generation;
- pthread_mutex_unlock(&once_masterlock);
+ __pthread_mutex_unlock(&once_masterlock);
pthread_cleanup_push(pthread_once_cancelhandler, once_control);
init_routine();
pthread_cleanup_pop(0);
- pthread_mutex_lock(&once_masterlock);
+ __pthread_mutex_lock(&once_masterlock);
WRITE_MEMORY_BARRIER();
*once_control = DONE;
state_changed = 1;
}
- pthread_mutex_unlock(&once_masterlock);
+ __pthread_mutex_unlock(&once_masterlock);
if (state_changed)
pthread_cond_broadcast(&once_finished);
@@ -341,19 +338,22 @@ strong_alias (__pthread_once, pthread_once)
* and reset them back to NEVER.
*/
+void __pthread_once_fork_prepare(void);
void __pthread_once_fork_prepare(void)
{
- pthread_mutex_lock(&once_masterlock);
+ __pthread_mutex_lock(&once_masterlock);
}
+void __pthread_once_fork_parent(void);
void __pthread_once_fork_parent(void)
{
- pthread_mutex_unlock(&once_masterlock);
+ __pthread_mutex_unlock(&once_masterlock);
}
+void __pthread_once_fork_child(void);
void __pthread_once_fork_child(void)
{
- pthread_mutex_init(&once_masterlock, NULL);
+ __pthread_mutex_init(&once_masterlock, NULL);
pthread_cond_init(&once_finished, NULL);
if (fork_generation <= INT_MAX - 4)
fork_generation += 4; /* leave least significant two bits zero */
diff --git a/libpthread/linuxthreads.old/oldsemaphore.c b/libpthread/linuxthreads.old/oldsemaphore.c
index 6817e8e7c..6e91dc3c7 100644
--- a/libpthread/linuxthreads.old/oldsemaphore.c
+++ b/libpthread/linuxthreads.old/oldsemaphore.c
@@ -53,6 +53,7 @@ static inline int sem_compare_and_swap(old_sem_t *sem, long oldval, long newval)
static void sem_restart_list(pthread_descr waiting);
+int __old_sem_init(old_sem_t *sem, int pshared, unsigned int value);
int __old_sem_init(old_sem_t *sem, int pshared, unsigned int value)
{
if (value > SEM_VALUE_MAX) {
@@ -77,6 +78,7 @@ static int old_sem_extricate_func(void *obj attribute_unused, pthread_descr th a
return 1;
}
+int __old_sem_wait(old_sem_t * sem);
int __old_sem_wait(old_sem_t * sem)
{
long oldstatus, newstatus;
@@ -139,6 +141,7 @@ int __old_sem_wait(old_sem_t * sem)
}
}
+int __old_sem_trywait(old_sem_t * sem);
int __old_sem_trywait(old_sem_t * sem)
{
long oldstatus, newstatus;
@@ -155,6 +158,7 @@ int __old_sem_trywait(old_sem_t * sem)
return 0;
}
+int __old_sem_post(old_sem_t * sem);
int __old_sem_post(old_sem_t * sem)
{
long oldstatus, newstatus;
@@ -178,6 +182,7 @@ int __old_sem_post(old_sem_t * sem)
return 0;
}
+int __old_sem_getvalue(old_sem_t * sem, int * sval);
int __old_sem_getvalue(old_sem_t * sem, int * sval)
{
long status = sem->sem_status;
@@ -188,6 +193,7 @@ int __old_sem_getvalue(old_sem_t * sem, int * sval)
return 0;
}
+int __old_sem_destroy(old_sem_t * sem);
int __old_sem_destroy(old_sem_t * sem)
{
if ((sem->sem_status & 1) == 0) {
diff --git a/libpthread/linuxthreads.old/ptfork.c b/libpthread/linuxthreads.old/ptfork.c
index 8c0b464d2..184508a3d 100644
--- a/libpthread/linuxthreads.old/ptfork.c
+++ b/libpthread/linuxthreads.old/ptfork.c
@@ -18,7 +18,7 @@
#include <errno.h>
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
#include <stddef.h>
#include <stdlib.h>
@@ -61,14 +61,14 @@ int pthread_atfork(void (*prepare)(void),
struct handler_list_block * block =
(struct handler_list_block *) malloc(sizeof(struct handler_list_block));
if (block == NULL) return ENOMEM;
- pthread_mutex_lock(&pthread_atfork_lock);
+ __pthread_mutex_lock(&pthread_atfork_lock);
/* "prepare" handlers are called in LIFO */
pthread_insert_list(&pthread_atfork_prepare, prepare, &block->prepare, 0);
/* "parent" handlers are called in FIFO */
pthread_insert_list(&pthread_atfork_parent, parent, &block->parent, 1);
/* "child" handlers are called in FIFO */
pthread_insert_list(&pthread_atfork_child, child, &block->child, 1);
- pthread_mutex_unlock(&pthread_atfork_lock);
+ __pthread_mutex_unlock(&pthread_atfork_lock);
return 0;
}
//strong_alias (__pthread_atfork, pthread_atfork)
@@ -78,18 +78,19 @@ static inline void pthread_call_handlers(struct handler_list * list)
for (/*nothing*/; list != NULL; list = list->next) (list->handler)();
}
-extern int __libc_fork(void);
+extern __typeof(fork) __libc_fork;
+pid_t __fork(void) attribute_hidden;
pid_t __fork(void)
{
pid_t pid;
struct handler_list * prepare, * child, * parent;
- pthread_mutex_lock(&pthread_atfork_lock);
+ __pthread_mutex_lock(&pthread_atfork_lock);
prepare = pthread_atfork_prepare;
child = pthread_atfork_child;
parent = pthread_atfork_parent;
- pthread_mutex_unlock(&pthread_atfork_lock);
+ __pthread_mutex_unlock(&pthread_atfork_lock);
pthread_call_handlers(prepare);
pid = __libc_fork();
if (pid == 0) {
@@ -101,13 +102,12 @@ pid_t __fork(void)
}
return pid;
}
-weak_alias (__fork, fork)
+strong_alias(__fork,fork)
-pid_t __vfork(void)
+pid_t vfork(void)
{
return __fork();
}
-weak_alias (__vfork, vfork)
#else
diff --git a/libpthread/linuxthreads.old/pthread.c b/libpthread/linuxthreads.old/pthread.c
index d7411f04b..4adf66cd6 100644
--- a/libpthread/linuxthreads.old/pthread.c
+++ b/libpthread/linuxthreads.old/pthread.c
@@ -16,7 +16,6 @@
#define __FORCE_GLIBC
#include <features.h>
-#define __USE_GNU
#include <errno.h>
#include <netdb.h> /* for h_errno */
#include <stddef.h>
@@ -39,12 +38,10 @@
#include <sys/types.h>
#include <sys/syscall.h>
-/* mods for uClibc: getpwd and getpagesize are the syscalls */
-#define __getpid getpid
-#define __getpagesize getpagesize
/* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
-
+extern __typeof(sigaction) __libc_sigaction;
+libpthread_hidden_proto(waitpid)
+libpthread_hidden_proto(raise)
/* These variables are used by the setup code. */
extern int _errno;
@@ -175,9 +172,9 @@ char *__pthread_initial_thread_bos = NULL;
* This is adapted when other stacks are malloc'ed since we don't know
* the bounds a-priori. -StS */
-#ifndef __ARCH_HAS_MMU__
+#ifndef __ARCH_USE_MMU__
char *__pthread_initial_thread_tos = NULL;
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
/* File descriptor for sending requests to the thread manager. */
/* Initially -1, meaning that the thread manager is not running. */
@@ -268,6 +265,7 @@ int __libc_current_sigrtmax (void)
/* Allocate real-time signal with highest/lowest available
priority. Please note that we don't use a lock since we assume
this function to be called at program start. */
+int __libc_allocate_rtsig (int high);
int __libc_allocate_rtsig (int high)
{
if (current_rtmin == -1 || current_rtmin > current_rtmax)
@@ -320,11 +318,11 @@ struct pthread_functions __pthread_functions =
.ptr___pthread_exit = pthread_exit,
.ptr_pthread_getschedparam = pthread_getschedparam,
.ptr_pthread_setschedparam = pthread_setschedparam,
- .ptr_pthread_mutex_destroy = pthread_mutex_destroy,
- .ptr_pthread_mutex_init = pthread_mutex_init,
- .ptr_pthread_mutex_lock = pthread_mutex_lock,
- .ptr_pthread_mutex_trylock = pthread_mutex_trylock,
- .ptr_pthread_mutex_unlock = pthread_mutex_unlock,
+ .ptr_pthread_mutex_destroy = __pthread_mutex_destroy,
+ .ptr_pthread_mutex_init = __pthread_mutex_init,
+ .ptr_pthread_mutex_lock = __pthread_mutex_lock,
+ .ptr_pthread_mutex_trylock = __pthread_mutex_trylock,
+ .ptr_pthread_mutex_unlock = __pthread_mutex_unlock,
.ptr_pthread_self = pthread_self,
.ptr_pthread_setcancelstate = pthread_setcancelstate,
.ptr_pthread_setcanceltype = pthread_setcanceltype,
@@ -365,8 +363,10 @@ static void pthread_initialize(void)
{
struct sigaction sa;
sigset_t mask;
+#ifdef __ARCH_USE_MMU__
struct rlimit limit;
rlim_t max_stack;
+#endif
/* If already done (e.g. by a constructor called earlier!), bail out */
if (__pthread_initial_thread_bos != NULL) return;
@@ -380,7 +380,7 @@ static void pthread_initialize(void)
__pthread_initial_thread_bos =
(char *)(((long)CURRENT_STACK_FRAME - 2 * STACK_SIZE) & ~(STACK_SIZE - 1));
/* Update the descriptor for the initial thread. */
- __pthread_initial_thread.p_pid = __getpid();
+ __pthread_initial_thread.p_pid = getpid();
/* If we have special thread_self processing, initialize that for the
main thread now. */
#ifdef INIT_THREAD_SELF
@@ -410,11 +410,11 @@ static void pthread_initialize(void)
beyond STACK_SIZE minus two pages (one page for the thread descriptor
immediately beyond, and one page to act as a guard page). */
-#ifdef __ARCH_HAS_MMU__
+#ifdef __ARCH_USE_MMU__
/* We cannot allocate a huge chunk of memory to mmap all thread stacks later
* on a non-MMU system. Thus, we don't need the rlimit either. -StS */
getrlimit(RLIMIT_STACK, &limit);
- max_stack = STACK_SIZE - 2 * __getpagesize();
+ max_stack = STACK_SIZE - 2 * getpagesize();
if (limit.rlim_cur > max_stack) {
limit.rlim_cur = max_stack;
setrlimit(RLIMIT_STACK, &limit);
@@ -425,11 +425,11 @@ static void pthread_initialize(void)
* malloc other stack frames such that they don't overlap. -StS
*/
__pthread_initial_thread_tos =
- (char *)(((long)CURRENT_STACK_FRAME + __getpagesize()) & ~(__getpagesize() - 1));
+ (char *)(((long)CURRENT_STACK_FRAME + getpagesize()) & ~(getpagesize() - 1));
__pthread_initial_thread_bos = (char *) 1; /* set it non-zero so we know we have been here */
PDEBUG("initial thread stack bounds: bos=%p, tos=%p\n",
__pthread_initial_thread_bos, __pthread_initial_thread_tos);
-#endif /* __ARCH_HAS_MMU__ */
+#endif /* __ARCH_USE_MMU__ */
/* Setup signal handlers for the initial thread.
Since signal handlers are shared between threads, these settings
@@ -462,6 +462,7 @@ static void pthread_initialize(void)
on_exit(pthread_onexit_process, NULL);
}
+void __pthread_initialize(void);
void __pthread_initialize(void)
{
pthread_initialize();
@@ -848,7 +849,7 @@ void __pthread_reset_main_thread()
}
/* Update the pid of the main thread */
- THREAD_SETMEM(self, p_pid, __getpid());
+ THREAD_SETMEM(self, p_pid, getpid());
/* Make the forked thread the main thread */
__pthread_main_thread = self;
THREAD_SETMEM(self, p_nextlive, self);
@@ -1090,7 +1091,7 @@ void __pthread_message(char * fmt, ...)
{
char buffer[1024];
va_list args;
- sprintf(buffer, "%05d : ", __getpid());
+ sprintf(buffer, "%05d : ", getpid());
va_start(args, fmt);
vsnprintf(buffer + 8, sizeof(buffer) - 8, fmt, args);
va_end(args);
diff --git a/libpthread/linuxthreads.old/ptlongjmp.c b/libpthread/linuxthreads.old/ptlongjmp.c
index c0ea8223a..055a217d3 100644
--- a/libpthread/linuxthreads.old/ptlongjmp.c
+++ b/libpthread/linuxthreads.old/ptlongjmp.c
@@ -21,11 +21,8 @@
/* These functions are not declared anywhere since they shouldn't be
used at another place but here. */
-extern void __libc_siglongjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-extern void __libc_longjmp (sigjmp_buf env, int val)
- __attribute__ ((noreturn));
-
+extern __typeof(siglongjmp) __libc_siglongjmp attribute_noreturn;
+extern __typeof(longjmp) __libc_longjmp attribute_noreturn;
static void pthread_cleanup_upto(__jmp_buf target)
{
@@ -42,14 +39,14 @@ static void pthread_cleanup_upto(__jmp_buf target)
THREAD_SETMEM(self, p_in_sighandler, NULL);
}
-void siglongjmp(sigjmp_buf env, int val)
+void attribute_noreturn siglongjmp(sigjmp_buf env, int val)
{
pthread_cleanup_upto(env->__jmpbuf);
__libc_siglongjmp(env, val);
}
-void longjmp(jmp_buf env, int val)
+void attribute_noreturn longjmp(jmp_buf env, int val)
{
pthread_cleanup_upto(env->__jmpbuf);
- __libc_siglongjmp(env, val);
+ __libc_longjmp(env, val);
}
diff --git a/libpthread/linuxthreads.old/semaphore.c b/libpthread/linuxthreads.old/semaphore.c
index 0a156e123..a44f52411 100644
--- a/libpthread/linuxthreads.old/semaphore.c
+++ b/libpthread/linuxthreads.old/semaphore.c
@@ -15,7 +15,6 @@
/* Semaphores a la POSIX 1003.1b */
#include <features.h>
-#define __USE_GNU
#include <errno.h>
#include "pthread.h"
#include "semaphore.h"
@@ -24,6 +23,7 @@
#include "restart.h"
#include "queue.h"
+int __new_sem_init(sem_t *sem, int pshared, unsigned int value);
int __new_sem_init(sem_t *sem, int pshared, unsigned int value)
{
if (value > SEM_VALUE_MAX) {
@@ -56,6 +56,7 @@ static int new_sem_extricate_func(void *obj, pthread_descr th)
return did_remove;
}
+int __new_sem_wait(sem_t * sem);
int __new_sem_wait(sem_t * sem)
{
volatile pthread_descr self = thread_self();
@@ -118,6 +119,7 @@ int __new_sem_wait(sem_t * sem)
return 0;
}
+int __new_sem_trywait(sem_t * sem);
int __new_sem_trywait(sem_t * sem)
{
int retval;
@@ -134,6 +136,7 @@ int __new_sem_trywait(sem_t * sem)
return retval;
}
+int __new_sem_post(sem_t * sem);
int __new_sem_post(sem_t * sem)
{
pthread_descr self = thread_self();
@@ -175,12 +178,14 @@ int __new_sem_post(sem_t * sem)
return 0;
}
+int __new_sem_getvalue(sem_t * sem, int * sval);
int __new_sem_getvalue(sem_t * sem, int * sval)
{
*sval = sem->__sem_value;
return 0;
}
+int __new_sem_destroy(sem_t * sem);
int __new_sem_destroy(sem_t * sem)
{
if (sem->__sem_waiting != NULL) {
diff --git a/libpthread/linuxthreads.old/signals.c b/libpthread/linuxthreads.old/signals.c
index 0ac858139..23ba9778f 100644
--- a/libpthread/linuxthreads.old/signals.c
+++ b/libpthread/linuxthreads.old/signals.c
@@ -24,7 +24,7 @@
#include <bits/sigcontextinfo.h>
/* mods for uClibc: __libc_sigaction is not in any standard headers */
-extern int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
+extern __typeof(sigaction) __libc_sigaction;
int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)
{
@@ -131,7 +131,8 @@ static void pthread_sighandler_rt(int signo, struct siginfo *si,
/* The wrapper around sigaction. Install our own signal handler
around the signal. */
-int __sigaction(int sig, const struct sigaction * act,
+libpthread_hidden_proto(sigaction)
+int sigaction(int sig, const struct sigaction * act,
struct sigaction * oact)
{
struct sigaction newact;
@@ -162,7 +163,7 @@ printf(__FUNCTION__": pthreads wrapper!\n");
if (__libc_sigaction(sig, newactp, oact) == -1)
return -1;
#ifdef DEBUG_PT
-printf(__FUNCTION__": signahdler installed, __sigaction successful\n");
+printf(__FUNCTION__": sighandler installed, sigaction successful\n");
#endif
if (sig > 0 && sig < NSIG)
{
@@ -175,7 +176,7 @@ printf(__FUNCTION__": signahdler installed, __sigaction successful\n");
}
return 0;
}
-strong_alias(__sigaction, sigaction)
+libpthread_hidden_def(sigaction)
/* A signal handler that does nothing */
static void pthread_null_sighandler(int sig attribute_unused) { }
@@ -236,6 +237,7 @@ int sigwait(const sigset_t * set, int * sig)
/* Redefine raise() to send signal to calling thread only,
as per POSIX 1003.1c */
+libpthread_hidden_proto(raise)
int raise (int sig)
{
int retcode = pthread_kill(pthread_self(), sig);
@@ -246,3 +248,4 @@ int raise (int sig)
return -1;
}
}
+libpthread_hidden_def(raise)
diff --git a/libpthread/linuxthreads.old/specific.c b/libpthread/linuxthreads.old/specific.c
index 509ee6665..72409b30b 100644
--- a/libpthread/linuxthreads.old/specific.c
+++ b/libpthread/linuxthreads.old/specific.c
@@ -15,7 +15,6 @@
/* Thread-specific data */
#include <features.h>
-#define __USE_GNU
#include <errno.h>
#include <stddef.h>
#include <stdlib.h>
@@ -43,18 +42,18 @@ int pthread_key_create(pthread_key_t * key, destr_function destr)
{
int i;
- pthread_mutex_lock(&pthread_keys_mutex);
+ __pthread_mutex_lock(&pthread_keys_mutex);
for (i = 0; i < PTHREAD_KEYS_MAX; i++) {
if (! pthread_keys[i].in_use) {
/* Mark key in use */
pthread_keys[i].in_use = 1;
pthread_keys[i].destr = destr;
- pthread_mutex_unlock(&pthread_keys_mutex);
+ __pthread_mutex_unlock(&pthread_keys_mutex);
*key = i;
return 0;
}
}
- pthread_mutex_unlock(&pthread_keys_mutex);
+ __pthread_mutex_unlock(&pthread_keys_mutex);
return EAGAIN;
}
@@ -63,9 +62,9 @@ int pthread_key_delete(pthread_key_t key)
{
pthread_descr self = thread_self();
- pthread_mutex_lock(&pthread_keys_mutex);
+ __pthread_mutex_lock(&pthread_keys_mutex);
if (key >= PTHREAD_KEYS_MAX || !pthread_keys[key].in_use) {
- pthread_mutex_unlock(&pthread_keys_mutex);
+ __pthread_mutex_unlock(&pthread_keys_mutex);
return EINVAL;
}
pthread_keys[key].in_use = 0;
@@ -91,7 +90,7 @@ int pthread_key_delete(pthread_key_t key)
} while (th != self);
}
- pthread_mutex_unlock(&pthread_keys_mutex);
+ __pthread_mutex_unlock(&pthread_keys_mutex);
return 0;
}
diff --git a/libpthread/linuxthreads.old/spinlock.c b/libpthread/linuxthreads.old/spinlock.c
index cdf45f195..e00bc3156 100644
--- a/libpthread/linuxthreads.old/spinlock.c
+++ b/libpthread/linuxthreads.old/spinlock.c
@@ -26,13 +26,15 @@
#include "spinlock.h"
#include "restart.h"
+libpthread_hidden_proto(nanosleep)
+
static void __pthread_acquire(int * spinlock);
static inline void __pthread_release(int * spinlock)
{
WRITE_MEMORY_BARRIER();
*spinlock = __LT_SPINLOCK_INIT;
- __asm __volatile ("" : "=m" (*spinlock) : "m" (*spinlock));
+ __asm __volatile__ ("" : "=m" (*spinlock) : "m" (*spinlock));
}
diff --git a/libpthread/linuxthreads.old/sysdeps/h8300/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/h8300/pt-machine.h
new file mode 100644
index 000000000..ad83147cb
--- /dev/null
+++ b/libpthread/linuxthreads.old/sysdeps/h8300/pt-machine.h
@@ -0,0 +1,58 @@
+/* Machine-dependent pthreads configuration and inline functions.
+ H8/300 version.
+ Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson <rth@tamu.edu>.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If
+ not, write to the Free Software Foundation, Inc.,
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _PT_MACHINE_H
+#define _PT_MACHINE_H 1
+
+#ifndef PT_EI
+# define PT_EI extern inline
+#endif
+
+extern long int testandset (int *spinlock);
+
+/* Spinlock implementation; required. */
+PT_EI long int
+testandset (int *spinlock)
+{
+ char ret;
+
+ __asm__ __volatile__(
+ "sub.w %0,%0\n\t"
+ "stc ccr,@-sp\n\t"
+ "orc #0x80,ccr\n\t"
+ "bld #0,@%2\n\t"
+ "bset #0,@%2\n\t"
+ "rotxl.w %0\n\t"
+ "ldc @sp+,ccr\n\t"
+ :"=r"(ret),"=m"(*spinlock)
+ :"g"(spinlock)
+ :"cc");
+
+ return ret;
+}
+
+
+/* Get some notion of the current stack. Need not be exactly the top
+ of the stack, just something somewhere in the current frame. */
+#define CURRENT_STACK_FRAME stack_pointer
+register char * stack_pointer __asm__ ("%sp");
+
+#endif /* pt-machine.h */
diff --git a/libpthread/linuxthreads.old/wrapsyscall.c b/libpthread/linuxthreads.old/wrapsyscall.c
index 6b8a00bb5..369c190d5 100644
--- a/libpthread/linuxthreads.old/wrapsyscall.c
+++ b/libpthread/linuxthreads.old/wrapsyscall.c
@@ -102,9 +102,11 @@ CANCELABLE_SYSCALL (int, msync, (__ptr_t addr, size_t length, int flags),
/* nanosleep(2). */
+libpthread_hidden_proto(nanosleep)
CANCELABLE_SYSCALL (int, nanosleep, (const struct timespec *requested_time,
struct timespec *remaining),
(requested_time, remaining))
+libpthread_hidden_def(nanosleep)
/* open(2). */
@@ -167,9 +169,11 @@ CANCELABLE_SYSCALL (__pid_t, wait, (__WAIT_STATUS_DEFN stat_loc), (stat_loc))
/* waitpid(2). */
+libpthread_hidden_proto(waitpid)
CANCELABLE_SYSCALL (__pid_t, waitpid, (__pid_t pid, int *stat_loc,
int options),
(pid, stat_loc, options))
+libpthread_hidden_def(waitpid)
/* write(2). */
diff --git a/libpthread/linuxthreads.old_db/Makefile.in b/libpthread/linuxthreads.old_db/Makefile.in
index c203232e7..acdcd69e3 100644
--- a/libpthread/linuxthreads.old_db/Makefile.in
+++ b/libpthread/linuxthreads.old_db/Makefile.in
@@ -1,14 +1,17 @@
# Makefile for uClibc
#
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
# Get the thread include dependencies and shared object name
-CFLAGS-linuxthreads.old_db := -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
+CFLAGS-linuxthreads.old_db := -DNOT_IN_libc -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
-LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols
+LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) $(call check_ld,--warn-unresolved-symbols)
+ifneq ($(NOSTRIP),y)
+LDFLAGS-libthread_db.so += -s
+endif
LIBS-libthread_db.so := $(LIBS)
@@ -28,26 +31,34 @@ else
libthread_db-a-y := $(libthread_db_OBJ)
endif
-libthread_db-multi-y := $(libthread_db_SRC)
-
lib-a-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.a
lib-so-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.so
objclean-y += libthread_db_clean
headers-$(PTHREADS_DEBUG_SUPPORT) += linuxthreads_db_headers
headers_clean-y += linuxthreads_db_headers_clean
+#ifeq ($(DOMULTI),n)
ifeq ($(DOPIC),y)
$(top_builddir)lib/libthread_db.so: $(top_builddir)lib/libthread_db.a $(libc)
else
$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db_so.a $(libc)
endif
$(call link.so,$(libthread_db_FULL_NAME),1)
+#else
+#$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db.oS | $(libc)
+# $(call linkm.so,$(libthread_db_FULL_NAME),1)
+#endif
$(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
$(Q)$(RM) $@
$(do_strip)
$(do_ar)
+$(libthread_db_OUT)/libthread_db.oS: $(libthread_db_SRC)
+ $(Q)$(RM) $@
+ $(compile-m)
+ $(do_t_strip)
+
$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $@
@@ -55,10 +66,10 @@ $(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
$(do_ar)
linuxthreads_db_headers:
- $(LN) -sf ../$(PTDIR)_db/thread_db.h $(top_builddir)include/
+ $(Q)$(LN) -sf ../$(PTDIR)_db/thread_db.h $(top_builddir)include/
linuxthreads_db_headers_clean:
$(RM) $(top_builddir)include/thread_db.h
libthread_db_clean:
- $(RM) $(libthread_db_OUT)/*.{o,os,a}
+ $(RM) $(libthread_db_OUT)/*.{o,os,oS,a}
diff --git a/libpthread/linuxthreads.old_db/td_init.c b/libpthread/linuxthreads.old_db/td_init.c
index d714f1ba0..6f0e1584c 100644
--- a/libpthread/linuxthreads.old_db/td_init.c
+++ b/libpthread/linuxthreads.old_db/td_init.c
@@ -20,8 +20,9 @@
#include "thread_dbP.h"
+#ifndef NDEBUG
int __td_debug;
-
+#endif
td_err_e
td_init (void)
diff --git a/libpthread/linuxthreads.old_db/thread_dbP.h b/libpthread/linuxthreads.old_db/thread_dbP.h
index 257beb2e9..f08c43206 100644
--- a/libpthread/linuxthreads.old_db/thread_dbP.h
+++ b/libpthread/linuxthreads.old_db/thread_dbP.h
@@ -11,7 +11,7 @@
#include "internals.h"
-/* Indeces for the symbol names. */
+/* Indices for the symbol names. */
enum
{
PTHREAD_THREADS_EVENTS = 0,
@@ -33,8 +33,8 @@ enum
/* Comment out the following for less verbose output. */
#ifndef NDEBUG
-# define LOG(c) if (__td_debug) __libc_write (2, c "\n", strlen (c "\n"))
-extern int __td_debug;
+# define LOG(c) if (__td_debug) write (2, c "\n", strlen (c "\n"))
+extern int __td_debug attribute_hidden;
#else
# define LOG(c)
#endif
@@ -86,7 +86,7 @@ struct agent_list
};
/* List of all known descriptors. */
-extern struct agent_list *__td_agent_list;
+extern struct agent_list *__td_agent_list attribute_hidden;
/* Function used to test for correct thread agent pointer. */
static inline int
@@ -105,6 +105,6 @@ ta_ok (const td_thragent_t *ta)
/* Internal wrapper around ps_pglobal_lookup. */
-extern int td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr);
+extern int td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr) attribute_hidden;
#endif /* thread_dbP.h */
diff --git a/libpthread/linuxthreads_db/Makefile.in b/libpthread/linuxthreads_db/Makefile.in
index 7833e1bad..1dd2b02b0 100644
--- a/libpthread/linuxthreads_db/Makefile.in
+++ b/libpthread/linuxthreads_db/Makefile.in
@@ -1,15 +1,17 @@
# Makefile for uClibc
#
-# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
#
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
# Get the thread include dependencies and shared object name
-CFLAGS-linuxthreads_db := -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
-CFLAGS-linuxthreads_db += -D_GNU_SOURCE
+CFLAGS-linuxthreads_db := -DNOT_IN_libc -DLIBPTHREAD_SO="\"libpthread.so.$(MAJOR_VERSION)\""
-LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) -s --warn-unresolved-symbols
+LDFLAGS-libthread_db.so := $(LDFLAGS_NOSTRIP) $(call check_ld,--warn-unresolved-symbols)
+ifneq ($(NOSTRIP),y)
+LDFLAGS-libthread_db.so += -s
+endif
LIBS-libthread_db.so := $(LIBS)
@@ -29,26 +31,34 @@ else
libthread_db-a-y := $(libthread_db_OBJ)
endif
-libthread_db-multi-y := $(libthread_db_SRC)
-
lib-a-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.a
lib-so-$(PTHREADS_DEBUG_SUPPORT) += $(top_builddir)lib/libthread_db.so
objclean-y += libthread_db_clean
headers-$(PTHREADS_DEBUG_SUPPORT) += linuxthreads_db_headers
headers_clean-y += linuxthreads_db_headers_clean
+#ifeq ($(DOMULTI),n)
ifeq ($(DOPIC),y)
$(top_builddir)lib/libthread_db.so: $(top_builddir)lib/libthread_db.a $(libc)
else
$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db_so.a $(libc)
endif
$(call link.so,$(libthread_db_FULL_NAME),1)
+#else
+#$(top_builddir)lib/libthread_db.so: $(libthread_db_OUT)/libthread_db.oS | $(libc)
+# $(call linkm.so,$(libthread_db_FULL_NAME),1)
+#endif
$(libthread_db_OUT)/libthread_db_so.a: $(libthread_db-so-y)
$(Q)$(RM) $@
$(do_strip)
$(do_ar)
+$(libthread_db_OUT)/libthread_db.oS: $(libthread_db_SRC)
+ $(Q)$(RM) $@
+ $(compile-m)
+ $(do_t_strip)
+
$(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
$(Q)$(INSTALL) -d $(dir $@)
$(Q)$(RM) $@
@@ -56,10 +66,10 @@ $(top_builddir)lib/libthread_db.a: $(libthread_db-a-y)
$(do_ar)
linuxthreads_db_headers:
- $(LN) -sf ../$(PTDIR)_db/thread_db.h $(top_builddir)include/
+ $(Q)$(LN) -sf ../$(PTDIR)_db/thread_db.h $(top_builddir)include/
linuxthreads_db_headers_clean:
$(RM) $(top_builddir)include/thread_db.h
libthread_db_clean:
- $(RM) $(libthread_db_OUT)/*.{o,os,a}
+ $(RM) $(libthread_db_OUT)/*.{o,os,oS,a}
diff --git a/libpthread/linuxthreads_db/td_init.c b/libpthread/linuxthreads_db/td_init.c
index d714f1ba0..6f0e1584c 100644
--- a/libpthread/linuxthreads_db/td_init.c
+++ b/libpthread/linuxthreads_db/td_init.c
@@ -20,8 +20,9 @@
#include "thread_dbP.h"
+#ifndef NDEBUG
int __td_debug;
-
+#endif
td_err_e
td_init (void)
diff --git a/libpthread/linuxthreads_db/thread_dbP.h b/libpthread/linuxthreads_db/thread_dbP.h
index 63b408afc..30bdae451 100644
--- a/libpthread/linuxthreads_db/thread_dbP.h
+++ b/libpthread/linuxthreads_db/thread_dbP.h
@@ -9,7 +9,7 @@
#include "../linuxthreads/descr.h"
-/* Indeces for the symbol names. */
+/* Indices for the symbol names. */
enum
{
PTHREAD_THREADS_EVENTS = 0,
@@ -32,7 +32,7 @@ enum
/* Comment out the following for less verbose output. */
#ifndef NDEBUG
# define LOG(c) if (__td_debug) write (2, c "\n", strlen (c "\n"))
-extern int __td_debug;
+extern int __td_debug attribute_hidden;
#else
# define LOG(c)
#endif
@@ -84,7 +84,7 @@ struct agent_list
};
/* List of all known descriptors. */
-extern struct agent_list *__td_agent_list;
+extern struct agent_list *__td_agent_list attribute_hidden;
/* Function used to test for correct thread agent pointer. */
static inline int
@@ -103,6 +103,6 @@ ta_ok (const td_thragent_t *ta)
/* Internal wrapper around ps_pglobal_lookup. */
-extern int td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr);
+extern int td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr) attribute_hidden;
#endif /* thread_dbP.h */
diff --git a/utils/Makefile.in b/utils/Makefile.in
index 0571b5765..57a00b307 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -5,7 +5,7 @@
# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
#
-CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) -B$(top_builddir)lib
+CFLAGS-utils := -DNOT_IN_libc $(SSP_ALL_CFLAGS) -B$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib
CFLAGS-utils-common := -I$(top_srcdir)ldso/include -DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" -DUCLIBC_LDSO=$(UCLIBC_LDSO)
CFLAGS-utils-shared := $(PIEFLAG) $(LDPIEFLAG)
@@ -18,7 +18,7 @@ else
CFLAGS-ldconfig += $(CFLAGS-utils-shared)
endif
-CFLAGS-ldd := $(CFLAGS-utils-common) $(CFLAGS-utils-shared) -D_GNU_SOURCE
+CFLAGS-ldd := $(CFLAGS-utils-common) $(CFLAGS-utils-shared)
# needs CFLAGS-utils explicitely, because the source file is not located in utils
CFLAGS-iconv := $(CFLAGS-utils) $(CFLAGS-utils-shared) -DL_iconv_main
@@ -35,7 +35,7 @@ endif
BUILD_CFLAGS-ldconfig.host := $(BUILD_CFLAGS-utils-common)
-BUILD_CFLAGS-ldd.host := $(BUILD_CFLAGS-utils-common) -D_GNU_SOURCE
+BUILD_CFLAGS-ldd.host := $(BUILD_CFLAGS-utils-common)
BUILD_LDFLAGS-utils := -Wl,-s
diff --git a/utils/ldconfig.c b/utils/ldconfig.c
index f54eadd27..30e5fdb7c 100644
--- a/utils/ldconfig.c
+++ b/utils/ldconfig.c
@@ -303,7 +303,7 @@ char *is_shlib(const char *dir, const char *name, int *type,
{
/* always call readsoname to update type */
if(expected_type == LIB_DLL) {
- warnx("%s is not an a.out library, its ELF!\n", buff);
+ warnx("%s is not an a.out library, it's ELF!", buff);
expected_type=LIB_ANY;
}
*type = LIB_ELF;
@@ -526,7 +526,7 @@ void scan_dir(const char *rawname)
}
else
{
- warnx("Unknown type field '%s' for dir '%s' - ignored\n", t, name);
+ warnx("Unknown type field '%s' for dir '%s' - ignored", t, name);
expected_type = LIB_ANY;
}
}
@@ -1055,7 +1055,7 @@ int main(int argc, char **argv)
if (strcmp(UCLIBC_RUNTIME_PREFIX "lib", cp) == 0 ||
strcmp(UCLIBC_RUNTIME_PREFIX "usr/lib", cp) == 0) {
if (verbose >= 0)
- warnx("Remove `%s' from `%s'\n", cp, LDSO_CONF);
+ warnx("You should remove `%s' from `%s'", cp, LDSO_CONF);
continue;
}
scan_dir(cp);
diff --git a/utils/ldd.c b/utils/ldd.c
index 4545cf328..314798354 100644
--- a/utils/ldd.c
+++ b/utils/ldd.c
@@ -26,9 +26,6 @@
*
*/
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE
-#endif
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>