diff --git a/build-locale-archive.c b/build-locale-archive.c index 187c7e5..fde71d6 100644 --- a/build-locale-archive.c +++ b/build-locale-archive.c @@ -12,10 +12,10 @@ #include #include #include -#include "../locale/hashval.h" +#include "locale/hashval.h" #define __LC_LAST 13 -#include "../locale/locarchive.h" -#include "../crypt/md5.h" +#include "locale/locarchive.h" +#include "crypt/md5.h" const char *alias_file = DATADIR "/locale/locale.alias"; const char *locar_file = PREFIX "/lib/locale/locale-archive"; @@ -36,7 +36,7 @@ static const char *locnames[] = { #define DEFINE_CATEGORY(category, category_name, items, a) \ [category] = category_name, -#include "../locale/categories.def" +#include "locale/categories.def" #undef DEFINE_CATEGORY }; @@ -147,7 +147,7 @@ extern void add_alias (struct locarhandle *ah, const char *alias, bool replace, const char *oldname, uint32_t *locrec_offset_p); -extern struct namehashent * +static struct namehashent * insert_name (struct locarhandle *ah, const char *name, size_t name_len, bool replace); diff --git a/eglibc-2.15-use-usrbin-localedef.patch b/eglibc-2.15-use-usrbin-localedef.patch deleted file mode 100644 index e7e94da..0000000 --- a/eglibc-2.15-use-usrbin-localedef.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -Naur eglibc-2.15.old/localedata/Makefile eglibc-2.15/localedata/Makefile ---- eglibc-2.15.old/localedata/Makefile 2011-11-17 21:56:08.000000000 +0000 -+++ eglibc-2.15/localedata/Makefile 2013-03-18 15:25:40.078955980 +0000 -@@ -159,7 +159,11 @@ - # Dependency for the locale files. We actually make it depend only on - # one of the files. - $(addprefix $(objpfx),$(CTYPE_FILES)): %: \ -- gen-locale.sh $(common-objpfx)locale/localedef Makefile \ -+ if [ -f /usr/bin/localedef ]; then \ -+ gen-locale.sh /usr/bin/localedef Makefile \ -+ else \ -+ gen-locale.sh $(common-objpfx)locale/localedef Makefile \ -+ fi\ - $(addprefix charmaps/,$(CHARMAPS)) $(addprefix locales/,$(LOCALE_SRCS)) - @$(SHELL) -e gen-locale.sh $(common-objpfx) \ - '$(if $(cross-localedef), \ -@@ -235,8 +239,12 @@ - INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES)) - - # Sometimes the whole collection of locale files should be installed. --LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ --$(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef -+ifeq (,$(wildcard /usr/bin/localedef)) -+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C $(common-objpfx)elf/ld.so --library-path $(rpath-link) $(common-objpfx)locale/localedef -+else -+LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C /usr/bin/localedef -+endif -+ - install-locales: $(INSTALL-SUPPORTED-LOCALES) - - install-locales-dir: diff --git a/eglibc-2.19-sb2-workaround.patch b/eglibc-2.19-sb2-workaround.patch deleted file mode 100644 index 3a628ad..0000000 --- a/eglibc-2.19-sb2-workaround.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c b/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c -index 490bd43..7f2505f 100644 ---- a/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c -+++ b/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c -@@ -21,4 +21,4 @@ - /* We can't use the normal "#include " because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ --#include -+#include -diff --git a/ports/sysdeps/arm/nptl/pthread_spin_lock.c b/ports/sysdeps/arm/nptl/pthread_spin_lock.c -index 7105c73..795db52 100644 ---- a/ports/sysdeps/arm/nptl/pthread_spin_lock.c -+++ b/ports/sysdeps/arm/nptl/pthread_spin_lock.c -@@ -20,4 +20,4 @@ - /* We can't use the normal "#include " because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ --#include -+#include -diff --git a/ports/sysdeps/mips/nptl/pthread_spin_lock.c b/ports/sysdeps/mips/nptl/pthread_spin_lock.c -index f3e718c..a6c4ca3 100644 ---- a/ports/sysdeps/mips/nptl/pthread_spin_lock.c -+++ b/ports/sysdeps/mips/nptl/pthread_spin_lock.c -@@ -20,4 +20,5 @@ - /* We can't use the normal "#include " because - it will resolve to this very file. Using "sysdeps/.." as reference to the - top level directory does the job. */ --#include -+#include -+ diff --git a/eglibc_2.19-0ubuntu6.13.debian.tar.xz b/eglibc_2.19-0ubuntu6.13.debian.tar.xz deleted file mode 100644 index a921aa4..0000000 Binary files a/eglibc_2.19-0ubuntu6.13.debian.tar.xz and /dev/null differ diff --git a/glibc-2.13-no-timestamping.patch b/glibc-2.13-no-timestamping.patch deleted file mode 100644 index e1f2328..0000000 --- a/glibc-2.13-no-timestamping.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -ru glibc-2.13/csu/Makefile glibc-2.13-no-timestamping/csu/Makefile ---- glibc-2.13/csu/Makefile 2011-01-18 05:34:07.000000000 +0100 -+++ glibc-2.13-no-timestamping/csu/Makefile 2011-08-23 17:07:34.363191368 +0200 -@@ -234,8 +234,8 @@ - if [ -z "$$os" ]; then \ - os=Linux; \ - fi; \ -- printf '"Compiled on a %s %s system on %s.\\n"\n' \ -- "$$os" "$$version" "`date +%Y-%m-%d`";; \ -+ printf '"Compiled on OBS, see rpm -q glibc for more information\\n"\n' \ -+ ;; \ - *) ;; \ - esac; \ - files="$(all-Banner-files)"; \ -Only in glibc-2.13-no-timestamping/csu: Makefile~ -diff -ru glibc-2.13/nscd/nscd_stat.c glibc-2.13-no-timestamping/nscd/nscd_stat.c ---- glibc-2.13/nscd/nscd_stat.c 2011-08-24 07:43:18.419464199 +0200 -+++ glibc-2.13-no-timestamping/nscd/nscd_stat.c 2011-08-24 07:43:52.837209224 +0200 -@@ -38,7 +38,7 @@ - - - /* We use this to make sure the receiver is the same. */ --static const char compilation[21] = __DATE__ " " __TIME__; -+static const char compilation[21] = "built on OBS"; - - /* Statistic data for one database. */ - struct dbstat diff --git a/glibc-arm-runfast.patch b/glibc-2.25-arm-runfast.patch similarity index 70% rename from glibc-arm-runfast.patch rename to glibc-2.25-arm-runfast.patch index a9627dd..a4d9d1a 100644 --- a/glibc-arm-runfast.patch +++ b/glibc-2.25-arm-runfast.patch @@ -4,20 +4,18 @@ diff -ru eglibc-2.18/csu/init-first.c eglibc-2.18-runfast/csu/init-first.c @@ -69,6 +69,9 @@ __setfpucw (__fpu_control); } - + + /* Set the default FPU mode once again it is RunFast */ + _FPU_SETCW(_FPU_DEFAULT); + /* Save the command-line arguments. */ __libc_argc = argc; __libc_argv = argv; -Only in eglibc-2.18-runfast/ports/sysdeps/arm: .fpu_control.h.rej.swp -diff -ru eglibc-2.18/ports/sysdeps/arm/fpu_control.h eglibc-2.18-runfast/ports/sysdeps/arm/fpu_control.h --- eglibc-2.18/ports/sysdeps/arm/fpu_control.h 2013-06-24 22:42:26.000000000 +0000 -+++ eglibc-2.18-runfast/ports/sysdeps/arm/fpu_control.h 2014-01-01 11:06:13.000000000 +0000 ++++ eglibc-2.18-runfast/sysdeps/arm/fpu_control.h 2014-01-01 11:06:13.000000000 +0000 @@ -22,7 +22,8 @@ #if !(defined(_LIBC) && !defined(_LIBC_TEST)) && defined(__SOFTFP__) - + #define _FPU_RESERVED 0xffffffff -#define _FPU_DEFAULT 0x00000000 +#define _FPU_DEFAULT (3 << 24) @@ -25,19 +23,17 @@ diff -ru eglibc-2.18/ports/sysdeps/arm/fpu_control.h eglibc-2.18-runfast/ports/s typedef unsigned int fpu_control_t; #define _FPU_GETCW(cw) (cw) = 0 #define _FPU_SETCW(cw) (void) (cw) -@@ -40,9 +41,11 @@ +@@ -44,10 +45,11 @@ extern fpu_control_t __fpu_control; /* Some bits in the FPSCR are not yet defined. They must be preserved when modifying the contents. */ #define _FPU_RESERVED 0x00086060 -#define _FPU_DEFAULT 0x00000000 +/* The default mode is RunFast */ -+#define _FPU_DEFAULT (3 << 24) -+ - /* Default + exceptions enabled. */ ++#define _FPU_DEFAULT (3 << 24) + + /* Default + exceptions enabled. */ -#define _FPU_IEEE (_FPU_DEFAULT | 0x00001f00) +#define _FPU_IEEE 0x00001f00 - + /* Type of the control word. */ typedef unsigned int fpu_control_t; -Only in eglibc-2.18-runfast/ports/sysdeps/arm: fpu_control.h.orig -Only in eglibc-2.18-runfast/ports/sysdeps/arm: fpu_control.h.rej diff --git a/glibc-2.25-bits.patch b/glibc-2.25-bits.patch new file mode 100644 index 0000000..de6014f --- /dev/null +++ b/glibc-2.25-bits.patch @@ -0,0 +1,133 @@ +--- glibc-2.25/bits/wordsize.h.bak 2018-11-08 15:12:14.756848932 +0200 ++++ glibc-2.25/bits/wordsize.h 2018-11-08 15:13:00.505009458 +0200 +@@ -1,27 +1,25 @@ +-#error "This file must be written based on the data type sizes of the target" +- + /* The following entries are a template for what defines should be in the + wordsize.h header file for a target. */ + + /* Size in bits of the 'long int' and pointer types. */ +-#define __WORDSIZE ++#define __WORDSIZE 32 + + /* This should be set to 1 if __WORDSIZE is 32 and size_t is type + 'unsigned long' instead of type 'unsigned int'. This will ensure + that SIZE_MAX is defined as an unsigned long constant instead of an + unsigned int constant. Set to 0 if __WORDSIZE is 32 and size_t is + 'unsigned int' and leave undefined if __WORDSIZE is 64. */ +-#define __WORDSIZE32_SIZE_ULONG ++#define __WORDSIZE32_SIZE_ULONG 0 + + /* This should be set to 1 if __WORDSIZE is 32 and ptrdiff_t is type 'long' + instead of type 'int'. This will ensure that PTRDIFF_MIN and PTRDIFF_MAX + are defined as long constants instead of int constants. Set to 0 if + __WORDSIZE is 32 and ptrdiff_t is type 'int' and leave undefined if + __WORDSIZE is 64. */ +-#define __WORDSIZE32_PTRDIFF_LONG ++#define __WORDSIZE32_PTRDIFF_LONG 0 + + /* Set to 1 in order to force time types to be 32 bits instead of 64 bits in + struct lastlog and struct utmp{,x} on 64-bit ports. This may be done in + order to make 64-bit ports compatible with 32-bit ports. Set to 0 for + 64-bit ports where the time types are 64-bits or for any 32-bit ports. */ +-#define __WORDSIZE_TIME64_COMPAT32 ++#define __WORDSIZE_TIME64_COMPAT32 0 +--- glibc-2.25/bits/errno.h.bak 2018-11-08 14:32:39.009340807 +0200 ++++ glibc-2.25/bits/errno.h 2018-11-08 14:43:21.450954354 +0200 +@@ -1,4 +1,5 @@ +-/* Copyright (C) 1991-2017 Free Software Foundation, Inc. ++/* Error constants. Linux specific version. ++ Copyright (C) 1996-2014 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 +@@ -15,20 +16,51 @@ + License along with the GNU C Library; if not, see + . */ + +-/* This file defines the `errno' constants. */ ++#ifdef _ERRNO_H + +-#if !defined __Emath_defined && (defined _ERRNO_H || defined __need_Emath) +-#undef __need_Emath +-#define __Emath_defined 1 +- +-# define EDOM XXX <--- fill in what is actually needed +-# define EILSEQ XXX <--- fill in what is actually needed +-# define ERANGE XXX <--- fill in what is actually needed +-#endif +- +-#ifdef _ERRNO_H +-# error "Define here all the missing error messages for the port. These" +-# error "must match the numbers of the kernel." +-# define Exxxx XXX +-... +-#endif ++# undef EDOM ++# undef EILSEQ ++# undef ERANGE ++# include ++ ++/* Linux has no ENOTSUP error code. */ ++# define ENOTSUP EOPNOTSUPP ++ ++/* Older Linux versions also had no ECANCELED error code. */ ++# ifndef ECANCELED ++# define ECANCELED 125 ++# endif ++ ++/* Support for error codes to support robust mutexes was added later, too. */ ++# ifndef EOWNERDEAD ++# define EOWNERDEAD 130 ++# define ENOTRECOVERABLE 131 ++# endif ++ ++# ifndef ERFKILL ++# define ERFKILL 132 ++# endif ++ ++# ifndef EHWPOISON ++# define EHWPOISON 133 ++# endif ++ ++# ifndef __ASSEMBLER__ ++/* Function to get address of global `errno' variable. */ ++extern int *__errno_location (void) __THROW __attribute__ ((__const__)); ++ ++# if !defined _LIBC || defined _LIBC_REENTRANT ++/* When using threads, errno is a per-thread value. */ ++# define errno (*__errno_location ()) ++# endif ++# endif /* !__ASSEMBLER__ */ ++#endif /* _ERRNO_H */ ++ ++#if !defined _ERRNO_H && defined __need_Emath ++/* This is ugly but the kernel header is not clean enough. We must ++ define only the values EDOM, EILSEQ and ERANGE in case __need_Emath is ++ defined. */ ++# define EDOM 33 /* Math argument out of domain of function. */ ++# define EILSEQ 84 /* Illegal byte sequence. */ ++# define ERANGE 34 /* Math result not representable. */ ++#endif /* !_ERRNO_H && __need_Emath */ +--- glibc-2.25/bits/endian.h.bak 2018-11-08 15:51:55.110637120 +0200 ++++ glibc-2.25/bits/endian.h 2018-11-08 15:52:20.538742585 +0200 +@@ -1,13 +1,10 @@ +-/* This file should define __BYTE_ORDER as appropriate for the machine +- in question. See string/endian.h for how to define it. +- +- If only the stub bits/endian.h applies to a particular configuration, +- bytesex.h is generated by running a program on the host machine. +- So if cross-compiling to a machine with a different byte order, +- the bits/endian.h file for that machine must exist. */ +- + #ifndef _ENDIAN_H + # error "Never use directly; include instead." + #endif + +-#error Machine byte order unknown. ++/* ARM can be either big or little endian. */ ++#ifdef __ARMEB__ ++#define __BYTE_ORDER __BIG_ENDIAN ++#else ++#define __BYTE_ORDER __LITTLE_ENDIAN ++#endif diff --git a/glibc-2.14.1-elf-rtld.c.1.diff b/glibc-2.25-elf-rtld.diff similarity index 83% rename from glibc-2.14.1-elf-rtld.c.1.diff rename to glibc-2.25-elf-rtld.diff index 3cec667..93b4f88 100644 --- a/glibc-2.14.1-elf-rtld.c.1.diff +++ b/glibc-2.25-elf-rtld.diff @@ -2,42 +2,41 @@ diff -ur glibc-2.14.1-orig/elf/rtld.c glibc-2.14.1/elf/rtld.c --- glibc-2.14.1-orig/elf/rtld.c 2011-10-07 12:48:55.000000000 +0300 +++ glibc-2.14.1/elf/rtld.c 2011-11-16 17:00:19.000000000 +0200 @@ -930,6 +930,7 @@ - + if (*user_entry == (ElfW(Addr)) ENTRY_POINT) { -+ const char *forced_argv0 = NULL; ++ char *forced_argv0 = NULL; /* Ho ho. We are not the program interpreter! We are the program itself! This means someone ran ld.so as a command. Well, that might be convenient to do sometimes. We support it by @@ -994,6 +995,14 @@ _dl_argc -= 2; - INTUSE(_dl_argv) += 2; + _dl_argv += 2; } -+ else if (! strcmp (INTUSE(_dl_argv)[1], "--argv0") && _dl_argc > 2) ++ else if (! strcmp (_dl_argv[1], "--argv0") && _dl_argc > 2) + { -+ forced_argv0 = INTUSE(_dl_argv)[2]; ++ forced_argv0 = _dl_argv[2]; + + _dl_skip_args += 2; + _dl_argc -= 2; -+ INTUSE(_dl_argv) += 2; ++ _dl_argv += 2; + } else break; - + @@ -1021,6 +1030,7 @@ variable LD_LIBRARY_PATH\n\ --inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\ in LIST\n\ + --argv0 STRING use STRING as argv[0]\n\ --audit LIST use objects named in LIST as auditors\n"); - + ++_dl_skip_args; @@ -1073,6 +1083,8 @@ HP_TIMING_DIFF (load_time, start, stop); } - + + if (forced_argv0 != NULL) _dl_argv[0] = forced_argv0; + /* Now the map for the main executable is available. */ main_map = GL(dl_ns)[LM_ID_BASE]._ns_loaded; - diff --git a/glibc-2.19-ldso-nodefaultdirs-option.5.diff b/glibc-2.25-ldso-nodefaultdirs-option.diff similarity index 83% rename from glibc-2.19-ldso-nodefaultdirs-option.5.diff rename to glibc-2.25-ldso-nodefaultdirs-option.diff index 51e7229..7d5f5d1 100644 --- a/glibc-2.19-ldso-nodefaultdirs-option.5.diff +++ b/glibc-2.25-ldso-nodefaultdirs-option.diff @@ -3,12 +3,12 @@ index 49f070f..621b5a3 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -2279,7 +2279,8 @@ _dl_map_object (struct link_map *loader, const char *name, - + /* If the loader has the DF_1_NODEFLIB flag set we must not use a cache entry from any of these directories. */ -- if (__builtin_expect (l->l_flags_1 & DF_1_NODEFLIB, 0)) -+ if (__builtin_expect (((l->l_flags_1 & DF_1_NODEFLIB) || -+ GLRO(dl_no_default_dirs)), 0)) +- if (__glibc_unlikely (l->l_flags_1 & DF_1_NODEFLIB)) ++ if (__glibc_unlikely (l->l_flags_1 & DF_1_NODEFLIB) || ++ GLRO(dl_no_default_dirs)) { const char *dirp = system_dirs; unsigned int cnt = 0; @@ -16,20 +16,20 @@ index 49f070f..621b5a3 100644 /* Finally, try the default path. */ if (fd == -1 && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL -- || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1)) -+ || __builtin_expect (!((l->l_flags_1 & DF_1_NODEFLIB) || -+ GLRO(dl_no_default_dirs)), 1)) +- || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB))) ++ || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)) || ++ GLRO(dl_no_default_dirs)) && rtld_search_dirs.dirs != (void *) -1) fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs, &realname, &fb, l, LA_SER_DEFAULT, &found_other_class); @@ -2487,7 +2489,7 @@ _dl_rtld_di_serinfo (struct link_map *loader, Dl_serinfo *si, bool counting) a way to indicate that in the results for Dl_serinfo. */ - + /* Finally, try the default path. */ - if (!(loader->l_flags_1 & DF_1_NODEFLIB)) + if (!((loader->l_flags_1 & DF_1_NODEFLIB) || GLRO(dl_no_default_dirs))) - add_path (&rtld_search_dirs, XXX_default); - + add_path (&p, &rtld_search_dirs, XXX_default); + if (counting) diff --git a/elf/dl-support.c b/elf/dl-support.c index 723814a..fccc1d4 100644 @@ -38,31 +38,31 @@ index 723814a..fccc1d4 100644 @@ -61,6 +61,9 @@ const char *_dl_inhibit_rpath; /* prefix to be added to all RUNPATHs and RPATHs */ const char *_dl_rpath_prefix = NULL; - + +/* flag: don't search default directories if set. */ +int _dl_no_default_dirs = 0; + /* The map for the object we will profile. */ struct link_map *_dl_profile_map; - + diff --git a/elf/rtld.c b/elf/rtld.c index ea3af55..75a2415 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -976,6 +976,15 @@ dl_main (const ElfW(Phdr) *phdr, --_dl_argc; - ++INTUSE(_dl_argv); + ++_dl_argv; } -+ else if (! strcmp (INTUSE(_dl_argv)[1], "--nodefaultdirs") ++ else if (! strcmp (_dl_argv[1], "--nodefaultdirs") + && _dl_argc > 2) + { + GLRO(dl_no_default_dirs) = 1; + + ++_dl_skip_args; + --_dl_argc; -+ ++INTUSE(_dl_argv); ++ ++_dl_argv; + } - else if (! strcmp (INTUSE(_dl_argv)[1], "--library-path") + else if (! strcmp (_dl_argv[1], "--library-path") && _dl_argc > 2) { @@ -1034,6 +1043,7 @@ of this helper program; chances are you did not intend to run this program.\n\ @@ -80,7 +80,7 @@ index 3116188..0759694 100644 @@ -559,6 +559,8 @@ struct rtld_global_ro platforms. */ EXTERN uint64_t _dl_hwcap2; - + + EXTERN int _dl_no_default_dirs; + #ifdef SHARED diff --git a/glibc-2.19-ldso-rpath-prefix-option.2.diff b/glibc-2.25-ldso-rpath-prefix-option.diff similarity index 92% rename from glibc-2.19-ldso-rpath-prefix-option.2.diff rename to glibc-2.25-ldso-rpath-prefix-option.diff index 0dc4e91..fb6d22d 100644 --- a/glibc-2.19-ldso-rpath-prefix-option.2.diff +++ b/glibc-2.25-ldso-rpath-prefix-option.diff @@ -13,7 +13,7 @@ Index: eglibc-2.19/elf/dl-load.c size_t nelems = 0; @@ -520,9 +520,23 @@ fillin_rpath (char *rpath, struct r_sear } - + /* See if this directory is already known. */ - for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next) - if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0) @@ -35,7 +35,7 @@ Index: eglibc-2.19/elf/dl-load.c + if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0) + break; + } - + if (dirp != NULL) { @@ -540,22 +554,43 @@ fillin_rpath (char *rpath, struct r_sear @@ -45,12 +45,12 @@ Index: eglibc-2.19/elf/dl-load.c + size_t rpath_prefix_len = 0; + + if (__builtin_expect (rpath_prefix != NULL, 0) -+ && !INTUSE(__libc_enable_secure)) ++ && !__libc_enable_secure) + { + rpath_prefix_len = strlen (rpath_prefix); + if (*cp != '/') rpath_prefix_len++; /* need to add a '/' */ + } - + /* It's a new directory. Create an entry and add it. */ dirp = (struct r_search_path_elem *) malloc (sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status) @@ -59,7 +59,7 @@ Index: eglibc-2.19/elf/dl-load.c if (dirp == NULL) _dl_signal_error (ENOMEM, NULL, NULL, N_("cannot create cache for search path")); - + dirp->dirname = ((char *) dirp + sizeof (*dirp) + ncapstr * sizeof (enum r_dir_status)); - *((char *) __mempcpy ((char *) dirp->dirname, cp, len)) = '\0'; @@ -79,18 +79,18 @@ Index: eglibc-2.19/elf/dl-load.c + *((char *) __mempcpy (prefixend, cp, len)) = '\0'; + } + dirp->dirnamelen = len + rpath_prefix_len; - + - if (len > max_dirnamelen) - max_dirnamelen = len; + if ((len + rpath_prefix_len) > max_dirnamelen) + max_dirnamelen = len + rpath_prefix_len; - + /* We have to make sure all the relative directories are never ignored. The current directory might change and @@ -566,7 +601,8 @@ fillin_rpath (char *rpath, struct r_sear - + dirp->what = what; - if (__builtin_expect (where != NULL, 1)) + if (__glibc_likely (where != NULL)) - dirp->where = memcpy ((char *) dirp + sizeof (*dirp) + len + 1 + dirp->where = memcpy ((char *) dirp + sizeof (*dirp) + + rpath_prefix_len + len + 1 @@ -100,19 +100,19 @@ Index: eglibc-2.19/elf/dl-load.c @@ -668,7 +704,7 @@ decompose_rpath (struct r_search_path_st _dl_signal_error (ENOMEM, NULL, NULL, errstring); } - + - fillin_rpath (copy, result, ":", 0, what, where, l); + fillin_rpath (copy, result, ":", 0, what, where, l, GLRO(dl_rpath_prefix)); - + /* Free the copied RPATH string. `fillin_rpath' make own copies if necessary. */ @@ -871,7 +907,7 @@ _dl_init_paths (const char *llp) - + (void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;", - INTUSE(__libc_enable_secure), "LD_LIBRARY_PATH", + __libc_enable_secure, "LD_LIBRARY_PATH", - NULL, l); + NULL, l, NULL/*no prefix*/); - + if (env_path_list.dirs[0] == NULL) { Index: eglibc-2.19/elf/dl-support.c @@ -122,33 +122,33 @@ Index: eglibc-2.19/elf/dl-support.c @@ -61,6 +61,9 @@ const char *_dl_profile_output; ignored. */ const char *_dl_inhibit_rpath; - + +/* prefix to be added to all RUNPATHs and RPATHs */ +const char *_dl_rpath_prefix = NULL; + /* The map for the object we will profile. */ struct link_map *_dl_profile_map; - + Index: eglibc-2.19/elf/rtld.c =================================================================== --- eglibc-2.19.orig/elf/rtld.c +++ eglibc-2.19/elf/rtld.c @@ -991,6 +991,15 @@ dl_main (const ElfW(Phdr) *phdr, _dl_argc -= 2; - INTUSE(_dl_argv) += 2; + _dl_argv += 2; } -+ else if (! strcmp (INTUSE(_dl_argv)[1], "--rpath-prefix") ++ else if (! strcmp (_dl_argv[1], "--rpath-prefix") + && _dl_argc > 2) + { -+ GLRO(dl_rpath_prefix) = INTUSE(_dl_argv)[2]; ++ GLRO(dl_rpath_prefix) = _dl_argv[2]; + + _dl_skip_args += 2; + _dl_argc -= 2; -+ INTUSE(_dl_argv) += 2; ++ _dl_argv += 2; + } - else if (! strcmp (INTUSE(_dl_argv)[1], "--audit") && _dl_argc > 2) + else if (! strcmp (_dl_argv[1], "--audit") && _dl_argc > 2) { - process_dl_audit (INTUSE(_dl_argv)[2]); + process_dl_audit (_dl_argv[2]); @@ -1025,6 +1034,7 @@ of this helper program; chances are you --inhibit-cache Do not use " LD_SO_CACHE "\n\ --library-path PATH use given PATH instead of content of the environment\n\ diff --git a/glibc-2.25-no-timestamping.patch b/glibc-2.25-no-timestamping.patch new file mode 100644 index 0000000..3301713 --- /dev/null +++ b/glibc-2.25-no-timestamping.patch @@ -0,0 +1,12 @@ +diff -ru glibc-2.13/nscd/nscd_stat.c glibc-2.13-no-timestamping/nscd/nscd_stat.c +--- glibc-2.13/nscd/nscd_stat.c 2011-08-24 07:43:18.419464199 +0200 ++++ glibc-2.13-no-timestamping/nscd/nscd_stat.c 2011-08-24 07:43:52.837209224 +0200 +@@ -38,7 +38,7 @@ + + + /* We use this to make sure the receiver is the same. */ +-static const char compilation[21] = __DATE__ " " __TIME__; ++static const char compilation[21] = "built on OBS"; + + /* Statistic data for one database. */ + struct dbstat diff --git a/glibc-2.14.1-nscd-socket-location.4.diff b/glibc-2.25-nscd-socket-location.diff similarity index 98% rename from glibc-2.14.1-nscd-socket-location.4.diff rename to glibc-2.25-nscd-socket-location.diff index 5e3e5d4..cfc83e4 100644 --- a/glibc-2.14.1-nscd-socket-location.4.diff +++ b/glibc-2.25-nscd-socket-location.diff @@ -4,7 +4,7 @@ diff -ur glibc-2.14.1+p3/nscd/connections.c glibc-2.14.1/nscd/connections.c @@ -502,6 +502,20 @@ return 0; } - + +int __nscd_get_socket_path(char *buf, size_t bufsiz) +{ + const char *ext_nscd_socket_path = getenv ("NSCD_SOCKET_PATH"); @@ -19,7 +19,7 @@ diff -ur glibc-2.14.1+p3/nscd/connections.c glibc-2.14.1/nscd/connections.c + return 0; +} + - + #ifdef O_CLOEXEC # define EXTRA_O_FLAGS O_CLOEXEC @@ -900,10 +914,15 @@ @@ -37,16 +37,16 @@ diff -ur glibc-2.14.1+p3/nscd/connections.c glibc-2.14.1/nscd/connections.c { - dbg_log ("%s: %s", _PATH_NSCDSOCKET, strerror (errno)); + dbg_log ("%s: %s", sock_addr.sun_path, strerror (errno)); - exit (errno == EACCES ? 4 : 1); + do_exit (errno == EACCES ? 4 : 1, 0, NULL); } - + @@ -930,7 +949,7 @@ #endif - + /* Set permissions for the socket. */ - chmod (_PATH_NSCDSOCKET, DEFFILEMODE); + chmod (sock_addr.sun_path, DEFFILEMODE); - + /* Set the socket up to accept connections. */ if (listen (sock, SOMAXCONN) < 0) diff -ur glibc-2.14.1+p3/nscd/nscd.c glibc-2.14.1/nscd/nscd.c @@ -55,7 +55,7 @@ diff -ur glibc-2.14.1+p3/nscd/nscd.c glibc-2.14.1/nscd/nscd.c @@ -126,6 +126,8 @@ /* True if only statistics are requested. */ static bool get_stats; - + +extern int __nscd_get_socket_path(char *buf, size_t bufsiz); + int @@ -63,7 +63,7 @@ diff -ur glibc-2.14.1+p3/nscd/nscd.c glibc-2.14.1/nscd/nscd.c { @@ -270,7 +272,11 @@ signal (SIGPIPE, SIG_IGN); - + /* Cleanup files created by a previous 'bind'. */ - unlink (_PATH_NSCDSOCKET); + { @@ -71,12 +71,12 @@ diff -ur glibc-2.14.1+p3/nscd/nscd.c glibc-2.14.1/nscd/nscd.c + if (__nscd_get_socket_path (addr.sun_path, sizeof(addr.sun_path)) >= 0) + unlink (addr.sun_path); + } - + /* Make sure we do not get recursive calls. */ __nss_disable_nscd (); @@ -448,8 +454,12 @@ return -1; - + addr.sun_family = AF_UNIX; - assert (sizeof (addr.sun_path) >= sizeof (_PATH_NSCDSOCKET)); - strcpy (addr.sun_path, _PATH_NSCDSOCKET); @@ -96,12 +96,12 @@ diff -ur glibc-2.14.1+p3/nscd/nscd.c glibc-2.14.1/nscd/nscd.c + struct sockaddr_un addr; + close_sockets (); - + /* Clean up the file created by 'bind'. */ - unlink (_PATH_NSCDSOCKET); + if (__nscd_get_socket_path (addr.sun_path, sizeof(addr.sun_path)) >= 0) + unlink (addr.sun_path); - + /* Clean up pid file. */ unlink (_PATH_NSCDPID); diff -ur glibc-2.14.1+p3/nscd/nscd_helper.c glibc-2.14.1/nscd/nscd_helper.c @@ -110,7 +110,7 @@ diff -ur glibc-2.14.1+p3/nscd/nscd_helper.c glibc-2.14.1/nscd/nscd_helper.c @@ -159,6 +159,19 @@ return ret; } - + +static int nscd_get_socket_path(char *buf, size_t bufsiz) +{ + const char *ext_nscd_socket_path = getenv ("NSCD_SOCKET_PATH"); @@ -124,11 +124,11 @@ diff -ur glibc-2.14.1+p3/nscd/nscd_helper.c glibc-2.14.1/nscd/nscd_helper.c + if (sizeof(_PATH_NSCDSOCKET) >= bufsiz) return -1; + return 0; +} - + static int open_socket (request_type type, const char *key, size_t keylen) @@ -203,7 +216,8 @@ - + struct sockaddr_un sun; sun.sun_family = AF_UNIX; - strcpy (sun.sun_path, _PATH_NSCDSOCKET); diff --git a/eglibc-2.15-nsswitchconf-location.3.diff b/glibc-2.25-nsswitchconf-location.diff similarity index 51% rename from eglibc-2.15-nsswitchconf-location.3.diff rename to glibc-2.25-nsswitchconf-location.diff index c1f997e..9899e0a 100644 --- a/eglibc-2.15-nsswitchconf-location.3.diff +++ b/glibc-2.25-nsswitchconf-location.diff @@ -1,34 +1,30 @@ diff -ru eglibc-2.15/nss/nsswitch.c eglibc-2.15-nsswitch/nss/nsswitch.c --- eglibc-2.15/nss/nsswitch.c 2011-11-17 22:56:08.000000000 +0100 +++ eglibc-2.15-nsswitch/nss/nsswitch.c 2012-02-22 10:38:02.004928523 +0100 -@@ -53,6 +53,8 @@ - See ../option-groups.def for the details. */ - #if __OPTION_EGLIBC_NSSWITCH - +@@ -41,6 +41,8 @@ + #include "../nscd/nscd_proto.h" + #include + +#include /* __libc_enable_secure */ + /* Prototypes for the local functions. */ static name_database *nss_parse_file (const char *fname) internal_function; static name_database_entry *nss_getline (char *line) internal_function; -@@ -141,8 +143,16 @@ - #if __OPTION_EGLIBC_NSSWITCH +@@ -121,8 +123,16 @@ __nss_database_lookup (const char *datab + /* Are we initialized yet? */ if (service_table == NULL) -- /* Read config file. */ -- service_table = nss_parse_file (_PATH_NSSWITCH_CONF); ++ { ++ const char *ext_nss_config_file = NULL; ++ if (__libc_enable_secure == 0) + { -+ const char *ext_nss_config_file = NULL; -+ if (__libc_enable_secure == 0) -+ { -+ ext_nss_config_file = getenv ("NSSWITCH_CONF_PATH"); -+ } -+ /* Read config file. */ -+ service_table = nss_parse_file (ext_nss_config_file ? -+ ext_nss_config_file : _PATH_NSSWITCH_CONF); ++ ext_nss_config_file = getenv ("NSSWITCH_CONF_PATH"); + } - #endif - + /* Read config file. */ +- service_table = nss_parse_file (_PATH_NSSWITCH_CONF); ++ service_table = nss_parse_file (ext_nss_config_file ? ++ ext_nss_config_file : _PATH_NSSWITCH_CONF); ++ } + /* Test whether configuration data is available. */ -Only in eglibc-2.15-nsswitch/nss: nsswitch.c~ -Only in eglibc-2.15-nsswitch/nss: nsswitch.c.orig -Only in eglibc-2.15-nsswitch/nss: nsswitch.c.rej + if (service_table != NULL) diff --git a/glibc-2.25-posix-spawn-fix.patch b/glibc-2.25-posix-spawn-fix.patch new file mode 100644 index 0000000..f7a8037 --- /dev/null +++ b/glibc-2.25-posix-spawn-fix.patch @@ -0,0 +1,141 @@ +From fe05e1cb6d64dba6172249c79526f1e9af8f2bfd Mon Sep 17 00:00:00 2001 +From: Adhemerval Zanella +Date: Thu, 12 Oct 2017 15:20:57 -0300 +Subject: [PATCH] posix: Fix improper assert in Linux posix_spawn (BZ#22273) + +As noted by Florian Weimer, current Linux posix_spawn implementation +can trigger an assert if the auxiliary process is terminated before +actually setting the err member: + + 340 /* Child must set args.err to something non-negative - we rely on + 341 the parent and child sharing VM. */ + 342 args.err = -1; + [...] + 362 new_pid = CLONE (__spawni_child, STACK (stack, stack_size), stack_size, + 363 CLONE_VM | CLONE_VFORK | SIGCHLD, &args); + 364 + 365 if (new_pid > 0) + 366 { + 367 ec = args.err; + 368 assert (ec >= 0); + +Another possible issue is killing the child between setting the err and +actually calling execve. In this case the process will not ran, but +posix_spawn also will not report any error: + + 269 + 270 args->err = 0; + 271 args->exec (args->file, args->argv, args->envp); + +As suggested by Andreas Schwab, this patch removes the faulty assert +and also handles any signal that happens before fork and execve as the +spawn was successful (and thus relaying the handling to the caller to +figure this out). Different than Florian, I can not see why using +atomics to set err would help here, essentially the code runs +sequentially (due CLONE_VFORK) and I think it would not be legal the +compiler evaluate ec without checking for new_pid result (thus there +is no need to compiler barrier). + +Summarizing the possible scenarios on posix_spawn execution, we +have: + + 1. For default case with a success execution, args.err will be 0, pid + will not be collected and it will be reported to caller. + + 2. For default failure case, args.err will be positive and the it will + be collected by the waitpid. An error will be reported to the + caller. + + 3. For the unlikely case where the process was terminated and not + collected by a caller signal handler, it will be reported as succeful + execution and not be collected by posix_spawn (since args.err will + be 0). The caller will need to actually handle this case. + + 4. For the unlikely case where the process was terminated and collected + by caller we have 3 other possible scenarios: + + 4.1. The auxiliary process was terminated with args.err equal to 0: + it will handled as 1. (so it does not matter if we hit the pid + reuse race since we won't possible collect an unexpected + process). + + 4.2. The auxiliary process was terminated after execve (due a failure + in calling it) and before setting args.err to -1: it will also + be handle as 1. but with the issue of not be able to report the + caller a possible execve failures. + + 4.3. The auxiliary process was terminated after args.err is set to -1: + this is the case where it will be possible to hit the pid reuse + case where we will need to collected the auxiliary pid but we + can not be sure if it will be expected one. I think for this + case we need to actually change waitpid to use WNOHANG to avoid + hanging indefinitely on the call and report an error to caller + since we can't differentiate between a default failure as 2. + and a possible pid reuse race issue. + +Checked on x86_64-linux-gnu. + + * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Handle the case where + the auxiliary process is terminated by a signal before calling _exit + or execve. +diff --git a/sysdeps/unix/sysv/linux/spawni.c b/sysdeps/unix/sysv/linux/spawni.c +index dea1650..d15fbb1 100644 +--- a/sysdeps/unix/sysv/linux/spawni.c ++++ b/sysdeps/unix/sysv/linux/spawni.c +@@ -17,7 +17,6 @@ + . */ + + #include +-#include + #include + #include + #include +@@ -268,7 +267,6 @@ __spawni_child (void *arguments) + __sigprocmask (SIG_SETMASK, (attr->__flags & POSIX_SPAWN_SETSIGMASK) + ? &attr->__ss : &args->oldmask, 0); + +- args->err = 0; + args->exec (args->file, args->argv, args->envp); + + /* This is compatibility function required to enable posix_spawn run +@@ -339,7 +337,7 @@ __spawnix (pid_t * pid, const char *file, + + /* Child must set args.err to something non-negative - we rely on + the parent and child sharing VM. */ +- args.err = -1; ++ args.err = 0; + args.file = file; + args.exec = exec; + args.fa = file_actions; +@@ -362,12 +360,26 @@ __spawnix (pid_t * pid, const char *file, + new_pid = CLONE (__spawni_child, STACK (stack, stack_size), stack_size, + CLONE_VM | CLONE_VFORK | SIGCHLD, &args); + ++ /* It needs to collect the case where the auxiliary process was created ++ but failed to execute the file (due either any preparation step or ++ for execve itself). */ + if (new_pid > 0) + { ++ /* Also, it handles the unlikely case where the auxiliary process was ++ terminated before calling execve as if it was successfully. The ++ args.err is set to 0 as default and changed to a positive value ++ only in case of failure, so in case of premature termination ++ due a signal args.err will remain zeroed and it will be up to ++ caller to actually collect it. */ + ec = args.err; +- assert (ec >= 0); +- if (ec != 0) +- __waitpid (new_pid, NULL, 0); ++ if (ec > 0) ++ /* There still an unlikely case where the child is cancelled after ++ setting args.err, due to a positive error value. Also due a ++ possible pid reuse race (where the kernel allocated the same pid ++ to unrelated process) we need not to undefinitely hang expecting ++ an invalid pid. In both cases an error is returned to the ++ caller. */ ++ __waitpid (new_pid, NULL, WNOHANG); + } + else + ec = -new_pid; +-- +2.9.3 diff --git a/eglibc_2.19.orig.tar.xz b/glibc-2.25.tar.xz similarity index 58% rename from eglibc_2.19.orig.tar.xz rename to glibc-2.25.tar.xz index 411cf5d..c9c84dd 100644 Binary files a/eglibc_2.19.orig.tar.xz and b/glibc-2.25.tar.xz differ diff --git a/glibc.changes b/glibc.changes index 809b028..b80a9e6 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,6 @@ +* Mon Nov 12 2018 Marko Kenttälä - 2.25.1 +- Upgrade to glibc-2.25, fixes jb#36174 + * Tue Oct 3 2017 Pekka Vuorela - 2.19+6.13.1 - Add ldconfig to %post. Fixes JB#39841 - Move docs out of main package. @@ -37,7 +40,7 @@ * Sat Dec 13 2014 Carsten Munk - 2.19 - Disable special -march=i486 for glibc -- Use correct release. Release is mungled on OBS +- Use correct release. Release is mungled on OBS - Build for i686 for accelerated functions goodness * Fri Dec 5 2014 Davide Bettio - 2.19 @@ -110,7 +113,7 @@ * Fri Nov 25 2011 Carsten Munk - 2.13 - Add glibc-2.13-onlyenus.patch, we're only interested in en_US locales right now. For integrators, you can use localedef in your %post - sections in kickstart files to generate the locales you need. This + sections in kickstart files to generate the locales you need. This shaves 3 minutes (at least) off cross builds of glibc and reduces basic Mer footprint (uncompressed) with 34 mb. @@ -129,11 +132,11 @@ * Thu Jun 23 2011 Carsten Munk - 2.13 - New gcc atomics for ARM breaks some configure tests (gzip, m4) - when running inside qemu-arm. Needed to make glibc 2.13 work - properly on MeeGo 1.3. + when running inside qemu-arm. Needed to make glibc 2.13 work + properly on MeeGo 1.3. -* Wed Jun 22 2011 Chris Ferron - 2.13 -- removed util-linux-ng as it has been replaced by util-linux +* Wed Jun 22 2011 Chris Ferron - 2.13 +- removed util-linux-ng as it has been replaced by util-linux * Sat Jun 18 2011 Anas Nashif - 2.13 - Workaround to avoid problems with new debuginfo in upcoming rpm @@ -161,13 +164,13 @@ - BMC#12517 - ARM: glibc wastes time checking for half-precision and fast-mult HWCAP libraries - BMC#12518 - ARM: default to FPU RunFast mode -* Tue Jan 04 2011 Austin Zhang - 2.11.90 -- Fixed syntax error from using %install_info MACRO, BMC#11918. +* Tue Jan 04 2011 Austin Zhang - 2.11.90 +- Fixed syntax error from using %install_info MACRO, BMC#11918. -* Wed Dec 29 2010 Austin Zhang - 2.11.90 -- BMC#10342: Error when installing glibc-devel with --excludedocs in .ks +* Wed Dec 29 2010 Austin Zhang - 2.11.90 +- BMC#10342: Error when installing glibc-devel with --excludedocs in .ks -* Fri Nov 26 2010 Brian Harring - 2.11.90 +* Fri Nov 26 2010 Brian Harring - 2.11.90 - BMC 10526; fix silent failure in building arm locale-archives. * Fri Aug 20 2010 Peter J Zhu - 2.11.90 @@ -179,14 +182,14 @@ * Fri Apr 16 2010 Austin Zhang - 2.11.90 - Patch from H.J tree for bugfix in memory optimization -- fix - BMC#983 + BMC#983 * Fri Mar 26 2010 Austin Zhang - 2.11.90 - Patches from upstream for workaround issue: prelink will lead - to SIGSEGV due to wrong hash table content in glibc. + to SIGSEGV due to wrong hash table content in glibc. * Fri Mar 19 2010 Austin Zhang - 2.11.90 -- Patches from H.J. L x86 branch: +- Patches from H.J. L x86 branch: Correct unwind info; update xmm3 when exit from loop (sync to 20100318) @@ -198,13 +201,13 @@ * Tue Mar 02 2010 Austin Zhang - 2.11.90-20100226 - For atom optimization: - Sync with hjl/release/2.11/x86 branch from upstream, which inlcude + Sync with hjl/release/2.11/x86 branch from upstream, which inlcude those memory operations optimization for atom (so remove old ones), and also include str operation optimizations for atom; Now, the up-to-date version is tillto 2010-02-26 * Tue Jan 19 2010 Austin Zhang - 2.11.90 -- Fixed CVE bug [MB#9120]: getpwnam shows shadow passwords of NIS +- Fixed CVE bug [MB#9120]: getpwnam shows shadow passwords of NIS users in GNU libc * Mon Dec 21 2009 Austin Zhang - 2.11.90 @@ -241,4 +244,3 @@ * Tue Aug 19 2008 Anas Nashif - 2.8 - exclude i586 from aux arches - diff --git a/glibc.spec b/glibc.spec index 8745427..ca13878 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,52 +1,27 @@ -# temporary needed for debuginfo change in rpm package -%define _unpackaged_files_terminate_build 0 -%define glibcsrcdir eglibc-2.19 -### glibc.spec.in follows: -%define run_glibc_tests 0 -%define multiarcharches %{ix86} x86_64 - - -Summary: Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC) Name: glibc -Version: 2.19+6.13.1 -Release: 1 -# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries. -# Things that are linked directly into dynamically linked programs -# and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional -# exception which allows linking it into any kind of programs or shared -# libraries without restrictions. +Summary: GNU C library shared libraries +Version: 2.25 +Release: 1 License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ Group: System/Libraries -URL: http://www.eglibc.org/ -Source0: https://launchpad.net/ubuntu/+archive/primary/+files/eglibc_2.19.orig.tar.xz -Source1: http://archive.ubuntu.com/ubuntu/pool/main/e/eglibc/eglibc_2.19-0ubuntu6.13.debian.tar.xz +URL: http://www.gnu.org/software/libc/ +Source0: glibc-2.25.tar.xz Source11: build-locale-archive.c -# glibc-arm-alignment-fix.patch: safe but probably not needed anymore Patch1: glibc-arm-alignment-fix.patch -# glibc-arm-runfast.patch: performance improvement patch -Patch2: glibc-arm-runfast.patch -# glibc-2.19-ldso-rpath-prefix-option.2.diff: required for OBS -Patch3: glibc-2.13-no-timestamping.patch -Patch4: glibc-2.14.1-elf-rtld.c.1.diff -# glibc-2.19-ldso-rpath-prefix-option.2.diff: required from scratchbox2 -Patch5: glibc-2.19-ldso-rpath-prefix-option.2.diff -# eglibc-2.15-nsswitchconf-location.3.diff: TODO review required -Patch6: eglibc-2.15-nsswitchconf-location.3.diff -# glibc-2.14.1-nscd-socket-location.4.diff: TODO review required -Patch7: glibc-2.14.1-nscd-socket-location.4.diff -# glibc-2.19-ldso-nodefaultdirs-option.5.diff: required from scratchbox2 -Patch8: glibc-2.19-ldso-nodefaultdirs-option.5.diff +Patch2: glibc-2.25-arm-runfast.patch +Patch3: glibc-2.25-no-timestamping.patch +Patch4: glibc-2.25-elf-rtld.diff +Patch5: glibc-2.25-ldso-rpath-prefix-option.diff +Patch6: glibc-2.25-nsswitchconf-location.diff +Patch7: glibc-2.25-nscd-socket-location.diff +Patch8: glibc-2.25-ldso-nodefaultdirs-option.diff Patch9: glibc-2.14-locarchive-fedora.patch -# eglibc-2.15-use-usrbin-localedef.patch: TODO review required -Patch10: eglibc-2.15-use-usrbin-localedef.patch -# eglibc-2.15-fix-neon-libdl.patch: fix crash -Patch11: eglibc-2.15-fix-neon-libdl.patch -# eglibc-2.19-shlib-make.patch: fix build fail -Patch12: eglibc-2.19-shlib-make.patch -# eglibc-2.19-sb2-workaround.patch: fix build fail -Patch13: eglibc-2.19-sb2-workaround.patch +Patch10: eglibc-2.15-fix-neon-libdl.patch +Patch11: eglibc-2.19-shlib-make.patch +Patch12: glibc-2.25-bits.patch +Patch13: glibc-2.25-posix-spawn-fix.patch Provides: ldconfig # The dynamic linker supports DT_GNU_HASH @@ -59,14 +34,11 @@ Provides: ld-linux.so.3 Provides: ld-linux.so.3(GLIBC_2.4) %endif +BuildRequires: xz tar # Require libgcc in case some program calls pthread_cancel in its %%post Requires(pre): libgcc -# This is for building auxiliary programs like memusage, nscd -# For initial glibc bootstraps it can be commented out -#BuildRequires: gd-devel libpng-devel zlib-devel texinfo BuildRequires: zlib-devel texinfo BuildRequires: sed >= 3.95, libcap-devel, gettext -#BuildRequires: /bin/ps, /bin/kill, /bin/awk, procps BuildRequires: gawk, util-linux, quilt # This gcc >= 3.2 is to ensure that __frame_state_for is exported by glibc # will be compatible with egcs 1.x.y @@ -98,6 +70,7 @@ BuildRequires: rpm >= 4.2-0.56 %define __find_provides %{_builddir}/%{glibcsrcdir}/find_provides.sh %define _filter_GLIBC_PRIVATE 1 +%define run_glibc_tests 0 %description The glibc package contains standard libraries which are used by @@ -193,69 +166,46 @@ which can be helpful during program debugging. If unsure if you need this, don't install this package. +%package debug +Summary: Debug libraries from GNU C library +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} -%prep -%setup -q -n %{glibcsrcdir} %{?glibc_release_unpack} -xz -dc %SOURCE1 | tar xf - - -# Not well formatted locales --cvm -sed -i "s|^localedata/locale-eo_EO.diff$||g" debian/patches/series -sed -i "s|^localedata/locale-ia.diff$||g" debian/patches/series -# This screws up armv6, as it doesn't have ARMv7 instructions/Thumb2 -%ifarch armv6l -sed -i "s|^arm/local-linaro-cortex-strings.diff$||g" debian/patches/series -%endif -sed -i "s|^kfreebsd.*$||g" debian/patches/series +%description debug +The glibc-debug package contains debug libraries. + +If unsure if you need this, don't install this package. -QUILT_PATCHES=debian/patches quilt push -a +%prep +rm -rf glibc-2.25 +xz -dc %SOURCE0 | tar -x -# glibc-arm-alignment-fix.patch -%patch1 -p1 +cd glibc-2.25 +%patch1 -p2 %ifarch %{arm} -# glibc-arm-runfast.patch %patch2 -p1 %endif -# glibc-2.13-no-timestamping.patch %patch3 -p1 -# glibc-2.14.1-elf-rtld.c.1.diff %patch4 -p1 -# glibc-2.19-ldso-rpath-prefix-option.2.diff %patch5 -p1 -# eglibc-2.15-nsswitchconf-location.3.diff %patch6 -p1 -# glibc-2.14.1-nscd-socket-location.4.diff %patch7 -p1 -# glibc-2.19-ldso-nodefaultdirs-option.5.diff %patch8 -p1 -# glibc-2.14-locarchive-fedora.patch %patch9 -p1 %if 0%{?qemu_user_space_build} -# eglibc-2.15-use-usrbin-localedef.patch %patch10 -p1 -# eglibc-2.15-fix-neon-libdl.patch -%patch11 -p1 %endif -# eglibc-2.19-shlib-make.patch +%patch11 -p1 %patch12 -p1 -# eglibc-2.19-sb2-workaround.patch %patch13 -p1 -cat > find_provides.sh < Gcc -%ifarch %{arm} mipsel aarch64 -EnablePorts="ports," -%else -EnablePorts="" -%endif - -build_nptl() -{ -builddir=build-%{nptl_target_cpu}-$1 -shift -rm -rf $builddir +builddir=build-%{name}-%{version} +rm -rf build-%{name}-* mkdir $builddir ; cd $builddir + echo libdir=/usr/lib > configparms echo slibdir=/lib >> configparms echo BUILD_CC=gcc >> configparms + %ifarch mipsel -build_CFLAGS="$BuildFlags -g -O1 $*" +build_CFLAGS="$BuildFlags -O1" %else -build_CFLAGS="$BuildFlags -g -O3 $*" +build_CFLAGS="$BuildFlags -O3" %endif + export MAKEINFO=: -../configure CC="$GCC" CXX="$GXX" CFLAGS="$build_CFLAGS" \ + +../glibc-2.25/configure CC="$GCC" CXX="$GXX" CFLAGS="$build_CFLAGS" \ --prefix=%{_prefix} \ - --enable-pt_chown "--enable-add-ons=libidn,"$EnablePorts"nptl" --without-cvs $EnableKernel \ + --enable-pt_chown "--enable-add-ons=libidn" --without-cvs $EnableKernel \ --enable-bind-now --with-tls --with-__thread \ --with-headers=%{_prefix}/include \ -%ifnarch %{arm} - --build %{nptl_target_cpu}-%{_vendor}-linux \ - --host %{nptl_target_cpu}-%{_vendor}-linux \ -%else -%ifarch armv7hl armv7tnhl armv7nhl - --build %{nptl_target_cpu}-%{_vendor}-linux-gnueabihf \ - --host %{nptl_target_cpu}-%{_vendor}-linux-gnueabihf \ -%else - --build %{nptl_target_cpu}-%{_vendor}-linux-gnueabi \ - --host %{nptl_target_cpu}-%{_vendor}-linux-gnueabi \ -%endif -%endif %ifarch %{multiarcharches} --enable-multi-arch \ %endif --disable-profile --enable-obsolete-rpc -make %{?_smp_mflags} -r CFLAGS="$build_CFLAGS" +make %{?_smp_mflags} -r CFLAGS="$build_CFLAGS" cd .. -} - -build_nptl linuxnptl $GCC -Os -static -o build-locale-archive %SOURCE11 \ - ./build-%{nptl_target_cpu}-linuxnptl/locale/locarchive.o \ - ./build-%{nptl_target_cpu}-linuxnptl/locale/md5.o \ + ./build-%{name}-%{version}/locale/locarchive.o \ + ./build-%{name}-%{version}/locale/md5.o \ -DDATADIR=\"%{_datadir}\" -DPREFIX=\"%{_prefix}\" \ - -L./build-%{nptl_target_cpu}-linuxnptl -I./locale + -L./build-%{name}-%{version} -Iglibc-2.25 %install -GCC=`cat Gcc` - -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT -make -j1 install_root=$RPM_BUILD_ROOT install -C build-%{nptl_target_cpu}-linuxnptl PARALLELMFLAGS= +rm -rf ${RPM_BUILD_ROOT} +cd build-%{name}-%{version} +make -j1 install_root=${RPM_BUILD_ROOT} install -librtso=`basename $RPM_BUILD_ROOT/%{_lib}/librt.so.*` - - -# Remove the files we don't want to distribute -rm -f $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libNoVersion* -rm -f $RPM_BUILD_ROOT/%{_lib}/libNoVersion* - -if [ -d $RPM_BUILD_ROOT%{_prefix}/info -a "%{_infodir}" != "%{_prefix}/info" ]; then - mkdir -p $RPM_BUILD_ROOT%{_infodir} - mv -f $RPM_BUILD_ROOT%{_prefix}/info/* $RPM_BUILD_ROOT%{_infodir} - rm -rf $RPM_BUILD_ROOT%{_prefix}/info -fi - -ln -sf libbsd-compat.a $RPM_BUILD_ROOT%{_prefix}/%{_lib}/libbsd.a - -install -p -m 644 nss/nsswitch.conf $RPM_BUILD_ROOT/etc/nsswitch.conf +install -p -m 644 ../glibc-2.25/nss/nsswitch.conf $RPM_BUILD_ROOT/etc/nsswitch.conf mkdir -p $RPM_BUILD_ROOT/etc/default -install -p -m 644 nis/nss $RPM_BUILD_ROOT/etc/default/nss +install -p -m 644 ../glibc-2.25/nis/nss $RPM_BUILD_ROOT/etc/default/nss -# This is for ncsd - in glibc 2.2 -install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT/etc - -# Don't include ld.so.cache -rm -f $RPM_BUILD_ROOT/etc/ld.so.cache +install -m 644 ../glibc-2.25/nscd/nscd.conf $RPM_BUILD_ROOT/etc # Include ld.so.conf echo 'include /etc/ld.so.conf.d/*.conf' > $RPM_BUILD_ROOT/etc/ld.so.conf @@ -386,7 +295,6 @@ done popd mkdir -p $RPM_BUILD_ROOT/%{_prefix}/lib/locale/ -> $RPM_BUILD_ROOT/%{_prefix}/lib/locale/locale-archive %ifarch armv7hl armv7tnhl armv7nhl ln -s /lib/ld-linux-armhf.so.3 ${RPM_BUILD_ROOT}/lib/ld-linux.so.3 @@ -497,19 +405,25 @@ ln -sf %{_prefix}/share/zoneinfo/US/Eastern $RPM_BUILD_ROOT/etc/localtime rm -rf $RPM_BUILD_ROOT%{_prefix}/share/zoneinfo -# Make sure %config files have the same timestamp -touch -r timezone/northamerica $RPM_BUILD_ROOT/etc/ld.so.conf -touch -r sunrpc/etc.rpc $RPM_BUILD_ROOT/etc/rpc - - # the last bit: more documentation -rm -rf documentation -mkdir documentation -cp crypt/README.ufc-crypt documentation/README.ufc-crypt -cp timezone/README documentation/README.timezone -cp ChangeLog{,.15,.16} documentation -bzip2 -9 documentation/ChangeLog* -cp posix/gai.conf documentation/ +rm -rf ../documentation +mkdir ../documentation +cp ../glibc-2.25/crypt/README.ufc-crypt ../documentation/README.ufc-crypt +cp ../glibc-2.25/timezone/README ../documentation/README.timezone +cp ../glibc-2.25/ChangeLog{,.15,.16} ../documentation +bzip2 -9 ../documentation/ChangeLog* +cp ../glibc-2.25/posix/gai.conf ../documentation/ + +# Docs +cp ../glibc-2.25/COPYING .. +cp ../glibc-2.25/LICENSES .. +cp ../glibc-2.25/COPYING.LIB .. +cp ../glibc-2.25/README .. +cp ../glibc-2.25/NEWS .. +cp ../glibc-2.25/INSTALL .. +cp ../glibc-2.25/BUGS .. +cp ../glibc-2.25/CONFORMANCE .. +install -D ../glibc-2.25/hesiod/README.hesiod ../hesiod/README.hesiod %if 0%{run_glibc_tests} @@ -541,7 +455,7 @@ echo ====================PLT RELOCS END================== %endif pushd $RPM_BUILD_ROOT/usr/%{_lib}/ -$GCC -r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a +gcc -r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a rm libpthread.a ar rcs libpthread.a libpthread.o rm libpthread.o @@ -565,7 +479,7 @@ touch $RPM_BUILD_ROOT/var/{db,run}/nscd/{passwd,group,hosts,services} touch $RPM_BUILD_ROOT/var/run/nscd/{socket,nscd.pid} %endif -install -m 700 build-locale-archive $RPM_BUILD_ROOT/usr/sbin/build-locale-archive +install -m 700 ../build-locale-archive $RPM_BUILD_ROOT/usr/sbin/build-locale-archive mkdir -p $RPM_BUILD_ROOT/var/cache/ldconfig > $RPM_BUILD_ROOT/var/cache/ldconfig/aux-cache @@ -597,14 +511,11 @@ if [ "$1" -ge "1" ]; then fi -%files -f rpm.filelist +%files -f build-%{name}-%{version}/rpm.filelist %defattr(-,root,root) %verify(not md5 size mtime) %config(noreplace) /etc/localtime %verify(not md5 size mtime) %config(noreplace) /etc/nsswitch.conf %verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf -%ifarch armv7hl armv7tnhl armv7nhl -/lib/ld-linux.so.3 -%endif %dir /etc/ld.so.conf.d %dir %{_prefix}/libexec/getconf %dir %{_prefix}/%{_lib}/gconv @@ -615,7 +526,7 @@ fi %ifnarch %{auxarches} -%files -f common.filelist common +%files -f build-%{name}-%{version}/common.filelist common %defattr(-,root,root) %dir %{_prefix}/lib/locale %dir %attr(755,root,root) /etc/default @@ -623,21 +534,21 @@ fi %attr(4711,root,root) %{_prefix}/libexec/pt_chown %doc documentation/* -%files -f devel.filelist devel +%files -f build-%{name}-%{version}/devel.filelist devel %defattr(-,root,root) -%doc README NEWS INSTALL BUGS PROJECTS CONFORMANCE +%doc README NEWS INSTALL BUGS CONFORMANCE %doc hesiod/README.hesiod -%files -f static.filelist static +%files -f build-%{name}-%{version}/static.filelist static %defattr(-,root,root) -%files -f headers.filelist headers +%files -f build-%{name}-%{version}/headers.filelist headers %defattr(-,root,root) -%files -f utils.filelist utils +%files -f build-%{name}-%{version}/utils.filelist utils %defattr(-,root,root) -%files -f nscd.filelist -n nscd +%files -f build-%{name}-%{version}/nscd.filelist -n nscd %defattr(-,root,root) %config(noreplace) /etc/nscd.conf %dir %attr(0755,root,root) /var/run/nscd @@ -655,3 +566,6 @@ fi %ghost %config(missingok,noreplace) /etc/sysconfig/nscd %endif +%files debug +%defattr(-,root,root) +%{_prefix}/%{_lib}/debug/usr/lib/*