patches/glibc/ports-2.12.1/190-localedef-mmap.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 22:43:07 2011 +0200 (2011-07-17)
changeset 2893 a8a65758664f
permissions -rw-r--r--
cc/gcc: do not use the core pass-2 to build the baremetal compiler

In case we build a baremetal compiler, use the standard passes:
- core_cc is used to build the C library;
- as such, it is meant to run on build, not host;
- the final compiler is meant to run on host;

As the current final compiler step can not build a baremetal compiler,
call the core backend from the final step.

NB: Currently, newlib is built during the start_files pass, so we have
to have a core compiler by then... Once we can build the baremetal
compiler from the final cc step, then we can move the newlib build to
the proper step, and then get rid of the core pass-1 static compiler...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
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