From 168457afa6a03e4165297985b6ec2d90c83d43c6 Mon Sep 17 00:00:00 2001 From: Austin Foxley Date: Tue, 20 Oct 2009 13:19:35 -0700 Subject: remove useless .gitignore Signed-off-by: Austin Foxley --- extra/.gitignore | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 extra/.gitignore diff --git a/extra/.gitignore b/extra/.gitignore deleted file mode 100644 index f47fe57ec..000000000 --- a/extra/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# -# Never ignore these -# -!.gitignore - -# -# Generated files -# -locale/c8tables.h -locale/codesets.txt -locale/gen_collate -locale/gen_ldc -locale/gen_locale -locale/gen_wc8bit -locale/gen_wctype -locale/locale_collate.h -locale/locale_data.c -locale/locale_tables.h -locale/locales.txt -locale/lt_defines.h -locale/uClibc_locale_data.h -locale/wctables.h -- cgit v1.2.3 From f51fb26dbcceee9e48d10facc830bd4a549f6cc2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 00:39:44 -0400 Subject: sparc: use HIDDEN_JUMPTARGET for errno Signed-off-by: Mike Frysinger --- libc/sysdeps/linux/sparc/fork.S | 2 +- libc/sysdeps/linux/sparc/pipe.S | 2 +- libc/sysdeps/linux/sparc/vfork.S | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libc/sysdeps/linux/sparc/fork.S b/libc/sysdeps/linux/sparc/fork.S index 00157cffd..7ead409f0 100644 --- a/libc/sysdeps/linux/sparc/fork.S +++ b/libc/sysdeps/linux/sparc/fork.S @@ -33,7 +33,7 @@ __libc_fork: bcc,a 9000f nop save %sp,-96,%sp - call __errno_location + call HIDDEN_JUMPTARGET(__errno_location) nop st %i0,[%o0] jmpl %i7+8,%g0 diff --git a/libc/sysdeps/linux/sparc/pipe.S b/libc/sysdeps/linux/sparc/pipe.S index 0226e3f5c..76a5b9617 100644 --- a/libc/sysdeps/linux/sparc/pipe.S +++ b/libc/sysdeps/linux/sparc/pipe.S @@ -52,7 +52,7 @@ pipe: restore %o0,%g0,%o0 .Lerror: - call __errno_location + call HIDDEN_JUMPTARGET(__errno_location) or %g0,EINVAL,%i0 st %i0,[%o0] ret diff --git a/libc/sysdeps/linux/sparc/vfork.S b/libc/sysdeps/linux/sparc/vfork.S index 35ca037d8..ed3e1a079 100644 --- a/libc/sysdeps/linux/sparc/vfork.S +++ b/libc/sysdeps/linux/sparc/vfork.S @@ -38,7 +38,7 @@ __vfork: bcc,a 9000f nop save %sp,-96,%sp - call __errno_location + call HIDDEN_JUMPTARGET(__errno_location) nop st %i0,[%o0] jmpl %i7+8,%g0 -- cgit v1.2.3 From bc5922f17d546bbd82644d0be03bb078bba1f85f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 00:39:59 -0400 Subject: sparc: use fputs to write to stderr This also has the advantage of fputs() having a hidden alias while puts does not. Signed-off-by: Mike Frysinger --- libc/sysdeps/linux/sparc/qp_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/sysdeps/linux/sparc/qp_ops.c b/libc/sysdeps/linux/sparc/qp_ops.c index 5b0dc5e87..123be53fb 100644 --- a/libc/sysdeps/linux/sparc/qp_ops.c +++ b/libc/sysdeps/linux/sparc/qp_ops.c @@ -5,7 +5,7 @@ static void fakedef(void) { - puts("Unimplemented _Q* func called, exiting\n"); + fputs("Unimplemented _Q* func called, exiting\n", stderr); exit(-1); } -- cgit v1.2.3 From 829779686b0a263ad3582aecc1cc7a296c38a1c9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 00:41:29 -0400 Subject: inet_ntop4: avoid inline initialization We only need to set the first byte to 0, but gcc likes to zero out the rest of the string with memset() when using this initialization style. Signed-off-by: Mike Frysinger --- libc/inet/ntop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libc/inet/ntop.c b/libc/inet/ntop.c index 57a0b8ccd..fa733e0ad 100644 --- a/libc/inet/ntop.c +++ b/libc/inet/ntop.c @@ -51,10 +51,12 @@ static const char * inet_ntop4(const u_char *src, char *dst, size_t size) { - char tmp[sizeof ("255.255.255.255") + 1] = "\0"; + char tmp[sizeof ("255.255.255.255") + 1]; int octet; int i; + tmp[0] = '\0'; + i = 0; for (octet = 0; octet <= 3; octet++) { -- cgit v1.2.3 From 3b96fc2ea791adfaeef265854d3a58259a0d3f19 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 00:43:19 -0400 Subject: sysctl: avoid inline initialization Assign each field one by one rather than stack initialization as gcc will call memset() to zero out the rest of the structure -- which we don't care about as the field is unused and not seen outside of the libc. Signed-off-by: Mike Frysinger --- libc/sysdeps/linux/common/sysctl.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/libc/sysdeps/linux/common/sysctl.c b/libc/sysdeps/linux/common/sysctl.c index 11d53cd8e..f65a3eaa2 100644 --- a/libc/sysdeps/linux/common/sysctl.c +++ b/libc/sysdeps/linux/common/sysctl.c @@ -10,10 +10,6 @@ #include #if defined __NR__sysctl && (defined __USE_GNU || defined __USE_BSD) -/* psm: including sys/sysctl.h would depend on kernel headers */ -extern int sysctl (int *__name, int __nlen, void *__oldval, - size_t *__oldlenp, void *__newval, size_t __newlen) __THROW; - struct __sysctl_args { int *name; int nlen; @@ -24,21 +20,17 @@ struct __sysctl_args { unsigned long __unused[4]; }; -static __always_inline -_syscall1(int, _sysctl, struct __sysctl_args *, args) - int sysctl(int *name, int nlen, void *oldval, size_t * oldlenp, void *newval, size_t newlen) { - struct __sysctl_args args = { - .name = name, - .nlen = nlen, - .oldval = oldval, - .oldlenp = oldlenp, - .newval = newval, - .newlen = newlen - }; - - return _sysctl(&args); + /* avoid initializing on the stack as gcc will call memset() */ + struct __sysctl_args args; + args.name = name; + args.nlen = nlen; + args.oldval = oldval; + args.oldlenp = oldlenp; + args.newval = newval; + args.newlen = newlen; + return INLINE_SYSCALL(_sysctl, 1, &args); } #endif -- cgit v1.2.3 From 3aa584adcfa3a1ed4292d99e5fa2a6bc578f8b80 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 01:04:07 -0400 Subject: regex: call memcpy() ourselves Call the hidden memcpy() ourselves otherwise gcc will emit a call to the public memcpy() which goes through the PLT. Signed-off-by: Mike Frysinger --- libc/misc/regex/regex_old.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c index 3550698d3..cbfb7ae7c 100644 --- a/libc/misc/regex/regex_old.c +++ b/libc/misc/regex/regex_old.c @@ -8085,7 +8085,8 @@ regexec ( int len = strlen (string); boolean want_reg_info = !preg->no_sub && nmatch > 0; - private_preg = *preg; + /* use hidden memcpy() ourselves rather than gcc calling public memcpy() */ + memcpy(&private_preg, preg, sizeof(*preg)); private_preg.not_bol = !!(eflags & REG_NOTBOL); private_preg.not_eol = !!(eflags & REG_NOTEOL); -- cgit v1.2.3 From e0ac4efbdb498319f03a2a95d75d061ab6c68491 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 01:05:28 -0400 Subject: libc: add hidden calls to pthread cleanup funcs A lot of libc code calls the pthread cleanup funcs implicitly (for stdio) which currently goes through the PLT. Since we already have forwarding symbols for these funcs, it's safe to declare the internal libc usage hidden as a loaded libpthread will have the real symbols found. Signed-off-by: Mike Frysinger --- libpthread/linuxthreads.old/forward.c | 2 ++ libpthread/linuxthreads.old/sysdeps/pthread/pthread.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libpthread/linuxthreads.old/forward.c b/libpthread/linuxthreads.old/forward.c index 402b15543..f5afc2f98 100644 --- a/libpthread/linuxthreads.old/forward.c +++ b/libpthread/linuxthreads.old/forward.c @@ -165,6 +165,8 @@ FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) FORWARD2 (_pthread_cleanup_push, void, (struct _pthread_cleanup_buffer * buffer, void (*routine)(void *), void * arg), (buffer, routine, arg), return) FORWARD2 (_pthread_cleanup_push_defer, void, (struct _pthread_cleanup_buffer * buffer, void (*routine)(void *), void * arg), (buffer, routine, arg), return) +libc_hidden_def(_pthread_cleanup_push_defer) FORWARD2 (_pthread_cleanup_pop, void, (struct _pthread_cleanup_buffer * buffer, int execute), (buffer, execute), return) FORWARD2 (_pthread_cleanup_pop_restore, void, (struct _pthread_cleanup_buffer * buffer, int execute), (buffer, execute), return) +libc_hidden_def(_pthread_cleanup_pop_restore) diff --git a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h index 38d566731..b1dcd1417 100644 --- a/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h +++ b/libpthread/linuxthreads.old/sysdeps/pthread/pthread.h @@ -642,6 +642,7 @@ extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *__buffer, extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer, void (*__routine) (void *), void *__arg) __THROW; +libc_hidden_proto(_pthread_cleanup_push_defer) extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buffer, void (*__routine) (void *), void *__arg) __THROW; @@ -655,6 +656,7 @@ extern void __pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *__buff extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer, int __execute) __THROW; +libc_hidden_proto(_pthread_cleanup_pop_restore) extern void __pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *__buffer, int __execute) __THROW; #endif -- cgit v1.2.3 From e30f2a09f1e8e5b368dc8f9210b491a3a4579329 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 01:12:47 -0400 Subject: test/plt: add a script to find PLT usage Signed-off-by: Mike Frysinger --- Rules.mak | 1 + test/plt/check-plt.sh | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 test/plt/check-plt.sh diff --git a/Rules.mak b/Rules.mak index ceb1e1019..e63f6a4b6 100644 --- a/Rules.mak +++ b/Rules.mak @@ -46,6 +46,7 @@ CC = $(CROSS)gcc AR = $(CROSS)ar LD = $(CROSS)ld NM = $(CROSS)nm +OBJDUMP = $(CROSS)objdump STRIPTOOL = $(CROSS)strip INSTALL = install diff --git a/test/plt/check-plt.sh b/test/plt/check-plt.sh new file mode 100755 index 000000000..bedc8fd35 --- /dev/null +++ b/test/plt/check-plt.sh @@ -0,0 +1,38 @@ +#!/bin/sh +allowed=" +calloc +free +malloc +memalign +realloc +" + +${OBJDUMP:-objdump} -d ${top_builddir:-../..}/lib/libc.so.? | \ +gawk -v allowed="${allowed}" ' +BEGIN { + COUNT = split(" " allowed, ALLOWED); +} + +# Strip away the noise. The name will be like: +# : +# +function symstrip(name) { + return gensub(/.*<([^>@]*).*/, "\\1", "", name); +} + +{ +# Match the start of the symbol disassembly +# 00009720 : +if ($2 ~ />:$/) { + f = symstrip($2); + +} else if ($NF ~ /@plt>/) { + rf = symstrip($NF); + for (a in ALLOWED) { + a = ALLOWED[a]; + if (a == rf) + next; + } + print "Func " f " references " rf; +} +}' | sort -u -- cgit v1.2.3 From 5a4c1b737f10317b168170094a07f3df2e181816 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 01:17:46 -0400 Subject: build with -fmerge-all-constants Glibc is already using this flag and it gives us a slight code shrink in a few functions. Signed-off-by: Mike Frysinger --- Rules.mak | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rules.mak b/Rules.mak index e63f6a4b6..7b59350fd 100644 --- a/Rules.mak +++ b/Rules.mak @@ -175,6 +175,8 @@ OPTIMIZATION:= OPTIMIZATION+=$(call check_gcc,-Os,-O2) # Use the gcc 3.4 -funit-at-a-time optimization when available OPTIMIZATION+=$(call check_gcc,-funit-at-a-time,) +# shrinks code by about 0.1% +OPTIMIZATION+=$(call check_gcc,-fmerge-all-constants) GCC_MAJOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 1) #GCC_MINOR_VER?=$(shell $(CC) -dumpversion | cut -d . -f 2) -- cgit v1.2.3 From 155bf12e232ca9eb16f6f21a78163cbf556f294f Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 22 Oct 2009 09:01:03 -0400 Subject: disable _POSIX_SPAWN define We don't provide spawn.h let alone any other spawn funcs/types, so don't set up the _POSIX_SPAWN define that some packages (like vlc) check. Signed-off-by: Mike Frysinger --- libc/sysdeps/linux/common/bits/posix_opt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libc/sysdeps/linux/common/bits/posix_opt.h b/libc/sysdeps/linux/common/bits/posix_opt.h index dfe259b7c..46d169759 100644 --- a/libc/sysdeps/linux/common/bits/posix_opt.h +++ b/libc/sysdeps/linux/common/bits/posix_opt.h @@ -128,7 +128,9 @@ #define _POSIX_SPIN_LOCKS 200112L /* The `spawn' function family is supported. */ +#if 0 /* no support in uClibc (yet) */ #define _POSIX_SPAWN 200112L +#endif /* We have POSIX timers. */ #define _POSIX_TIMERS 200112L -- cgit v1.2.3 From ca9f4a455bfe8fd3bedb2c4536997dd6d5f16630 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 23 Oct 2009 13:36:55 +0200 Subject: remember some TODOs for 0.9.31 Signed-off-by: Bernhard Reutner-Fischer --- TODO | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index fa5a9bbf5..fcfaf011b 100644 --- a/TODO +++ b/TODO @@ -9,14 +9,23 @@ TODO list for every uClibc release: them in the include files as well by checking for the proper define from include/bits/uClibc_config.h (pulled in from features.h) - - -General release feature sets: +TODO list for the uClibc 0.9.31 release: ------------------------------------------------- -.29 will be mostly as-is -.30 will be the NPTL merge -.31 for the no-kernel-headers fix, etc, etc. - + *) merge NPTL + Settle cancellation + support arches: (- todo; + done) + + arm + + sh + - i386 + - x86_64 + - mips + - ... + *) Go through SUSv4 + TOC: http://www.opengroup.org/onlinepubs/9699919799/xrat/contents.html + shell (busybox): http://www.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap01.html#tag_22_01_01 + interface: + http://www.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap13.html#tag_21_13_02 + http://www.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap01.html#tag_23_01_01 TODO list for the uClibc 0.9.29 release: -- cgit v1.2.3 From 575c76ab8f915aa1c728f353ed9d528f0070449c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 28 Oct 2009 20:12:54 +0100 Subject: support selecting which locales to build Introduce UCLIBC_BUILD_MINIMAL_LOCALES and if selected build only those locales. Based on a patch by Bernhard Reutner-Fischer. Signed-off-by: Marc Andre Tanner Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 38 +++++++++++++++++++++++++++++++++++++- extra/locale/Makefile.in | 32 +++++++++++++++++--------------- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 8fa9a47ae..75f87feff 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1299,6 +1299,28 @@ config UCLIBC_HAS_LOCALE Answer Y to enable locale support. Most people will answer N. +choice + +prompt "Locale data" + depends on UCLIBC_HAS_LOCALE + default UCLIBC_BUILD_ALL_LOCALE + +config UCLIBC_BUILD_ALL_LOCALE + bool "All locales" + depends on UCLIBC_HAS_LOCALE + default y + help + This builds all the locales that are available on your + host-box. + +config UCLIBC_BUILD_MINIMAL_LOCALE + bool "Only selected locales" + depends on UCLIBC_HAS_LOCALE + default n + help + If you do not need all locales that are available on your + host-box, then set this to 'Y'. + config UCLIBC_PREGENERATED_LOCALE_DATA bool "Use Pre-generated Locale Data" depends on UCLIBC_HAS_LOCALE @@ -1311,6 +1333,20 @@ config UCLIBC_PREGENERATED_LOCALE_DATA Saying N here is highly recommended. +endchoice + +config UCLIBC_BUILD_MINIMAL_LOCALES + string "locales to use" + depends on UCLIBC_BUILD_MINIMAL_LOCALE + default "en_US" + help + Space separated list of locales to use. + + E.g.: + en_US en_GB de_AT + default: + en_US + config UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA bool "Automagically Download the Pre-generated Locale Data (if necessary)" depends on UCLIBC_PREGENERATED_LOCALE_DATA @@ -1323,7 +1359,7 @@ config UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA and place the uClibc-locale-*.tgz tarball in the extra/locale/ directory. - Go ahead and make life easy for yourself... Answer Y. + Note that the use of pregenerated locale data is discouraged. config UCLIBC_HAS_XLOCALE bool "Extended Locale Support (experimental/incomplete)" diff --git a/extra/locale/Makefile.in b/extra/locale/Makefile.in index fe2e3cfd8..8bda8d8aa 100644 --- a/extra/locale/Makefile.in +++ b/extra/locale/Makefile.in @@ -85,7 +85,7 @@ $(locale_OUT)/codesets.txt: echo "and then edit that file to disable/enable the codesets you wish to support. "; \ echo " "; \ false; \ - fi; + fi $(locale_OUT)/locales.txt: @if [ ! -f $@ ] ; then \ @@ -100,14 +100,14 @@ $(locale_OUT)/locales.txt: echo "to support. "; \ echo " "; \ false; \ - fi; + fi else $(locale_OUT)/codesets.txt: @$(disp_gen) ifeq ($(UCLIBC_BUILD_MINIMAL_LOCALE),y) - $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ASCII.pairs" > $@ ; \ + $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ASCII.pairs" > $@ $(Q)echo "$(CURDIR)/$(locale_DIR)/charmaps/ISO-8859-1.pairs" >> $@ else $(Q)set -e; \ @@ -128,13 +128,15 @@ endif $(locale_OUT)/locales.txt: $(locale_DIR)/LOCALES @$(disp_gen) ifeq ($(UCLIBC_BUILD_MINIMAL_LOCALE),y) - $(Q)echo "@euro e" > $@ ; \ - $(Q)echo "#-" >> $@ ; \ - $(Q)echo "UTF-8 yes" >> $@ ; \ - $(Q)echo "8-BIT yes" >> $@ ; \ - $(Q)echo "#-" >> $@ ; \ - $(Q)echo "en_US.UTF-8 UTF-8" >> $@ ; \ - $(Q)echo "en_US ISO-8859-1" >> $@ + $(Q)echo "@euro e" > $@ + $(Q)echo "#-" >> $@ + $(Q)echo "UTF-8 yes" >> $@ + $(Q)echo "8-BIT yes" >> $@ + $(Q)echo "#-" >> $@ + $(Q)for locale in $(call qstrip,$(UCLIBC_BUILD_MINIMAL_LOCALES)); do \ + echo "$$locale.UTF-8 UTF-8"; \ + echo "$$locale ISO-8859-1"; \ + done >> $@ else $(Q)cat $< > $@ endif @@ -175,11 +177,11 @@ $(locale_OUT)/c8tables.h: $(locale_OUT)/gen_wc8bit $(locale_OUT)/codesets.txt # Warning! Beware tr_TR toupper/tolower exceptions! $(locale_OUT)/wctables.h: $(locale_OUT)/gen_wctype @$(disp_gen) - $(Q)$< $(FLAG-locale-verbose) en_US > $@ || \ - $< $(FLAG-locale-verbose) en_US.UTF-8 > $@ || \ - $< $(FLAG-locale-verbose) en_US.iso8859-1 > $@ || \ - $< $(FLAG-locale-verbose) en_GB > $@ || \ - $< $(FLAG-locale-verbose) en_GB.UTF-8 > $@ + $(Q)for locale in $(call qstrip,$(UCLIBC_BUILD_MINIMAL_LOCALES)) en_US en_GB; do \ + $< $(FLAG-locale-verbose) $$locale > $@ || \ + $< $(FLAG-locale-verbose) $$locale.UTF-8 > $@ || \ + $< $(FLAG-locale-verbose) $$locale.iso8859-1 > $@ && break; \ + done $(locale_OUT)/locale_tables.h: $(locale_OUT)/gen_locale $(locale_OUT)/locales.txt @$(disp_gen) -- cgit v1.2.3 From ce7914a16a6e1d36a68346de26d713e880765c92 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 28 Oct 2009 20:49:18 +0100 Subject: remove wrong default for choice Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 3 --- 1 file changed, 3 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 75f87feff..02a16eed3 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1308,7 +1308,6 @@ prompt "Locale data" config UCLIBC_BUILD_ALL_LOCALE bool "All locales" depends on UCLIBC_HAS_LOCALE - default y help This builds all the locales that are available on your host-box. @@ -1316,7 +1315,6 @@ config UCLIBC_BUILD_ALL_LOCALE config UCLIBC_BUILD_MINIMAL_LOCALE bool "Only selected locales" depends on UCLIBC_HAS_LOCALE - default n help If you do not need all locales that are available on your host-box, then set this to 'Y'. @@ -1324,7 +1322,6 @@ config UCLIBC_BUILD_MINIMAL_LOCALE config UCLIBC_PREGENERATED_LOCALE_DATA bool "Use Pre-generated Locale Data" depends on UCLIBC_HAS_LOCALE - default n help Use pre-built locale data. -- cgit v1.2.3 From 7345b706ad95539779218fd198da8e8e76f08838 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 28 Oct 2009 20:56:34 +0100 Subject: Simplify kconfig wording of thread support Use a choice for thread support selection. Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 93 +++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 02a16eed3..1d3e153bb 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -383,69 +383,41 @@ config LDSO_GNU_HASH_SUPPORT If you want to use this new feature, answer Y -config HAS_NO_THREADS - bool - default n - -config UCLIBC_HAS_THREADS - bool "POSIX Threading support" - depends on !HAS_NO_THREADS - default y - # linuxthreads and linuxthreads.old need nanosleep() - select UCLIBC_HAS_REALTIME +choice + prompt "Thread support" + #default UCLIBC_HAS_THREADS_NATIVE if (TARGET_alpha || TARGET_arm || TARGET_i386 || TARGET_mips || TARGET_powerpc || TARGET_sh || TARGET_sh64) + default HAS_NO_THREADS help If you want to compile uClibc with pthread support, then answer Y. This will increase the size of uClibc by adding a bunch of locking to critical data structures, and adding extra code to ensure that functions are properly reentrant. - If your applications require pthreads, answer Y. - -config UCLIBC_HAS_TLS - bool "Thread-Local Storage" - depends on UCLIBC_HAS_THREADS_NATIVE - default n - help - If you want to enable TLS support then answer Y. - This is fast an efficient way to store per-thread local data - which is not on stack. It needs __thread support enabled in - gcc. - -config PTHREADS_DEBUG_SUPPORT - bool "Build pthreads debugging support" - default n - depends on UCLIBC_HAS_THREADS +config HAS_NO_THREADS + bool "none" help - Say Y here if you wish to be able to debug applications that use - uClibc's pthreads library. By enabling this option, a library - named libthread_db will be built. This library will be dlopen()'d - by gdb and will allow gdb to debug the threads in your application. - - IMPORTANT NOTE! Because gdb must dlopen() the libthread_db library, - you must compile gdb with uClibc in order for pthread debugging to - work properly. - - If you are doing development and want to debug applications using - uClibc's pthread library, answer Y. Otherwise, answer N. + Disable thread support. config LINUXTHREADS_OLD - bool "Use the older (stable) version of linuxthreads" - default y - depends on UCLIBC_HAS_THREADS && !UCLIBC_HAS_THREADS_NATIVE + bool "older (stable) version of linuxthreads" + # linuxthreads and linuxthreads.old need nanosleep() + select UCLIBC_HAS_REALTIME help There are two versions of linuxthreads. The older (stable) version has been in uClibc for quite a long time but hasn't seen too many updates other than bugfixes. + +config LINUXTHREADS_NEW + bool "slightly newer version of linuxthreads" + help The new version has not been tested much, and lacks ports for arches which glibc does not support (like bfin/frv/etc...), but is based on the latest code from glibc, so it may be the only choice for the newer ports (like alpha/amd64/64bit arches and hppa). config UCLIBC_HAS_THREADS_NATIVE - bool "Native POSIX Threading (NPTL) Support" - depends on UCLIBC_HAS_THREADS - default n + bool "Native POSIX Threading (NPTL)" select UCLIBC_HAS_TLS help If you want to compile uClibc with NPTL support, then answer Y. @@ -464,9 +436,38 @@ config UCLIBC_HAS_THREADS_NATIVE that way until further notice at which point this notice will disappear. Thank you for your support and for not smoking. -config LINUXTHREADS_NEW - def_bool y - depends on UCLIBC_HAS_THREADS && !LINUXTHREADS_OLD && !UCLIBC_HAS_THREADS_NATIVE +endchoice + +config UCLIBC_HAS_THREADS + def_bool y if !HAS_NO_THREADS + +config UCLIBC_HAS_TLS + bool "Thread-Local Storage" + depends on UCLIBC_HAS_THREADS_NATIVE + default n + help + If you want to enable TLS support then answer Y. + This is fast an efficient way to store per-thread local data + which is not on stack. It needs __thread support enabled in + gcc. + +config PTHREADS_DEBUG_SUPPORT + bool "Build pthreads debugging support" + default n + depends on UCLIBC_HAS_THREADS + help + Say Y here if you wish to be able to debug applications that use + uClibc's pthreads library. By enabling this option, a library + named libthread_db will be built. This library will be dlopen()'d + by gdb and will allow gdb to debug the threads in your application. + + IMPORTANT NOTE! Because gdb must dlopen() the libthread_db library, + you must compile gdb with uClibc in order for pthread debugging to + work properly. + + If you are doing development and want to debug applications using + uClibc's pthread library, answer Y. Otherwise, answer N. + config UCLIBC_HAS_SYSLOG bool "Syslog support" -- cgit v1.2.3 From 1de3bed755666eb3d0b3529e33c9a8b8445293ff Mon Sep 17 00:00:00 2001 From: Austin Foxley Date: Mon, 9 Nov 2009 13:17:04 -0800 Subject: Rules.mak fix typo (qstrup -> qstrip) Signed-off-by: Austin Foxley --- Rules.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rules.mak b/Rules.mak index 7b59350fd..d354e7db0 100644 --- a/Rules.mak +++ b/Rules.mak @@ -95,7 +95,7 @@ export ARCH # Make certain these contain a final "/", but no "//"s. TARGET_SUBARCH:=$(call qstrip,$(shell grep -s '^TARGET_SUBARCH' $(top_builddir)/.config | $(SED) -e 's/^TARGET_SUBARCH=//')) TARGET_SUBARCH:=$(call qstrip,$(TARGET_SUBARCH)) -RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(call qstrup,$(RUNTIME_PREFIX))))) +RUNTIME_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(call qstrip,$(RUNTIME_PREFIX))))) DEVEL_PREFIX:=$(strip $(subst //,/, $(subst ,/, $(call qstrip,$(DEVEL_PREFIX))))) KERNEL_HEADERS:=$(strip $(subst //,/, $(subst ,/, $(call qstrip,$(KERNEL_HEADERS))))) export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS -- cgit v1.2.3 From eaacd088acf8653e22a0fa6193e63942850e6751 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 13 Nov 2009 15:59:25 +0100 Subject: silence warning about undefined CPP token Signed-off-by: Bernhard Reutner-Fischer --- include/ctype.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ctype.h b/include/ctype.h index da73a44fc..2d62847fe 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -281,7 +281,7 @@ __NTH (toupper (int __c)) # if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) -# if __UCLIBC_SUSV4_LEGACY__ +# if defined __UCLIBC_SUSV4_LEGACY__ # define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)]) # define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)]) # endif -- cgit v1.2.3 From 2c3ed060512a2e90ec9f912cf1a5eb1ecd700fb9 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 14 Nov 2009 15:57:47 +0100 Subject: realpath: SUSv4 compliant Signed-off-by: Mike Frysinger Signed-off-by: Bernhard Reutner-Fischer --- include/stdlib.h | 4 +--- libc/stdlib/realpath.c | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/include/stdlib.h b/include/stdlib.h index e462c1c93..536f81a1e 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -659,7 +659,6 @@ extern char *canonicalize_file_name (__const char *__name) __THROW __nonnull ((1)) __wur; #endif -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Return the canonical absolute name of file NAME. If RESOLVED is null, the result is malloc'd; otherwise, if the canonical name is PATH_MAX chars or more, returns null with `errno' set to @@ -667,8 +666,7 @@ extern char *canonicalize_file_name (__const char *__name) returns the name in RESOLVED. */ /* we choose to handle __resolved==NULL as crash :) */ extern char *realpath (__const char *__restrict __name, - char *__restrict __resolved) __THROW __wur __nonnull((2)); -#endif + char *__restrict __resolved) __THROW __wur; /* Shorthand for type of comparison functions. */ diff --git a/libc/stdlib/realpath.c b/libc/stdlib/realpath.c index 1a00c3112..80c25f098 100644 --- a/libc/stdlib/realpath.c +++ b/libc/stdlib/realpath.c @@ -36,19 +36,10 @@ #define MAX_READLINKS 32 -#ifdef __STDC__ char *realpath(const char *path, char got_path[]) -#else -char *realpath(path, got_path) -const char *path; -char got_path[]; -#endif { char copy_path[PATH_MAX]; - /* use user supplied buffer directly - reduces stack usage */ - /* char got_path[PATH_MAX]; */ - char *max_path; - char *new_path; + char *max_path, *new_path, *allocated_path; size_t path_len; int readlinks = 0; #ifdef S_IFLNK @@ -72,12 +63,13 @@ char got_path[]; /* Copy so that path is at the end of copy_path[] */ strcpy(copy_path + (PATH_MAX-1) - path_len, path); path = copy_path + (PATH_MAX-1) - path_len; + allocated_path = got_path ? NULL : (got_path = malloc(PATH_MAX)); max_path = got_path + PATH_MAX - 2; /* points to last non-NUL char */ new_path = got_path; if (*path != '/') { /* If it's a relative pathname use getcwd for starters. */ if (!getcwd(new_path, PATH_MAX - 1)) - return NULL; + goto err; new_path += strlen(new_path); if (new_path[-1] != '/') *new_path++ = '/'; @@ -114,6 +106,8 @@ char got_path[]; while (*path != '\0' && *path != '/') { if (new_path > max_path) { __set_errno(ENAMETOOLONG); + err: + free(allocated_path); return NULL; } *new_path++ = *path++; @@ -122,7 +116,7 @@ char got_path[]; /* Protect against infinite loops. */ if (readlinks++ > MAX_READLINKS) { __set_errno(ELOOP); - return NULL; + goto err; } path_len = strlen(path); /* See if last (so far) pathname component is a symlink. */ @@ -133,13 +127,13 @@ char got_path[]; if (link_len < 0) { /* EINVAL means the file exists but isn't a symlink. */ if (errno != EINVAL) { - return NULL; + goto err; } } else { /* Safe sex check. */ if (path_len + link_len >= PATH_MAX - 2) { __set_errno(ENAMETOOLONG); - return NULL; + goto err; } /* Note: readlink doesn't add the null byte. */ /* copy_path[link_len] = '\0'; - we don't need it too */ -- cgit v1.2.3 From 73d6e5c41b61633e22ea74e3aa2df721512dca57 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 14 Nov 2009 15:59:35 +0100 Subject: libm: fix C99_MATH on __NO_LONG_DOUBLE_MATH hosts alias l to their normal double counterparts. Works around problems with libgcc blindly calling __finitel on e.g. ppc32 Signed-off-by: Bernhard Reutner-Fischer --- libm/Makefile.in | 5 ----- libm/ldouble_wrappers.c | 39 --------------------------------------- libm/math_private.h | 13 +++++++++++++ libm/s_finite.c | 3 +++ libm/s_fpclassify.c | 3 +++ libm/s_isinf.c | 3 +++ libm/s_isnan.c | 3 +++ libm/s_signbit.c | 3 +++ 8 files changed, 28 insertions(+), 44 deletions(-) diff --git a/libm/Makefile.in b/libm/Makefile.in index d17d64fae..f1f42f696 100644 --- a/libm/Makefile.in +++ b/libm/Makefile.in @@ -129,11 +129,6 @@ FL_MOBJ := \ # Not implemented [yet?]: nexttowardl.o LD_MOBJ := \ - __finitel.o \ - __fpclassifyl.o \ - __isinfl.o \ - __isnanl.o \ - __signbitl.o \ acoshl.o \ acosl.o \ asinhl.o \ diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c index c53b99773..9c2e522bb 100644 --- a/libm/ldouble_wrappers.c +++ b/libm/ldouble_wrappers.c @@ -116,16 +116,6 @@ long long func##l(long double x) \ } #endif /* __i386__ && __OPTIMIZE__ */ -#if defined __NO_LONG_DOUBLE_MATH -# define int_WRAPPER_C99(func) /* not needed */ -# else -# define int_WRAPPER_C99(func) \ -int func##l(long double x) \ -{ \ - return func((double) x); \ -} \ -libm_hidden_def(func##l) -#endif /* Implement the following, as defined by SuSv3 */ #if 0 @@ -501,32 +491,3 @@ long double significandl(long double x) return (long double) significand((double) x); } #endif - -#ifdef __DO_C99_MATH__ - -#ifdef L___fpclassifyl -int_WRAPPER1(__fpclassify) -libm_hidden_def(__fpclassifyl) -#endif - -#ifdef L___finitel -int_WRAPPER1(__finite) -libm_hidden_def(__finitel) -#endif - -#ifdef L___signbitl -int_WRAPPER1(__signbit) -libm_hidden_def(__signbitl) -#endif - -#ifdef L___isnanl -int_WRAPPER1(__isnan) -libm_hidden_def(__isnanl) -#endif - -#ifdef L___isinfl -int_WRAPPER1(__isinf) -libm_hidden_def(__isinfl) -#endif - -#endif diff --git a/libm/math_private.h b/libm/math_private.h index 2c5a30ac2..b6bea80ae 100644 --- a/libm/math_private.h +++ b/libm/math_private.h @@ -255,5 +255,18 @@ extern int __kernel_rem_pio2 (double*,double*,int,int,int,const int*) attribu #define math_force_eval(x) do { __typeof(x) __x = (x); __asm __volatile ("" : : "m" (__x)); } while (0) #endif +/* If we do not have long double support, then alias to the double variant. */ +#if defined __NO_LONG_DOUBLE_MATH +# define int_WRAPPER_C99(func) \ +weak_alias(func,func##l) +# else +# define int_WRAPPER_C99(func) \ +int func##l(long double x) \ +{ \ + return func((double) x); \ +} \ +libm_hidden_def(func##l) +#endif + #endif /* _MATH_PRIVATE_H_ */ diff --git a/libm/s_finite.c b/libm/s_finite.c index 9bbc00286..5b2bc2907 100644 --- a/libm/s_finite.c +++ b/libm/s_finite.c @@ -30,3 +30,6 @@ int __finite(double x) return (hx | 0x800fffff) != 0xffffffff; } libm_hidden_def(__finite) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__finite) +#endif diff --git a/libm/s_fpclassify.c b/libm/s_fpclassify.c index a05cd563e..99a635474 100644 --- a/libm/s_fpclassify.c +++ b/libm/s_fpclassify.c @@ -40,3 +40,6 @@ int __fpclassify(double x) return retval; } libm_hidden_def(__fpclassify) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__fpclassify) +#endif diff --git a/libm/s_isinf.c b/libm/s_isinf.c index 62e5263bb..1f65b8378 100644 --- a/libm/s_isinf.c +++ b/libm/s_isinf.c @@ -21,3 +21,6 @@ int __isinf(double x) return ~(lx >> 31) & (hx >> 30); } libm_hidden_def(__isinf) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__isinf) +#endif diff --git a/libm/s_isnan.c b/libm/s_isnan.c index 1bc49cb02..fb44f6a6e 100644 --- a/libm/s_isnan.c +++ b/libm/s_isnan.c @@ -27,3 +27,6 @@ int __isnan(double x) return (int)(((u_int32_t)hx)>>31); } libm_hidden_def(__isnan) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__isnan) +#endif diff --git a/libm/s_signbit.c b/libm/s_signbit.c index ee1b7c62e..ca4144af8 100644 --- a/libm/s_signbit.c +++ b/libm/s_signbit.c @@ -33,3 +33,6 @@ __signbit (double x) return hx & 0x80000000; } libm_hidden_def(__signbit) +#if defined __DO_C99_MATH__ +int_WRAPPER_C99(__signbit) +#endif -- cgit v1.2.3 From 53c9f62657f222a3fefed852e1b2029033ec4014 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sat, 14 Nov 2009 17:50:41 +0100 Subject: Revert "libm: fix C99_MATH on __NO_LONG_DOUBLE_MATH hosts" This reverts commit 73d6e5c41b61633e22ea74e3aa2df721512dca57. barking up the wrong tree Signed-off-by: Bernhard Reutner-Fischer --- libm/Makefile.in | 5 +++++ libm/ldouble_wrappers.c | 39 +++++++++++++++++++++++++++++++++++++++ libm/math_private.h | 13 ------------- libm/s_finite.c | 3 --- libm/s_fpclassify.c | 3 --- libm/s_isinf.c | 3 --- libm/s_isnan.c | 3 --- libm/s_signbit.c | 3 --- 8 files changed, 44 insertions(+), 28 deletions(-) diff --git a/libm/Makefile.in b/libm/Makefile.in index f1f42f696..d17d64fae 100644 --- a/libm/Makefile.in +++ b/libm/Makefile.in @@ -129,6 +129,11 @@ FL_MOBJ := \ # Not implemented [yet?]: nexttowardl.o LD_MOBJ := \ + __finitel.o \ + __fpclassifyl.o \ + __isinfl.o \ + __isnanl.o \ + __signbitl.o \ acoshl.o \ acosl.o \ asinhl.o \ diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c index 9c2e522bb..c53b99773 100644 --- a/libm/ldouble_wrappers.c +++ b/libm/ldouble_wrappers.c @@ -116,6 +116,16 @@ long long func##l(long double x) \ } #endif /* __i386__ && __OPTIMIZE__ */ +#if defined __NO_LONG_DOUBLE_MATH +# define int_WRAPPER_C99(func) /* not needed */ +# else +# define int_WRAPPER_C99(func) \ +int func##l(long double x) \ +{ \ + return func((double) x); \ +} \ +libm_hidden_def(func##l) +#endif /* Implement the following, as defined by SuSv3 */ #if 0 @@ -491,3 +501,32 @@ long double significandl(long double x) return (long double) significand((double) x); } #endif + +#ifdef __DO_C99_MATH__ + +#ifdef L___fpclassifyl +int_WRAPPER1(__fpclassify) +libm_hidden_def(__fpclassifyl) +#endif + +#ifdef L___finitel +int_WRAPPER1(__finite) +libm_hidden_def(__finitel) +#endif + +#ifdef L___signbitl +int_WRAPPER1(__signbit) +libm_hidden_def(__signbitl) +#endif + +#ifdef L___isnanl +int_WRAPPER1(__isnan) +libm_hidden_def(__isnanl) +#endif + +#ifdef L___isinfl +int_WRAPPER1(__isinf) +libm_hidden_def(__isinfl) +#endif + +#endif diff --git a/libm/math_private.h b/libm/math_private.h index b6bea80ae..2c5a30ac2 100644 --- a/libm/math_private.h +++ b/libm/math_private.h @@ -255,18 +255,5 @@ extern int __kernel_rem_pio2 (double*,double*,int,int,int,const int*) attribu #define math_force_eval(x) do { __typeof(x) __x = (x); __asm __volatile ("" : : "m" (__x)); } while (0) #endif -/* If we do not have long double support, then alias to the double variant. */ -#if defined __NO_LONG_DOUBLE_MATH -# define int_WRAPPER_C99(func) \ -weak_alias(func,func##l) -# else -# define int_WRAPPER_C99(func) \ -int func##l(long double x) \ -{ \ - return func((double) x); \ -} \ -libm_hidden_def(func##l) -#endif - #endif /* _MATH_PRIVATE_H_ */ diff --git a/libm/s_finite.c b/libm/s_finite.c index 5b2bc2907..9bbc00286 100644 --- a/libm/s_finite.c +++ b/libm/s_finite.c @@ -30,6 +30,3 @@ int __finite(double x) return (hx | 0x800fffff) != 0xffffffff; } libm_hidden_def(__finite) -#if defined __DO_C99_MATH__ -int_WRAPPER_C99(__finite) -#endif diff --git a/libm/s_fpclassify.c b/libm/s_fpclassify.c index 99a635474..a05cd563e 100644 --- a/libm/s_fpclassify.c +++ b/libm/s_fpclassify.c @@ -40,6 +40,3 @@ int __fpclassify(double x) return retval; } libm_hidden_def(__fpclassify) -#if defined __DO_C99_MATH__ -int_WRAPPER_C99(__fpclassify) -#endif diff --git a/libm/s_isinf.c b/libm/s_isinf.c index 1f65b8378..62e5263bb 100644 --- a/libm/s_isinf.c +++ b/libm/s_isinf.c @@ -21,6 +21,3 @@ int __isinf(double x) return ~(lx >> 31) & (hx >> 30); } libm_hidden_def(__isinf) -#if defined __DO_C99_MATH__ -int_WRAPPER_C99(__isinf) -#endif diff --git a/libm/s_isnan.c b/libm/s_isnan.c index fb44f6a6e..1bc49cb02 100644 --- a/libm/s_isnan.c +++ b/libm/s_isnan.c @@ -27,6 +27,3 @@ int __isnan(double x) return (int)(((u_int32_t)hx)>>31); } libm_hidden_def(__isnan) -#if defined __DO_C99_MATH__ -int_WRAPPER_C99(__isnan) -#endif diff --git a/libm/s_signbit.c b/libm/s_signbit.c index ca4144af8..ee1b7c62e 100644 --- a/libm/s_signbit.c +++ b/libm/s_signbit.c @@ -33,6 +33,3 @@ __signbit (double x) return hx & 0x80000000; } libm_hidden_def(__signbit) -#if defined __DO_C99_MATH__ -int_WRAPPER_C99(__signbit) -#endif -- cgit v1.2.3 From 0b3be5bb62587afbb718103298b3767ebd6fb4de Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 15 Nov 2009 19:30:00 +0100 Subject: ldso: Add missing newlines to some debug messages Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/bfin/elfinterp.c | 2 +- ldso/ldso/cris/elfinterp.c | 6 +++--- ldso/ldso/frv/elfinterp.c | 2 +- ldso/ldso/i386/elfinterp.c | 4 ++-- ldso/ldso/powerpc/elfinterp.c | 2 +- ldso/ldso/sh/elfinterp.c | 4 ++-- ldso/ldso/sh64/elfinterp.c | 4 ++-- ldso/ldso/xtensa/elfinterp.c | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ldso/ldso/bfin/elfinterp.c b/ldso/ldso/bfin/elfinterp.c index c771507be..e8d88bd5a 100644 --- a/ldso/ldso/bfin/elfinterp.c +++ b/ldso/ldso/bfin/elfinterp.c @@ -306,7 +306,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, reloc_addr->entry_point, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, reloc_addr->entry_point, reloc_addr); #endif return 0; diff --git a/ldso/ldso/cris/elfinterp.c b/ldso/ldso/cris/elfinterp.c index 7d8fbced6..32ea2da9e 100644 --- a/ldso/ldso/cris/elfinterp.c +++ b/ldso/ldso/cris/elfinterp.c @@ -77,7 +77,7 @@ _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) _dl_dprintf(_dl_debug_file, "\nresolve function: %s", symname); if (_dl_debug_detail) _dl_dprintf(_dl_debug_file, - "\n\tpatched: %x ==> %x @ %x", + "\n\tpatched: %x ==> %x @ %x\n", *got_addr, new_addr, got_addr); } if (!_dl_debug_nofixups) { @@ -219,7 +219,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x", + _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif @@ -260,7 +260,7 @@ _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x", + _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif diff --git a/ldso/ldso/frv/elfinterp.c b/ldso/ldso/frv/elfinterp.c index 75fd20c9e..4b94033de 100644 --- a/ldso/ldso/frv/elfinterp.c +++ b/ldso/ldso/frv/elfinterp.c @@ -310,7 +310,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, reloc_addr->entry_point, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, reloc_addr->entry_point, reloc_addr); #endif return 0; diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c index af0b397d0..649c207f9 100644 --- a/ldso/ldso/i386/elfinterp.c +++ b/ldso/ldso/i386/elfinterp.c @@ -254,7 +254,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x", + _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif @@ -294,7 +294,7 @@ _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x", + _dl_dprintf(_dl_debug_file, "\n\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif diff --git a/ldso/ldso/powerpc/elfinterp.c b/ldso/ldso/powerpc/elfinterp.c index ff7fb1f27..0dcb175bf 100644 --- a/ldso/ldso/powerpc/elfinterp.c +++ b/ldso/ldso/powerpc/elfinterp.c @@ -304,7 +304,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, out_nocode: #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif return 0; } diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c index 594da53aa..10b944380 100644 --- a/ldso/ldso/sh/elfinterp.c +++ b/ldso/ldso/sh/elfinterp.c @@ -243,7 +243,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif return 0; @@ -280,7 +280,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", old_val, *reloc_addr, reloc_addr); + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif return 0; diff --git a/ldso/ldso/sh64/elfinterp.c b/ldso/ldso/sh64/elfinterp.c index 51ca9785c..74fda04dc 100644 --- a/ldso/ldso/sh64/elfinterp.c +++ b/ldso/ldso/sh64/elfinterp.c @@ -280,7 +280,7 @@ static int _dl_do_reloc(struct elf_resolve *tpnt,struct dyn_elf *scope, #ifdef __SUPPORT_LD_DEBUG__ if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif @@ -318,7 +318,7 @@ static int _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, #ifdef __SUPPORT_LD_DEBUG__ if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x", + _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif diff --git a/ldso/ldso/xtensa/elfinterp.c b/ldso/ldso/xtensa/elfinterp.c index 3d54d8ad1..48281913d 100644 --- a/ldso/ldso/xtensa/elfinterp.c +++ b/ldso/ldso/xtensa/elfinterp.c @@ -213,7 +213,7 @@ _dl_do_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, } #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf (_dl_debug_file, "\tpatched: %x ==> %x @ %x", + _dl_dprintf (_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif @@ -252,7 +252,7 @@ _dl_do_lazy_reloc (struct elf_resolve *tpnt, struct dyn_elf *scope, #if defined (__SUPPORT_LD_DEBUG__) if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf (_dl_debug_file, "\tpatched: %x ==> %x @ %x", + _dl_dprintf (_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", old_val, *reloc_addr, reloc_addr); #endif return 0; -- cgit v1.2.3 From 5962e391388a20e1886d400c83c36596e4d02f45 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 15 Nov 2009 19:34:35 +0100 Subject: libm: use int_WRAPPER_C99 macro Signed-off-by: Bernhard Reutner-Fischer --- libm/ldouble_wrappers.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libm/ldouble_wrappers.c b/libm/ldouble_wrappers.c index c53b99773..34f06722e 100644 --- a/libm/ldouble_wrappers.c +++ b/libm/ldouble_wrappers.c @@ -505,28 +505,23 @@ long double significandl(long double x) #ifdef __DO_C99_MATH__ #ifdef L___fpclassifyl -int_WRAPPER1(__fpclassify) -libm_hidden_def(__fpclassifyl) +int_WRAPPER_C99(__fpclassify) #endif #ifdef L___finitel -int_WRAPPER1(__finite) -libm_hidden_def(__finitel) +int_WRAPPER_C99(__finite) #endif #ifdef L___signbitl -int_WRAPPER1(__signbit) -libm_hidden_def(__signbitl) +int_WRAPPER_C99(__signbit) #endif #ifdef L___isnanl -int_WRAPPER1(__isnan) -libm_hidden_def(__isnanl) +int_WRAPPER_C99(__isnan) #endif #ifdef L___isinfl -int_WRAPPER1(__isinf) -libm_hidden_def(__isinfl) +int_WRAPPER_C99(__isinf) #endif #endif -- cgit v1.2.3 From 221e018e52a079379660d143f086454e2da27244 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 17 Nov 2009 20:47:44 +0100 Subject: .gitignore: remove unneeded pattern Signed-off-by: Bernhard Reutner-Fischer --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 549ca4593..5ceb817c4 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,6 @@ # *.os *.oS -*.dep *.a *.i *.o -- cgit v1.2.3 From a2f970ecf7cddbb9fe1275c6a0d23cc75b953844 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 11 Nov 2009 10:57:57 +0100 Subject: correct documentation Signed-off-by: Bernhard Reutner-Fischer --- include/elf.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/elf.h b/include/elf.h index 0da4bf7a7..b86aa52be 100644 --- a/include/elf.h +++ b/include/elf.h @@ -2180,10 +2180,10 @@ typedef Elf32_Addr Elf32_Conflict; #define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ /* GNU relocs used in PIC code sequences. */ -#define R_PPC_REL16 249 /* word32 (sym-.) */ -#define R_PPC_REL16_LO 250 /* half16 (sym-.)@l */ -#define R_PPC_REL16_HI 251 /* half16 (sym-.)@h */ -#define R_PPC_REL16_HA 252 /* half16 (sym-.)@ha */ +#define R_PPC_REL16 249 /* word32 (sym+add-.) */ +#define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */ +#define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */ +#define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */ /* This is a phony reloc to handle any old fashioned TOC16 references that may still be in object files. */ -- cgit v1.2.3 From fa1bb23a599da9283f190ab525b971c55475f5f9 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 18 Nov 2009 13:24:07 +0100 Subject: _Exit(): add weak alias to _exit() for C99 Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/_exit.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libc/sysdeps/linux/common/_exit.c b/libc/sysdeps/linux/common/_exit.c index fbeed0d8a..6cece0878 100644 --- a/libc/sysdeps/linux/common/_exit.c +++ b/libc/sysdeps/linux/common/_exit.c @@ -21,3 +21,4 @@ void attribute_noreturn _exit(int status) INLINE_SYSCALL(exit, 1, status); } libc_hidden_def(_exit) +weak_alias(_exit,_Exit) -- cgit v1.2.3 From 9caa67af987a28558bfb4045d31b8b8719b3f8ec Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 18 Nov 2009 16:00:43 +0100 Subject: MAXFLOAT: obsolescent in SUSv4 Signed-off-by: Bernhard Reutner-Fischer --- include/math.h | 2 ++ include/values.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/math.h b/include/math.h index ecd01877c..83ed8993c 100644 --- a/include/math.h +++ b/include/math.h @@ -377,8 +377,10 @@ extern int matherr (struct exception *__exc); #else /* !SVID */ # ifdef __USE_XOPEN +# ifdef __UCLIBC_SUSV4_LEGACY__ /* X/Open wants another strange constant. */ # define MAXFLOAT 3.40282347e+38F +# endif # endif #endif /* SVID */ diff --git a/include/values.h b/include/values.h index d8bd8b50a..daf95118a 100644 --- a/include/values.h +++ b/include/values.h @@ -53,7 +53,9 @@ #include #define MAXDOUBLE DBL_MAX +#ifdef __UCLIBC_SUSV4_LEGACY__ #define MAXFLOAT FLT_MAX +#endif #define MINDOUBLE DBL_MIN #define MINFLOAT FLT_MIN #define DMINEXP DBL_MIN_EXP -- cgit v1.2.3 From 06962b0ccf39ef0b2ebb3b73809d81e34da71e1d Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 15:59:19 +0100 Subject: .gitignore more testfiles Signed-off-by: Bernhard Reutner-Fischer --- test/.gitignore | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/.gitignore b/test/.gitignore index 776a7e0a0..d438af7d0 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -3,8 +3,13 @@ # !.gitignore # +# Generated files +# +*.out +# # Executable test # +*_glibc argp/argp-ex[1-4] argp/argp-test argp/bug-argp1 @@ -35,6 +40,7 @@ inet/tst-ethers inet/tst-ethers-line inet/tst-network inet/tst-ntoa +librt/shmtest locale/bug-iconv-trans locale/collate-test locale/dump-ctype @@ -108,7 +114,10 @@ malloc/tst-[cmv]alloc malloc/tst-mallocfork malloc/tst-mcheck malloc/tst-obstack -math/gen-libm-test.pl +math/libm-test-ulps.h +math/libm-test.c +math/test-fpucw +math/tst-definitions misc/bug-glob2 misc/bug-readdir1 misc/dirent -- cgit v1.2.3 From 8b2ceb8dc4c882a1f5936e6794bc87591422f2d3 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Wed, 18 Nov 2009 16:06:49 +0100 Subject: test: sync up with toplevel buildsys test/Rules.mak was duplicating too much from the toplevel Rules.mak (which is included anyway). Signed-off-by: Bernhard Reutner-Fischer --- test/Rules.mak | 88 +++++++++++++++++++--------------------------------------- test/Test.mak | 30 +++++++++++--------- 2 files changed, 45 insertions(+), 73 deletions(-) diff --git a/test/Rules.mak b/test/Rules.mak index 8e154c590..492b99706 100644 --- a/test/Rules.mak +++ b/test/Rules.mak @@ -31,9 +31,10 @@ export LC_ALL ifeq ($(strip $(TARGET_ARCH)),) TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ -e 's/i.86/i386/' \ - -e 's/sparc.*/sparc/' \ - -e 's/arm.*/arm/g' \ + -e 's/sun.*/sparc/' -e 's/sparc.*/sparc/' \ + -e 's/sa110/arm/' -e 's/arm.*/arm/g' \ -e 's/m68k.*/m68k/' \ + -e 's/parisc.*/hppa/' \ -e 's/ppc/powerpc/g' \ -e 's/v850.*/v850/g' \ -e 's/sh[234]/sh/' \ @@ -44,76 +45,42 @@ TARGET_ARCH:=$(shell $(CC) -dumpmachine | sed -e s'/-.*//' \ endif export TARGET_ARCH - -#-------------------------------------------------------- -# If you are running a cross compiler, you will want to set 'CROSS' -# to something more interesting... Target architecture is determined -# by asking the CC compiler what arch it compiles things for, so unless -# your compiler is broken, you should not need to specify TARGET_ARCH -# -# Most people will set this stuff on the command line, i.e. -# make CROSS=mipsel-linux- -# will build uClibc for 'mipsel'. - -CROSS = $(subst ",, $(strip $(CROSS_COMPILER_PREFIX))) -CC = $(CROSS)gcc -RM = rm -f -RM_R = $(RM) -r - -# Select the compiler needed to build binaries for your development system -HOSTCC = gcc - - -#-------------------------------------------------------- -# A nifty macro to make testing gcc features easier -check_gcc=$(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \ - then echo "$(1)"; else echo "$(2)"; fi) - -# use '-Os' optimization if available, else use -O2, allow Config to override -# Override optimization settings when debugging -ifeq ($(DODEBUG),y) -OPTIMIZATION = -O0 -else -OPTIMIZATION += $(call check_gcc,-Os,-O2) -endif - -XWARNINGS := $(subst ",, $(strip $(WARNINGS))) -Wstrict-prototypes -XARCH_CFLAGS := $(subst ",, $(strip $(ARCH_CFLAGS))) $(CPU_CFLAGS) -XCOMMON_CFLAGS := -D_GNU_SOURCE -I$(top_builddir)test -CFLAGS := $(XWARNINGS) $(OPTIMIZATION) $(XCOMMON_CFLAGS) $(XARCH_CFLAGS) -nostdinc -I$(top_builddir)$(LOCAL_INSTALL_PATH)/usr/include - -CC_IPREFIX := $(shell $(CC) --print-file-name=include) -CC_INC := -I$(dir $(CC_IPREFIX))include-fixed -I$(CC_IPREFIX) -CFLAGS += $(CC_INC) +RM_R = $(Q)$(RM) -r ifneq ($(KERNEL_HEADERS),) ifeq ($(patsubst /%,/,$(KERNEL_HEADERS)),/) # Absolute path in KERNEL_HEADERS -CFLAGS += -I$(KERNEL_HEADERS) +KERNEL_INCLUDES += -I$(KERNEL_HEADERS) else # Relative path in KERNEL_HEADERS -CFLAGS += -I$(top_builddir)$(KERNEL_HEADERS) +KERNEL_INCLUDES += -I$(top_builddir)$(KERNEL_HEADERS) endif endif +XCOMMON_CFLAGS := -I$(top_builddir)test -D_GNU_SOURCE +XWARNINGS += $(call check_gcc,-Wstrict-prototypes,) +CFLAGS := -nostdinc -I$(top_builddir)$(LOCAL_INSTALL_PATH)/usr/include +CFLAGS += $(XCOMMON_CFLAGS) $(KERNEL_INCLUDES) $(CC_INC) +CFLAGS += $(OPTIMIZATION) $(CPU_CFLAGS) $(XWARNINGS) + # Can't add $(OPTIMIZATION) here, it may be target-specific. # Just adding -Os for now. -HOST_CFLAGS += $(XWARNINGS) -Os $(XCOMMON_CFLAGS) +HOST_CFLAGS += $(XCOMMON_CFLAGS) -Os $(XWARNINGS) -LDFLAGS := $(CPU_LDFLAGS) +LDFLAGS := $(CPU_LDFLAGS-y) ifeq ($(DODEBUG),y) CFLAGS += -g HOST_CFLAGS += -g - LDFLAGS += -g - HOST_LDFLAGS += -g + LDFLAGS += -Wl,-g + HOST_LDFLAGS += -Wl,-g else - LDFLAGS += -s - HOST_LDFLAGS += -s + LDFLAGS += -Wl,-s + HOST_LDFLAGS += -Wl,-s endif -ifneq ($(strip $(HAVE_SHARED)),y) - LDFLAGS += -static - HOST_LDFLAGS += -static +ifneq ($(HAVE_SHARED),y) + LDFLAGS += -Wl,-static + HOST_LDFLAGS += -Wl,-static endif LDFLAGS += -B$(top_builddir)lib -Wl,-rpath,$(top_builddir)lib -Wl,-rpath-link,$(top_builddir)lib @@ -124,7 +91,7 @@ UCLIBC_LDSO_ABSPATH=$(SHARED_LIB_LOADER_PREFIX) endif ifeq ($(findstring -static,$(LDFLAGS)),) - LDFLAGS += -Wl,--dynamic-linker,$(UCLIBC_LDSO_ABSPATH)/$(UCLIBC_LDSO) +LDFLAGS += -Wl,--dynamic-linker,$(UCLIBC_LDSO_ABSPATH)/$(UCLIBC_LDSO) endif ifeq ($(LDSO_GNU_HASH_SUPPORT),y) @@ -133,9 +100,7 @@ LDFLAGS += -Wl,${LDFLAGS_GNUHASH} endif -# Filter output -MAKEFLAGS += --no-print-directory -ifneq ($(findstring s,$(MAKEFLAGS)),) +ifneq ($(findstring -s,$(MAKEFLAGS)),) DISP := sil Q := @ SCAT := -@true @@ -150,12 +115,15 @@ Q := @ SCAT := -@true endif endif +ifneq ($(Q),) +MAKEFLAGS += --no-print-directory +endif banner := --------------------------------- pur_showclean = echo " "CLEAN $(notdir $(CURDIR)) pur_showdiff = echo " "TEST_DIFF $(notdir $(CURDIR))/ pur_showlink = echo " "TEST_LINK $(notdir $(CURDIR))/ $@ -pur_showtest = echo " "TEST_EXEC $(notdir $(CURDIR))/ $(patsubst %.exe,%,$@) +pur_showtest = echo " "TEST_EXEC $(notdir $(CURDIR))/ $(@:.exe=) sil_showclean = sil_showdiff = true sil_showlink = true @@ -163,7 +131,7 @@ sil_showtest = true ver_showclean = ver_showdiff = true echo ver_showlink = true echo -ver_showtest = printf "\n$(banner)\nTEST $(notdir $(PWD))/ $(patsubst %.exe,%,$@)\n$(banner)\n" +ver_showtest = printf "\n$(banner)\nTEST $(notdir $(CURDIR))/ $(@:.exe=)\n$(banner)\n" do_showclean = $($(DISP)_showclean) do_showdiff = $($(DISP)_showdiff) do_showlink = $($(DISP)_showlink) diff --git a/test/Test.mak b/test/Test.mak index 66565498f..2dab7f741 100644 --- a/test/Test.mak +++ b/test/Test.mak @@ -14,12 +14,12 @@ ifeq ($(SHELL_TESTS),) SHELL_TESTS := $(patsubst %.sh,shell_%,$(wildcard *.sh)) endif -ifneq ($(filter-out test,$(TESTS)),$(TESTS)) +ifneq ($(filter-out test,$(strip $(TESTS))),$(strip $(TESTS))) $(error Sanity check: cannot have a test named "test.c") endif U_TARGETS := $(TESTS) -G_TARGETS := $(patsubst %,%_glibc,$(U_TARGETS)) +G_TARGETS := $(addsuffix _glibc,$(U_TARGETS)) ifeq ($(GLIBC_ONLY),) TARGETS += $(U_TARGETS) @@ -30,35 +30,39 @@ endif CLEAN_TARGETS := $(U_TARGETS) $(G_TARGETS) COMPILE_TARGETS := $(TARGETS) -RUN_TARGETS := $(patsubst %,%.exe,$(TARGETS)) +RUN_TARGETS := $(addsuffix .exe,$(TARGETS)) TARGETS += $(SHELL_TESTS) +CFLAGS+=$(CFLAGS_$(notdir $(CURDIR))) define binary_name $(patsubst %.exe,%,$@) endef +define tst_src_name +$(patsubst %_glibc,%,$(binary_name)) +endef define diff_test $(Q)\ - for x in "$(binary_name).out" "$(patsubst %_glibc,%,$(binary_name)).out" ; do \ + for x in "$(binary_name).out" "$(tst_src_name).out" ; do \ test -e "$$x.good" && $(do_showdiff) "$(binary_name).out" "$$x.good" && exec diff -u "$(binary_name).out" "$$x.good" ; \ done ; \ true endef define uclibc_glibc_diff_test $(Q)\ - test -z "$(DODIFF_$(patsubst %_glibc,%,$(binary_name)))" && exec true ; \ + test -z "$(DODIFF_$(tst_src_name))" && exec true ; \ uclibc_out="$(binary_name).out" ; \ - glibc_out="$(patsubst %_glibc,%,$(binary_name)).out" ; \ + glibc_out="$(tst_src_name).out" ; \ $(do_showdiff) $$uclibc_out $$glibc_out ; \ exec diff -u "$$uclibc_out" "$$glibc_out" endef define exec_test $(showtest) $(Q)\ - $(WRAPPER) $(WRAPPER_$(patsubst %_glibc,%,$(binary_name))) \ - ./$(binary_name) $(OPTS) $(OPTS_$(patsubst %_glibc,%,$(binary_name))) > "$(binary_name).out" 2>&1 ; \ + $(WRAPPER) $(WRAPPER_$(tst_src_name)) \ + ./$(binary_name) $(OPTS) $(OPTS_$(tst_src_name)) > "$(binary_name).out" 2>&1 ; \ ret=$$? ; \ - expected_ret="$(RET_$(patsubst %_glibc,%,$(binary_name)))" ; \ + expected_ret="$(RET_$(tst_src_name))" ; \ test -z "$$expected_ret" && export expected_ret=0 ; \ if ! test $$ret -eq $$expected_ret ; then \ echo "ret == $$ret ; expected_ret == $$expected_ret" ; \ @@ -79,19 +83,19 @@ endif compile: $(COMPILE_TARGETS) -G_TARGET_SRCS := $(patsubst %,%.c,$(G_TARGETS)) -U_TARGET_SRCS := $(patsubst %,%.c,$(U_TARGETS)) +G_TARGET_SRCS := $(addsuffix .c,$(G_TARGETS)) +U_TARGET_SRCS := $(addsuffix .c,$(U_TARGETS)) $(MAKE_SRCS): Makefile $(TESTDIR)Makefile $(TESTDIR)Rules.mak $(TESTDIR)Test.mak $(U_TARGETS): $(U_TARGET_SRCS) $(MAKE_SRCS) $(showlink) - $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -c $@.c -o $@.o + $(Q)$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(notdir $(CURDIR))) $(CFLAGS_$@) -c $@.c -o $@.o $(Q)$(CC) $(LDFLAGS) $@.o -o $@ $(EXTRA_LDFLAGS) $(LDFLAGS_$@) $(G_TARGETS): $(U_TARGET_SRCS) $(MAKE_SRCS) $(showlink) - $(Q)$(HOSTCC) $(HOST_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(patsubst %_glibc,%,$@)) -c $(patsubst %_glibc,%,$@).c -o $@.o + $(Q)$(HOSTCC) $(HOST_CFLAGS) $(CFLAGS_$(notdir $(CURDIR))) $(CFLAGS_$(patsubst %_glibc,%,$@)) -c $(patsubst %_glibc,%,$@).c -o $@.o $(Q)$(HOSTCC) $(HOST_LDFLAGS) $@.o -o $@ $(EXTRA_LDFLAGS) $(LDFLAGS_$(patsubst %_glibc,%,$@)) -- cgit v1.2.3 From 62447c11492169462fa4b19c97413d5492ba7854 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 17:57:37 +0100 Subject: fixup working in helptexts and spell out suggested defaults for LDSO_RUNPATH Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 1d3e153bb..7f14b9c3b 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -282,7 +282,7 @@ config LDSO_LDD_SUPPORT depends on HAVE_SHARED default y help - Enable this to enable all the code needed to support traditional ldd, + Enable all the code needed to support traditional ldd, which executes the shared library loader to resolve all dependencies and then provide a list of shared libraries that are required for an application to function. Disabling this option will makes uClibc's @@ -333,14 +333,15 @@ config UCLIBC_STATIC_LDCONFIG Enable this option to statically link the ldconfig binary. Making ldconfig static can be beneficial if you have a library - problem and need to use ldconfig to recover. Sometimes, it is + problem and need to use ldconfig to recover. Sometimes it is preferable to instead keep the size of the system down, in which case you should disable this option. config LDSO_RUNPATH bool "Enable ELF RUNPATH tag support" depends on HAVE_SHARED - default y + default y if LDSO_CACHE_SUPPORT + default n if !LDSO_CACHE_SUPPORT help ELF's may have dynamic RPATH/RUNPATH tags. These tags list paths which extend the library search paths. They are really only useful -- cgit v1.2.3 From a59d48422fc6073f254a1f9cb8580f23ab921568 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 18:03:00 +0100 Subject: libnsl: add knob to disable it It's a dummy either way. Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 6 ++++++ libnsl/Makefile.in | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 7f14b9c3b..833d180e4 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1191,6 +1191,12 @@ config UCLIBC_HAS_RESOLV_STUB help Provide a dummy resolv library. +config UCLIBC_HAS_LIBNSL_STUB + bool "Provide libnsl stub" + default n + help + Provide a dummy nsl library. + endif diff --git a/libnsl/Makefile.in b/libnsl/Makefile.in index fac88ce55..24d530a83 10