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 100644 --- a/libnsl/Makefile.in +++ b/libnsl/Makefile.in @@ -28,8 +28,8 @@ libnsl-a-y := $(libnsl_OBJ) endif libnsl-so-y := $(libnsl_OBJ:.o=.os) -lib-a-y += $(top_builddir)lib/libnsl.a -lib-so-y += $(top_builddir)lib/libnsl.so +lib-a-$(UCLIBC_HAS_LIBNSL_STUB) += $(top_builddir)lib/libnsl.a +lib-so-$(UCLIBC_HAS_LIBNSL_STUB) += $(top_builddir)lib/libnsl.so objclean-y += libnsl_clean ifeq ($(DOPIC),y) -- cgit v1.2.3 From 3b547855d9745ffd59077a355995251eb06928a9 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 18:17:06 +0100 Subject: libutil: provide knob to disable it These tty utility functions are non-standard. They usually are available on BSD and/or glibc based systems. Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 24 ++++++++++++++++++++++++ libutil/Makefile.in | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 833d180e4..13bebd37f 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1197,6 +1197,30 @@ config UCLIBC_HAS_LIBNSL_STUB help Provide a dummy nsl library. +config UCLIBC_HAS_LIBUTIL + bool "Provide libutil library and functions" + default n + help + Provide a libutil library. + This non-standard conforming library provides the following + utility functions: + + forkpty(): combines openpty(), fork(2), and login_tty() to + create a new process operating in a pseudo-terminal. + login(): write utmp and wtmp entries + login_tty(): prepares for a login on the tty fd by creating a + new session, making fd the controlling terminal for + the calling process, setting fd to be the standard + input, output, and error streams of the current + process, and closing fd. + logout(): write utmp and wtmp entries + logwtmp(): constructs a utmp structure and calls updwtmp() to + append the structure to the utmp file. + openpty(): finds an available pseudo-terminal and returns + file descriptors for the master and slave + + This library adds about 3k-4k to your system. + endif diff --git a/libutil/Makefile.in b/libutil/Makefile.in index a5abdfaba..b0182015c 100644 --- a/libutil/Makefile.in +++ b/libutil/Makefile.in @@ -35,8 +35,8 @@ libutil-a-y := $(libutil_OBJ) endif libutil-so-y := $(libutil_OBJ:.o=.os) -lib-a-y += $(top_builddir)lib/libutil.a -lib-so-y += $(top_builddir)lib/libutil.so +lib-a-$(UCLIBC_HAS_LIBUTIL) += $(top_builddir)lib/libutil.a +lib-so-$(UCLIBC_HAS_LIBUTIL) += $(top_builddir)lib/libutil.so objclean-y += libutil_clean ifeq ($(DOMULTI),n) -- cgit v1.2.3 From 3982dd7ff251ee502ec6b5a75680a09ec60b3428 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 18:23:41 +0100 Subject: UCLIBC_HAS_RESOLV_STUB: Rename config symbol s/UCLIBC_HAS_RESOLV_STUB/UCLIBC_HAS_LIBRESOLV_STUB/ for consistency. Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 2 +- libresolv/Makefile.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 13bebd37f..419a568ac 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1185,7 +1185,7 @@ config UCLIBC_HAS_EXTRA_COMPAT_RES_STATE Answer Y if selecting UCLIBC_HAS_COMPAT_RES_STATE is not enough. As far as I can say, this should never be needed. -config UCLIBC_HAS_RESOLV_STUB +config UCLIBC_HAS_LIBRESOLV_STUB bool "Provide libresolv stub" default n help diff --git a/libresolv/Makefile.in b/libresolv/Makefile.in index efd0d9297..c859c4c7a 100644 --- a/libresolv/Makefile.in +++ b/libresolv/Makefile.in @@ -28,8 +28,8 @@ libresolv-a-y := $(libresolv_OBJ) endif libresolv-so-y := $(libresolv_OBJ:.o=.os) -lib-a-$(UCLIBC_HAS_RESOLV_STUB) += $(top_builddir)lib/libresolv.a -lib-so-$(UCLIBC_HAS_RESOLV_STUB) += $(top_builddir)lib/libresolv.so +lib-a-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(top_builddir)lib/libresolv.a +lib-so-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(top_builddir)lib/libresolv.so objclean-y += libresolv_clean ifeq ($(DOPIC),y) -- cgit v1.2.3 From 4c5c4502d0d6ae2e6cd495b1084a6c9d34a8cab3 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 18:49:24 +0100 Subject: DO_XSI_MATH: add config knob Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in.arch | 11 +++++++++++ libc/sysdeps/linux/common/bits/mathcalls.h | 2 ++ libm/Makefile.in | 8 ++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/extra/Configs/Config.in.arch b/extra/Configs/Config.in.arch index 76ab0022f..8a02cb1a2 100644 --- a/extra/Configs/Config.in.arch +++ b/extra/Configs/Config.in.arch @@ -160,6 +160,17 @@ config DO_C99_MATH If your applications require the newer C99 math library functions, then answer Y. +config DO_XSI_MATH + bool "Enable XSI math extensions to the ISO C standard (bessel)" + depends on UCLIBC_HAS_FLOATS + default n + help + X/Open System Interfaces extensions to ISO C math functions + (differential equation functions): + + j0, j1, jn - Bessel functions of the first kind + y0, y1, yn - Bessel functions of the second kind + config UCLIBC_HAS_FENV bool "Enable C99 Floating-point environment" depends on UCLIBC_HAS_FLOATS diff --git a/libc/sysdeps/linux/common/bits/mathcalls.h b/libc/sysdeps/linux/common/bits/mathcalls.h index 811738238..df2e21cc8 100644 --- a/libc/sysdeps/linux/common/bits/mathcalls.h +++ b/libc/sysdeps/linux/common/bits/mathcalls.h @@ -244,6 +244,7 @@ __END_NAMESPACE_C99 /* Return nonzero if VALUE is not a number. */ __MATHDECL_PRIV (int,isnan,, (_Mdouble_ __value), (__const__)) +# ifdef __DO_XSI_MATH__ /* Bessel functions. */ __MATHCALL (j0,, (_Mdouble_)) __MATHCALL (j1,, (_Mdouble_)) @@ -251,6 +252,7 @@ __MATHCALL (jn,, (int, _Mdouble_)) __MATHCALL (y0,, (_Mdouble_)) __MATHCALL (y1,, (_Mdouble_)) __MATHCALL (yn,, (int, _Mdouble_)) +# endif #endif diff --git a/libm/Makefile.in b/libm/Makefile.in index d17d64fae..56b2d76c3 100644 --- a/libm/Makefile.in +++ b/libm/Makefile.in @@ -56,8 +56,8 @@ LD_MSRC := ldouble_wrappers.c ifeq ($(DO_C99_MATH),y) libm_CSRC := \ e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c \ - e_exp.c e_fmod.c e_hypot.c e_j0.c \ - e_j1.c e_jn.c e_lgamma_r.c e_log.c e_log2.c e_log10.c \ + e_exp.c e_fmod.c e_hypot.c \ + e_lgamma_r.c e_log.c e_log2.c e_log10.c \ e_pow.c e_remainder.c e_rem_pio2.c e_scalb.c e_sinh.c \ e_sqrt.c k_cos.c k_rem_pio2.c k_sin.c k_standard.c k_tan.c \ s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c \ @@ -209,6 +209,10 @@ libm_CSRC := \ FL_MOBJ := sqrtf.o endif +ifeq ($(DO_XSI_MATH),y) +libm_CSRC += e_j0.c e_j1.c e_jn.c +endif + # assume that arch specific versions are provided as single sources/objects ifeq ($(UCLIBC_HAS_FPU),y) ifeq ($(DO_C99_MATH),y) -- cgit v1.2.3 From 5530578d87079defddaeb75843ce3e44d46bd8d0 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 18:57:32 +0100 Subject: fix misplaced HAS_LIBUTIL knob Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 49 +++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index 419a568ac..b7cc8f377 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -725,6 +725,31 @@ config UCLIBC_HAS_GETPT def_bool y endif +config UCLIBC_HAS_LIBUTIL + bool "Provide libutil library and functions" + depends on UCLIBC_HAS_PTY + default n + help + Provide a libutil library. + This non-standard conforming library provides the following + utility functions: + + forkpty(): combines openpty(), fork(2), and login_tty() to + create a new process operating in a pseudo-terminal. + login(): write utmp and wtmp entries + login_tty(): prepares for a login on the tty fd by creating a + new session, making fd the controlling terminal for + the calling process, setting fd to be the standard + input, output, and error streams of the current + process, and closing fd. + logout(): write utmp and wtmp entries + logwtmp(): constructs a utmp structure and calls updwtmp() to + append the structure to the utmp file. + openpty(): finds an available pseudo-terminal and returns + file descriptors for the master and slave + + This library adds about 3k-4k to your system. + config UCLIBC_HAS_TM_EXTENSIONS bool "Support 'struct tm' timezone extension fields" default y @@ -1197,30 +1222,6 @@ config UCLIBC_HAS_LIBNSL_STUB help Provide a dummy nsl library. -config UCLIBC_HAS_LIBUTIL - bool "Provide libutil library and functions" - default n - help - Provide a libutil library. - This non-standard conforming library provides the following - utility functions: - - forkpty(): combines openpty(), fork(2), and login_tty() to - create a new process operating in a pseudo-terminal. - login(): write utmp and wtmp entries - login_tty(): prepares for a login on the tty fd by creating a - new session, making fd the controlling terminal for - the calling process, setting fd to be the standard - input, output, and error streams of the current - process, and closing fd. - logout(): write utmp and wtmp entries - logwtmp(): constructs a utmp structure and calls updwtmp() to - append the structure to the utmp file. - openpty(): finds an available pseudo-terminal and returns - file descriptors for the master and slave - - This library adds about 3k-4k to your system. - endif -- cgit v1.2.3 From c356796c330ec98fdbe5b9daba0ba386fb643540 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 19:07:30 +0100 Subject: disable libutil related prototypes if asked to Signed-off-by: Bernhard Reutner-Fischer --- include/utmp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/utmp.h b/include/utmp.h index c198ede35..182f45e1c 100644 --- a/include/utmp.h +++ b/include/utmp.h @@ -37,6 +37,7 @@ __BEGIN_DECLS +#ifdef __UCLIBC_HAS_LIBUTIL__ /* Make FD be the controlling terminal, stdin, stdout, and stderr; then close FD. Returns 0 on success, nonzero on error. */ extern int login_tty (int __fd) __THROW; @@ -51,6 +52,7 @@ extern int logout (__const char *__ut_line) __THROW; /* Append to wtmp an entry for the current time and the given info. */ extern void logwtmp (__const char *__ut_line, __const char *__ut_name, __const char *__ut_host) __THROW; +#endif /* Append entry UTMP to the wtmp-like file WTMP_FILE. */ extern void updwtmp (__const char *__wtmp_file, __const struct utmp *__utmp) -- cgit v1.2.3 From a46c18e3ee62ea2e5c0498d1ef1ca2afb47f3022 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 00:03:53 +0200 Subject: rm uClibc_arch_features.h on install uClibc_arch_features.h is included already by libc-symbols.h. If gcc needs it, fix gcc. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 3 +-- include/features.h | 3 --- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile.in b/Makefile.in index affbe5321..f0a6fb496 100644 --- a/Makefile.in +++ b/Makefile.in @@ -203,6 +203,7 @@ $(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c HEADERS_RM- := \ dl-osinfo.h \ _lfs_64.h \ + bits/uClibc_arch_features.h \ bits/kernel_sigaction.h \ bits/kernel_stat.h \ bits/kernel_types.h \ @@ -215,8 +216,6 @@ HEADERS_RM- := \ bits/sigcontextinfo.h \ bits/stackinfo.h \ tls.h - # gcc 4.3.1 needs it, dont rm: - #bits/uClibc_arch_features.h HEADERS_RM-$(UCLIBC_HAS_FLOATS) += \ complex.h \ fpu_control.h \ diff --git a/include/features.h b/include/features.h index 66447e2ed..8a39cc8e0 100644 --- a/include/features.h +++ b/include/features.h @@ -34,9 +34,6 @@ #define __need_uClibc_config_h #include #undef __need_uClibc_config_h -#ifdef _LIBC -#include -#endif /* For uClibc, always optimize for size -- this should disable * a lot of expensive inlining... -- cgit v1.2.3 From a5263b281af8cbdb477629e68c6b0638d690e21b Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 22:28:50 +0100 Subject: Add missing order-only prereq for unifdef For O= make sure that top_builddir/extra/scripts is created before trying to build unifdef into it. Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index f0a6fb496..0a8ff648c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -194,7 +194,7 @@ install: install_runtime install_dev RUNTIME_PREFIX_LIB_FROM_DEVEL_PREFIX_LIB=$(shell $(top_srcdir)extra/scripts/relative_path.sh $(DEVEL_PREFIX)lib $(RUNTIME_PREFIX)lib) -$(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c +$(top_builddir)extra/scripts/unifdef: $(top_srcdir)extra/scripts/unifdef.c|$(@D) $(hcompile.u) # Installs header files. @@ -386,7 +386,7 @@ hostutils: install_hostutils: hostutils $(Q)$(MAKE) CROSS="$(CROSS)" CC="$(CC)" HOSTCC="$(HOSTCC)" DOTHOST=.host -C utils utils_install -$(addprefix $(top_builddir),include/bits include/sys include/config extra/config/lxdialog extra/locale $(subdirs)): +$(addprefix $(top_builddir),include/bits include/sys include/config extra/config/lxdialog extra/locale extra/scripts $(subdirs)): $(do_mkdir) # configuration -- cgit v1.2.3 From 148540ddf354a58468bc66498e99dc3881035a57 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 00:22:23 +0200 Subject: no need for bits/syscalls.h on target Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 5 +---- include/sys/syscall.h | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0a8ff648c..eaa5ca688 100644 --- a/Makefile.in +++ b/Makefile.in @@ -207,6 +207,7 @@ HEADERS_RM- := \ bits/kernel_sigaction.h \ bits/kernel_stat.h \ bits/kernel_types.h \ + bits/syscalls.h \ bits/syscalls-common.h \ bits/utmpx.h \ bits/uClibc_errno.h \ @@ -285,10 +286,6 @@ install_headers: headers $(top_builddir)extra/scripts/unifdef $(INSTALL) -d $(PREFIX)$(DEVEL_PREFIX)include top_builddir=$(top_builddir) \ $(top_srcdir)extra/scripts/install_headers.sh include $(PREFIX)$(DEVEL_PREFIX)include - # Disabled. If libc-internal.h is needed, document here why! - #printf '#ifndef _LIBC_INTERNAL_H\n#define _LIBC_INTERNAL_H 1\n#endif\n' >$(PREFIX)$(DEVEL_PREFIX)include/libc-internal.h - echo '/* Dont use _syscall#() macros; use the syscall() function */' > \ - $(PREFIX)$(DEVEL_PREFIX)include/bits/syscalls.h cd $(PREFIX)$(DEVEL_PREFIX)include && $(RM) -r $(HEADERS_RM-) ifeq ($(UCLIBC_HAS_WCHAR),) cd $(PREFIX)$(DEVEL_PREFIX)include && mv -f wchar-stub.h wchar.h diff --git a/include/sys/syscall.h b/include/sys/syscall.h index db8364bcf..25264cf91 100644 --- a/include/sys/syscall.h +++ b/include/sys/syscall.h @@ -19,18 +19,18 @@ #ifndef _SYSCALL_H #define _SYSCALL_H 1 +/* User application code should use syscall(). */ + +#include +#include +#ifdef _LIBC /* The _syscall#() macros are for uClibc internal use only. - * User application code should use syscall() instead. * * The kernel provided _syscall[0-6] macros from asm/unistd.h are not suitable * for use in uClibc as they lack PIC support etc, so for uClibc we use our own * local _syscall# macros to be certain all such variations are handled * properly. */ - -#include -#include -#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc) # include # include #endif -- cgit v1.2.3 From 603f9d3c0fd96b5a9cdffa04bceb4466d97e7333 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 00:30:42 +0200 Subject: remove some unneeded headers on install Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index eaa5ca688..f365bb8e2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -216,7 +216,11 @@ HEADERS_RM- := \ bits/atomic.h \ bits/sigcontextinfo.h \ bits/stackinfo.h \ - tls.h + tls.h \ + rpc/des_crypt.h \ + rpc/key_prot.h \ + rpc/rpc_des.h \ + sgtty.h HEADERS_RM-$(UCLIBC_HAS_FLOATS) += \ complex.h \ fpu_control.h \ -- cgit v1.2.3 From 64f11aa906c9df236d89f5db98132cf08c4f1393 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 00:38:07 +0200 Subject: remove ARCH_CFLAGS, ARCH_LDFLAGS and CROSS Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- Makerules | 4 ++-- Rules.mak | 15 +++++++++++---- extra/Configs/Config.alpha | 3 --- extra/Configs/Config.arm | 3 --- extra/Configs/Config.avr32 | 3 --- extra/Configs/Config.bfin | 3 --- extra/Configs/Config.cris | 3 --- extra/Configs/Config.e1 | 8 -------- extra/Configs/Config.frv | 3 --- extra/Configs/Config.h8300 | 3 --- extra/Configs/Config.hppa | 3 --- extra/Configs/Config.i960 | 4 ---- extra/Configs/Config.ia64 | 3 --- extra/Configs/Config.microblaze | 7 ------- extra/Configs/Config.mips | 4 ---- extra/Configs/Config.nios | 7 ------- extra/Configs/Config.nios2 | 6 ------ extra/Configs/Config.powerpc | 3 --- extra/Configs/Config.sh | 3 --- extra/Configs/Config.sh64 | 3 --- extra/Configs/Config.sparc | 3 --- extra/Configs/Config.v850 | 7 ------- extra/Configs/Config.vax | 10 ---------- extra/Configs/Config.x86_64 | 3 --- extra/Configs/Config.xtensa | 4 ---- 25 files changed, 13 insertions(+), 105 deletions(-) diff --git a/Makerules b/Makerules index 4cc3e5813..87d7f4a0a 100644 --- a/Makerules +++ b/Makerules @@ -184,7 +184,7 @@ maybe_exec = \ CFLAGS_gen.dep = -MT $@ -MD -MP -MF $(dir $@).$(notdir $@).dep -cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) $(ARCH_CFLAGS) \ +cmd_compile.c = $(CC) -c $< -o $@ $(CFLAGS) \ $(CFLAGS-$(suffix $@)) \ $(filter-out $(CFLAGS-OMIT-$(notdir $<)),$(CFLAGS-$(notdir $( Date: Sat, 17 Oct 2009 00:41:08 +0200 Subject: FORCE_SHAREABLE_TEXT_SEGMENTS requires DOPIC Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- extra/Configs/Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index b7cc8f377..d344385c6 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -265,6 +265,7 @@ config HAVE_SHARED config FORCE_SHAREABLE_TEXT_SEGMENTS bool "Only load shared libraries which can share their text segment" depends on HAVE_SHARED + select DOPIC default n help If you answer Y here, the uClibc native shared library loader will -- cgit v1.2.3 From be800f25ee834eea10fbc4d2bfe623d0855753e3 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 01:10:38 +0200 Subject: a.out.h: why was this needed? Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/a.out.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/a.out.h b/include/a.out.h index d963de74c..027c49ad5 100644 --- a/include/a.out.h +++ b/include/a.out.h @@ -1,5 +1 @@ -#ifdef _LIBC -# include_next -#else -# include -#endif +#include -- cgit v1.2.3 From 0ccab5e4a96ae1ad60a815c0045e1f0a51ea27d1 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 01:14:16 +0200 Subject: move extend_alloca macro to alloca.h guard it by _LIBC. __MAX_ALLOCA_CUTOFF is not needed on target either Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/alloca.h | 33 ++++++++++++++++++++++++++++++++- include/libc-internal.h | 30 ------------------------------ 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/include/alloca.h b/include/alloca.h index b4fc31738..2565b4835 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -36,7 +36,38 @@ extern void *alloca (size_t __size) __THROW; # define alloca(size) __builtin_alloca (size) #endif /* GCC. */ -#define __MAX_ALLOCA_CUTOFF 65536 +#ifdef _LIBC +# define __MAX_ALLOCA_CUTOFF 65536 + +# include +# ifdef _STACK_GROWS_DOWN +# define extend_alloca(buf, len, newlen) \ + (__typeof (buf)) ({ size_t __newlen = (newlen); \ + char *__newbuf = alloca (__newlen); \ + if (__newbuf + __newlen == (char *) buf) \ + len += __newlen; \ + else \ + len = __newlen; \ + __newbuf; }) +# elif defined _STACK_GROWS_UP +# define extend_alloca(buf, len, newlen) \ + (__typeof (buf)) ({ size_t __newlen = (newlen); \ + char *__newbuf = alloca (__newlen); \ + char *__buf = (buf); \ + if (__buf + __newlen == __newbuf) \ + { \ + len += __newlen; \ + __newbuf = __buf; \ + } \ + else \ + len = __newlen; \ + __newbuf; }) +# else +# error unknown stack +# define extend_alloca(buf, len, newlen) \ + alloca (((len) = (newlen))) +# endif +#endif __END_DECLS diff --git a/include/libc-internal.h b/include/libc-internal.h index 33956d8b1..8809bc042 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -67,36 +67,6 @@ extern const char *__uclibc_progname attribute_hidden; # endif /* IS_IN_libc */ -/* #include */ -#include -#if defined(_STACK_GROWS_DOWN) -# define extend_alloca(buf, len, newlen) \ - (__typeof (buf)) ({ size_t __newlen = (newlen); \ - char *__newbuf = alloca (__newlen); \ - if (__newbuf + __newlen == (char *) buf) \ - len += __newlen; \ - else \ - len = __newlen; \ - __newbuf; }) -#elif defined(_STACK_GROWS_UP) -# define extend_alloca(buf, len, newlen) \ - (__typeof (buf)) ({ size_t __newlen = (newlen); \ - char *__newbuf = alloca (__newlen); \ - char *__buf = (buf); \ - if (__buf + __newlen == __newbuf) \ - { \ - len += __newlen; \ - __newbuf = __buf; \ - } \ - else \ - len = __newlen; \ - __newbuf; }) -#else -# warning unknown stack -# define extend_alloca(buf, len, newlen) \ - alloca (((len) = (newlen))) -#endif - #endif /* __ASSEMBLER__ */ #endif /* _LIBC_INTERNAL_H */ -- cgit v1.2.3 From 577b8d7e5643ec4ffbaeae9cebfa87bacaf966e7 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 01:40:34 +0200 Subject: inet.h: mark inet_ntoa_r as uClibc specific Ddisable some prototypes of unimplemented funcs. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/arpa/inet.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/arpa/inet.h b/include/arpa/inet.h index 8ecad55f0..fbd715af0 100644 --- a/include/arpa/inet.h +++ b/include/arpa/inet.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -57,9 +57,11 @@ libc_hidden_proto(inet_network) is a pointer to an internal array containing the string. */ extern char *inet_ntoa (struct in_addr __in) __THROW; libc_hidden_proto(inet_ntoa) +#ifdef __UCLIBC__ /* Recursion-safe flavor */ extern char *inet_ntoa_r (struct in_addr __in, char *__buf) __THROW; libc_hidden_proto(inet_ntoa_r) +#endif /* Convert from presentation format of an Internet number in buffer starting at CP to the binary network format and store result for @@ -84,6 +86,7 @@ libc_hidden_proto(inet_ntop) extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW; libc_hidden_proto(inet_aton) +#if 0 /* Format a network number NET into presentation format and place result in buffer starting at BUF with length of LEN bytes. */ extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __THROW; @@ -111,6 +114,7 @@ extern unsigned int inet_nsap_addr (__const char *__cp, extern char *inet_nsap_ntoa (int __len, __const unsigned char *__cp, char *__buf) __THROW; #endif +#endif __END_DECLS -- cgit v1.2.3 From efe75b58fd43743d84fd74eac8a0e1d6edcc430c Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 01:46:10 +0200 Subject: nameser.h: sync with glibc Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/arpa/nameser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index a9c199e25..917ba19b9 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -287,7 +287,7 @@ typedef enum __ns_type { ns_t_naptr = 35, /* Naming Authority PoinTeR */ ns_t_kx = 36, /* Key Exchange */ ns_t_cert = 37, /* Certification record */ - ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ + ns_t_a6 = 38, /* IPv6 address (deprecated, use ns_t_aaaa) */ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ -- cgit v1.2.3 From 5f37f10508892a4180a1934764dfeb7ce0b1ff19 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 02:04:20 +0200 Subject: assert: make linenumber unsigned Move attribute_noreturn to header. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/assert.h | 8 ++++---- libc/misc/assert/__assert.c | 7 +++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/assert.h b/include/assert.h index 439179d8d..40b16059b 100644 --- a/include/assert.h +++ b/include/assert.h @@ -51,15 +51,15 @@ __BEGIN_DECLS /* This prints an "Assertion failed" message and aborts. */ -extern void __assert __P((const char *, const char *, int, const char *)); +extern void __assert(const char *, const char *, unsigned int, const char *) + __THROW __attribute__ ((__noreturn__)); libc_hidden_proto(__assert) __END_DECLS # define assert(expr) \ - (__ASSERT_VOID_CAST ((expr) ? 0 : \ - (__assert (__STRING(expr), __FILE__, __LINE__, \ - __ASSERT_FUNCTION), 0))) + (__ASSERT_VOID_CAST ((expr) ? 0 : \ + (__assert (__STRING(expr), __FILE__, __LINE__, __ASSERT_FUNCTION), 0))) /* Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__' which contains the name of the function currently being defined. diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c index ff9e47dcf..18c6f5ecf 100644 --- a/libc/misc/assert/__assert.c +++ b/libc/misc/assert/__assert.c @@ -29,8 +29,6 @@ #include #include -#include -#include /* Get the prototype from assert.h as a double-check. */ @@ -43,8 +41,8 @@ static smallint in_assert; /* bss inits to 0. */ -void attribute_noreturn __assert(const char *assertion, const char * filename, - int linenumber, register const char * function) +void __assert(const char *assertion, const char * filename, + unsigned int linenumber, register const char * function) { if (!in_assert) { in_assert = 1; @@ -62,6 +60,7 @@ void attribute_noreturn __assert(const char *assertion, const char * filename, assertion ); } + /* shouldn't we? fflush(stderr); */ abort(); } -- cgit v1.2.3 From ed4533ecdc7c39e8c6e7f1f3d4a0c00a8c1845a5 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 02:19:35 +0200 Subject: move __linux__ to libc-internal.h Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/features.h | 8 -------- include/libc-internal.h | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/features.h b/include/features.h index 8a39cc8e0..9602ecc0d 100644 --- a/include/features.h +++ b/include/features.h @@ -448,12 +448,4 @@ uClibc was built without large file support enabled. # include #endif -/* Some people like to build up uClibc with *-elf toolchains, so - * a little grease here until we drop '#ifdef __linux__' checks - * from our source code. - */ -#ifndef __linux__ -# define __linux__ 1 -#endif - #endif /* features.h */ diff --git a/include/libc-internal.h b/include/libc-internal.h index 8809bc042..443b1fc50 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -69,4 +69,12 @@ extern const char *__uclibc_progname attribute_hidden; #endif /* __ASSEMBLER__ */ +/* Some people like to build up uClibc with *-elf toolchains, so + * a little grease here until we drop '#ifdef __linux__' checks + * from our source code. + */ +#ifndef __linux__ +# define __linux__ 1 +#endif + #endif /* _LIBC_INTERNAL_H */ -- cgit v1.2.3 From 8793e73bdbc8c9b4c4ad218bc9159eecf36ebcaa Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 19 Nov 2009 23:00:32 +0100 Subject: SUSv4: disable isascii, toascii, _toupper, _tolower [__]isascii need to be defined all the time for the build. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/ctype.h | 33 +++++++++++++++++---------- libc/sysdeps/linux/common/bits/uClibc_ctype.h | 2 ++ test/ctype/ctype.c | 2 ++ 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/include/ctype.h b/include/ctype.h index 2d62847fe..dcfeb1b3e 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -66,7 +66,8 @@ libc_hidden_proto(tolower) extern int toupper(int __c) __THROW; libc_hidden_proto(toupper) -#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +#if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) && \ + defined __UCLIBC_SUSV4_LEGACY__ /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii(int __c) __THROW; @@ -203,11 +204,12 @@ libc_hidden_proto(__ctype_tolower) #endif /* __UCLIBC_HAS_XLOCALE__ */ - +#ifdef __UCLIBC_SUSV4_LEGACY__ #define __isascii(c) (((c) & ~0x7f) == 0) /* If C is a 7 bit value. */ #define __toascii(c) ((c) & 0x7f) /* Mask off high bits. */ +#endif -#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc) +#ifdef _LIBC /* These are uClibc-specific. */ #define __isdigit_char(C) (((unsigned char)((C) - '0')) <= 9) #define __isdigit_int(C) (((unsigned int)((C) - '0')) <= 9) @@ -278,13 +280,12 @@ __NTH (toupper (int __c)) # define toupper(c) __tobody(c, toupper, __UCLIBC_CTYPE_TOUPPER, (c)) # endif /* Optimizing gcc */ -# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \ + && defined __UCLIBC_SUSV4_LEGACY__ # define isascii(c) __isascii (c) # define toascii(c) __toascii (c) -# if defined __UCLIBC_SUSV4_LEGACY__ -# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)]) -# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)]) -# endif +# define _tolower(c) ((int) (__UCLIBC_CTYPE_TOLOWER)[(int) (c)]) +# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)]) # endif #endif /* not __cplusplus */ @@ -334,8 +335,8 @@ libc_hidden_proto(isxdigit_l) extern int isblank_l(int, __locale_t) __THROW; libc_hidden_proto(isblank_l) -# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN - +# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \ + && defined __UCLIBC_SUSV4_LEGACY__ /* Return nonzero iff C is in the ASCII set (i.e., is no more than 7 bits wide). */ extern int isascii_l (int __c) __THROW; @@ -378,7 +379,8 @@ libc_hidden_proto(toupper_l) # define __isxdigit_l(c,l) __isctype_l((c), _ISxdigit, (l)) # define __isblank_l(c,l) __isctype_l((c), _ISblank, (l)) -# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \ + && defined __UCLIBC_SUSV4_LEGACY__ # define __isascii_l(c,l) ((l), __isascii (c)) # define __toascii_l(c,l) ((l), __toascii (c)) # endif @@ -396,7 +398,8 @@ libc_hidden_proto(toupper_l) # define isxdigit_l(c,l) __isxdigit_l ((c), (l)) # define isblank_l(c,l) __isblank_l ((c), (l)) -# if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN +# if (defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN) \ + && defined __UCLIBC_SUSV4_LEGACY__ # define isascii_l(c,l) __isascii_l ((c), (l)) # define toascii_l(c,l) __toascii_l ((c), (l)) # endif @@ -409,4 +412,10 @@ __END_DECLS #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */ +/* We define {__,}isascii for internal use only */ +#if defined _LIBC && !defined __UCLIBC_SUSV4_LEGACY__ +# define __isascii(c) (((c) & ~0x7f) == 0) +# define isascii(c) __isascii (c) +#endif + #endif /* ctype.h */ diff --git a/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/libc/sysdeps/linux/common/bits/uClibc_ctype.h index 43371286b..22d2df03a 100644 --- a/libc/sysdeps/linux/common/bits/uClibc_ctype.h +++ b/libc/sysdeps/linux/common/bits/uClibc_ctype.h @@ -103,12 +103,14 @@ __BEGIN_DECLS /* Now some non-ansi/iso c99 macros. */ +#ifndef __UCLIBC_SUSV4_LEGACY__ #define __isascii(c) (((c) & ~0x7f) == 0) #define __toascii(c) ((c) & 0x7f) /* Works correctly *only* on lowercase letters! */ #define _toupper(c) ((c) ^ 0x20) /* Works correctly *only* on letters (of any case) and numbers */ #define _tolower(c) ((c) | 0x20) +#endif __END_DECLS diff --git a/test/ctype/ctype.c b/test/ctype/ctype.c index 352b2d2c8..f38f722b2 100644 --- a/test/ctype/ctype.c +++ b/test/ctype/ctype.c @@ -56,6 +56,7 @@ int main( int argc, char **argv) +#ifdef __UCLIBC_SUSV4_LEGACY__ /* isascii() */ { int buffer[]={ 'a', 'z', 'A', 'Z', '\n', -1}; @@ -71,6 +72,7 @@ int main( int argc, char **argv) TEST( isascii(c)==0); } } +#endif /* iscntrl() */ -- cgit v1.2.3 From 13726cfc7c19328d6af0abd538baadfbf679856f Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:31:36 +0200 Subject: use __BYTE_ORDER and __*ENDIAN Those without the __ prefix are BSD specific. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/arpa/nameser_compat.h | 4 ++-- include/ieee754.h | 8 ++++---- include/netinet/icmp6.h | 12 ++++++------ include/netinet/ip6.h | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h index e3ef864cd..7fe46a16d 100644 --- a/include/arpa/nameser_compat.h +++ b/include/arpa/nameser_compat.h @@ -47,7 +47,7 @@ typedef struct { unsigned id :16; /* query identification number */ -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN /* fields in third byte */ unsigned qr: 1; /* response flag */ unsigned opcode: 4; /* purpose of message */ @@ -61,7 +61,7 @@ typedef struct { unsigned cd: 1; /* checking disabled by resolver */ unsigned rcode :4; /* response code */ #endif -#if BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN +#if __BYTE_ORDER == __LITTLE_ENDIAN || __BYTE_ORDER == __PDP_ENDIAN /* fields in third byte */ unsigned rd :1; /* recursion desired */ unsigned tc :1; /* truncated message */ diff --git a/include/ieee754.h b/include/ieee754.h index 7131e5de6..b17c29ab7 100644 --- a/include/ieee754.h +++ b/include/ieee754.h @@ -80,7 +80,7 @@ union ieee754_double unsigned int mantissa1:32; #endif /* Big endian. */ #if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN +# if __FLOAT_WORD_ORDER == __BIG_ENDIAN unsigned int mantissa0:20; unsigned int exponent:11; unsigned int negative:1; @@ -106,7 +106,7 @@ union ieee754_double unsigned int mantissa0:19; unsigned int mantissa1:32; #else -# if __FLOAT_WORD_ORDER == BIG_ENDIAN +# if __FLOAT_WORD_ORDER == __BIG_ENDIAN unsigned int mantissa0:19; unsigned int quiet_nan:1; unsigned int exponent:11; @@ -142,7 +142,7 @@ union ieee854_long_double unsigned int mantissa1:32; #endif #if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN +# if __FLOAT_WORD_ORDER == __BIG_ENDIAN unsigned int exponent:15; unsigned int negative:1; unsigned int empty:16; @@ -171,7 +171,7 @@ union ieee854_long_double unsigned int mantissa1:32; #endif #if __BYTE_ORDER == __LITTLE_ENDIAN -# if __FLOAT_WORD_ORDER == BIG_ENDIAN +# if __FLOAT_WORD_ORDER == __BIG_ENDIAN unsigned int exponent:15; unsigned int negative:1; unsigned int empty:16; diff --git a/include/netinet/icmp6.h b/include/netinet/icmp6.h index 0cb1aa6a6..225e49e07 100644 --- a/include/netinet/icmp6.h +++ b/include/netinet/icmp6.h @@ -161,11 +161,11 @@ struct nd_neighbor_advert /* neighbor advertisement */ #define nd_na_code nd_na_hdr.icmp6_code #define nd_na_cksum nd_na_hdr.icmp6_cksum #define nd_na_flags_reserved nd_na_hdr.icmp6_data32[0] -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN #define ND_NA_FLAG_ROUTER 0x80000000 #define ND_NA_FLAG_SOLICITED 0x40000000 #define ND_NA_FLAG_OVERRIDE 0x20000000 -#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#else /* __BYTE_ORDER == __LITTLE_ENDIAN */ #define ND_NA_FLAG_ROUTER 0x00000080 #define ND_NA_FLAG_SOLICITED 0x00000040 #define ND_NA_FLAG_OVERRIDE 0x00000020 @@ -299,10 +299,10 @@ struct rr_pco_use /* use prefix part */ #define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x20 #define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x10 -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN # define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80000000 # define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40000000 -#elif BYTE_ORDER == LITTLE_ENDIAN +#elif __BYTE_ORDER == __LITTLE_ENDIAN # define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80 # define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40 #endif @@ -316,10 +316,10 @@ struct rr_result /* router renumbering result message */ struct in6_addr rrr_prefix; }; -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN # define ICMP6_RR_RESULT_FLAGS_OOB 0x0002 # define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0001 -#elif BYTE_ORDER == LITTLE_ENDIAN +#elif __BYTE_ORDER == __LITTLE_ENDIAN # define ICMP6_RR_RESULT_FLAGS_OOB 0x0200 # define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100 #endif diff --git a/include/netinet/ip6.h b/include/netinet/ip6.h index bef2af2f5..c82b277e1 100644 --- a/include/netinet/ip6.h +++ b/include/netinet/ip6.h @@ -102,11 +102,11 @@ struct ip6_frag uint32_t ip6f_ident; /* identification */ }; -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN # define IP6F_OFF_MASK 0xfff8 /* mask out offset from _offlg */ # define IP6F_RESERVED_MASK 0x0006 /* reserved bits in ip6f_offlg */ # define IP6F_MORE_FRAG 0x0001 /* more-fragments flag */ -#else /* BYTE_ORDER == LITTLE_ENDIAN */ +#else /* __BYTE_ORDER == __LITTLE_ENDIAN */ # define IP6F_OFF_MASK 0xf8ff /* mask out offset from _offlg */ # define IP6F_RESERVED_MASK 0x0600 /* reserved bits in ip6f_offlg */ # define IP6F_MORE_FRAG 0x0100 /* more-fragments flag */ @@ -176,11 +176,11 @@ struct ip6_opt_router }; /* Router alert values (in network byte order) */ -#if BYTE_ORDER == BIG_ENDIAN +#if __BYTE_ORDER == __BIG_ENDIAN # define IP6_ALERT_MLD 0x0000 # define IP6_ALERT_RSVP 0x0001 # define IP6_ALERT_AN 0x0002 -#else /* BYTE_ORDER == LITTLE_ENDING */ +#else /* __BYTE_ORDER == __LITTLE_ENDING */ # define IP6_ALERT_MLD 0x0000 # define IP6_ALERT_RSVP 0x0100 # define IP6_ALERT_AN 0x0200 -- cgit v1.2.3 From a193e5a08463ea97f55cb66ccd001f156ec7aa87 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:36:43 +0200 Subject: msgrcv is of type ssize_t Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/sys/msg.h | 10 +++++++--- libc/misc/sysvipc/msgq.c | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/sys/msg.h b/include/sys/msg.h index 1fd64b2ac..cdc96be9b 100644 --- a/include/sys/msg.h +++ b/include/sys/msg.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1995,1996,1997,1999,2000,2003 Free Software Foundation, Inc. +/* Copyright (C) 1995-1997,1999,2000,2003,2006,2007 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,6 +22,9 @@ #include +#define __need_size_t +#include + /* Get common definition of System V style IPC. */ #include @@ -66,8 +70,8 @@ extern int msgget (key_t __key, int __msgflg) __THROW; This function is a cancellation point and therefore not marked with __THROW. */ -extern int msgrcv (int __msqid, void *__msgp, size_t __msgsz, - long int __msgtyp, int __msgflg); +extern ssize_t msgrcv (int __msqid, void *__msgp, size_t __msgsz, + long int __msgtyp, int __msgflg); /* Send message to message queue. diff --git a/libc/misc/sysvipc/msgq.c b/libc/misc/sysvipc/msgq.c index e43a9ed04..dac886f7f 100644 --- a/libc/misc/sysvipc/msgq.c +++ b/libc/misc/sysvipc/msgq.c @@ -43,9 +43,9 @@ struct new_msg_buf{ #ifdef L_msgrcv #ifdef __NR_msgrcv -_syscall5(int, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg) +_syscall5(ssize_t, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg) #else -int msgrcv (int msqid, void *msgp, size_t msgsz, +ssize_t msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, int msgflg) { struct new_msg_buf temp; -- cgit v1.2.3 From 9a9fe3ad32b7f42650d6acdab484782320ae8e6d Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:45:53 +0200 Subject: sync some headers and disable unused prototypes Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/inttypes.h | 148 +++++++++++++++++++++++++++++---- include/langinfo.h | 48 +++++++---- include/locale.h | 10 +-- include/net/ethernet.h | 10 ++- include/net/if_arp.h | 10 ++- include/netinet/ether.h | 4 + include/paths.h | 1 - include/regexp.h | 20 +++-- include/rpc/auth.h | 4 + include/rpc/auth_des.h | 4 + include/signal.h | 2 + include/stdlib.h | 26 +++--- include/sys/mman.h | 6 +- include/sys/poll.h | 2 - include/sys/shm.h | 3 +- include/sys/socket.h | 9 +- include/sys/statvfs.h | 8 +- include/sys/timex.h | 2 + include/sys/utsname.h | 23 +++-- include/sys/wait.h | 2 +- libc/sysdeps/linux/mips/bits/termios.h | 1 + 21 files changed, 268 insertions(+), 75 deletions(-) diff --git a/include/inttypes.h b/include/inttypes.h index b1d4302a2..137d3dbd4 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997-2001, 2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -70,8 +70,8 @@ typedef wchar_t __gwchar_t; # define PRIdLEAST64 __PRI64_PREFIX "d" # define PRIdFAST8 "d" -# define PRIdFAST16 "d" -# define PRIdFAST32 "d" +# define PRIdFAST16 __PRIPTR_PREFIX "d" +# define PRIdFAST32 __PRIPTR_PREFIX "d" # define PRIdFAST64 __PRI64_PREFIX "d" @@ -86,8 +86,8 @@ typedef wchar_t __gwchar_t; # define PRIiLEAST64 __PRI64_PREFIX "i" # define PRIiFAST8 "i" -# define PRIiFAST16 "i" -# define PRIiFAST32 "i" +# define PRIiFAST16 __PRIPTR_PREFIX "i" +# define PRIiFAST32 __PRIPTR_PREFIX "i" # define PRIiFAST64 __PRI64_PREFIX "i" /* Octal notation. */ @@ -102,8 +102,8 @@ typedef wchar_t __gwchar_t; # define PRIoLEAST64 __PRI64_PREFIX "o" # define PRIoFAST8 "o" -# define PRIoFAST16 "o" -# define PRIoFAST32 "o" +# define PRIoFAST16 __PRIPTR_PREFIX "o" +# define PRIoFAST32 __PRIPTR_PREFIX "o" # define PRIoFAST64 __PRI64_PREFIX "o" /* Unsigned integers. */ @@ -118,8 +118,8 @@ typedef wchar_t __gwchar_t; # define PRIuLEAST64 __PRI64_PREFIX "u" # define PRIuFAST8 "u" -# define PRIuFAST16 "u" -# define PRIuFAST32 "u" +# define PRIuFAST16 __PRIPTR_PREFIX "u" +# define PRIuFAST32 __PRIPTR_PREFIX "u" # define PRIuFAST64 __PRI64_PREFIX "u" /* lowercase hexadecimal notation. */ @@ -134,8 +134,8 @@ typedef wchar_t __gwchar_t; # define PRIxLEAST64 __PRI64_PREFIX "x" # define PRIxFAST8 "x" -# define PRIxFAST16 "x" -# define PRIxFAST32 "x" +# define PRIxFAST16 __PRIPTR_PREFIX "x" +# define PRIxFAST32 __PRIPTR_PREFIX "x" # define PRIxFAST64 __PRI64_PREFIX "x" /* UPPERCASE hexadecimal notation. */ @@ -150,8 +150,8 @@ typedef wchar_t __gwchar_t; # define PRIXLEAST64 __PRI64_PREFIX "X" # define PRIXFAST8 "X" -# define PRIXFAST16 "X" -# define PRIXFAST32 "X" +# define PRIXFAST16 __PRIPTR_PREFIX "X" +# define PRIXFAST32 __PRIPTR_PREFIX "X" # define PRIXFAST64 __PRI64_PREFIX "X" @@ -311,7 +311,7 @@ extern intmax_t strtoimax (__const char *__restrict __nptr, extern uintmax_t strtoumax (__const char *__restrict __nptr, char ** __restrict __endptr, int __base) __THROW; -#if defined __UCLIBC_HAS_WCHAR__ && __UCLIBC_HAS_WCHAR__ +#ifdef __UCLIBC_HAS_WCHAR__ /* Like `wcstol' but convert to `intmax_t'. */ extern intmax_t wcstoimax (__const __gwchar_t *__restrict __nptr, __gwchar_t **__restrict __endptr, int __base) @@ -323,6 +323,126 @@ extern uintmax_t wcstoumax (__const __gwchar_t *__restrict __nptr, __THROW; #endif +#if 0 /*def __USE_EXTERN_INLINES*/ + +# if __WORDSIZE == 64 + +extern long int __strtol_internal (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base, int __group) + __THROW __nonnull ((1)) __wur; +/* Like `strtol' but convert to `intmax_t'. */ +__extern_inline intmax_t +__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr, + int base)) +{ + return __strtol_internal (nptr, endptr, base, 0); +} + +extern unsigned long int __strtoul_internal (__const char * + __restrict __nptr, + char ** __restrict __endptr, + int __base, int __group) + __THROW __nonnull ((1)) __wur; +/* Like `strtoul' but convert to `uintmax_t'. */ +__extern_inline uintmax_t +__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr, + int base)) +{ + return __strtoul_internal (nptr, endptr, base, 0); +} + +extern long int __wcstol_internal (__const __gwchar_t * __restrict __nptr, + __gwchar_t **__restrict __endptr, + int __base, int __group) + __THROW __nonnull ((1)) __wur; +/* Like `wcstol' but convert to `intmax_t'. */ +__extern_inline intmax_t +__NTH (wcstoimax (__const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) +{ + return __wcstol_internal (nptr, endptr, base, 0); +} + +extern unsigned long int __wcstoul_internal (__const __gwchar_t * + __restrict __nptr, + __gwchar_t ** + __restrict __endptr, + int __base, int __group) + __THROW __nonnull ((1)) __wur; +/* Like `wcstoul' but convert to `uintmax_t'. */ +__extern_inline uintmax_t +__NTH (wcstoumax (__const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) +{ + return __wcstoul_internal (nptr, endptr, base, 0); +} + +# else /* __WORDSIZE == 32 */ + +__extension__ +extern long long int __strtoll_internal (__const char *__restrict __nptr, + char **__restrict __endptr, + int __base, int __group) + __THROW __nonnull ((1)) __wur; +/* Like `strtol' but convert to `intmax_t'. */ +__extern_inline intmax_t +__NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr, + int base)) +{ + return __strtoll_internal (nptr, endptr, base, 0); +} + +__extension__ +extern unsigned long long int __strtoull_internal (__const char * + __restrict __nptr, + char ** + __restrict __endptr, + int __base, + int __group) + __THROW __nonnull ((1)) __wur; +/* Like `strtoul' but convert to `uintmax_t'. */ +__extern_inline uintmax_t +__NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr, + int base)) +{ + return __strtoull_internal (nptr, endptr, base, 0); +} + +__extension__ +extern long long int __wcstoll_internal (__const __gwchar_t * + __restrict __nptr, + __gwchar_t **__restrict __endptr, + int __base, int __group) + __THROW __nonnull ((1)) __wur; +/* Like `wcstol' but convert to `intmax_t'. */ +__extern_inline intmax_t +__NTH (wcstoimax (__const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) +{ + return __wcstoll_internal (nptr, endptr, base, 0); +} + + +__extension__ +extern unsigned long long int __wcstoull_internal (__const __gwchar_t * + __restrict __nptr, + __gwchar_t ** + __restrict __endptr, + int __base, + int __group) + __THROW __nonnull ((1)) __wur; +/* Like `wcstoul' but convert to `uintmax_t'. */ +__extern_inline uintmax_t +__NTH (wcstoumax (__const __gwchar_t *__restrict nptr, + __gwchar_t **__restrict endptr, int base)) +{ + return __wcstoull_internal (nptr, endptr, base, 0); +} + +# endif /* __WORDSIZE == 32 */ +#endif /* Use extern inlines. */ + __END_DECLS #endif /* inttypes.h */ diff --git a/include/langinfo.h b/include/langinfo.h index f289a66c0..2e2ee4ec8 100644 --- a/include/langinfo.h +++ b/include/langinfo.h @@ -1,5 +1,5 @@ /* Access to locale-dependent parameters. - Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1995-2002,2003,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,13 +32,20 @@ __BEGIN_DECLS (LC_*) and an item index within the category. Some code may depend on the item values within a category increasing monotonically with the indices. */ +#if 0 +#define _NL_ITEM(category, index) (((category) << 16) | (index)) + +/* Extract the category and item index from a constructed `nl_item' value. */ +#define _NL_ITEM_CATEGORY(item) ((int) (item) >> 16) +#define _NL_ITEM_INDEX(item) ((int) (item) & 0xffff) +#else #define _NL_ITEM(category, index) \ (((category) << __NL_ITEM_CATEGORY_SHIFT) | (index)) /* Extract the category and item index from a constructed `nl_item' value. */ #define _NL_ITEM_CATEGORY(item) ((int) (item) >> __NL_ITEM_CATEGORY_SHIFT) #define _NL_ITEM_INDEX(item) ((int) (item) & __NL_ITEM_INDEX_MASK) - +#endif /* Enumeration of locale items that can be queried with `nl_langinfo'. */ enum @@ -312,6 +319,9 @@ enum _NL_CTYPE_INDIGITS8_WC, _NL_CTYPE_INDIGITS9_WC, _NL_CTYPE_OUTDIGIT0_MB, +#else + _NL_CTYPE_OUTDIGIT0_MB = _NL_ITEM (__LC_CTYPE, 0), +#endif _NL_CTYPE_OUTDIGIT1_MB, _NL_CTYPE_OUTDIGIT2_MB, _NL_CTYPE_OUTDIGIT3_MB, @@ -321,6 +331,7 @@ enum _NL_CTYPE_OUTDIGIT7_MB, _NL_CTYPE_OUTDIGIT8_MB, _NL_CTYPE_OUTDIGIT9_MB, +#if 0 _NL_CTYPE_OUTDIGIT0_WC, _NL_CTYPE_OUTDIGIT1_WC, _NL_CTYPE_OUTDIGIT2_WC, @@ -340,6 +351,7 @@ enum _NL_CTYPE_TRANSLIT_DEFAULT_MISSING, _NL_CTYPE_TRANSLIT_IGNORE_LEN, _NL_CTYPE_TRANSLIT_IGNORE, + _NL_CTYPE_MAP_TO_NONASCII, _NL_CTYPE_EXTRA_MAP_1, _NL_CTYPE_EXTRA_MAP_2, _NL_CTYPE_EXTRA_MAP_3, @@ -354,17 +366,7 @@ enum _NL_CTYPE_EXTRA_MAP_12, _NL_CTYPE_EXTRA_MAP_13, _NL_CTYPE_EXTRA_MAP_14, -#else /* 0 */ - _NL_CTYPE_OUTDIGIT0_MB = _NL_ITEM (__LC_CTYPE, 0), - _NL_CTYPE_OUTDIGIT1_MB, - _NL_CTYPE_OUTDIGIT2_MB, - _NL_CTYPE_OUTDIGIT3_MB, - _NL_CTYPE_OUTDIGIT4_MB, - _NL_CTYPE_OUTDIGIT5_MB, - _NL_CTYPE_OUTDIGIT6_MB, - _NL_CTYPE_OUTDIGIT7_MB, - _NL_CTYPE_OUTDIGIT8_MB, - _NL_CTYPE_OUTDIGIT9_MB, +#else /* 0 */ _NL_CTYPE_CODESET_NAME, /* uClibc note: MUST BE LAST ENTRY!!! */ CODESET = _NL_CTYPE_CODESET_NAME, #define CODESET CODESET @@ -433,6 +435,10 @@ enum __N_SIGN_POSN, #ifdef __USE_GNU # define N_SIGN_POSN __N_SIGN_POSN +#endif +#if 0 /* moved below for some reason on uClibc */ + _NL_MONETARY_CRNCYSTR, +#define CRNCYSTR _NL_MONETARY_CRNCYSTR #endif __INT_P_CS_PRECEDES, #ifdef __USE_GNU @@ -458,10 +464,10 @@ enum #ifdef __USE_GNU # define INT_N_SIGN_POSN __INT_N_SIGN_POSN #endif - +#if 1 /* moved here from above */ _NL_MONETARY_CRNCYSTR, #define CRNCYSTR _NL_MONETARY_CRNCYSTR - +#endif #if 0 _NL_MONETARY_DUO_INT_CURR_SYMBOL, _NL_MONETARY_DUO_CURRENCY_SYMBOL, @@ -591,10 +597,18 @@ enum _NL_IDENTIFICATION_CODESET, _NL_NUM_LC_IDENTIFICATION, #endif + /* This marks the highest value used. */ _NL_NUM }; +/* This macro produces an item you can pass to `nl_langinfo' or + `nl_langinfo_l' to get the name of the locale in use for CATEGORY. */ +#define _NL_LOCALE_NAME(category) _NL_ITEM ((category), -1) +#ifdef __USE_GNU +# define NL_LOCALE_NAME(category) _NL_LOCALE_NAME (category) +#endif + /* Return the current locale's value for ITEM. If ITEM is invalid, an empty string is returned. @@ -606,8 +620,7 @@ extern char *nl_langinfo (nl_item __item) __THROW; libc_hidden_proto(nl_langinfo) -#ifdef __UCLIBC_HAS_XLOCALE__ -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__ /* This interface is for the extended locale model. See for more information. */ @@ -618,7 +631,6 @@ libc_hidden_proto(nl_langinfo) extern char *nl_langinfo_l (nl_item __item, __locale_t l); libc_hidden_proto(nl_langinfo_l) #endif -#endif __END_DECLS diff --git a/include/locale.h b/include/locale.h index cdb3a09d9..b740908f0 100644 --- a/include/locale.h +++ b/include/locale.h @@ -39,6 +39,7 @@ __BEGIN_DECLS #define LC_COLLATE __LC_COLLATE #define LC_MONETARY __LC_MONETARY #define LC_MESSAGES __LC_MESSAGES +#define LC_ALL __LC_ALL #if 0 #define LC_PAPER __LC_PAPER #define LC_NAME __LC_NAME @@ -47,9 +48,10 @@ __BEGIN_DECLS #define LC_MEASUREMENT __LC_MEASUREMENT #define LC_IDENTIFICATION __LC_IDENTIFICATION #endif -#define LC_ALL __LC_ALL +__BEGIN_NAMESPACE_STD + /* Structure giving information about numeric and monetary notation. */ struct lconv { @@ -121,8 +123,6 @@ struct lconv }; -__BEGIN_NAMESPACE_STD - /* Set and/or return the current locale. */ extern char *setlocale (int __category, __const char *__locale) __THROW; @@ -133,7 +133,7 @@ libc_hidden_proto(localeconv) __END_NAMESPACE_STD -#if defined(__USE_GNU) && defined(__UCLIBC_HAS_LOCALE__) +#if defined __USE_GNU && defined __UCLIBC_HAS_LOCALE__ /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is @@ -145,7 +145,7 @@ __END_NAMESPACE_STD Attention: all these functions are *not* standardized in any form. This is a proof-of-concept implementation. */ -#if defined(__UCLIBC_HAS_XLOCALE__) +#ifdef __UCLIBC_HAS_XLOCALE__ /* Get locale datatype definition. */ # include #endif diff --git a/include/net/ethernet.h b/include/net/ethernet.h index 7ca8e8348..0242d5899 100644 --- a/include/net/ethernet.h +++ b/include/net/ethernet.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2001, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -45,9 +45,17 @@ struct ether_header /* Ethernet protocol ID's */ #define ETHERTYPE_PUP 0x0200 /* Xerox PUP */ +#define ETHERTYPE_SPRITE 0x0500 /* Sprite */ #define ETHERTYPE_IP 0x0800 /* IP */ #define ETHERTYPE_ARP 0x0806 /* Address resolution */ #define ETHERTYPE_REVARP 0x8035 /* Reverse ARP */ +#define ETHERTYPE_AT 0x809B /* AppleTalk protocol */ +#define ETHERTYPE_AARP 0x80F3 /* AppleTalk ARP */ +#define ETHERTYPE_VLAN 0x8100 /* IEEE 802.1Q VLAN tagging */ +#define ETHERTYPE_IPX 0x8137 /* IPX */ +#define ETHERTYPE_IPV6 0x86dd /* IP protocol version 6 */ +#define ETHERTYPE_LOOPBACK 0x9000 /* used to test interfaces */ + #define ETHER_ADDR_LEN ETH_ALEN /* size of ethernet addr */ #define ETHER_TYPE_LEN 2 /* bytes in type field */ diff --git a/include/net/if_arp.h b/include/net/if_arp.h index 46f035bef..9608652ee 100644 --- a/include/net/if_arp.h +++ b/include/net/if_arp.h @@ -1,5 +1,5 @@ /* Definitions for Address Resolution Protocol. - Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1997,1999,2001,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -96,7 +96,7 @@ struct arphdr #define ARPHRD_ADAPT 264 #define ARPHRD_ROSE 270 #define ARPHRD_X25 271 /* CCITT X.25. */ -#define ARPHDR_HWX25 272 /* Boards with X.25 in firmware. */ +#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware. */ #define ARPHRD_PPP 512 #define ARPHRD_CISCO 513 /* Cisco HDLC. */ #define ARPHRD_HDLC ARPHRD_CISCO @@ -126,6 +126,12 @@ struct arphdr #define ARPHRD_FCFABRIC 787 /* Fibrechanel fabric. */ #define ARPHRD_IEEE802_TR 800 /* Magic type ident for TR. */ #define ARPHRD_IEEE80211 801 /* IEEE 802.11. */ +#define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header. */ +#define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header. */ + +#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known. */ +#define ARPHRD_NONE 0xFFFE /* Zero header length. */ + /* ARP ioctl request. */ struct arpreq diff --git a/include/netinet/ether.h b/include/netinet/ether.h index 3d8902f50..5e89dfe9e 100644 --- a/include/netinet/ether.h +++ b/include/netinet/ether.h @@ -25,7 +25,9 @@ /* Get definition of `struct ether_addr'. */ #include +#ifdef _LIBC #define ETHER_FILE_NAME "/etc/ethers" +#endif __BEGIN_DECLS @@ -41,6 +43,7 @@ extern struct ether_addr *ether_aton_r (__const char *__asc, struct ether_addr *__addr) __THROW; libc_hidden_proto(ether_aton_r) +#if 0 /* Map 48 bit Ethernet number ADDR to HOSTNAME. */ extern int ether_ntohost (char *__hostname, __const struct ether_addr *__addr) __THROW; @@ -52,6 +55,7 @@ extern int ether_hostton (__const char *__hostname, struct ether_addr *__addr) /* Scan LINE and set ADDR and HOSTNAME. */ extern int ether_line (__const char *__line, struct ether_addr *__addr, char *__hostname) __THROW; +#endif __END_DECLS diff --git a/include/paths.h b/include/paths.h index ae892c4cf..305937fc5 100644 --- a/include/paths.h +++ b/include/paths.h @@ -64,7 +64,6 @@ #define _PATH_VI "/usr/bin/vi" #define _PATH_WTMP "/var/log/wtmp" -/* uClibc */ #ifdef _LIBC #define _PATH_PASSWD "/etc/passwd" #define _PATH_GROUP "/etc/group" diff --git a/include/regexp.h b/include/regexp.h index b7b50b710..57b7f93ea 100644 --- a/include/regexp.h +++ b/include/regexp.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2004, 2008 + Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -81,6 +82,7 @@ __BEGIN_DECLS +#if 0 /* Interface variables. They contain the results of the successful calls to `setp' and `advance'. */ extern char *loc1; @@ -89,6 +91,7 @@ extern char *loc2; /* The use of this variable in the `advance' function is not supported. */ extern char *locs; +#endif #ifndef __DO_NOT_DEFINE_COMPILE @@ -129,8 +132,9 @@ compile (char *__restrict instring, char *__restrict expbuf, __expr_ptr = (regex_t *) expbuf; /* The remaining space in the buffer can be used for the compiled pattern. */ - __expr_ptr->buffer = expbuf + sizeof (regex_t); - __expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer; + __expr_ptr->__REPB_PREFIX (buffer) = expbuf + sizeof (regex_t); + __expr_ptr->__REPB_PREFIX (allocated) + = endbuf - (char *) __expr_ptr->__REPB_PREFIX (buffer); while ((__ch = (GETC ())) != eof) { @@ -162,7 +166,10 @@ compile (char *__restrict instring, char *__restrict expbuf, } __input_buffer[__current_size++] = __ch; } - __input_buffer[__current_size++] = '\0'; + if (__current_size) + __input_buffer[__current_size++] = '\0'; + else + __input_buffer = ""; /* Now compile the pattern. */ __error = regcomp (__expr_ptr, __input_buffer, REG_NEWLINE); @@ -198,11 +205,13 @@ compile (char *__restrict instring, char *__restrict expbuf, } /* Everything is ok. */ - RETURN ((char *) (__expr_ptr->buffer + __expr_ptr->used)); + RETURN ((char *) (__expr_ptr->__REPB_PREFIX (buffer) + + __expr_ptr->__REPB_PREFIX (used))); } #endif +#if 0 /* Find the next match in STRING. The compiled regular expression is found in the buffer starting at EXPBUF. `loc1' will return the first character matched and `loc2' points to the next unmatched @@ -215,6 +224,7 @@ extern int step (__const char *__restrict __string, position of the first unmatched character. */ extern int advance (__const char *__restrict __string, __const char *__restrict __expbuf) __THROW; +#endif __END_DECLS diff --git a/include/rpc/auth.h b/include/rpc/auth.h index e8390c885..ee5396fc5 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -176,11 +176,13 @@ extern AUTH *authunix_create_default (void); libc_hidden_proto(authunix_create_default) extern AUTH *authnone_create (void) __THROW; libc_hidden_proto(authnone_create) +#if 0 extern AUTH *authdes_create (const char *__servername, u_int __window, struct sockaddr *__syncaddr, des_block *__ckey) __THROW; extern AUTH *authdes_pk_create (const char *, netobj *, u_int, struct sockaddr *, des_block *) __THROW; +#endif #define AUTH_NONE 0 /* no authentication */ @@ -192,6 +194,7 @@ extern AUTH *authdes_pk_create (const char *, netobj *, u_int, #define AUTH_DH AUTH_DES /* Diffie-Hellman (this is DES) */ #define AUTH_KERB 4 /* kerberos style */ +#if 0 /* * Netname manipulating functions * @@ -216,6 +219,7 @@ extern int key_gendes (des_block *); extern int key_setsecret (char *); extern int key_secretkey_is_set (void); extern int key_get_conv (char *, des_block *); +#endif /* * XDR an opaque authentication struct. diff --git a/include/rpc/auth_des.h b/include/rpc/auth_des.h index 7a6b8be8d..d51b7ce7c 100644 --- a/include/rpc/auth_des.h +++ b/include/rpc/auth_des.h @@ -24,6 +24,7 @@ __BEGIN_DECLS +#if 0 /* There are two kinds of "names": fullnames and nicknames */ enum authdes_namekind { @@ -47,6 +48,7 @@ struct authdes_cred struct authdes_fullname adc_fullname; uint32_t adc_nickname; }; +#endif /* A timeval replacement for !32bit platforms */ struct rpc_timeval @@ -55,6 +57,7 @@ struct rpc_timeval uint32_t tv_usec; /* Microseconds. */ }; +#if 0 /* A des authentication verifier */ struct authdes_verf { @@ -102,6 +105,7 @@ extern int getpublickey (__const char *__name, char *__key) __THROW; the key. */ extern int getsecretkey (__const char *__name, char *__key, __const char *__passwd) __THROW; +#endif extern int rtime (struct sockaddr_in *__addrp, struct rpc_timeval *__timep, struct rpc_timeval *__timeout) __THROW; diff --git a/include/signal.h b/include/signal.h index 31ebc133c..0a09c7ad4 100644 --- a/include/signal.h +++ b/include/signal.h @@ -376,10 +376,12 @@ extern int sigreturn (struct sigcontext *__scp) __THROW; #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +# ifdef __UCLIBC_SUSV4_LEGACY__ /* If INTERRUPT is nonzero, make signal SIG interrupt system calls (causing them to fail with EINTR); if INTERRUPT is zero, make system calls be restarted after signal SIG. */ extern int siginterrupt (int __sig, int __interrupt) __THROW; +# endif # include # ifdef __USE_XOPEN diff --git a/include/stdlib.h b/include/stdlib.h index 536f81a1e..155b8f1ea 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -90,7 +90,7 @@ typedef union # define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status)) # define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status)) # define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status)) -# if 0 /* def __WIFCONTINUED */ +# ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status)) # endif #endif /* X/Open and not included. */ @@ -141,12 +141,13 @@ __END_NAMESPACE_C99 #if 0 #define MB_CUR_MAX (__ctype_get_mb_cur_max ()) extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; -#endif +#else #ifdef __UCLIBC_HAS_WCHAR__ #define MB_CUR_MAX (_stdlib_mb_cur_max ()) extern size_t _stdlib_mb_cur_max (void) __THROW __wur; libc_hidden_proto(_stdlib_mb_cur_max) #endif +#endif __BEGIN_NAMESPACE_STD @@ -240,8 +241,7 @@ __END_NAMESPACE_C99 #endif /* ISO C99 or GCC and use MISC. */ -#ifdef __UCLIBC_HAS_XLOCALE__ -#ifdef __USE_GNU +#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__ /* The concept of one static locale per category is not very well thought out. Many applications will need to process its data using information from several different locales. Another application is @@ -296,9 +296,7 @@ extern long double strtold_l (__const char *__restrict __nptr, __locale_t __loc) __THROW __nonnull ((1, 3)) __wur; #endif /* __UCLIBC_HAS_FLOATS__ */ - #endif /* GNU */ -#endif /* __UCLIBC_HAS_XLOCALE__ */ #if defined __USE_SVID || defined __USE_XOPEN_EXTENDED @@ -494,13 +492,16 @@ __END_NAMESPACE_STD __BEGIN_NAMESPACE_STD /* Re-allocate the previously allocated block in PTR, making the new block SIZE bytes long. */ +/* __attribute_malloc__ is not used, because if realloc returns + the same pointer that was passed to it, aliasing needs to be allowed + between objects pointed by the old and new pointers. */ extern void *realloc (void *__ptr, size_t __size) - __THROW __attribute_malloc__ __attribute_warn_unused_result__; + __THROW __attribute_warn_unused_result__; /* Free a block allocated by `malloc', `realloc' or `calloc'. */ extern void free (void *__ptr) __THROW; __END_NAMESPACE_STD -#ifdef __USE_MISC +#if 0 /*def __USE_MISC*/ /* Free a block. An alias for `free'. (Sun Unices). */ extern void cfree (void *__ptr) __THROW; #endif /* Use misc. */ @@ -560,10 +561,12 @@ extern char *getenv (__const char *__name) __THROW __nonnull ((1)) __wur; libc_hidden_proto(getenv) __END_NAMESPACE_STD +#if 0 /* This function is similar to the above but returns NULL if the programs is running with SUID or SGID enabled. */ extern char *__secure_getenv (__const char *__name) __THROW __nonnull ((1)) __wur; +#endif #if defined __USE_SVID || defined __USE_XOPEN /* The SVID says this is in , but this seems a better place. */ @@ -723,12 +726,11 @@ __END_NAMESPACE_C99 #endif -#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD +#if ( defined __USE_SVID || defined __USE_XOPEN_EXTENDED ) && defined __UCLIBC_HAS_FLOATS__ /* Convert floating point numbers to strings. The returned values are valid only until another call to the same function. */ # ifdef __UCLIBC_SUSV3_LEGACY__ - #if 0 /* Convert VALUE to a string with NDIGIT digits and return a pointer to this. Set *DECPT with the position of the decimal character and *SIGN @@ -750,6 +752,7 @@ extern char *gcvt (double __value, int __ndigit, char *__buf) __THROW __nonnull ((3)) __wur; # endif /* __UCLIBC_SUSV3_LEGACY__ */ + # if 0 /*def __USE_MISC*/ /* Long double versions of above functions. */ extern char *qecvt (long double __value, int __ndigit, @@ -782,6 +785,7 @@ extern int qfcvt_r (long double __value, int __ndigit, # endif /* misc */ #endif /* use MISC || use X/Open Unix */ + #ifdef __UCLIBC_HAS_WCHAR__ __BEGIN_NAMESPACE_STD /* Return the length of the multibyte character @@ -807,7 +811,7 @@ __END_NAMESPACE_STD #endif /* __UCLIBC_HAS_WCHAR__ */ -#ifdef __USE_SVID +#if 0 /*def __USE_SVID*/ /* Determine whether the string value of RESPONSE matches the affirmation or negative response expression as specified by the LC_MESSAGES category in the program's current locale. Returns 1 if affirmative, 0 if diff --git a/include/sys/mman.h b/include/sys/mman.h index 609f78a73..d46b92258 100644 --- a/include/sys/mman.h +++ b/include/sys/mman.h @@ -1,5 +1,5 @@ /* Definitions for BSD-style memory management. - Copyright (C) 1994-2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1994-2000, 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -59,8 +59,8 @@ extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) __THROW; libc_hidden_proto(mmap) #else -# ifdef __REDIRECT -extern void * __REDIRECT (mmap, +# ifdef __REDIRECT_NTH +extern void * __REDIRECT_NTH (mmap, (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset), mmap64); diff --git a/include/sys/poll.h b/include/sys/poll.h index 13b913494..53ba6e2eb 100644 --- a/include/sys/poll.h +++ b/include/sys/poll.h @@ -30,8 +30,6 @@ /* Get the timespec definition. */ # define __need_timespec # include -/* get NULL definition. */ -# include #endif diff --git a/include/sys/shm.h b/include/sys/shm.h index 8ec30b486..786ce752b 100644 --- a/include/sys/shm.h +++ b/include/sys/shm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-1999, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995-1999, 2000, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -41,6 +41,7 @@ typedef __pid_t pid_t; # endif #endif /* X/Open */ + __BEGIN_DECLS /* The following System V style IPC functions implement a shared memory diff --git a/include/sys/socket.h b/include/sys/socket.h index fb5135d3d..0824fc855 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -1,5 +1,6 @@ /* Declarations of socket constants, types, and functions. - Copyright (C) 1991,92,1994-2001,2003 Free Software Foundation, Inc. + Copyright (C) 1991,92,1994-2001,2003,2005,2007,2008 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,6 +28,10 @@ __BEGIN_DECLS #include #define __need_size_t #include +#ifdef __USE_GNU +/* Get the __sigset_t definition. */ +# include +#endif /* This operating system-specific header file defines the SOCK_*, PF_*, @@ -231,7 +236,7 @@ libc_hidden_proto(accept) extern int shutdown (int __fd, int __how) __THROW; -#ifdef __USE_XOPEN2K +#if 0 /*def __USE_XOPEN2K*/ /* Determine wheter socket is at a out-of-band mark. */ extern int sockatmark (int __fd) __THROW; #endif diff --git a/include/sys/statvfs.h b/include/sys/statvfs.h index e755bafc1..6199c5d02 100644 --- a/include/sys/statvfs.h +++ b/include/sys/statvfs.h @@ -54,8 +54,8 @@ extern int statvfs (__const char *__restrict __file, __THROW __nonnull ((1, 2)); libc_hidden_proto(statvfs) #else -# ifdef __REDIRECT -extern int __REDIRECT (statvfs, +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (statvfs, (__const char *__restrict __file, struct statvfs *__restrict __buf), statvfs64) __nonnull ((1, 2)); @@ -76,8 +76,8 @@ extern int fstatvfs (int __fildes, struct statvfs *__buf) __THROW __nonnull ((2)); libc_hidden_proto(fstatvfs) #else -# ifdef __REDIRECT -extern int __REDIRECT (fstatvfs, (int __fildes, struct statvfs *__buf), +# ifdef __REDIRECT_NTH +extern int __REDIRECT_NTH (fstatvfs, (int __fildes, struct statvfs *__buf), fstatvfs64) __nonnull ((2)); # else # define fstatvfs fstatvfs64 diff --git a/include/sys/timex.h b/include/sys/timex.h index b4998f5ab..5e82d464d 100644 --- a/include/sys/timex.h +++ b/include/sys/timex.h @@ -116,7 +116,9 @@ struct timex __BEGIN_DECLS +#if 0 extern int __adjtimex (struct timex *__ntx) __THROW; +#endif extern int adjtimex (struct timex *__ntx) __THROW; libc_hidden_proto(adjtimex) diff --git a/include/sys/utsname.h b/include/sys/utsname.h index 41534d553..7b57888ce 100644 --- a/include/sys/utsname.h +++ b/include/sys/utsname.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 92, 94, 96, 97, 99 Free Software Foundation, Inc. +/* Copyright (C) 1991,92,94,96,97,99,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,26 +29,38 @@ __BEGIN_DECLS #include +#ifndef _UTSNAME_SYSNAME_LENGTH +# define _UTSNAME_SYSNAME_LENGTH _UTSNAME_LENGTH +#endif #ifndef _UTSNAME_NODENAME_LENGTH # define _UTSNAME_NODENAME_LENGTH _UTSNAME_LENGTH #endif +#ifndef _UTSNAME_RELEASE_LENGTH +# define _UTSNAME_RELEASE_LENGTH _UTSNAME_LENGTH +#endif +#ifndef _UTSNAME_VERSION_LENGTH +# define _UTSNAME_VERSION_LENGTH _UTSNAME_LENGTH +#endif +#ifndef _UTSNAME_MACHINE_LENGTH +# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH +#endif /* Structure describing the system and machine. */ struct utsname { /* Name of the implementation of the operating system. */ - char sysname[_UTSNAME_LENGTH]; + char sysname[_UTSNAME_SYSNAME_LENGTH]; /* Name of this node on the network. */ char nodename[_UTSNAME_NODENAME_LENGTH]; /* Current release level of this implementation. */ - char release[_UTSNAME_LENGTH]; + char release[_UTSNAME_RELEASE_LENGTH]; /* Current version level of this release. */ - char version[_UTSNAME_LENGTH]; + char version[_UTSNAME_VERSION_LENGTH]; /* Name of the hardware type the system is running on. */ - char machine[_UTSNAME_LENGTH]; + char machine[_UTSNAME_MACHINE_LENGTH]; #if _UTSNAME_DOMAIN_LENGTH - 0 /* Name of the domain of this node on the network. */ @@ -61,6 +73,7 @@ struct utsname }; #ifdef __USE_SVID +/* Note that SVID assumes all members have the same size. */ # define SYS_NMLN _UTSNAME_LENGTH #endif diff --git a/include/sys/wait.h b/include/sys/wait.h index 59ccd9331..f283fe228 100644 --- a/include/sys/wait.h +++ b/include/sys/wait.h @@ -85,7 +85,7 @@ typedef union # define WIFEXITED(status) __WIFEXITED(__WAIT_INT(status)) # define WIFSIGNALED(status) __WIFSIGNALED(__WAIT_INT(status)) # define WIFSTOPPED(status) __WIFSTOPPED(__WAIT_INT(status)) -# if 0 /*def __WIFCONTINUED*/ +# ifdef __WIFCONTINUED # define WIFCONTINUED(status) __WIFCONTINUED(__WAIT_INT(status)) # endif #endif /* not included. */ diff --git a/libc/sysdeps/linux/mips/bits/termios.h b/libc/sysdeps/linux/mips/bits/termios.h index 546faa020..fb351995c 100644 --- a/libc/sysdeps/linux/mips/bits/termios.h +++ b/libc/sysdeps/linux/mips/bits/termios.h @@ -73,6 +73,7 @@ struct termios #define IXANY 0004000 /* Any character will restart after stop. */ #define IXOFF 0010000 /* Enable start/stop input control. */ #define IMAXBEL 0020000 /* Ring bell when input queue is full. */ +#define IUTF8 0040000 /* Input is UTF8. */ /* c_oflag bits */ #define OPOST 0000001 /* Perform output processing. */ -- cgit v1.2.3 From f683d2c5c57b22f02c5c681f1408ae0bc61412c8 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 03:51:49 +0200 Subject: protocols.h: remove Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/netinet/protocols.h | 62 --------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 include/netinet/protocols.h diff --git a/include/netinet/protocols.h b/include/netinet/protocols.h deleted file mode 100644 index 1a619c474..000000000 --- a/include/netinet/protocols.h +++ /dev/null @@ -1,62 +0,0 @@ -/* protocols.h */ -#ifndef _NETINET_PROTOCOLS_H -#define _NETINET_PROTOCOLS_H - -#define IP_ICMP 1 -#define IP_IGMP 2 -#define IP_GGP 3 -#define IP_ST 5 -#define IP_TCP 6 -#define IP_UCL 7 -#define IP_EGP 8 -#define IP_IGP 9 -#define IP_BBN_RCC_MON 10 -#define IP_NVP_II 11 -#define IP_PUP 12 -#define IP_ARGUS 13 -#define IP_EMCON 14 -#define IP_XNET 15 -#define IP_CHAOS 16 -#define IP_UDP 17 -#define IP_MUX 18 -#define IP_DCN_MEAS 19 -#define IP_HMP 20 -#define IP_PRM 21 -#define IP_XNS_IDP 22 -#define IP_TRUNK1 23 -#define IP_TRUNK2 24 -#define IP_LEAF1 25 -#define IP_LEAF2 26 -#define IP_RDP 27 -#define IP_IRTP 28 -#define IP_ISO_TP4 29 -#define IP_NETBLT 30 -#define IP_MFE_NSP 31 -#define IP_MERIT_INP 32 -#define IP_SEP 33 -#define IP_3PC 34 -#define IP_CFTP 62 -#define SAT_EXPAK 64 -#define IP_RVD 66 -#define IP_IPPC 67 -#define IP_SAT_MON 69 -#define IP_VISA 70 -#define IP_IPCV 71 -#define IP_BR_SAT_MON 76 -#define IP_SUN_ND 77 -#define IP_WB_MON 78 -#define IP_WB_EXPAK 79 -#define IP_ISO_IP 80 -#define IP_VMTP 81 -#define IP_SECURE_VMTP 82 -#define IP_VINES 83 -#define IP_TTP 84 -#define NSFNET_IGP 85 -#define IP_DGP 86 -#define IP_TCF 87 -#define IP_IGRP 88 -#define IP_OSPFIGP 89 -#define IP_SPRITE_RPG 90 -#define IP_LARP 91 - -#endif /* _NETINET_PROTOCOLS_H*/ -- cgit v1.2.3 From a9e4475b961e4f2c502de9953c5d8a8bc6dcffb0 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 04:07:01 +0200 Subject: update headers and disable prototypes Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/features.h | 2 ++ include/netinet/in.h | 41 ++++++++++++++++++++++++++++------------- include/nl_types.h | 2 ++ 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/include/features.h b/include/features.h index 9602ecc0d..5ee2b333a 100644 --- a/include/features.h +++ b/include/features.h @@ -340,8 +340,10 @@ #endif /* We do support the IEC 559 math functionality, real and complex. */ +#ifdef __UCLIBC_HAS_FLOATS__ #define __STDC_IEC_559__ 1 #define __STDC_IEC_559_COMPLEX__ 1 +#endif #ifdef __UCLIBC_HAS_WCHAR__ /* wchar_t uses ISO 10646-1 (2nd ed., published 2000-09-15) / Unicode 3.1. */ diff --git a/include/netinet/in.h b/include/netinet/in.h index 851aace59..06965d65b 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007 +/* Copyright (C) 1991-2001, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -53,6 +53,8 @@ enum #define IPPROTO_IDP IPPROTO_IDP IPPROTO_TP = 29, /* SO Transport Protocol Class 4. */ #define IPPROTO_TP IPPROTO_TP + IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol. */ +#define IPPROTO_DCCP IPPROTO_DCCP IPPROTO_IPV6 = 41, /* IPv6 header. */ #define IPPROTO_IPV6 IPPROTO_IPV6 IPPROTO_ROUTING = 43, /* IPv6 routing header. */ @@ -83,6 +85,8 @@ enum #define IPPROTO_COMP IPPROTO_COMP IPPROTO_SCTP = 132, /* Stream Control Transmission Protocol. */ #define IPPROTO_SCTP IPPROTO_SCTP + IPPROTO_UDPLITE = 136, /* UDP-Lite protocol. */ +#define IPPROTO_UDPLITE IPPROTO_UDPLITE IPPROTO_RAW = 255, /* Raw IP packets. */ #define IPPROTO_RAW IPPROTO_RAW IPPROTO_MAX @@ -195,13 +199,17 @@ struct in6_addr { union { - uint8_t u6_addr8[16]; - uint16_t u6_addr16[8]; - uint32_t u6_addr32[4]; - } in6_u; -#define s6_addr in6_u.u6_addr8 -#define s6_addr16 in6_u.u6_addr16 -#define s6_addr32 in6_u.u6_addr32 + uint8_t __u6_addr8[16]; +#if defined __USE_MISC || defined __USE_GNU + uint16_t __u6_addr16[8]; + uint32_t __u6_addr32[4]; +#endif + } __in6_u; +#define s6_addr __in6_u.__u6_addr8 +#if defined __USE_MISC || defined __USE_GNU +# define s6_addr16 __in6_u.__u6_addr16 +# define s6_addr32 __in6_u.__u6_addr32 +#endif }; extern const struct in6_addr in6addr_any; /* :: */ @@ -213,11 +221,8 @@ libc_hidden_proto(in6addr_loopback) #define INET_ADDRSTRLEN 16 #define INET6_ADDRSTRLEN 46 -/* Get the definition of the macro to define the common sockaddr members. */ -#include - -#if 1 /* defined __UCLIBC_HAS_IPV4__ */ +#if 1 /*def __UCLIBC_HAS_IPV4__*/ /* Structure describing an Internet socket address. */ struct sockaddr_in { @@ -244,6 +249,7 @@ struct sockaddr_in6 }; +#if defined __USE_MISC || defined __USE_GNU /* IPv4 multicast request. */ struct ip_mreq { @@ -265,6 +271,8 @@ struct ip_mreq_source /* IP address of interface. */ struct in_addr imr_sourceaddr; }; +#endif + /* Likewise, for IPv6. */ struct ipv6_mreq @@ -277,6 +285,7 @@ struct ipv6_mreq }; +#if defined __USE_MISC || defined __USE_GNU /* Multicast group request. */ struct group_req { @@ -343,6 +352,7 @@ struct group_filter - sizeof (struct sockaddr_storage) \ + ((numsrc) \ * sizeof (struct sockaddr_storage))) +#endif /* Get system-specific definitions. */ @@ -432,13 +442,17 @@ libc_hidden_proto(htons) && (((__const uint32_t *) (a))[2] == ((__const uint32_t *) (b))[2]) \ && (((__const uint32_t *) (a))[3] == ((__const uint32_t *) (b))[3])) +#if defined __USE_MISC || defined __USE_GNU /* Bind socket to a privileged IP port. */ extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __THROW; libc_hidden_proto(bindresvport) +# if 0 /*def __UCLIBC_HAS_IPV6__*/ /* The IPv6 version of this function. */ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) __THROW; +# endif +#endif #define IN6_IS_ADDR_MC_NODELOCAL(a) \ @@ -461,6 +475,8 @@ extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in) (IN6_IS_ADDR_MULTICAST(a) \ && ((((__const uint8_t *) (a))[1] & 0xf) == 0xe)) + +#if 0 /*def __USE_GNU*/ /* IPv6 packet information. */ struct in6_pktinfo { @@ -476,7 +492,6 @@ struct ip6_mtuinfo }; -#if 0 /*def __USE_GNU*/ /* Obsolete hop-by-hop and Destination Options Processing (RFC 2292). */ extern int inet6_option_space (int __nbytes) __THROW __attribute_deprecated__; diff --git a/include/nl_types.h b/include/nl_types.h index 74e762113..d6d48ecd9 100644 --- a/include/nl_types.h +++ b/include/nl_types.h @@ -40,6 +40,7 @@ typedef void *nl_catd; /* Type used by `nl_langinfo'. */ typedef int nl_item; +#if 0 /* Open message catalog for later use, returning descriptor. This function is a possible cancellation point and therefore not @@ -53,6 +54,7 @@ extern char *catgets (nl_catd __catalog, int __set, int __number, /* Close message CATALOG. */ extern int catclose (nl_catd __catalog) __THROW __nonnull ((1)); +#endif __END_DECLS -- cgit v1.2.3 From 2d9bad0c0a0309899b7fa603d4b4f9b2932165a0 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 04:16:12 +0200 Subject: help broken apps to detect __GLIBC__ headers Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/features.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/features.h b/include/features.h index 5ee2b333a..2ecf1987a 100644 --- a/include/features.h +++ b/include/features.h @@ -361,14 +361,16 @@ /* This macro indicates that the installed library is the GNU C Library. For historic reasons the value now is 6 and this will stay from now on. The use of this variable is deprecated. */ -# undef __GNU_LIBRARY__ -# define __GNU_LIBRARY__ 6 +/* uClibc WARNING: leave these aligned to the left, don't put a space after '#', else + * broken apps could fail the check. */ +#undef __GNU_LIBRARY__ +#define __GNU_LIBRARY__ 6 /* Major and minor version number of the GNU C library package. Use these macros to test for features in specific releases. */ /* Don't do it, if you want to keep uClibc happy. */ -# define __GLIBC__ 2 -# define __GLIBC_MINOR__ 2 +#define __GLIBC__ 2 +#define __GLIBC_MINOR__ 2 #endif #define __GLIBC_PREREQ(maj, min) \ -- cgit v1.2.3 From 343c9c0f915dc7dce19c9b30f2197d61389ef4f4 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 04:17:57 +0200 Subject: limits.h: update Should we care about compilers not defining __LONG_LONG_MAX__? Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/limits.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/include/limits.h b/include/limits.h index 45cd6f253..3e9a5df88 100644 --- a/include/limits.h +++ b/include/limits.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1991, 92, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2005 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -122,20 +123,20 @@ #if defined __GNUC__ && !defined _GCC_LIMITS_H_ /* `_GCC_LIMITS_H_' is what GCC's file defines. */ # include_next +#endif /* The files in some gcc versions don't define LLONG_MIN, LLONG_MAX, and ULLONG_MAX. Instead only the values gcc defined for ages are available. */ -# ifdef __USE_ISOC99 -# ifndef LLONG_MIN -# define LLONG_MIN LONG_LONG_MIN -# endif -# ifndef LLONG_MAX -# define LLONG_MAX LONG_LONG_MAX -# endif -# ifndef ULLONG_MAX -# define ULLONG_MAX ULONG_LONG_MAX -# endif +#if defined __USE_ISOC99 && defined __GNUC__ +# ifndef LLONG_MIN +# define LLONG_MIN (-LLONG_MAX-1) +# endif +# ifndef LLONG_MAX +# define LLONG_MAX __LONG_LONG_MAX__ +# endif +# ifndef ULLONG_MAX +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1) # endif #endif -- cgit v1.2.3 From e9e0fd1a2ef7757aebef832af6fdc0c306ba87d7 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 17 Oct 2009 04:27:18 +0200 Subject: features.h: reorganize Reorganize so uClibc related changes are better seen when syncing with glibc. Signed-off-by: Peter S. Mazinger Signed-off-by: Bernhard Reutner-Fischer --- include/features.h | 125 +++++++++++++++++++++++++---------------------------- 1 file changed, 59 insertions(+), 66 deletions(-) diff --git a/include/features.h b/include/features.h index 2ecf1987a..1d47b5660 100644 --- a/include/features.h +++ b/include/features.h @@ -19,32 +19,6 @@ #ifndef _FEATURES_H #define _FEATURES_H 1 -/* This macro indicates that the installed library is uClibc. Use - * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in - * specific releases. */ -#define __UCLIBC__ 1 - -/* Load up the current set of uClibc supported features along - * with the current uClibc major and minor version numbers. - * For uClibc release 0.9.26, these numbers would be: - * #define __UCLIBC_MAJOR__ 0 - * #define __UCLIBC_MINOR__ 9 - * #define __UCLIBC_SUBLEVEL__ 26 - */ -#define __need_uClibc_config_h -#include -#undef __need_uClibc_config_h - -/* For uClibc, always optimize for size -- this should disable - * a lot of expensive inlining... - * TODO: this is wrong! __OPTIMIZE_SIZE__ is an indicator of - * gcc -Os compile. We should not mess with compiler inlines. - * We should instead disable __USE_EXTERN_INLINES unconditionally, - * or maybe actually audit and test uclibc to work correctly - * with __USE_EXTERN_INLINES on. - */ -#define __OPTIMIZE_SIZE__ 1 - /* These are defined by the user (or the compiler) to specify the desired environment: @@ -186,10 +160,8 @@ # define _XOPEN_SOURCE 700 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 -# ifdef __UCLIBC_HAS_LFS__ -# undef _LARGEFILE64_SOURCE -# define _LARGEFILE64_SOURCE 1 -# endif /* __UCLIBC_HAS_LFS__ */ +# undef _LARGEFILE64_SOURCE +# define _LARGEFILE64_SOURCE 1 # undef _BSD_SOURCE # define _BSD_SOURCE 1 # undef _SVID_SOURCE @@ -198,6 +170,57 @@ # define _ATFILE_SOURCE 1 #endif +/* This macro indicates that the installed library is uClibc. Use + * __UCLIBC_MAJOR__ and __UCLIBC_MINOR__ to test for the features in + * specific releases. */ +#define __UCLIBC__ 1 + +#ifdef __UCLIBC__ +/* Load up the current set of uClibc supported features along + * with the current uClibc major and minor version numbers. + * For uClibc release 0.9.26, these numbers would be: + * #define __UCLIBC_MAJOR__ 0 + * #define __UCLIBC_MINOR__ 9 + * #define __UCLIBC_SUBLEVEL__ 26 + */ +# define __need_uClibc_config_h +# include +# undef __need_uClibc_config_h + +/* For uClibc, always optimize for size -- this should disable + * a lot of expensive inlining... + * TODO: this is wrong! __OPTIMIZE_SIZE__ is an indicator of + * gcc -Os compile. We should not mess with compiler inlines. + * We should instead disable __USE_EXTERN_INLINES unconditionally, + * or maybe actually audit and test uclibc to work correctly + * with __USE_EXTERN_INLINES on. + */ +# define __OPTIMIZE_SIZE__ 1 + +/* disable unsupported features */ +# undef _FORTIFY_SOURCE +# undef __LDBL_COMPAT + +# ifndef __UCLIBC_HAS_THREADS__ +# if defined _REENTRANT || defined _THREAD_SAFE +# warning requested reentrant code, but thread support was disabled +# undef _REENTRANT +# undef _THREAD_SAFE +# endif +# endif + +# ifndef __UCLIBC_HAS_LFS__ +# undef _LARGEFILE64_SOURCE +/* NOTE: This is probably incorrect on a 64-bit arch... */ +# if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 +# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \ +uClibc was built without large file support enabled. +# endif +# elif defined __BCC__ +# error BCC does not support LFS, please disable it +# endif +#endif /* __UCLIBC__ */ + /* If nothing (other than _GNU_SOURCE) is defined, define _BSD_SOURCE and _SVID_SOURCE. */ #if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \ @@ -326,8 +349,6 @@ # define __USE_REENTRANT 1 #endif -/* uClibc does not support _FORTIFY_SOURCE */ -#undef _FORTIFY_SOURCE #if defined _FORTIFY_SOURCE && _FORTIFY_SOURCE > 0 \ && __GNUC_PREREQ (4, 1) && defined __OPTIMIZE__ && __OPTIMIZE__ > 0 # if _FORTIFY_SOURCE > 1 @@ -396,7 +417,9 @@ __USE_FILE_OFFSET64 but not __USE_LARGEFILE[64]. */ # if defined __USE_FILE_OFFSET64 && !defined __REDIRECT # define __USE_LARGEFILE 1 +# ifdef __UCLIBC_HAS_LFS__ # define __USE_LARGEFILE64 1 +# endif # endif #endif /* !ASSEMBLER */ @@ -414,41 +437,11 @@ # define __USE_EXTERN_INLINES 1 #endif - -/* Make sure users large file options agree with uClibc's configuration. */ -#ifndef __UCLIBC_HAS_LFS__ - -/* If uClibc was built without large file support, output an error if - * 64-bit file offsets were requested. - * NOTE: This is probably incorrect on a 64-bit arch... */ -# ifdef __USE_FILE_OFFSET64 -# error It appears you have defined _FILE_OFFSET_BITS=64. Unfortunately, \ -uClibc was built without large file support enabled. -# endif - -/* If uClibc was built without large file support and _LARGEFILE64_SOURCE - * is defined, undefine it. */ -# ifdef _LARGEFILE64_SOURCE -# undef _LARGEFILE64_SOURCE -# undef __USE_LARGEFILE64 -# endif - -/* If we're actually building uClibc with large file support, - * define __USE_LARGEFILE64 and __USE_LARGEFILE. */ -#elif defined _LIBC -# undef _LARGEFILE_SOURCE -# undef _LARGEFILE64_SOURCE -# undef _FILE_OFFSET_BITS -# undef __USE_LARGEFILE -# undef __USE_LARGEFILE64 -# undef __USE_FILE_OFFSET64 -# define _LARGEFILE_SOURCE 1 -# define _LARGEFILE64_SOURCE 1 -# define __USE_LARGEFILE 1 -# define __USE_LARGEFILE64 1 -#endif - #ifdef _LIBC +# ifdef __UCLIBC_HAS_LFS__ +# undef _FILE_OFFSET_BITS +# undef __USE_FILE_OFFSET64 +# endif # include #endif -- cgit v1.2.3 From 42c91e83ce9ff723105d1c04f05dccf756c9452f Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 09:37:56 +0100 Subject: __assert: include unistd.h for smallint Signed-off-by: Bernhard Reutner-Fischer --- libc/misc/assert/__assert.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c index 18c6f5ecf..8afde52ff 100644 --- a/libc/misc/assert/__assert.c +++ b/libc/misc/assert/__assert.c @@ -29,7 +29,7 @@ #include #include - +#include /* Get the prototype from assert.h as a double-check. */ #undef NDEBUG @@ -63,5 +63,4 @@ void __assert(const char *assertion, const char * filename, /* shouldn't we? fflush(stderr); */ abort(); } - libc_hidden_def(__assert) -- cgit v1.2.3 From 6d3ed00a41a94889854e76fd2aee0e685eba2b2e Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 09:41:04 +0100 Subject: ppoll: get NULL from stddef.h Signed-off-by: Bernhard Reutner-Fischer --- libc/sysdeps/linux/common/ppoll.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libc/sysdeps/linux/common/ppoll.c b/libc/sysdeps/linux/common/ppoll.c index c9efe8d08..02c8013a5 100644 --- a/libc/sysdeps/linux/common/ppoll.c +++ b/libc/sysdeps/linux/common/ppoll.c @@ -20,10 +20,10 @@ #include #include #include +#define __need_NULL +#include #if defined __NR_ppoll && defined __UCLIBC_LINUX_SPECIFIC__ - - int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, const sigset_t *sigmask) @@ -39,5 +39,4 @@ ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout, return INLINE_SYSCALL(ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8); } libc_hidden_def(ppoll) - #endif -- cgit v1.2.3 From 45ebfdf7d0bc2e1f68acd1534076342b2f3f5c52 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 10:13:16 +0100 Subject: remove superfluous extra semicolons Signed-off-by: Bernhard Reutner-Fischer --- extra/locale/locale_mmap.h | 20 ++++++++++---------- ldso/include/dl-syscall.h | 33 +++++++++++++++++---------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/extra/locale/locale_mmap.h b/extra/locale/locale_mmap.h index 4b231ef9e..5b0df9074 100644 --- a/extra/locale/locale_mmap.h +++ b/extra/locale/locale_mmap.h @@ -50,24 +50,24 @@ typedef struct { /* width?? */ #endif - __LOCALE_DATA_COMMON_MMAP(ctype); - __LOCALE_DATA_COMMON_MMAP(numeric); - __LOCALE_DATA_COMMON_MMAP(monetary); - __LOCALE_DATA_COMMON_MMAP(time); + __LOCALE_DATA_COMMON_MMAP(ctype) + __LOCALE_DATA_COMMON_MMAP(numeric) + __LOCALE_DATA_COMMON_MMAP(monetary) + __LOCALE_DATA_COMMON_MMAP(time) /* collate is different */ - __LOCALE_DATA_COMMON_MMAP(messages); + __LOCALE_DATA_COMMON_MMAP(messages) #ifdef __CTYPE_HAS_8_BIT_LOCALES const __codeset_8_bit_t codeset_8_bit[__LOCALE_DATA_NUM_CODESETS]; #endif - __LOCALE_DATA_COMMON_MMIDX(ctype); - __LOCALE_DATA_COMMON_MMIDX(numeric); - __LOCALE_DATA_COMMON_MMIDX(monetary); - __LOCALE_DATA_COMMON_MMIDX(time); + __LOCALE_DATA_COMMON_MMIDX(ctype) + __LOCALE_DATA_COMMON_MMIDX(numeric) + __LOCALE_DATA_COMMON_MMIDX(monetary) + __LOCALE_DATA_COMMON_MMIDX(time) /* collate is different */ - __LOCALE_DATA_COMMON_MMIDX(messages); + __LOCALE_DATA_COMMON_MMIDX(messages) const uint16_t collate_data[__lc_collate_data_LEN]; diff --git a/ldso/include/dl-syscall.h b/ldso/include/dl-syscall.h index 3284637c0..982bc9bf6 100644 --- a/ldso/include/dl-syscall.h +++ b/ldso/include/dl-syscall.h @@ -36,60 +36,60 @@ dynamic linking at all, so we cannot return any error codes. We just punt if there is an error. */ #define __NR__dl_exit __NR_exit -static __always_inline _syscall1(void, _dl_exit, int, status); +static __always_inline _syscall1(void, _dl_exit, int, status) #define __NR__dl_close __NR_close -static __always_inline _syscall1(int, _dl_close, int, fd); +static __always_inline _syscall1(int, _dl_close, int, fd) #define __NR__dl_open __NR_open static __always_inline _syscall3(int, _dl_open, const char *, fn, int, flags, - __kernel_mode_t, mode); + __kernel_mode_t, mode) #define __NR__dl_write __NR_write static __always_inline _syscall3(unsigned long, _dl_write, int, fd, - const void *, buf, unsigned long, count); + const void *, buf, unsigned long, count) #define __NR__dl_read __NR_read static __always_inline _syscall3(unsigned long, _dl_read, int, fd, - const void *, buf, unsigned long, count); + const void *, buf, unsigned long, count) #define __NR__dl_mprotect __NR_mprotect static __always_inline _syscall3(int, _dl_mprotect, const void *, addr, - unsigned long, len, int, prot); + unsigned long, len, int, prot) #define __NR__dl_stat __NR_stat static __always_inline _syscall2(int, _dl_stat, const char *, file_name, - struct stat *, buf); + struct stat *, buf) #define __NR__dl_fstat __NR_fstat -static __always_inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf); +static __always_inline _syscall2(int, _dl_fstat, int, fd, struct stat *, buf) #define __NR__dl_munmap __NR_munmap -static __always_inline _syscall2(int, _dl_munmap, void *, start, unsigned long, length); +static __always_inline _syscall2(int, _dl_munmap, void *, start, unsigned long, length) #ifdef __NR_getxuid # define __NR_getuid __NR_getxuid #endif #define __NR__dl_getuid __NR_getuid -static __always_inline _syscall0(uid_t, _dl_getuid); +static __always_inline _syscall0(uid_t, _dl_getuid) #ifndef __NR_geteuid # define __NR_geteuid __NR_getuid #endif #define __NR__dl_geteuid __NR_geteuid -static __always_inline _syscall0(uid_t, _dl_geteuid); +static __always_inline _syscall0(uid_t, _dl_geteuid) #ifdef __NR_getxgid # define __NR_getgid __NR_getxgid #endif #define __NR__dl_getgid __NR_getgid -static __always_inline _syscall0(gid_t, _dl_getgid); +static __always_inline _syscall0(gid_t, _dl_getgid) #ifndef __NR_getegid # define __NR_getegid __NR_getgid #endif #define __NR__dl_getegid __NR_getegid -static __always_inline _syscall0(gid_t, _dl_getegid); +static __always_inline _syscall0(gid_t, _dl_getegid) #ifdef __NR_getxpid # define __NR_getpid __NR_getxpid @@ -99,17 +99,18 @@ static __always_inline _syscall0(gid_t, _dl_getpid); #define __NR__dl_readlink __NR_readlink static __always_inline _syscall3(int, _dl_readlink, const char *, path, char *, buf, - size_t, bufsiz); + size_t, bufsiz) #ifdef __UCLIBC_HAS_SSP__ # include # define __NR__dl_gettimeofday __NR_gettimeofday static __always_inline _syscall2(int, _dl_gettimeofday, struct timeval *, tv, # ifdef __USE_BSD - struct timezone *, tz); + struct timezone * # else - void *, tz); + void * # endif + , tz) #endif /* Some architectures always use 12 as page shift for mmap2() eventhough the -- cgit v1.2.3 From 3149763ed4a6782cb152f33139f4e02ade5f252e Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 19:38:53 +0100 Subject: make test-skeleton C89 compliant Signed-off-by: Bernhard Reutner-Fischer --- test/test-skeleton.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/test-skeleton.c b/test/test-skeleton.c index c61d09e82..752158405 100644 --- a/test/test-skeleton.c +++ b/test/test-skeleton.c @@ -137,14 +137,15 @@ timeout_handler (int sig __attribute__ ((unused))) { int killed = 0; int status; + int i; /* Send signal. */ kill (pid, SIGKILL); /* Wait for it to terminate. */ - int i; for (i = 0; i < 5; ++i) { + struct timespec ts; killed = waitpid (pid, &status, WNOHANG|WUNTRACED); if (killed != 0) break; @@ -153,7 +154,6 @@ timeout_handler (int sig __attribute__ ((unused))) nanosleep() call return prematurely, all the better. We won't restart it since this probably means the child process finally died. */ - struct timespec ts; ts.tv_sec = 0; ts.tv_nsec = 100000000; nanosleep (&ts, NULL); @@ -213,6 +213,7 @@ main (int argc, char *argv[]) int opt; unsigned int timeoutfactor = 1; pid_t termpid; + char *envstr_timeoutfactor; /* Make uses of freed and uninitialized memory known. */ #ifdef __MALLOC_STANDARD__ @@ -244,7 +245,7 @@ main (int argc, char *argv[]) /* If set, read the test TIMEOUTFACTOR value from the environment. This value is used to scale the default test timeout values. */ - char *envstr_timeoutfactor = getenv ("TIMEOUTFACTOR"); + envstr_timeoutfactor = getenv ("TIMEOUTFACTOR"); if (envstr_timeoutfactor != NULL) { char *envstr_conv = envstr_timeoutfactor; @@ -303,6 +304,9 @@ main (int argc, char *argv[]) if (pid == 0) { /* This is the child. */ +#ifdef RLIMIT_DATA + struct rlimit data_limit; +#endif #ifdef RLIMIT_CORE /* Try to avoid dumping core. */ struct rlimit core_limit; @@ -313,7 +317,6 @@ main (int argc, char *argv[]) #ifdef RLIMIT_DATA /* Try to avoid eating all memory if a test leaks. */ - struct rlimit data_limit; if (getrlimit (RLIMIT_DATA, &data_limit) == 0) { if (TEST_DATA_LIMIT == RLIM_INFINITY) -- cgit v1.2.3 From ef85033ac8e07fd45d6f45463dcfecf9c78ae7ef Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 20:05:07 +0100 Subject: futimens: add function Signed-off-by: Bernhard Reutner-Fischer --- include/sys/stat.h | 1 + libc/sysdeps/linux/common/futimens.c | 23 +++++++++ libc/sysdeps/linux/common/utimensat.c | 2 + test/.gitignore | 2 + test/time/tst-futimens1.c | 90 +++++++++++++++++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 libc/sysdeps/linux/common/futimens.c create mode 100644 test/time/tst-futimens1.c diff --git a/include/sys/stat.h b/include/sys/stat.h index d84ace5a2..170a4e633 100644 --- a/include/sys/stat.h +++ b/include/sys/stat.h @@ -375,6 +375,7 @@ extern int utimensat (int __fd, __const char *__path, __const struct timespec __times[2], int __flags) __THROW __nonnull ((2)); +libc_hidden_proto(utimensat) #endif #ifdef __USE_XOPEN2K8 diff --git a/libc/sysdeps/linux/common/futimens.c b/libc/sysdeps/linux/common/futimens.c new file mode 100644 index 000000000..090dfa69c --- /dev/null +++ b/libc/sysdeps/linux/common/futimens.c @@ -0,0 +1,23 @@ +/* vi: set sw=4 ts=4: */ +/* + * futimens() implementation for uClibc + * + * Copyright (C) 2009 Bernhard Reutner-Fischer + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include +#define __need_timespec +#include +#ifdef __NR_utimensat +extern int utimensat (int __fd, __const char *__path, + __const struct timespec __times[2], + int __flags) __THROW; +libc_hidden_proto(utimensat) + +int futimens (int fd, __const struct timespec ts[2]) +{ + return utimensat(fd, 0, ts, 0); +} +#endif diff --git a/libc/sysdeps/linux/common/utimensat.c b/libc/sysdeps/linux/common/utimensat.c index 3c5af8586..2cfb8247d 100644 --- a/libc/sysdeps/linux/common/utimensat.c +++ b/libc/sysdeps/linux/common/utimensat.c @@ -11,6 +11,8 @@ #ifdef __NR_utimensat _syscall4(int, utimensat, int, fd, const char *, path, const struct timespec *, times, int, flags) +libc_hidden_def(utimensat) #else /* should add emulation with utimens() and /proc/self/fd/ ... */ #endif + diff --git a/test/.gitignore b/test/.gitignore index d438af7d0..1e7cd584e 100644 --- a/test/.gitignore +++ b/test/.gitignore @@ -237,6 +237,8 @@ string/tst-strxfrm termios/termios time/clocktest time/test_time +time/tst-ftime_l +time/tst-futimens1 time/tst-mktime time/tst-mktime3 time/tst-strptime2 diff --git a/test/time/tst-futimens1.c b/test/time/tst-futimens1.c new file mode 100644 index 000000000..a452de2c7 --- /dev/null +++ b/test/time/tst-futimens1.c @@ -0,0 +1,90 @@ +/* vi: set sw=4 ts=4: */ +/* testcase + * Copyright (C) 2009 Bernhard Reutner-Fischer + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ +#include +#include +#include +#include +#include +#include +#include + +struct +{ + char *name; /* name of file to open */ + int flags; /* flags for file descriptor */ + const struct timespec ts[2]; + int err; /* expected errno */ +} tests [] = +{ + {"futimens.tst", (O_CREAT|O_TRUNC), {{0,0},{0,0}}, 0}, + {"futimens.tst", (O_CREAT|O_TRUNC), {{99,0},{0,0}}, 0}, + {"futimens.tst", (O_CREAT|O_TRUNC), {{0,99},{0,0}}, 0}, + {"futimens.tst", (O_CREAT|O_TRUNC), {{0,0},{99,0}}, 0}, + {"futimens.tst", (O_CREAT|O_TRUNC), {{0,0},{0,99}}, 0}, + {"futimens.tst", (O_CREAT|O_TRUNC), {{11,2},{3,4}}, 0}, +}; +int do_test(int argc, char **argv) { + char *name; + int i, errors; + errors = argc - argc + 0; + + for (i=0; i < (int) (sizeof(tests)/sizeof(tests[0])); ++i) { + int err, fd; + struct stat sb; + name = tests[i].name; + if (*name != '.') + unlink(name); + fd = open(name, tests[i].flags); + if (fd < 0) + abort(); + errno = 0; + err = futimens(fd, tests[i].ts); + if ((errno && !err) || (!errno && err)) { + err = errno; + printf("%s: FAILED test %d (errno and return value disagree)\n", + argv[0], i); + ++errors; + } else + err = errno; + if (err != tests[i].err) { + printf("%s: FAILED test %d (expected errno %d, got %d)\n", + argv[0], i, tests[i].err, err); + ++errors; + continue; + } + if (stat(name, &sb) < 0) { + printf("%s: FAILED test %d (verification)\n", argv[0], i); + ++errors; + continue; + } else { + unsigned wrong = tests[i].ts[0].tv_sec != sb.st_atim.tv_sec || + tests[i].ts[0].tv_nsec != sb.st_atim.tv_nsec || + tests[i].ts[1].tv_sec != sb.st_mtim.tv_sec || + tests[i].ts[1].tv_nsec != sb.st_mtim.tv_nsec; + if (wrong) { + ++errors; + if (tests[i].ts[0].tv_sec != sb.st_atim.tv_sec) + printf("%s: FAILED test %d (access time, sec: expected %ld, got %ld)\n", + argv[0], i, tests[i].ts[0].tv_sec, sb.st_atim.tv_sec); + if (tests[i].ts[0].tv_nsec != sb.st_atim.tv_nsec) + printf("%s: FAILED test %d (access time, nsec: expected %ld, got %ld)\n", + argv[0], i, tests[i].ts[0].tv_nsec, sb.st_atim.tv_nsec); + + if (tests[i].ts[1].tv_sec != sb.st_mtim.tv_sec) + printf("%s: FAILED test %d (modification time, sec: expected %ld, got %ld)\n", + argv[0], i, tests[i].ts[1].tv_sec, sb.st_mtim.tv_sec); + if (tests[i].ts[1].tv_nsec != sb.st_mtim.tv_nsec) + printf("%s: FAILED test %d (modification time, nsec: expected %ld, got %ld)\n", + argv[0], i, tests[i].ts[1].tv_nsec, sb.st_mtim.tv_nsec); + } + } + } + if (*name != '.') + unlink(name); + printf("%d errors.\n", errors); + return (!errors) ? EXIT_SUCCESS : EXIT_FAILURE; +} +#include -- cgit v1.2.3 From a8697cd0367004528df656ea1bfaf1090aa59fe9 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 20:28:49 +0100 Subject: silence rule overriding Signed-off-by: Bernhard Reutner-Fischer --- extra/config/Makefile.kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/config/Makefile.kconfig b/extra/config/Makefile.kconfig index fa8c2dd9c..83c20c474 100644 --- a/extra/config/Makefile.kconfig +++ b/extra/config/Makefile.kconfig @@ -150,8 +150,8 @@ clean-files += config.pot linux.pot # Check that we have the required ncurses stuff installed for lxdialog (menuconfig) PHONY += $(obj)/dochecklxdialog $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog -$(obj)/dochecklxdialog: - $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) +#$(obj)/dochecklxdialog: +# $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES) always := dochecklxdialog -- cgit v1.2.3 From f8f038ccd1980a2451a591393b1910a50ac6752b Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Fri, 20 Nov 2009 20:30:02 +0100 Subject: realclean: wipe kconfig objects Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 3 +++ Makerules | 2 +- extra/config/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index f365bb8e2..9633bb02c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -427,6 +427,9 @@ defconfig: $(top_builddir)extra/config/conf $(Q)$(top_builddir)extra/config/conf -d extra/Configs/Config.in \ -D extra/Configs/defconfigs/$(ARCH) +menuconfig-clean-y: + $(Q)$(MAKE) -C extra/config menuconfig_clean + include_clean: $(Q)$(RM) $(top_builddir)include/fpu_control.h $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h @set -e; \ diff --git a/Makerules b/Makerules index 87d7f4a0a..fdc956f45 100644 --- a/Makerules +++ b/Makerules @@ -435,7 +435,7 @@ files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \ FORCE: clean: objclean-y headers_clean-y -realclean: clean +realclean: clean menuconfig-clean-y $(Q)$(RM) $(.depends.dep) objclean-y: $(objclean-y) diff --git a/extra/config/Makefile b/extra/config/Makefile index 7d8a1e4ad..04175e541 100644 --- a/extra/config/Makefile +++ b/extra/config/Makefile @@ -73,8 +73,8 @@ $(obj)/%:: $(top_srcdir)$(src)/%_shipped @$(disp_gen) $(Q)cat $< > $@ endif -clean: - $(do_rm) $(clean-files) conf +menuconfig_clean: + $(do_rm) $(clean-files) conf $(wildcard *.o) distclean: clean $(do_rm) $(lxdialog) $(conf-objs) $(mconf-objs) \ $(kxgettext-objs) \ -- cgit v1.2.3 From 7208a3ad1e5d01a1f4b22bc24c056a426e892590 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 21 Nov 2009 20:09:42 -0500 Subject: install shared libs with +x perms Signed-off-by: Mike Frysinger --- Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 9633bb02c..39dd18cc1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -316,7 +316,7 @@ ifeq ($(HARDWIRED_ABSPATH),y) $(top_builddir)lib/libc.so > $(PREFIX)$(DEVEL_PREFIX)lib/libc.so; \ fi else - -$(INSTALL) -m 644 lib/libc.so $(PREFIX)$(DEVEL_PREFIX)lib/ + -$(INSTALL) -m 755 lib/libc.so $(PREFIX)$(DEVEL_PREFIX)lib/ endif ifeq ($(UCLIBC_HAS_THREADS),y) ifneq ($(LINUXTHREADS_OLD),y) @@ -328,7 +328,7 @@ ifeq ($(HARDWIRED_ABSPATH),y) >> $(PREFIX)$(DEVEL_PREFIX)lib/libpthread.so; \ fi else - -$(INSTALL) -m 644 lib/libpthread.so $(PREFIX)$(DEVEL_PREFIX)lib/ + -$(INSTALL) -m 755 lib/libpthread.so $(PREFIX)$(DEVEL_PREFIX)lib/ endif endif endif @@ -361,7 +361,7 @@ endif install_runtime: all ifeq ($(HAVE_SHARED),y) $(INSTALL) -d $(PREFIX)$(RUNTIME_PREFIX)lib - $(INSTALL) -m 644 lib/lib*-$(VERSION).so \ + $(INSTALL) -m 755 lib/lib*-$(VERSION).so \ $(PREFIX)$(RUNTIME_PREFIX)lib (cd lib && $(TAR) -cf - *.so.*) | $(TAR) -xf - -C $(PREFIX)$(RUNTIME_PREFIX)lib @if [ -x lib/$(UCLIBC_LDSO_NAME)-$(VERSION).so ] ; then \ -- cgit v1.2.3 From 0265979ae16b5ab98f95bbd29dd5aaf8d0c6f84c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 22 Nov 2009 03:17:46 -0500 Subject: remove incorrect text from abspath option Signed-off-by: Mike Frysinger --- extra/Configs/Config.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index d344385c6..5ef2b9f14 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -1937,10 +1937,9 @@ config HARDWIRED_ABSPATH This is a build time optimization. It has no impact on dynamic linking at runtime, which doesn't use linker scripts. - You must disable this to use uClibc with a relocatable toolchain, - such as the prebuilt binary cross compilers at - http://uclibc.org/downloads/binaries which may be installed at an - arbitrary location (such as in a user's home directory). + You must disable this to use uClibc with old non-sysroot toolchains, + such as the prebuilt binary cross compilers at: + http://uclibc.org/downloads/binaries The amount of time saved by this optimization is actually too small to measure. The linker just had to search the library path to find the -- cgit v1.2.3 From b71274eebd68b7c68ab95c856f8075bdf4524cd7 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 22 Nov 2009 03:37:56 -0500 Subject: install_headers.sh: make more user friendly Make it easier to run this by hand and don't abort when recursive chown and chmod fail as these often aren't due to uClibc settings. Signed-off-by: Mike Frysinger --- extra/scripts/install_headers.sh | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/extra/scripts/install_headers.sh b/extra/scripts/install_headers.sh index 4faf04011..14d64dc9d 100755 --- a/extra/scripts/install_headers.sh +++ b/extra/scripts/install_headers.sh @@ -4,6 +4,10 @@ # $2 = dst dir # $top_builddir = well you guessed it +srcdir=${1:-include} +dstdir=${2:-`. ./.config 2>/dev/null && echo ${DEVEL_PREFIX}/include`} +: ${top_builddir:=.} + die_if_not_dir() { for dir in "$@"; do @@ -19,9 +23,9 @@ umask 022 # Sanity tests -die_if_not_dir "$1" -mkdir -p "$2" 2>/dev/null -die_if_not_dir "$2" +die_if_not_dir "${srcdir}" +mkdir -p "${dstdir}" 2>/dev/null +die_if_not_dir "${dstdir}" die_if_not_dir "$top_builddir" if ! test -x "$top_builddir/extra/scripts/unifdef"; then echo "Error: need '$top_builddir/extra/scripts/unifdef' executable" @@ -31,16 +35,16 @@ fi # Sanitize and copy uclibc headers ( -# We must cd, or else we'll prepend "$1" to filenames! -cd "$1" || exit 1 +# We must cd, or else we'll prepend "${srcdir}" to filenames! +cd "${srcdir}" || exit 1 find . ! -name '.' -a ! -path '*/.*' | sed -e 's/^\.\///' -e '/^config\//d' \ -e '/^config$/d' ) | \ ( IFS='' while read -r filename; do - if test -d "$1/$filename"; then - mkdir -p "$2/$filename" 2>/dev/null + if test -d "${srcdir}/$filename"; then + mkdir -p "${dstdir}/$filename" 2>/dev/null continue fi if test x"${filename##libc-*.h}" = x""; then @@ -55,15 +59,18 @@ while read -r filename; do -U_LIBC \ -U__UCLIBC_GEN_LOCALE \ -U__NO_CTYPE \ - "$1/$filename" \ + "${srcdir}/$filename" \ | sed -e '/^rtld_hidden_proto[ ]*([a-zA-Z0-9_]*)$/d' \ | sed -e '/^lib\(c\|m\|resolv\|dl\|intl\|rt\|nsl\|util\|crypt\|pthread\)_hidden_proto[ ]*([a-zA-Z0-9_]*)$/d' \ - >"$2/$filename" + >"${dstdir}/$filename" done ) # Fix mode/owner bits -cd "$2" || exit 1 +cd "${dstdir}" || exit 1 chmod -R u=rwX,go=rX . >/dev/null 2>&1 chown -R `id | sed 's/^uid=\([0-9]*\).*gid=\([0-9]*\).*$/\1:\2/'` . >/dev/null 2>&1 + +# ignore errors on unrelated files +exit 0 -- cgit v1.2.3