From 0a7a66275add650678feee2d26287adfd578022f70eca9234a77dfd5807c2fa2 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 27 Jun 2011 12:05:13 +0000 Subject: [PATCH] Accepting request 74639 from home:a_jaeger:branches:openSUSE:Factory Fix warnings, speed up getsysstats. OBS-URL: https://build.opensuse.org/request/show/74639 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=69 --- glibc-2.13-warnings.fix | 33 +++++ glibc-2.15-getsysstats-speedup.patch | 145 ++++++++++++++++++++++ glibc-2.3-SuSE.diff | 43 ------- glibc-2.3-regcomp.diff | 13 -- glibc-2.3.90-ld.so-madvise.diff | 76 ------------ glibc-gconvcache-s390.diff | 5 + glibc-suse-note.diff | 127 ------------------- glibc-testsuite.patch | 15 +++ glibc-x86-bits-sigcontext.patch | 142 +++++---------------- glibc.changes | 20 +++ glibc.spec | 179 +++++++++++++-------------- 11 files changed, 339 insertions(+), 459 deletions(-) create mode 100644 glibc-2.13-warnings.fix create mode 100644 glibc-2.15-getsysstats-speedup.patch delete mode 100644 glibc-2.3-SuSE.diff delete mode 100644 glibc-2.3-regcomp.diff delete mode 100644 glibc-2.3.90-ld.so-madvise.diff delete mode 100644 glibc-suse-note.diff create mode 100644 glibc-testsuite.patch diff --git a/glibc-2.13-warnings.fix b/glibc-2.13-warnings.fix new file mode 100644 index 0000000..45d3c2e --- /dev/null +++ b/glibc-2.13-warnings.fix @@ -0,0 +1,33 @@ +commit 5615eaf26469f20c2d8c3be5770e12564a1edfff +Author: Roland McGrath +Date: Fri Jun 10 12:45:09 2011 -0700 + + Quash some new warnings from GCC 4.6. + +2011-06-10 Roland McGrath + + * elf/dl-open.c (_dl_open): Quash warnings when DL_NNS==1. + +diff --git a/elf/dl-open.c b/elf/dl-open.c +index 8d90b56..19fda91 100644 +--- a/elf/dl-open.c ++++ b/elf/dl-open.c +@@ -516,7 +516,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid, + if (__builtin_expect (nsid == LM_ID_NEWLM, 0)) + { + /* Find a new namespace. */ +- for (nsid = 1; nsid < GL(dl_nns); ++nsid) ++ for (nsid = 1; DL_NNS > 1 && nsid < GL(dl_nns); ++nsid) + if (GL(dl_ns)[nsid]._ns_loaded == NULL) + break; + +@@ -528,8 +528,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid, + _dl_signal_error (EINVAL, file, NULL, N_("\ + no more namespaces available for dlmopen()")); + } +- +- if (nsid == GL(dl_nns)) ++ else if (nsid == GL(dl_nns)) + { + __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock); + ++GL(dl_nns); diff --git a/glibc-2.15-getsysstats-speedup.patch b/glibc-2.15-getsysstats-speedup.patch new file mode 100644 index 0000000..87a29ef --- /dev/null +++ b/glibc-2.15-getsysstats-speedup.patch @@ -0,0 +1,145 @@ +From glibc.git (for 2.15): + +2011-06-23 H.J. Lu + + * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Use + __gettimeofday instead of gettimeofday. + +2011-06-22 Ulrich Drepper + + * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Use + /sys/devices/system/cpu/online if it is usable. + + * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Rate limit + reading the information from the /proc filesystem to once a second. + +--- glibc-2.13/sysdeps/unix/sysv/linux/getsysstats.c 2010-04-08 10:45:22.000000000 +0200 ++++ glibc.git/sysdeps/unix/sysv/linux/getsysstats.c 2011-06-27 09:56:27.359389056 +0200 +@@ -1,5 +1,5 @@ + /* Determine various system internal values, Linux version. +- Copyright (C) 1996-2003,2006,2007,2009,2010 Free Software Foundation, Inc. ++ Copyright (C) 1996-2003,2006,2007,2009,2010,2011 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper , 1996. + +@@ -35,6 +35,16 @@ + + #include + #include ++#include ++ ++#ifndef HAVE_CLOCK_GETTIME_VSYSCALL ++# undef INTERNAL_VSYSCALL ++# define INTERNAL_VSYSCALL INTERNAL_SYSCALL ++# undef INLINE_VSYSCALL ++# define INLINE_VSYSCALL INLINE_SYSCALL ++#else ++# include ++#endif + + + /* How we can determine the number of available processors depends on +@@ -128,6 +138,22 @@ + int + __get_nprocs () + { ++ static int cached_result; ++ static time_t timestamp; ++ ++#ifdef __ASSUME_POSIX_TIMERS ++ struct timespec ts; ++ INTERNAL_SYSCALL_DECL (err); ++ INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts); ++#else ++ struct timeval ts; ++ __gettimeofday (&ts, NULL); ++#endif ++ time_t prev = timestamp; ++ atomic_read_barrier (); ++ if (ts.tv_sec == prev) ++ return cached_result; ++ + /* XXX Here will come a test for the new system call. */ + + const size_t buffer_size = __libc_use_alloca (8192) ? 8192 : 512; +@@ -135,20 +161,65 @@ + char *buffer_end = buffer + buffer_size; + char *cp = buffer_end; + char *re = buffer_end; +- int result = 1; + + #ifdef O_CLOEXEC + const int flags = O_RDONLY | O_CLOEXEC; + #else + const int flags = O_RDONLY; + #endif ++ int fd = open_not_cancel_2 ("/sys/devices/system/cpu/online", flags); ++ char *l; ++ int result = 0; ++ if (fd != -1) ++ { ++ l = next_line (fd, buffer, &cp, &re, buffer_end); ++ if (l != NULL) ++ do ++ { ++ char *endp; ++ unsigned long int n = strtoul (l, &endp, 10); ++ if (l == endp) ++ { ++ result = 0; ++ break; ++ } ++ ++ unsigned long int m = n; ++ if (*endp == '-') ++ { ++ l = endp + 1; ++ m = strtoul (l, &endp, 10); ++ if (l == endp) ++ { ++ result = 0; ++ break; ++ } ++ } ++ ++ result += m - n + 1; ++ ++ l = endp; ++ while (l < re && isspace (*l)) ++ ++l; ++ } ++ while (l < re); ++ ++ close_not_cancel_no_status (fd); ++ ++ if (result > 0) ++ goto out; ++ } ++ ++ cp = buffer_end; ++ re = buffer_end; ++ result = 1; ++ + /* The /proc/stat format is more uniform, use it by default. */ +- int fd = open_not_cancel_2 ("/proc/stat", flags); ++ fd = open_not_cancel_2 ("/proc/stat", flags); + if (fd != -1) + { + result = 0; + +- char *l; + while ((l = next_line (fd, buffer, &cp, &re, buffer_end)) != NULL) + /* The current format of /proc/stat has all the cpu* entries + at the front. We assume here that stays this way. */ +@@ -169,6 +240,11 @@ + } + } + ++ out: ++ cached_result = result; ++ atomic_write_barrier (); ++ timestamp = ts.tv_sec; ++ + return result; + } + weak_alias (__get_nprocs, get_nprocs) diff --git a/glibc-2.3-SuSE.diff b/glibc-2.3-SuSE.diff deleted file mode 100644 index 62a1ff2..0000000 --- a/glibc-2.3-SuSE.diff +++ /dev/null @@ -1,43 +0,0 @@ -Index: io/Makefile -=================================================================== ---- io/Makefile.orig -+++ io/Makefile -@@ -64,7 +64,7 @@ static-only-routines = stat fstat lstat - - others := pwd - test-srcs := ftwtest --tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ -+tests := test-utime test-stat test-stat2 tst-getcwd \ - tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \ - tst-openat tst-unlinkat tst-fstatat tst-futimesat \ - tst-renameat tst-fchownat tst-fchmodat tst-faccessat \ -Index: libio/stdio.h -=================================================================== ---- libio/stdio.h.orig -+++ libio/stdio.h -@@ -145,10 +145,12 @@ typedef _G_fpos64_t fpos64_t; - extern struct _IO_FILE *stdin; /* Standard input stream. */ - extern struct _IO_FILE *stdout; /* Standard output stream. */ - extern struct _IO_FILE *stderr; /* Standard error output stream. */ -+#ifdef __STDC__ - /* C89/C99 say they're macros. Make them happy. */ - #define stdin stdin - #define stdout stdout - #define stderr stderr -+#endif - - __BEGIN_NAMESPACE_STD - /* Remove file FILENAME. */ -Index: stdio-common/Makefile -=================================================================== ---- stdio-common/Makefile.orig -+++ stdio-common/Makefile -@@ -52,7 +52,7 @@ tests := tstscanf test_rdwr test-popen t - temptest tst-fileno test-fwrite tst-ungetc tst-ferror \ - xbug errnobug \ - bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 bug12 bug13 \ -- tfformat tiformat tllformat tstdiomisc tst-printfsz tst-wc-printf \ -+ tfformat tiformat tllformat tst-printfsz tst-wc-printf \ - scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \ - scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \ - tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \ diff --git a/glibc-2.3-regcomp.diff b/glibc-2.3-regcomp.diff deleted file mode 100644 index 8340d83..0000000 --- a/glibc-2.3-regcomp.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: posix/regcomp.c -=================================================================== ---- posix/regcomp.c.orig -+++ posix/regcomp.c -@@ -2254,6 +2254,8 @@ parse_expression (re_string_t *regexp, r - else if (syntax & RE_CONTEXT_INDEP_OPS) - { - fetch_token (token, regexp, syntax); -+ if (token->type == OP_CLOSE_SUBEXP || token->type == OP_ALT) -+ return NULL; - return parse_expression (regexp, preg, token, syntax, nest, err); - } - /* else fall through */ diff --git a/glibc-2.3.90-ld.so-madvise.diff b/glibc-2.3.90-ld.so-madvise.diff deleted file mode 100644 index fd01e86..0000000 --- a/glibc-2.3.90-ld.so-madvise.diff +++ /dev/null @@ -1,76 +0,0 @@ -Index: elf/dl-load.c -=================================================================== ---- elf/dl-load.c.orig -+++ elf/dl-load.c -@@ -1207,6 +1207,9 @@ cannot allocate TLS data structures for - goto call_lose_errno; - } - -+ if (GLRO(dl_madvise)) -+ posix_fadvise (fd, c->mapoff, maplength, POSIX_FADV_WILLNEED); -+ - l->l_map_end = l->l_map_start + maplength; - l->l_addr = l->l_map_start - c->mapstart; - -Index: elf/dl-support.c -=================================================================== ---- elf/dl-support.c.orig -+++ elf/dl-support.c -@@ -42,6 +42,7 @@ size_t _dl_platformlen; - - int _dl_debug_mask; - int _dl_lazy; -+int _dl_madvise; - ElfW(Addr) _dl_use_load_bias = -2; - int _dl_dynamic_weak; - -@@ -254,6 +255,8 @@ _dl_non_dynamic_init (void) - - _dl_lazy = *(getenv ("LD_BIND_NOW") ?: "") == '\0'; - -+ _dl_madvise = *(getenv ("LD_NOMADVISE") ?: "") == '\0'; -+ - _dl_bind_not = *(getenv ("LD_BIND_NOT") ?: "") != '\0'; - - _dl_dynamic_weak = *(getenv ("LD_DYNAMIC_WEAK") ?: "") == '\0'; -Index: elf/rtld.c -=================================================================== ---- elf/rtld.c.orig -+++ elf/rtld.c -@@ -158,6 +158,7 @@ struct rtld_global_ro _rtld_global_ro at - ._dl_lazy = 1, - ._dl_fpu_control = _FPU_DEFAULT, - ._dl_pointer_guard = 1, -+ ._dl_madvise = 1, - - /* Function pointers. */ - ._dl_debug_printf = _dl_debug_printf, -@@ -2612,6 +2613,14 @@ process_envvars (enum mode *modep) - break; - - case 9: -+ /* Test whether we should not advise the kernel -+ about memory usage. */ -+ if (memcmp (envline, "NOMADVISE", 9) == 0) -+ { -+ GLRO(dl_madvise) = envline[10] == '\0'; -+ break; -+ } -+ - /* Test whether we want to see the content of the auxiliary - array passed up from the kernel. */ - if (!INTUSE(__libc_enable_secure) -Index: sysdeps/generic/ldsodefs.h -=================================================================== ---- sysdeps/generic/ldsodefs.h.orig -+++ sysdeps/generic/ldsodefs.h -@@ -580,6 +580,9 @@ struct rtld_global_ro - /* Do we do lazy relocations? */ - EXTERN int _dl_lazy; - -+ /* Should we advise kernel about memory usage? */ -+ EXTERN int _dl_madvise; -+ - /* Nonzero if runtime lookups should not update the .got/.plt. */ - EXTERN int _dl_bind_not; - diff --git a/glibc-gconvcache-s390.diff b/glibc-gconvcache-s390.diff index 93d58c7..a09308d 100644 --- a/glibc-gconvcache-s390.diff +++ b/glibc-gconvcache-s390.diff @@ -1,3 +1,8 @@ +2011-06-21 Andreas Jaeger + + * sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules): + Copy rule from iconvdata/Makefile. + Index: glibc/sysdeps/s390/s390-64/Makefile =================================================================== --- sysdeps/s390/s390-64/Makefile 2009-08-03 10:18:31.000000000 +0200 diff --git a/glibc-suse-note.diff b/glibc-suse-note.diff deleted file mode 100644 index 5e85769..0000000 --- a/glibc-suse-note.diff +++ /dev/null @@ -1,127 +0,0 @@ - -This patch creates a SuSE .note section with version number 10.2 - -================================================================================ -Index: Makerules -=================================================================== ---- Makerules.orig -+++ Makerules -@@ -475,6 +475,7 @@ $(common-objpfx)shlib.lds: $(common-objp - -e '/^=========/,/^=========/!d;/^=========/d' \ - $(if $(filter yes,$(have-hash-style)), \ - -e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } &/' \ -+ -e 's/^.*\.gnu\.hash[ ]*:.*$$/ .note.ABI-tag : { *(.note.ABI-tag) } .note.SuSE : { *(.note.SuSE) } &/' \ - -e '/^[ ]*\.hash[ ]*:.*$$/{h;d;}' \ - -e '/DATA_SEGMENT_ALIGN/{H;g}' \ - , \ -@@ -500,7 +501,7 @@ common-generated += shlib.lds - - define build-shlib - $(build-shlib-helper) -o $@ -T $(common-objpfx)shlib.lds \ -- $(csu-objpfx)abi-note.o $(build-shlib-objlist) -+ $(csu-objpfx)abi-note.o $(csu-objpfx)suse-note.o $(build-shlib-objlist) - endef - else - ifneq (,$(findstring aix,$(config-os))) -@@ -542,7 +543,7 @@ ifeq (yes,$(elf)) - # not for shared objects - define build-module - $(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \ -- $(csu-objpfx)abi-note.o $(build-module-objlist) -+ $(csu-objpfx)abi-note.o $(csu-objpfx)suse-note.o $(build-module-objlist) - endef - define build-module-asneeded - $(build-module-helper) -o $@ -T $(common-objpfx)shlib.lds \ -Index: csu/Makefile -=================================================================== ---- csu/Makefile.orig -+++ csu/Makefile -@@ -125,7 +125,7 @@ $(objpfx)defs.h: $(objpfx)initfini.s - endif - - ifeq (yes,$(elf)) --extra-objs += abi-note.o init.o -+extra-objs += abi-note.o suse-note.o init.o - asm-CPPFLAGS += -I$(objpfx). - endif - -@@ -143,12 +143,15 @@ ifeq (yes,$(elf)) - # We link the ELF startfile along with a SHT_NOTE section indicating - # the kernel ABI the binaries linked with this library will require. - $(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \ -+ $(objpfx)suse-note.o \ - $(objpfx)init.o - $(link-relocatable) - $(objpfx)S$(start-installed-name): $(objpfx)start.os $(objpfx)abi-note.o \ -+ $(objpfx)suse-note.o \ - $(objpfx)init.o - $(link-relocatable) - $(objpfx)b$(start-installed-name): $(objpfx)start.ob $(objpfx)abi-note.ob \ -+ $(objpfx)suse-note.ob \ - $(objpfx)init.ob - $(link-relocatable) - else -Index: csu/suse-note.S -=================================================================== ---- /dev/null -+++ csu/suse-note.S -@@ -0,0 +1,59 @@ -+/* Special .init and .fini section support. -+ Copyright (C) 1997, 2001, 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 -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ In addition to the permissions in the GNU Lesser General Public -+ License, the Free Software Foundation gives you unlimited -+ permission to link the compiled version of this file with other -+ programs, and to distribute those programs without any restriction -+ coming from the use of this file. (The Lesser General Public -+ License restrictions do apply in other respects; for example, they -+ cover modification of the file, and distribution when not linked -+ into another program.) -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+/* Look in abi-note.S for the definition of an ELF note section. */ -+ -+#include -+ -+#define PROD_TYPE_BOX 0 -+#define PROD_TYPE_SLES 1 -+ -+#define NOTE_VERSION 1 -+#define PROD_TYPE PROD_TYPE_BOX -+#define PROD_MAJOR 10 -+#define PROD_MINOR 2 -+ -+/* The linker (GNU ld 2.8 and later) recognizes an allocated section whose -+ name begins with `.note' and creates a PT_NOTE program header entry -+ pointing at it. */ -+ -+ .section ".note.SuSE", "a" -+ .p2align 2 -+ .long 1f - 0f /* name length */ -+ .long 3f - 2f /* data length */ -+ .long 0x45537553 /* note type ("SuSE" in little endian) */ -+0: .asciz "SuSE" /* vendor name */ -+1: -+ .p2align 2 -+2: /* Data */ -+ .byte NOTE_VERSION /* Version of following data */ -+ .byte PROD_TYPE /* product type (box, sles, nld, whatever) */ -+ .byte PROD_MAJOR /* product version */ -+ .byte PROD_MINOR /* product minor version */ -+3: -+ .p2align 2 /* pad out section */ diff --git a/glibc-testsuite.patch b/glibc-testsuite.patch new file mode 100644 index 0000000..c9c4a53 --- /dev/null +++ b/glibc-testsuite.patch @@ -0,0 +1,15 @@ +test-lfs runs for ever on ReiserFS. Let's disable it completely. + +Index: io/Makefile +=================================================================== +--- io/Makefile.orig ++++ io/Makefile +@@ -64,7 +64,7 @@ static-only-routines = stat fstat lstat + + others := pwd + test-srcs := ftwtest +-tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \ ++tests := test-utime test-stat test-stat2 tst-getcwd \ + tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \ + tst-openat tst-unlinkat tst-fstatat tst-futimesat \ + tst-renameat tst-fchownat tst-fchmodat tst-faccessat \ diff --git a/glibc-x86-bits-sigcontext.patch b/glibc-x86-bits-sigcontext.patch index c1eca5c..4acfa3d 100644 --- a/glibc-x86-bits-sigcontext.patch +++ b/glibc-x86-bits-sigcontext.patch @@ -1,113 +1,35 @@ -2011-06-20 Andreas Jaeger - * sysdeps/unix/sysv/linux/i386/bits/sigcontext.h: New file. +http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6e502e19455c6110dd4487d91b7b7d6d8121f9ba -============================================================ -Index: ./sysdeps/unix/sysv/linux/i386/bits/sigcontext.h ---- ./sysdeps/unix/sysv/linux/i386/bits/sigcontext.h created -+++ ./sysdeps/unix/sysv/linux/i386/bits/sigcontext.h 2011-06-20 12:14:48.528411362 +0200 1.1 -@@ -0,0 +1,104 @@ -+/* Copyright (C) 2011 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. +commit 6e502e19455c6110dd4487d91b7b7d6d8121f9ba +Author: Ulrich Drepper +Date: Wed Jun 22 08:32:55 2011 -0400 + + Clean up after kernel sigcontext header mess + + +2011-06-21 Andreas Jaeger + + * sysdeps/unix/sysv/linux/bits/sigcontext.h: Fix definition of + NULL after inclusion of kernel headers. + + +diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h +index 67dcf94..0f5b607 100644 +--- a/sysdeps/unix/sysv/linux/bits/sigcontext.h ++++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h +@@ -1,4 +1,4 @@ +-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. ++/* Copyright (C) 1996, 1997, 1998, 2011 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 +@@ -26,4 +26,8 @@ + # define sigcontext_struct sigcontext + + # include + -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#ifndef _BITS_SIGCONTEXT_H -+#define _BITS_SIGCONTEXT_H 1 -+ -+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H -+# error "Never use directly; include instead." -+#endif -+ -+struct _fpreg -+{ -+ unsigned short significand[4]; -+ unsigned short exponent; -+}; -+ -+struct _fpxreg -+{ -+ unsigned short significand[4]; -+ unsigned short exponent; -+ unsigned short padding[3]; -+}; -+ -+struct _xmmreg -+{ -+ __uint32_t element[4]; -+}; -+ -+ -+ -+struct _fpstate -+{ -+ /* Regular FPU environment. */ -+ __uint32_t cw; -+ __uint32_t sw; -+ __uint32_t tag; -+ __uint32_t ipoff; -+ __uint32_t cssel; -+ __uint32_t dataoff; -+ __uint32_t datasel; -+ struct _fpreg _st[8]; -+ unsigned short status; -+ unsigned short magic; -+ -+ /* FXSR FPU environment. */ -+ __uint32_t _fxsr_env[6]; -+ __uint32_t mxcsr; -+ __uint32_t reserved; -+ struct _fpxreg _fxsr_st[8]; -+ struct _xmmreg _xmm[8]; -+ __uint32_t padding[56]; -+}; -+ -+#ifndef sigcontext_struct -+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but -+ we need sigcontext. Some packages have come to rely on -+ sigcontext_struct being defined on 32-bit x86, so define this for -+ their benefit. */ -+# define sigcontext_struct sigcontext -+#endif -+ -+struct sigcontext -+{ -+ unsigned short gs, __gsh; -+ unsigned short fs, __fsh; -+ unsigned short es, __esh; -+ unsigned short ds, __dsh; -+ unsigned long edi; -+ unsigned long esi; -+ unsigned long ebp; -+ unsigned long esp; -+ unsigned long ebx; -+ unsigned long edx; -+ unsigned long ecx; -+ unsigned long eax; -+ unsigned long trapno; -+ unsigned long err; -+ unsigned long eip; -+ unsigned short cs, __csh; -+ unsigned long eflags; -+ unsigned long esp_at_signal; -+ unsigned short ss, __ssh; -+ struct _fpstate * fpstate; -+ unsigned long oldmask; -+ unsigned long cr2; -+}; -+ -+ -+#endif /* _BITS_SIGCONTEXT_H */ ++/* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */ ++# define __need_NULL ++# include + #endif diff --git a/glibc.changes b/glibc.changes index b9be988..693de3d 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Mon Jun 27 11:00:33 UTC 2011 - aj@suse.de + +- Update glibc-x86-bits-sigcontext.patch with version accepted + upstream. +- Add glibc-2.15-getsysstats-speedup.patch to "Fix Linux + sysconf(_SC_NPROCESSORS_[CONF|ONLN]) performance problem" +- Fix warning about potential array subscript out of bounds + (glibc-2.13-wranings.fix). +- Fix some rpmlint warnings. + +------------------------------------------------------------------- +Tue Jun 21 10:59:33 UTC 2011 - aj@suse.de + +- Cleanup spec file, change PreReqs. +- Remove obsolete patches: glibc-2.3.90-ld.so-madvise.diff, + glibc-suse-note.diff, glibc-2.3-regcomp.diff. +- Rename glibc-2.3-SuSE.diff to glibc-testsuite.patch, remove obsolete + parts. + ------------------------------------------------------------------- Mon Jun 20 12:47:46 UTC 2011 - aj@suse.de diff --git a/glibc.spec b/glibc.spec index b7f241d..3362c14 100644 --- a/glibc.spec +++ b/glibc.spec @@ -58,12 +58,13 @@ BuildRequires: libstdc++-devel %define enablekernel 2.6.5 %endif %define exp_malloc 1 +# ngpt was used in 8.1 and SLES8 Obsoletes: ngpt < 2.2.2 Obsoletes: ngpt-devel < 2.2.2 Provides: ngpt = 2.2.2 Provides: ngpt-devel = 2.2.2 Conflicts: kernel < %{enablekernel} -# bug437293 +# bug437293 - handle update from SLES10 on PowerPC %ifarch ppc64 Obsoletes: glibc-64bit %endif @@ -84,7 +85,7 @@ Source10: bindresvport.blacklist Source12: glibc_post_upgrade.c Source15: glibc.rpmlintrc Source16: baselibs.conf -PreReq: filesystem +Requires(pre): filesystem Provides: rtld(GNU_HASH) BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %_target_cpu == "i686" @@ -93,8 +94,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build NoSource: 0 %endif # -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch0: glibc-2.3-SuSE.diff +# PATCH-FIX-OPENSUSE remove lfs test from testsuite aj@suse.de +Patch0: glibc-testsuite.patch # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch1: glibc-2.3.90-noversion.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines @@ -110,8 +111,6 @@ Patch7: glibc-version.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch8: glibc-2.4.90-revert-only-euro.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch9: glibc-2.3-regcomp.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch11: glibc-2.3.1.localedef.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch12: glibc-2.3.2.no_archive.diff @@ -120,12 +119,8 @@ Patch13: libm-x86-64.diff.bz2 # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch14: glibc-2.3.90-bindresvport.blacklist.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch15: glibc-suse-note.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch16: glibc-2.4.90-no_NO.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines -Patch17: glibc-2.3.90-ld.so-madvise.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch18: glibc-2.3.3-amd64-s_ceil.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch20: glibc-2.4-china.diff @@ -155,7 +150,7 @@ Patch33: glibc-compiled-binaries.diff Patch36: glibc-no-unwind-tables.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch37: glibc-2.10-nscd-nostack.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines +# PATCH-FEATURE-SLE increase cpusetsize to 4096, needs to be kept for compatibility kukuk@suse.de Patch38: glibc-cpusetsize.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch39: glibc-2.10.99-ia64-include.diff @@ -183,22 +178,26 @@ Patch49: glibc-fini-unwind.diff Patch50: glibc-gconvcache-s390.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch51: glibc-vfprintf-positional.diff -# FIX-OPENSUSE bnc#657627 +# PATCH-FIX-OPENSUSE bnc#657627 Patch52: glibc-elf-localscope.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines +# PATCH-FIX-UPSTREAM Fix longlong.h for zArch Patch53: glibc-zarch-longlong.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines +# PATCH-FEATURE-OPENSUSE disable backward memcpy aj@suse.de Patch54: glibc-disable-backward-memcpy.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch55: glibc-bso-12454.diff -# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines +# PATCH-FIX-UPSTREAM fix static memcpy Patch56: glibc-static-memcpy.diff # FIX-OPENSUSE compile some files with -fno-strict-aliasing Patch58: glibc-strict-aliasing.diff # PATCH-FIX-UPSTREAM fix preloading of shared libs aj@suse.de Patch59: glibc-2.13-dl-load.patch -# PATCH-FIX-UPSTREAM fix x86 aj@suse.de Patch60: glibc-x86-bits-sigcontext.patch +# PATCH-FEATURE-UPSTREAM Speedup getsysstats call aj@suse.de +Patch61: glibc-2.15-getsysstats-speedup.patch +# PATCH-FIX-UPSTREAM Fix gcc 4.6 warnings aj@suse.de +Patch62: glibc-2.13-warnings.fix # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines Patch500: ARM_glibc-2.10.1-local-eabi-wchar.diff # PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines @@ -219,7 +218,8 @@ without these libraries. License: GPLv2+ Summary: Info Files for the GNU C Library Group: Documentation/Other -PreReq: %{install_info_prereq} +Requires(post): %{install_info_prereq} +Requires(postun): %{install_info_prereq} %description info @@ -254,7 +254,7 @@ created. License: GPLv2+ ; LGPLv2.1+ Summary: Locale Data for Localized Programs Group: System/Libraries -PreReq: /bin/cat +Requires(post): /bin/cat Requires: glibc = %{version} # bug437293 %ifarch ppc64 @@ -274,7 +274,9 @@ Summary: Name Service Caching Daemon Group: System/Daemons Provides: aaa_base:/etc/init.d/nscd Provides: glibc:/usr/sbin/nscd -PreReq: %insserv_prereq +Requires(preun): %insserv_prereq +Requires(post): %insserv_prereq +Requires(postun): %insserv_prereq %description -n nscd @@ -312,8 +314,8 @@ Obsoletes: glibc-devel-64bit %ifarch ppc Obsoletes: glibc-devel-32bit %endif -PreReq: /bin/rm -Requires: glibc = %{version}, linux-kernel-headers +Requires: glibc = %{version} +Requires: linux-kernel-headers %description devel @@ -340,9 +342,9 @@ Requires: glibc = %{version} %description utils -The glibc-utils package contains memusage, a memory usage profiler, -mtrace, a memory leak tracer and xtrace, a function call tracer -which can be helpful during program debugging. +The glibc-utils package contains mtrace, a memory leak tracer and +xtrace, a function call tracer which can be helpful during program +debugging. If you are unsure if you need this, don't install this package. @@ -379,8 +381,7 @@ versions of your software. # any other leave out ports %setup -n glibc-%{version} -q -a 3 -a 4 %endif -# Seems not needed anymore -#%patch0 +%patch0 # libNoVersion part is only active on ix86 %patch1 %patch2 -p1 @@ -389,17 +390,13 @@ versions of your software. %patch5 %patch7 %patch8 -# Seems not needed anymore -#%patch9 %patch11 %patch12 %patch13 -E # We have s_sincos.c in patch13, remove duplicate rm sysdeps/x86_64/fpu/s_sincos.S %patch14 -%patch15 %patch16 -%patch17 %patch18 %patch20 %patch21 @@ -443,7 +440,9 @@ rm nscd/s-stamp %patch56 -p1 %patch58 %patch59 -p1 -%patch60 +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 %ifarch %arm armv5tel armv7l %patch500 %patch501 @@ -492,7 +491,7 @@ echo "#define CVSDATE \"`date -r ChangeLog +%Y%m%d`\"" >> version.h # # Default CFLAGS and Compiler # -BuildFlags="$RPM_OPT_FLAGS -U_FORTIFY_SOURCE" +BuildFlags="%{optflags} -U_FORTIFY_SOURCE" BuildFlags="$(echo $BuildFlags | sed -e 's#-fstack-protector##' -e 's#-ffortify=[0-9]*##')" BuildCC="gcc" BuildCCplus="g++" @@ -627,7 +626,7 @@ make -C cc-base html # # Build glibc_post_upgrade binary # -$BuildCC -static $RPM_OPT_FLAGS -Os $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_post_upgrade \ +$BuildCC -static %{optflags} -Os $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glibc_post_upgrade \ -Lcc-base -Bcc-base/csu \ '-DREMOVE_TLS_DIRS' '-DREMOVE_PPC_OPTIMIZE_POWER5' \ %ifarch ppc ppc64 @@ -644,7 +643,7 @@ $BuildCC -static $RPM_OPT_FLAGS -Os $RPM_SOURCE_DIR/glibc_post_upgrade.c -o glib '-DREMOVE_PPC_OPTIMIZE_CELL' \ %endif %endif - '-DLIBDIR="/%{_lib}"' '-DGCONV_MODULES_DIR="%{_prefix}/%{_lib}/gconv"' + '-DLIBDIR="/%{_lib}"' '-DGCONV_MODULES_DIR="%{_libdir}/gconv"' ####################################################################### ### @@ -689,12 +688,12 @@ make -C cc-base check-abi || echo check-abi failed export STRIP_KEEP_SYMTAB=*.so* # Make sure we will create the gconv-modules.cache -mkdir -p $RPM_BUILD_ROOT%{_libdir}/gconv -touch $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache +mkdir -p %{buildroot}%{_libdir}/gconv +touch %{buildroot}%{_libdir}/gconv/gconv-modules.cache # Install base glibc # Do not install in parallel, timezone Makefile will fail -make install_root=$RPM_BUILD_ROOT install -C cc-base +make install_root=%{buildroot} install -C cc-base # Install power-optimized glibc %if %{optimize_power} @@ -716,24 +715,24 @@ make install_root=$RPM_BUILD_ROOT install -C cc-base ppc-cell-be \ %endif ; do - make install_root=${RPM_BUILD_ROOT}/$pcpu install -C cc-$pcpu - mkdir -p $RPM_BUILD_ROOT/%{_lib}/$pcpu + make install_root=%{buildroot}/$pcpu install -C cc-$pcpu + mkdir -p %{buildroot}/%{_lib}/$pcpu for i in libc-%{version} libm-%{version} libpthread-%{version} libthread_db-1.0 librt-%{version}; do - mv $RPM_BUILD_ROOT/$pcpu/%{_lib}/$i.so $RPM_BUILD_ROOT/%{_lib}/$pcpu + mv %{buildroot}/$pcpu/%{_lib}/$i.so %{buildroot}/%{_lib}/$pcpu done - $my_ldconfig -n $RPM_BUILD_ROOT/%{_lib}/$pcpu/ - rm -rf $RPM_BUILD_ROOT/$pcpu + $my_ldconfig -n %{buildroot}/%{_lib}/$pcpu/ + rm -rf %{buildroot}/$pcpu done %if %{powerpc_optimize_cpu_power6} # power6 is compatible with power6x # doing a symlink doesnt work, ldconfig follows them and accepts only the first real dir - if test -d $RPM_BUILD_ROOT/%{_lib}/power6; then - mkdir -p $RPM_BUILD_ROOT/%{_lib}/power6x - for i in $RPM_BUILD_ROOT/%{_lib}/power6/*.so; do + if test -d %{buildroot}/%{_lib}/power6; then + mkdir -p %{buildroot}/%{_lib}/power6x + for i in %{buildroot}/%{_lib}/power6/*.so; do b=`basename $i` - ln -vs ../power6/$b $RPM_BUILD_ROOT/%{_lib}/power6x/$b + ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b done - $my_ldconfig -n $RPM_BUILD_ROOT/%{_lib}/power6x/ + $my_ldconfig -n %{buildroot}/%{_lib}/power6x/ fi %endif %endif # optimize_power @@ -742,7 +741,7 @@ make install_root=$RPM_BUILD_ROOT install -C cc-base %if %{build_locales} # Do not install locales in parallel! cd cc-base - make install_root=$RPM_BUILD_ROOT install-locales -C ../localedata objdir=`pwd` + make install_root=%{buildroot} install-locales -C ../localedata objdir=`pwd` cd .. %endif # Create file list for glibc-locale package @@ -751,55 +750,55 @@ make install_root=$RPM_BUILD_ROOT install -C cc-base # Prepare obsolete/, used only on some architectures: export RPM_BUILD_ROOT %ifarch %ix86 -mkdir -p $RPM_BUILD_ROOT/%{_lib}/obsolete +mkdir -p %{buildroot}/%{_lib}/obsolete %endif # NPTL is not usable outside of glibc, so include # the generic one (RH#162634) -cp -av bits/stdio-lock.h $RPM_BUILD_ROOT%{_prefix}/include/bits/stdio-lock.h +cp -av bits/stdio-lock.h %{buildroot}%{_includedir}/bits/stdio-lock.h %ifarch s390x # s390x is different ... - mkdir $RPM_BUILD_ROOT/lib - ln -sf ../%{_lib}/ld-%{version}.so $RPM_BUILD_ROOT/lib/ld64.so.1 + mkdir %{buildroot}/lib + ln -sf ../%{_lib}/ld-%{version}.so %{buildroot}/lib/ld64.so.1 %endif # Miscelanna: -install -m 0700 glibc_post_upgrade $RPM_BUILD_ROOT%{_sbindir} +install -m 0700 glibc_post_upgrade %{buildroot}%{_sbindir} -install -m 644 $RPM_SOURCE_DIR/bindresvport.blacklist $RPM_BUILD_ROOT/etc -install -m 644 $RPM_SOURCE_DIR/nsswitch.conf $RPM_BUILD_ROOT/etc -install -m 644 posix/gai.conf $RPM_BUILD_ROOT/etc +install -m 644 $RPM_SOURCE_DIR/bindresvport.blacklist %{buildroot}/etc +install -m 644 $RPM_SOURCE_DIR/nsswitch.conf %{buildroot}/etc +install -m 644 posix/gai.conf %{buildroot}/etc -mkdir -p $RPM_BUILD_ROOT/etc/default -install -m 644 nis/nss $RPM_BUILD_ROOT/etc/default/ +mkdir -p %{buildroot}/etc/default +install -m 644 nis/nss %{buildroot}/etc/default/ -mkdir -p $RPM_BUILD_ROOT/usr/include/resolv -install -m 0644 resolv/mapv4v6addr.h $RPM_BUILD_ROOT/usr/include/resolv/ -install -m 0644 resolv/mapv4v6hostent.h $RPM_BUILD_ROOT/usr/include/resolv/ +mkdir -p %{buildroot}%{_includedir}/resolv +install -m 0644 resolv/mapv4v6addr.h %{buildroot}%{_includedir}/resolv/ +install -m 0644 resolv/mapv4v6hostent.h %{buildroot}%{_includedir}/resolv/ -mkdir -p $RPM_BUILD_ROOT/usr/share/doc/glibc -cp -p manual/libc/*.html $RPM_BUILD_ROOT/usr/share/doc/glibc +mkdir -p %{buildroot}%{_datadir}/doc/glibc +cp -p manual/libc/*.html %{buildroot}%{_datadir}/doc/glibc -cd manpages; make install_root=$RPM_BUILD_ROOT install; cd .. +cd manpages; make install_root=%{buildroot} install; cd .. # nscd tools: -cp nscd/nscd.conf $RPM_BUILD_ROOT/etc -mkdir -p $RPM_BUILD_ROOT/etc/apparmor.d -cp $RPM_SOURCE_DIR/usr.sbin.nscd $RPM_BUILD_ROOT/etc/apparmor.d -mkdir -p $RPM_BUILD_ROOT/etc/init.d -install -m 755 $RPM_SOURCE_DIR/nscd.init $RPM_BUILD_ROOT/etc/init.d/nscd -ln -sf /etc/init.d/nscd $RPM_BUILD_ROOT/usr/sbin/rcnscd -mkdir -p $RPM_BUILD_ROOT/var/run/nscd -touch $RPM_BUILD_ROOT/var/run/nscd/{passwd,group,hosts} -touch $RPM_BUILD_ROOT/var/run/nscd/{socket,nscd.pid} +cp nscd/nscd.conf %{buildroot}/etc +mkdir -p %{buildroot}/etc/apparmor.d +cp $RPM_SOURCE_DIR/usr.sbin.nscd %{buildroot}/etc/apparmor.d +mkdir -p %{buildroot}/etc/init.d +install -m 755 $RPM_SOURCE_DIR/nscd.init %{buildroot}/etc/init.d/nscd +ln -sf /etc/init.d/nscd %{buildroot}/usr/sbin/rcnscd +mkdir -p %{buildroot}/var/run/nscd +touch %{buildroot}/var/run/nscd/{passwd,group,hosts} +touch %{buildroot}/var/run/nscd/{socket,nscd.pid} # # Create ld.so.conf # -cat > $RPM_BUILD_ROOT/etc/ld.so.conf < %{buildroot}/etc/ld.so.conf < $RPM_BUILD_ROOT/etc/ld.so.conf <