From c164cf038c522d153bf9ac6c4bddabe0be81a7e1 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 8 Apr 2010 10:33:09 +0200 Subject: confstr: properly stringify version parts Signed-off-by: Bernhard Reutner-Fischer --- libc/unistd/confstr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libc/unistd/confstr.c b/libc/unistd/confstr.c index 957ee4d27..fc0bd599e 100644 --- a/libc/unistd/confstr.c +++ b/libc/unistd/confstr.c @@ -52,11 +52,13 @@ size_t confstr (int name, char *buf, size_t len) string_len = sizeof("linuxthreads-x.xx"); # elif defined __UCLIBC_HAS_THREADS_NATIVE__ # define __NPTL_VERSION ("NPTL " \ - #__UCLIBC_MAJOR__ "." \ - #__UCLIBC_MINOR__ "." \ - #__UCLIBC_SUBLEVEL__) + __stringify(__UCLIBC_MAJOR__) "." \ + __stringify(__UCLIBC_MINOR__) "." \ + __stringify(__UCLIBC_SUBLEVEL__)) string = __NPTL_VERSION; string_len = sizeof(__NPTL_VERSION); +# else +# error unable to determine thread impl # endif break; #endif -- cgit v1.2.3 From bb3ea9c344083c03dac8d816fc93a393ddba8b58 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Thu, 8 Apr 2010 10:33:53 +0200 Subject: .gitignore getconf binaries Signed-off-by: Bernhard Reutner-Fischer --- utils/.gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/.gitignore b/utils/.gitignore index 8b2853db0..5b2ee4764 100644 --- a/utils/.gitignore +++ b/utils/.gitignore @@ -1,8 +1,10 @@ +getconf +getconf.host +iconv +iconv.host ldconfig ldconfig.host ldd ldd.host -iconv -iconv.host locale locale.host -- cgit v1.2.3 From eda86005f81342094c211ba13c8128afcff98f5d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 9 Apr 2010 23:17:34 +0200 Subject: resolv: tentatively fix usage of uninitialized DNS parameters See "Possible regression from timeout commit for resolv.conf" thread. Also remove superfluous NULL check. Signed-off-by: Denys Vlasenko --- libc/inet/resolv.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 9459199da..84289a619 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -905,8 +905,8 @@ __UCLIBC_MUTEX_INIT(__resolv_lock, PTHREAD_MUTEX_INITIALIZER); /* Protected by __resolv_lock */ void (*__res_sync)(void); /*uint32_t __resolv_opts; */ -uint8_t __resolv_timeout; -uint8_t __resolv_attempts; +uint8_t __resolv_timeout = RES_TIMEOUT; +uint8_t __resolv_attempts = RES_DFLRETRY; unsigned __nameservers; unsigned __searchdomains; sockaddr46_t *__nameserver; @@ -1062,8 +1062,6 @@ void attribute_hidden __open_nameservers(void) if (p == NULL || (p1 = strchr(p, ':')) == NULL) continue; *p1++ = '\0'; - if (p1 == NULL) - continue; if (strcmp(p, "timeout") == 0) what = &__resolv_timeout; else if (strcmp(p, "attempts") == 0) -- cgit v1.2.3 From 625b805068561d121baf226cd67cb7aa6e6ba7ba Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Sun, 11 Apr 2010 22:56:05 +0200 Subject: ldso_sh: Provide only one definition for elf_machine_type_class It doesn't need to provide different definition of elf_machine_type_class macro depending on TLS support. It also fixes build for sh architecture when thread support is off: CC ldso/ldso/ldso.oS In file included from ./ldso/ldso/sh/dl-sysdep.h:9, from ./ldso/include/dl-string.h:11, from ./ldso/include/ldso.h:40, from ldso/ldso/ldso.c:33: ./include/tls.h:6:22: error: tls.h: No such file or directory make: *** [ldso/ldso/ldso.oS] Error 1 Signed-off-by: Carmelo Amoroso --- ldso/ldso/sh/dl-sysdep.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ldso/ldso/sh/dl-sysdep.h b/ldso/ldso/sh/dl-sysdep.h index 56e1820f3..21244ec1f 100644 --- a/ldso/ldso/sh/dl-sysdep.h +++ b/ldso/ldso/sh/dl-sysdep.h @@ -6,7 +6,6 @@ /* Define this if the system uses RELOCA. */ #define ELF_USES_RELOCA #include -#include /* * Initialization sequence for a GOT. */ @@ -89,17 +88,11 @@ _dl_urem(unsigned int n, unsigned int base) define the value. ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one of the main executable's symbols, as for a COPY reloc. */ -#if defined USE_TLS # define elf_machine_type_class(type) \ ((((type) == R_SH_JMP_SLOT || (type) == R_SH_TLS_DTPMOD32 \ || (type) == R_SH_TLS_DTPOFF32 || (type) == R_SH_TLS_TPOFF32) \ * ELF_RTYPE_CLASS_PLT) \ | (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY)) -#else -#define elf_machine_type_class(type) \ - ((((type) == R_SH_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY)) -#endif /* Return the link-time address of _DYNAMIC. Conveniently, this is the first element of the GOT. This must be inlined in a function which -- cgit v1.2.3 From 62174f7330a4578faf2df6c108c0ee6ee5270325 Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Mon, 12 Apr 2010 09:23:43 +0200 Subject: libc_regex: __libc_lock primitives are actually available on uClibc __libc_lock primitives are actually available on uClibc when threading support is enable, so in this case they can be used. It also fixes the following compiler warnings: In file included from libc/misc/regex/regex.c:55: libc/misc/regex/regex_internal.h:49:1: warning: "__libc_lock_define" redefined [SNIP] libc/misc/regex/regex_internal.h:50:1: warning: "__libc_lock_init" redefined [SNIP] libc/misc/regex/regex_internal.h:51:1: warning: "__libc_lock_lock" redefined [SNIP] libc/misc/regex/regex_internal.h:52:1: warning: "__libc_lock_unlock" redefined Signed-off-by: Carmelo Amoroso (cherry picked from commit 65f9ccdafd008abd9892dfc46fb9737ec4d964c5) Signed-off-by: Carmelo Amoroso --- libc/misc/regex/regex_internal.h | 4 ++++ libc/misc/regex/regexec.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libc/misc/regex/regex_internal.h b/libc/misc/regex/regex_internal.h index 03f08bf52..0a255e37f 100644 --- a/libc/misc/regex/regex_internal.h +++ b/libc/misc/regex/regex_internal.h @@ -46,10 +46,14 @@ # include #endif +#ifdef __UCLIBC_HAS_THREADS__ +#include +#else #define __libc_lock_define(CLASS, NAME) #define __libc_lock_init(NAME) do { } while (0) #define __libc_lock_lock(NAME) do { } while (0) #define __libc_lock_unlock(NAME) do { } while (0) +#endif #undef gettext #undef gettext_noop diff --git a/libc/misc/regex/regexec.c b/libc/misc/regex/regexec.c index 92cbd821a..568108a67 100644 --- a/libc/misc/regex/regexec.c +++ b/libc/misc/regex/regexec.c @@ -222,7 +222,7 @@ regexec (preg, string, nmatch, pmatch, eflags) { reg_errcode_t err; int start, length; -#ifndef __UCLIBC__ /* libc_lock_lock does not exist */ +#ifdef __UCLIBC_HAS_THREADS__ re_dfa_t *dfa = (re_dfa_t *) preg->buffer; #endif @@ -382,10 +382,9 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len) regmatch_t *pmatch; int nregs, rval; int eflags = 0; -#ifndef __UCLIBC__ /* libc_lock_lock does not exist */ +#ifdef __UCLIBC_HAS_THREADS__ re_dfa_t *dfa = (re_dfa_t *) bufp->buffer; #endif - /* Check for out-of-range. */ if (BE (start < 0 || start > length, 0)) return -1; -- cgit v1.2.3 From ed15ebd5148bfdd3fda358e1cc8da621f8eede29 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 12 Apr 2010 09:43:08 +0200 Subject: silence warning about undefined preprocessor token Signed-off-by: Bernhard Reutner-Fischer --- ldso/ldso/arm/elfinterp.c | 2 +- ldso/ldso/i386/elfinterp.c | 2 +- ldso/ldso/mips/elfinterp.c | 2 +- ldso/ldso/sh/elfinterp.c | 4 ++-- ldso/ldso/sparc/elfinterp.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ldso/ldso/arm/elfinterp.c b/ldso/ldso/arm/elfinterp.c index bf7426790..9bbf92c8c 100644 --- a/ldso/ldso/arm/elfinterp.c +++ b/ldso/ldso/arm/elfinterp.c @@ -276,7 +276,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, _dl_memcpy((void *) reloc_addr, (void *) symbol_addr, symtab[symtab_index].st_size); break; -#if USE_TLS +#if defined USE_TLS && USE_TLS case R_ARM_TLS_DTPMOD32: *reloc_addr = def_mod->l_tls_modid; break; diff --git a/ldso/ldso/i386/elfinterp.c b/ldso/ldso/i386/elfinterp.c index 649c207f9..a01c1d020 100644 --- a/ldso/ldso/i386/elfinterp.c +++ b/ldso/ldso/i386/elfinterp.c @@ -228,7 +228,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, symtab[symtab_index].st_size); } break; -#if USE_TLS +#if defined USE_TLS && USE_TLS case R_386_TLS_DTPMOD32: *reloc_addr = tls_tpnt->l_tls_modid; break; diff --git a/ldso/ldso/mips/elfinterp.c b/ldso/ldso/mips/elfinterp.c index 149fc5674..b6e0932c7 100644 --- a/ldso/ldso/mips/elfinterp.c +++ b/ldso/ldso/mips/elfinterp.c @@ -201,7 +201,7 @@ int _dl_parse_relocation_information(struct dyn_elf *xpnt, } switch (reloc_type) { -#if USE_TLS +#if defined USE_TLS && USE_TLS # if _MIPS_SIM == _MIPS_SIM_ABI64 case R_MIPS_TLS_DTPMOD64: case R_MIPS_TLS_DTPREL64: diff --git a/ldso/ldso/sh/elfinterp.c b/ldso/ldso/sh/elfinterp.c index 10b944380..715eadc15 100644 --- a/ldso/ldso/sh/elfinterp.c +++ b/ldso/ldso/sh/elfinterp.c @@ -192,7 +192,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, old_val = *reloc_addr; #endif -#if USE_TLS +#if defined USE_TLS && USE_TLS /* In case of a TLS reloc, tls_tpnt NULL means we have an 'anonymous' symbol. This is the case for a static tls variable, so the lookup module is just that one is referencing the tls variable. */ @@ -225,7 +225,7 @@ _dl_do_reloc (struct elf_resolve *tpnt,struct dyn_elf *scope, case R_SH_RELATIVE: *reloc_addr = (unsigned long) tpnt->loadaddr + rpnt->r_addend; break; -#if USE_TLS +#if defined USE_TLS && USE_TLS case R_SH_TLS_DTPMOD32: *reloc_addr = tls_tpnt->l_tls_modid; break; diff --git a/ldso/ldso/sparc/elfinterp.c b/ldso/ldso/sparc/elfinterp.c index 75e77772c..56335cb5c 100644 --- a/ldso/ldso/sparc/elfinterp.c +++ b/ldso/ldso/sparc/elfinterp.c @@ -272,7 +272,7 @@ _dl_do_reloc(struct elf_resolve *tpnt, struct dyn_elf *scope, } else _dl_dprintf(_dl_debug_file, "no symbol_addr to copy !?\n"); break; -#if USE_TLS +#if defined USE_TLS && USE_TLS case R_SPARC_TLS_DTPMOD32: *reloc_addr = tls_tpnt->l_tls_modid; break; -- cgit v1.2.3 From 8ba98cc2aa3409f57f7b2a6da424ebb64dae250c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 12 Apr 2010 10:00:54 +0200 Subject: *.i depend on generated headers Signed-off-by: Bernhard Reutner-Fischer --- Makerules | 1 + 1 file changed, 1 insertion(+) diff --git a/Makerules b/Makerules index 83ecaed26..af95ca0f9 100644 --- a/Makerules +++ b/Makerules @@ -309,6 +309,7 @@ endef CFLAGS-.os+=$(PICFLAG) CFLAGS-.oS+=$(PICFLAG) -DSHARED +$(top_srcdir)%.i: | pregen $(top_builddir)%.o: $(top_srcdir)%.c FORCE ; $(compile.c) $(top_builddir)%.os: $(top_srcdir)%.c FORCE ; $(compile.c) $(top_builddir)%.oS: $(top_srcdir)%.c FORCE ; $(compile.c) -- cgit v1.2.3 From 400fda729df34fa969a2346a3567a0ac02341fb3 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 12 Apr 2010 10:11:53 +0200 Subject: prettify make clean forgot extra/config Signed-off-by: Bernhard Reutner-Fischer --- Makefile.in | 2 +- extra/config/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index aacb1ab6a..3716b94d3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -430,7 +430,7 @@ defconfig: $(top_builddir)extra/config/conf -D extra/Configs/defconfigs/$(ARCH) menuconfig-clean-y: - $(Q)$(MAKE) -C extra/config menuconfig_clean + $(Q)$(MAKE) -C extra/config CLEAN_extra/config include_clean: $(Q)$(RM) $(top_builddir)include/fpu_control.h $(top_builddir)include/dl-osinfo.h $(top_builddir)include/hp-timing.h diff --git a/extra/config/Makefile b/extra/config/Makefile index ce406adc2..800f750d3 100644 --- a/extra/config/Makefile +++ b/extra/config/Makefile @@ -73,7 +73,7 @@ $(obj)/%:: $(top_srcdir)$(src)/%_shipped @$(disp_gen) $(Q)cat $< > $@ endif -menuconfig_clean: +CLEAN_extra/config menuconfig_clean: $(do_rm) $(clean-files) $(lxdialog) conf $(wildcard *.o) distclean: clean $(do_rm) $(lxdialog) $(conf-objs) $(mconf-objs) \ -- cgit v1.2.3 From e90c33f951efc032ca23f48326343a83c0b54b10 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 12 Apr 2010 15:09:25 +0200 Subject: attribute_optimize: fix typo with args curious how 308f5c6e5fd56ea3d1a5512e34388aad788f1180 ever worked.. :P Signed-off-by: Bernhard Reutner-Fischer --- include/libc-symbols.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libc-symbols.h b/include/libc-symbols.h index 2729d306c..4615a6aa5 100644 --- a/include/libc-symbols.h +++ b/include/libc-symbols.h @@ -86,9 +86,9 @@ #endif #if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -# define attribute_optimize(lvl) __attribute__ ((optimize(x))) +# define attribute_optimize(x) __attribute__ ((optimize(x))) #else -# define attribute_optimize(lvl) +# define attribute_optimize(x) #endif #define attribute_unused __attribute__ ((unused)) -- cgit v1.2.3