CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
pkg-get: removed port (included in opt collection)
[ports/core-arm.git] / glibc / Optimize-__getpagesize-a-bit.patch
CommitLineData
5c8665cf
JB
1This is the important part of 8f4a5048eea6536ee85c0f2670adbb97d71e427d.
2Unfortunately the assertion fails in statically linked binaries.
3
4diff --git a/sysdeps/unix/sysv/linux/getpagesize.c b/sysdeps/unix/sysv/linux/getpagesize.c
5index 6d03b3b..0866079 100644
6--- a/sysdeps/unix/sysv/linux/getpagesize.c
7+++ b/sysdeps/unix/sysv/linux/getpagesize.c
8@@ -1,4 +1,4 @@
9-/* Copyright (C) 1991,1992,1995-1997,2000,2002,2004
10+/* Copyright (C) 1991,1992,1995-1997,2000,2002,2004,2010
11 Free Software Foundation, Inc.
12 This file is part of the GNU C Library.
13
14@@ -17,30 +17,37 @@
15 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
16 02111-1307 USA. */
17
18+#include <assert.h>
19 #include <unistd.h>
20 #include <sys/param.h>
21
22 #include <ldsodefs.h>
23+#include <kernel-features.h>
24
25 /* Return the system page size. */
26 int
27 __getpagesize ()
28 {
29+#ifdef __ASSUME_AT_PAGESIZE
30+ assert (GLRO(dl_pagesize) != 0);
31+ return GLRO(dl_pagesize);
32+#else
33 if (GLRO(dl_pagesize) != 0)
34 return GLRO(dl_pagesize);
35
36-#ifdef EXEC_PAGESIZE
37+# ifdef EXEC_PAGESIZE
38 return EXEC_PAGESIZE;
39-#else /* No EXEC_PAGESIZE. */
40-#ifdef NBPG
41-#ifndef CLSIZE
42-#define CLSIZE 1
43-#endif /* No CLSIZE. */
44+# else /* No EXEC_PAGESIZE. */
45+# ifdef NBPG
46+# ifndef CLSIZE
47+# define CLSIZE 1
48+# endif /* No CLSIZE. */
49 return NBPG * CLSIZE;
50-#else /* No NBPG. */
51+# else /* No NBPG. */
52 return NBPC;
53-#endif /* NBPG. */
54-#endif /* EXEC_PAGESIZE. */
55+# endif /* NBPG. */
56+# endif /* EXEC_PAGESIZE. */
57+#endif
58 }
59 libc_hidden_def (__getpagesize)
60 weak_alias (__getpagesize, getpagesize)
61--
621.7.2.1
63