patches/glibc/ports-2.12.1/190-localedef-mmap.patch
author "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
Thu Jul 28 22:09:31 2011 +0200 (2011-07-28)
changeset 2573 424fa2092ace
permissions -rw-r--r--
scripts/libc: do not build add-ons by default

Currently, no --enable-add-ons option is passed to libc configure when
"$(do_libc_add_ons_list ,)" is empty, which makes configure automatically search
for present add-ons. In that case, all present add-ons are built, although
no add-on was selected by the user in the config. Moreover, this can make the
configure fail if some non-standard add-ons like eglibc-localedef are present.

This behavior also leads to an inconsistency from a user point of view between
the following cases:
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS="none" in the config,
which makes "$(do_libc_add_ons_list ,)" return "", so all present add-ons
are built.
- LIBC_ADDONS_LIST="", LIBC_GLIBC_USE_PORTS=n and THREADS!="none" in the
config, which makes "$(do_libc_add_ons_list ,)" return the add-on supporting
the chosen threading implementation, e.g. "nptl", so only this add-on is
built.

This patch disables the building of all add-ons in that case.

It is still possible to build all present add-ons by adding --enable-add-ons to
LIBC_GLIBC_EXTRA_CONFIG_ARRAY.

Signed-off-by: "Benoît THÉBAUDEAU" <benoit.thebaudeau@advansee.com>
yann@2437
     1
sniped from Debian
yann@2437
     2
http://bugs.gentoo.org/289615
yann@2437
     3
yann@2437
     4
2009-10-27  Aurelien Jarno  <aurelien@aurel32.net>
yann@2437
     5
yann@2437
     6
	* locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
yann@2437
     7
	used later with MMAP_FIXED | MMAP_SHARED to cope with different
yann@2437
     8
	alignment restrictions.
yann@2437
     9
yann@2437
    10
diff -durN glibc-2.12.1.orig/locale/programs/locarchive.c glibc-2.12.1/locale/programs/locarchive.c
yann@2437
    11
--- glibc-2.12.1.orig/locale/programs/locarchive.c	2009-04-27 16:07:47.000000000 +0200
yann@2437
    12
+++ glibc-2.12.1/locale/programs/locarchive.c	2009-11-13 00:50:01.000000000 +0100
yann@2437
    13
@@ -134,7 +134,7 @@
yann@2437
    14
   size_t reserved = RESERVE_MMAP_SIZE;
yann@2437
    15
   int xflags = 0;
yann@2437
    16
   if (total < reserved
yann@2437
    17
-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
yann@2437
    18
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
yann@2437
    19
 		       -1, 0)) != MAP_FAILED))
yann@2437
    20
     xflags = MAP_FIXED;
yann@2437
    21
   else
yann@2437
    22
@@ -396,7 +396,7 @@
yann@2437
    23
   size_t reserved = RESERVE_MMAP_SIZE;
yann@2437
    24
   int xflags = 0;
yann@2437
    25
   if (total < reserved
yann@2437
    26
-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
yann@2437
    27
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
yann@2437
    28
 		       -1, 0)) != MAP_FAILED))
yann@2437
    29
     xflags = MAP_FIXED;
yann@2437
    30
   else
yann@2437
    31
@@ -614,7 +614,7 @@
yann@2437
    32
   int xflags = 0;
yann@2437
    33
   void *p;
yann@2437
    34
   if (st.st_size < reserved
yann@2437
    35
-      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
yann@2437
    36
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
yann@2437
    37
 		       -1, 0)) != MAP_FAILED))
yann@2437
    38
     xflags = MAP_FIXED;
yann@2437
    39
   else