Commit 14c2593c authored by Uninstall's avatar Uninstall

Update to eglibc 2.19 with ubuntu/debian patches

Change-Id: I620625c7e5984d738ddbafe586dcad20691d9a32
Signed-off-by: Uninstall's avatarDavide Bettio <davide.bettio@ispirata.com>
parent e23cc8d6
......@@ -26,6 +26,12 @@ int verbose = 0;
int max_locarchive_open_retry = 10;
const char *output_prefix;
/* Endianness should have been taken care of by localedef. We don't need to do
additional swapping. We need this variable exported however, since
locarchive.c uses it to determine if it needs to swap endianness of a value
before writing to or reading from the archive. */
bool swap_endianness_p = false;
static const char *locnames[] =
{
#define DEFINE_CATEGORY(category, category_name, items, a) \
......@@ -96,7 +102,7 @@ open_tmpl_archive (struct locarhandle *ah)
struct stat64 st;
int fd;
struct locarhead head;
const char *archivefname = tmpl_file;
const char *archivefname = ah->fname == NULL ? tmpl_file : ah->fname;
/* Open the archive. We must have exclusive write access. */
fd = open64 (archivefname, O_RDONLY);
......@@ -250,7 +256,8 @@ compute_data (struct locarhandle *ah, struct nameent *name, size_t sumused,
}
static int
fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[],
fill_archive (struct locarhandle *tmpl_ah,
const char *fname, size_t nlist, char *list[],
const char *primary)
{
struct locarhandle ah;
......@@ -304,6 +311,9 @@ fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[],
/* Open the archive. This call never returns if we cannot
successfully open the archive. */
ah.fname = NULL;
if (fname != NULL)
ah.fname = fname;
open_archive (&ah, false);
if (primary != NULL)
......@@ -532,7 +542,7 @@ fill_archive (struct locarhandle *tmpl_ah, size_t nlist, char *list[],
return result;
}
int main ()
int main (int argc, char *argv[])
{
char path[4096];
DIR *dirp;
......@@ -547,6 +557,11 @@ int main ()
if (dirp == NULL)
error (EXIT_FAILURE, errno, "cannot open directory \"%s\"", loc_path);
/* Use the template file as specified on the command line. */
tmpl_ah.fname = NULL;
if (argc > 1)
tmpl_ah.fname = argv[1];
open_tmpl_archive (&tmpl_ah);
unlink (locar_file);
......@@ -623,10 +638,12 @@ int main ()
cnt++;
}
closedir (dirp);
fill_archive (&tmpl_ah, cnt, list, primary);
/* Store the archive to the file specified as the second argument on the
command line or the default locale archive. */
fill_archive (&tmpl_ah, argc > 2 ? argv[2] : NULL, cnt, list, primary);
close_archive (&tmpl_ah);
truncate (tmpl_file, 0);
char *argv[] = { "/usr/sbin/tzdata-update", NULL };
execve (argv[0], (char *const *)argv, (char *const *)&argv[1]);
char *tz_argv[] = { "/usr/sbin/tzdata-update", NULL };
execve (tz_argv[0], (char *const *)tz_argv, (char *const *)&tz_argv[1]);
exit (0);
}
--- eglibc-2.15/ports/sysdeps/mips/Makefile 2012-01-04 17:35:09.000000000 +0100
+++ eglibc-2.15-mips-async-unwind/ports/sysdeps/mips/Makefile 2012-02-24 15:19:44.915827395 +0100
@@ -21,11 +21,11 @@
endif
ifeq ($(subdir),csu)
-CFLAGS-initfini.s += -fno-unwind-tables
+CFLAGS-initfini.s += -fno-asynchronous-unwind-tables -fno-unwind-tables
endif
ifeq ($(subdir),nptl)
-CFLAGS-pt-initfini.s += -fno-unwind-tables
+CFLAGS-pt-initfini.s += -fno-asynchronous-unwind-tables -fno-unwind-tables
endif
ASFLAGS-.os += $(pic-ccflag)
--- eglibc-2.15/ports/sysdeps/unix/sysv/linux/mips/Makefile 2011-12-22 20:27:39.000000000 +0100
+++ eglibc-2.15-mips-no-n32-n64/ports/sysdeps/unix/sysv/linux/mips/Makefile 2012-02-24 16:23:23.380420249 +0100
@@ -7,7 +7,7 @@
sysdep_headers += sys/cachectl.h sys/sysmips.h sys/tas.h
-syscall-list-variants := o32 n32 n64
+syscall-list-variants := o32
syscall-list-includes := sgidefs.h
syscall-list-o32-options := -mabi=32
syscall-list-o32-condition := _MIPS_SIM == _MIPS_SIM_ABI32
This diff is collapsed.
diff -ru eglibc-2.18/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c eglibc-2.18-sb2-workaround/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c
--- eglibc-2.18/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c 2013-01-10 00:28:48.000000000 +0000
+++ eglibc-2.18-sb2-workaround/ports/sysdeps/aarch64/nptl/pthread_spin_lock.c 2013-12-27 08:56:08.000000000 +0000
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 <nptl/pthread_spin_lock.c>" because
it will resolve to this very file. Using "sysdeps/.." as reference to the
top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
+#include <sysdeps/../../eglibc-2.18/nptl/pthread_spin_lock.c>
diff -ru eglibc-2.18/ports/sysdeps/arm/nptl/pthread_spin_lock.c eglibc-2.18-sb2-workaround/ports/sysdeps/arm/nptl/pthread_spin_lock.c
--- eglibc-2.18/ports/sysdeps/arm/nptl/pthread_spin_lock.c 2013-01-10 00:28:48.000000000 +0000
+++ eglibc-2.18-sb2-workaround/ports/sysdeps/arm/nptl/pthread_spin_lock.c 2013-12-27 08:55:03.000000000 +0000
+#include <sysdeps/../../eglibc-2.19/nptl/pthread_spin_lock.c>
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 <nptl/pthread_spin_lock.c>" because
it will resolve to this very file. Using "sysdeps/.." as reference to the
top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
+#include <sysdeps/../../eglibc-2.18/nptl/pthread_spin_lock.c>
diff -ru eglibc-2.18/ports/sysdeps/mips/nptl/pthread_spin_lock.c eglibc-2.18-sb2-workaround/ports/sysdeps/mips/nptl/pthread_spin_lock.c
--- eglibc-2.18/ports/sysdeps/mips/nptl/pthread_spin_lock.c 2013-01-10 00:28:48.000000000 +0000
+++ eglibc-2.18-sb2-workaround/ports/sysdeps/mips/nptl/pthread_spin_lock.c 2013-12-27 08:56:28.000000000 +0000
+#include <sysdeps/../../eglibc-2.19/nptl/pthread_spin_lock.c>
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 <nptl/pthread_spin_lock.c>" because
it will resolve to this very file. Using "sysdeps/.." as reference to the
top level directory does the job. */
-#include <sysdeps/../nptl/pthread_spin_lock.c>
+#include <sysdeps/../../eglibc-2.18/nptl/pthread_spin_lock.c>
+#include <sysdeps/../../eglibc-2.19/nptl/pthread_spin_lock.c>
+
Index: eglibc-2.15/Makerules
===================================================================
--- eglibc-2.15.orig/Makerules 2011-10-25 03:37:10.000000000 +0300
+++ eglibc-2.15/Makerules 2013-07-16 14:35:52.581191695 +0300
@@ -509,25 +509,19 @@
diff --git a/Makerules b/Makerules
index b46b09b..297e605 100644
--- a/Makerules
+++ b/Makerules
@@ -454,25 +454,19 @@ shlib-lds-flags =
else
# binutils only position loadable notes into the first page for binaries,
# not for shared objects
-$(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
- $(LINK.o) -shared -Wl,-O1 \
- -nostdlib -nostartfiles \
- $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
- $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \
- -Wl,--verbose 2>&1 | \
- sed > $@T \
- -e '/^=========/,/^=========/!d;/^=========/d' \
......@@ -33,14 +33,14 @@ Index: eglibc-2.15/Makerules
PROVIDE(__start___libc_subfreeres = .);\
__libc_subfreeres : { *(__libc_subfreeres) }\
PROVIDE(__stop___libc_subfreeres = .);\
@@ -538,6 +532,13 @@
@@ -483,6 +477,13 @@ $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
__libc_thread_subfreeres : { *(__libc_thread_subfreeres) }\
PROVIDE(__stop___libc_thread_subfreeres = .);\
/DISCARD/ : { *(.gnu.glibc-stub.*) }@'
+$(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules
+ $(LINK.o) -shared -Wl,-O1 \
+ -nostdlib -nostartfiles \
+ $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
+ $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \
+ -Wl,--verbose 2>&1 | \
+ sed > $@T \
+ $(shlib-lds-hash) $(shlib-lds-dynbss) $(shlib-lds-jcr)
......
diff -ru eglibc-2.18/elf/dl-load.c eglibc-2.18-nodefaultdirs/elf/dl-load.c
--- eglibc-2.18/elf/dl-load.c 2014-01-01 10:24:04.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/elf/dl-load.c 2014-01-01 10:25:39.000000000 +0000
@@ -2280,7 +2280,9 @@
/* 'l' is always != NULL for dynamically linked objects. */
l != NULL &&
# endif
- __builtin_expect (l->l_flags_1 & DF_1_NODEFLIB, 0))
+ __builtin_expect (((l->l_flags_1 & DF_1_NODEFLIB) ||
+ GLRO(dl_no_default_dirs)), 0))
+
{
const char *dirp = system_dirs;
unsigned int cnt = 0;
@@ -2322,7 +2324,8 @@
/* 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))
&& 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);
@@ -2488,7 +2491,7 @@
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);
if (counting)
diff -ru eglibc-2.18/elf/dl-load.c.orig eglibc-2.18-nodefaultdirs/elf/dl-load.c.orig
--- eglibc-2.18/elf/dl-load.c.orig 2013-07-02 00:11:45.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/elf/dl-load.c.orig 2014-01-01 10:24:04.000000000 +0000
@@ -481,7 +481,8 @@
static struct r_search_path_elem **
fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
- int check_trusted, const char *what, const char *where)
+ int check_trusted, const char *what, const char *where,
+ const char *rpath_prefix)
{
char *cp;
size_t nelems = 0;
@@ -512,9 +513,23 @@
continue;
/* 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)
- break;
+ if (__builtin_expect (rpath_prefix != NULL, 0))
+ {
+ /* has rpath_prefix */
+ size_t rpath_prefix_len = strlen (rpath_prefix);
+
+ for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next)
+ if (dirp->dirnamelen == (rpath_prefix_len+len) &&
+ (memcmp (cp, rpath_prefix, rpath_prefix_len) == 0) &&
+ (memcmp (cp+rpath_prefix_len, dirp->dirname, len) == 0))
+ break;
+ }
+ else
+ {
+ for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next)
+ if (dirp->dirnamelen == len && memcmp (cp, dirp->dirname, len) == 0)
+ break;
+ }
if (dirp != NULL)
{
@@ -532,22 +547,43 @@
size_t cnt;
enum r_dir_status init_val;
size_t where_len = where ? strlen (where) + 1 : 0;
+ size_t rpath_prefix_len = 0;
+
+ if (__builtin_expect (rpath_prefix != NULL, 0)
+ && !INTUSE(__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)
- + where_len + len + 1);
+ + where_len + rpath_prefix_len + len + 1);
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';
- dirp->dirnamelen = len;
+ if (rpath_prefix_len == 0)
+ {
+ *((char *) __mempcpy ((char *) dirp->dirname, cp, len)) = '\0';
+ }
+ else
+ {
+ char *prefixend;
+
+ prefixend = (char *) __mempcpy ((char *) dirp->dirname,
+ rpath_prefix, rpath_prefix_len);
+ if (*cp != '/')
+ prefixend[-1] = '/'; /* replace \0 */
+ *((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
@@ -558,7 +594,8 @@
dirp->what = what;
if (__builtin_expect (where != NULL, 1))
- dirp->where = memcpy ((char *) dirp + sizeof (*dirp) + len + 1
+ dirp->where = memcpy ((char *) dirp + sizeof (*dirp)
+ + rpath_prefix_len + len + 1
+ (ncapstr * sizeof (enum r_dir_status)),
where, where_len);
else
@@ -660,7 +697,7 @@
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
}
- fillin_rpath (copy, result, ":", 0, what, where);
+ fillin_rpath (copy, result, ":", 0, what, where, GLRO(dl_rpath_prefix));
/* Free the copied RPATH string. `fillin_rpath' make own copies if
necessary. */
@@ -865,7 +902,7 @@
(void) fillin_rpath (llp_tmp, env_path_list.dirs, ":;",
INTUSE(__libc_enable_secure), "LD_LIBRARY_PATH",
- NULL);
+ NULL, NULL/*no prefix*/);
if (env_path_list.dirs[0] == NULL)
{
diff -ru eglibc-2.18/elf/dl-support.c eglibc-2.18-nodefaultdirs/elf/dl-support.c
--- eglibc-2.18/elf/dl-support.c 2014-01-01 10:24:04.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/elf/dl-support.c 2014-01-01 10:25:39.000000000 +0000
@@ -64,6 +64,9 @@
/* 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 -ru eglibc-2.18/elf/dl-support.c.orig eglibc-2.18-nodefaultdirs/elf/dl-support.c.orig
--- eglibc-2.18/elf/dl-support.c.orig 2013-07-02 00:11:45.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/elf/dl-support.c.orig 2014-01-01 10:24:04.000000000 +0000
@@ -61,6 +61,9 @@
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;
diff -ru eglibc-2.18/elf/rtld.c eglibc-2.18-nodefaultdirs/elf/rtld.c
--- eglibc-2.18/elf/rtld.c 2014-01-01 10:24:04.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/elf/rtld.c 2014-01-01 10:26:13.000000000 +0000
@@ -978,6 +978,15 @@
--_dl_argc;
++INTUSE(_dl_argv);
}
+ else if (! strcmp (INTUSE(_dl_argv)[1], "--nodefaultdirs")
+ && _dl_argc > 2)
+ {
+ GLRO(dl_no_default_dirs) = 1;
+
+ ++_dl_skip_args;
+ --_dl_argc;
+ ++INTUSE(_dl_argv);
+ }
else if (! strcmp (INTUSE(_dl_argv)[1], "--library-path")
&& _dl_argc > 2)
{
@@ -1051,6 +1060,7 @@
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
in LIST\n\
--argv0 STRING use STRING as argv[0]\n\
+ --nodefaultdirs Do not search from default directories or cache\n\
--audit LIST use objects named in LIST as auditors\n");
++_dl_skip_args;
diff -ru eglibc-2.18/elf/rtld.c.orig eglibc-2.18-nodefaultdirs/elf/rtld.c.orig
--- eglibc-2.18/elf/rtld.c.orig 2014-01-01 10:23:45.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/elf/rtld.c.orig 2014-01-01 10:24:04.000000000 +0000
@@ -996,6 +996,15 @@
_dl_argc -= 2;
INTUSE(_dl_argv) += 2;
}
+ else if (! strcmp (INTUSE(_dl_argv)[1], "--rpath-prefix")
+ && _dl_argc > 2)
+ {
+ GLRO(dl_rpath_prefix) = INTUSE(_dl_argv)[2];
+
+ _dl_skip_args += 2;
+ _dl_argc -= 2;
+ INTUSE(_dl_argv) += 2;
+ }
else if (! strcmp (INTUSE(_dl_argv)[1], "--audit") && _dl_argc > 2)
{
process_dl_audit (INTUSE(_dl_argv)[2]);
@@ -1038,6 +1047,7 @@
--inhibit-cache Do not use " LD_SO_CACHE "\n\
--library-path PATH use given PATH instead of content of the environment\n\
variable LD_LIBRARY_PATH\n\
+ --rpath-prefix PREFIX add PREFIX to every RUNPATH and RPATH component\n\
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
in LIST\n\
--argv0 STRING use STRING as argv[0]\n\
Only in eglibc-2.18-nodefaultdirs/elf: rtld.c.rej
diff -ru eglibc-2.18/sysdeps/generic/ldsodefs.h eglibc-2.18-nodefaultdirs/sysdeps/generic/ldsodefs.h
--- eglibc-2.18/sysdeps/generic/ldsodefs.h 2014-01-01 10:24:04.000000000 +0000
+++ eglibc-2.18-nodefaultdirs/sysdeps/generic/ldsodefs.h 2014-01-01 10:25:39.000000000 +0000
@@ -566,6 +566,8 @@
platforms. */
EXTERN uint64_t _dl_hwcap2;
+ EXTERN int _dl_no_default_dirs;
+
#ifdef SHARED
/* We add a function table to _rtld_global which is then used to
call the function instead of going through the PLT. The result
diff --git a/elf/dl-load.c b/elf/dl-load.c
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))
{
const char *dirp = system_dirs;
unsigned int cnt = 0;
@@ -2321,7 +2322,8 @@ _dl_map_object (struct link_map *loader, const char *name,
/* 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))
&& 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);
if (counting)
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 723814a..fccc1d4 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -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);
}
+ else if (! strcmp (INTUSE(_dl_argv)[1], "--nodefaultdirs")
+ && _dl_argc > 2)
+ {
+ GLRO(dl_no_default_dirs) = 1;
+
+ ++_dl_skip_args;
+ --_dl_argc;
+ ++INTUSE(_dl_argv);
+ }
else if (! strcmp (INTUSE(_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\
--list list all dependencies and how they are resolved\n\
--verify verify that given object really is a dynamically linked\n\
object we can handle\n\
+ --nodefaultdirs Do not search from default directories or cache\n\
--inhibit-cache Do not use " LD_SO_CACHE "\n\
--library-path PATH use given PATH instead of content of the environment\n\
variable LD_LIBRARY_PATH\n\
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index 3116188..0759694 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -559,6 +559,8 @@ struct rtld_global_ro
platforms. */
EXTERN uint64_t _dl_hwcap2;
+ EXTERN int _dl_no_default_dirs;
+
#ifdef SHARED
/* We add a function table to _rtld_global which is then used to
call the function instead of going through the PLT. The result
diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c
--- glibc-2.14.1+p1/elf/dl-load.c 2011-10-07 12:48:55.000000000 +0300
+++ glibc-2.14.1/elf/dl-load.c 2011-11-16 17:07:07.000000000 +0200
@@ -487,7 +487,8 @@
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 1be7a3c..49f070f 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -482,7 +482,7 @@ static size_t max_dirnamelen;
static struct r_search_path_elem **
fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
- int check_trusted, const char *what, const char *where)
+ int check_trusted, const char *what, const char *where,
+ const char *rpath_prefix)
int check_trusted, const char *what, const char *where,
- struct link_map *l)
+ struct link_map *l, const char *rpath_prefix)
{
char *cp;
size_t nelems = 0;
@@ -518,9 +519,23 @@
continue;
@@ -520,9 +520,23 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
}
/* See if this directory is already known. */
- for (dirp = GL(dl_all_dirs); dirp != NULL; dirp = dirp->next)
......@@ -38,7 +38,7 @@ diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c
if (dirp != NULL)
{
@@ -538,22 +553,43 @@
@@ -540,22 +554,43 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
size_t cnt;
enum r_dir_status init_val;
size_t where_len = where ? strlen (where) + 1 : 0;
......@@ -87,7 +87,7 @@ diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c
/* We have to make sure all the relative directories are
never ignored. The current directory might change and
@@ -564,7 +600,8 @@
@@ -566,7 +601,8 @@ fillin_rpath (char *rpath, struct r_search_path_elem **result, const char *sep,
dirp->what = what;
if (__builtin_expect (where != NULL, 1))
......@@ -97,28 +97,29 @@ diff -ur glibc-2.14.1+p1/elf/dl-load.c glibc-2.14.1/elf/dl-load.c
+ (ncapstr * sizeof (enum r_dir_status)),
where, where_len);
else
@@ -666,7 +703,7 @@
@@ -668,7 +704,7 @@ decompose_rpath (struct r_search_path_struct *sps,
_dl_signal_error (ENOMEM, NULL, NULL, errstring);
}
- fillin_rpath (copy, result, ":", 0, what, where);
+ fillin_rpath (copy, result, ":", 0, what, where, GLRO(dl_rpath_prefix));
- 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. */
@@ -865,7 +902,7 @@
@@ -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",
- NULL);
+ NULL, NULL/*no prefix*/);
- NULL, l);
+ NULL, l, NULL/*no prefix*/);
if (env_path_list.dirs[0] == NULL)
{
diff -ur glibc-2.14.1+p1/elf/dl-support.c glibc-2.14.1/elf/dl-support.c
--- glibc-2.14.1+p1/elf/dl-support.c 2011-10-07 12:48:55.000000000 +0300
+++ glibc-2.14.1/elf/dl-support.c 2011-11-16 17:07:07.000000000 +0200
@@ -57,6 +57,9 @@
diff --git a/elf/dl-support.c b/elf/dl-support.c
index e435436..723814a 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -58,6 +58,9 @@ const char *_dl_profile_output;
ignored. */
const char *_dl_inhibit_rpath;
......@@ -128,10 +129,11 @@ diff -ur glibc-2.14.1+p1/elf/dl-support.c glibc-2.14.1/elf/dl-support.c
/* The map for the object we will profile. */
struct link_map *_dl_profile_map;
diff -ur glibc-2.14.1+p1/elf/rtld.c glibc-2.14.1/elf/rtld.c
--- glibc-2.14.1+p1/elf/rtld.c 2011-11-16 17:00:19.000000000 +0200
+++ glibc-2.14.1/elf/rtld.c 2011-11-16 17:08:18.000000000 +0200
@@ -987,6 +987,15 @@
diff --git a/elf/rtld.c b/elf/rtld.c
index 6dcbabc..ea3af55 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -994,6 +994,15 @@ dl_main (const ElfW(Phdr) *phdr,
_dl_argc -= 2;
INTUSE(_dl_argv) += 2;
}
......@@ -147,18 +149,19 @@ diff -ur glibc-2.14.1+p1/elf/rtld.c glibc-2.14.1/elf/rtld.c
else if (! strcmp (INTUSE(_dl_argv)[1], "--audit") && _dl_argc > 2)
{
process_dl_audit (INTUSE(_dl_argv)[2]);
@@ -1028,6 +1037,7 @@
object we can handle\n\
@@ -1028,6 +1037,7 @@ of this helper program; chances are you did not intend to run this program.\n\
--inhibit-cache Do not use " LD_SO_CACHE "\n\
--library-path PATH use given PATH instead of content of the environment\n\
variable LD_LIBRARY_PATH\n\
+ --rpath-prefix PREFIX add PREFIX to every RUNPATH and RPATH component\n\
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
in LIST\n\
--argv0 STRING use STRING as argv[0]\n\
diff -ur glibc-2.14.1+p1/sysdeps/generic/ldsodefs.h glibc-2.14.1/sysdeps/generic/ldsodefs.h
--- glibc-2.14.1+p1/sysdeps/generic/ldsodefs.h 2011-10-07 12:48:55.000000000 +0300
+++ glibc-2.14.1/sysdeps/generic/ldsodefs.h 2011-11-16 17:07:07.000000000 +0200
@@ -687,6 +687,12 @@
--audit LIST use objects named in LIST as auditors\n");
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index ffeb093..3116188 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -593,6 +593,12 @@ struct rtld_global_ro
/* 0 if internal pointer values should not be guarded, 1 if they should. */
EXTERN int _dl_pointer_guard;
......
* Thu Mar 20 2014 Davide Bettio <davide.bettio@ispirata.com> - 2.19
- Upgrade to 2.19
* Sat Mar 08 2014 Davide Bettio <davide.bettio@ispirata.com> - 2.18
- Do not build glibc for mipsel with -O3 enabled
......
# temporary needed for debuginfo change in rpm package
%define _unpackaged_files_terminate_build 0
%define glibcsrcdir eglibc-2.18
%define glibcsrcdir eglibc-2.19
### glibc.spec.in follows:
%define run_glibc_tests 0
%define multiarcharches %{ix86} x86_64
......@@ -8,7 +8,7 @@
Summary: Embedded GLIBC (EGLIBC) is a variant of the GNU C Library (GLIBC)
Name: glibc
Version: 2.18
Version: 2.19
Release: 1
# GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
......@@ -19,26 +19,34 @@ 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.18.orig.tar.xz
Source1: eglibc_2.18-0ubuntu2.debian.tar.xz
Source0: https://launchpad.net/ubuntu/+archive/primary/+files/eglibc_2.19.orig.tar.xz
Source1: eglibc_2.19-0ubuntu2.debian.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
Patch5: glibc-2.14.1-ldso-rpath-prefix-option.2.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
Patch8: glibc-2.14.1-ldso-nodefaultdirs-option.5.diff
#Patch9: eglibc-2.15-mips-async-unwind.patch
#Patch10: eglibc-2.15-mips-no-n32-n64.patch
Patch11: glibc-2.14-locarchive-fedora.patch
#Patch12: eglibc-2.15-disable-multilib.patch
Patch13: eglibc-2.15-use-usrbin-localedef.patch
Patch14: eglibc-2.15-fix-neon-libdl.patch
#Patch15: eglibc-2.15-shlib-make.patch
#Patch16: eglibc-2.17-linaro-optimizations.diff
Patch17: eglibc-2.18-sb2-workaround.patch
# glibc-2.19-ldso-nodefaultdirs-option.5.diff: required from scratchbox2
Patch8: glibc-2.19-ldso-nodefaultdirs-option.5.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
Provides: ldconfig
# The dynamic linker supports DT_GNU_HASH
......@@ -185,28 +193,37 @@ If unsure if you need this, don't install this package.
%prep
%setup -q -n %{glibcsrcdir} %{?glibc_release_unpack}
xz -dc %SOURCE1 | tar xf -
#%patch0 -p1
# glibc-arm-alignment-fix.patch
%patch1 -p1
%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
#%patch9 -p1
#%patch10 -p1
%patch11 -p1
#%patch12 -p1
# glibc-2.14-locarchive-fedora.patch
%patch9 -p1
%if 0%{?qemu_user_space_build}