Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'jb36174' into 'master'
[glibc] Update to glibc-2.25, fixes jb#36174

See merge request mer-core/glibc!14
  • Loading branch information
Matti Kosola committed Dec 4, 2018
2 parents 12d8199 + c2700b8 commit 1d63539
Show file tree
Hide file tree
Showing 17 changed files with 483 additions and 379 deletions.
10 changes: 5 additions & 5 deletions build-locale-archive.c
Expand Up @@ -12,10 +12,10 @@
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#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";
Expand All @@ -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
};

Expand Down Expand Up @@ -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);

Expand Down
31 changes: 0 additions & 31 deletions eglibc-2.15-use-usrbin-localedef.patch

This file was deleted.

31 changes: 0 additions & 31 deletions eglibc-2.19-sb2-workaround.patch

This file was deleted.

Binary file removed eglibc_2.19-0ubuntu6.13.debian.tar.xz
Binary file not shown.
27 changes: 0 additions & 27 deletions glibc-2.13-no-timestamping.patch

This file was deleted.

20 changes: 8 additions & 12 deletions glibc-arm-runfast.patch → glibc-2.25-arm-runfast.patch
Expand Up @@ -4,40 +4,36 @@ 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)
+
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
133 changes: 133 additions & 0 deletions 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
<http://www.gnu.org/licenses/>. */

-/* 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/errno.h>
+
+/* 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 <bits/endian.h> directly; include <endian.h> 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
19 changes: 9 additions & 10 deletions glibc-2.14.1-elf-rtld.c.1.diff → glibc-2.25-elf-rtld.diff
Expand Up @@ -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;

0 comments on commit 1d63539

Please sign in to comment.