[patch] 2.4, head: PAGE_SHIFT changes break glibc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ralf,

 Recent changes made to <asm/page.h> break a build of glibc 2.2.5 for me.  
Compilation bails out due to PAGE_SHIFT being undeclared -- glibc pulls it
as it uses PAGE_SIZE in linuxthreads/internals.h.  The PAGE_SHIFT macro
depends on configuration now (I use an empty cofinguration for glibc
headers, hence the error) and thus it'd better be simply private to the
kernel.  Glibc will then use sysconf(_SC_PAGE_SIZE) which now better
reflects actual configuration of the system it's run on.

 Here's a patch that limits PAGE_SIZE to the kernel scope.  If there's any
other program that needs PAGE_SIZE, it should be converted to
sysconf(_SC_PAGE_SIZE) as well.

 OK to apply?

 Additionally, I think we should also implement the getpagesize syscall to
benefit statically linked programs (and make glibc use it like for other
platforms that use variable page sizes).  Finally, I'm not sure such a
noticeable change was a good move in these late days of 2.4...

  Maciej

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

linux-include-mips-2.4.22-20031115-mips-page_size.patch
diff -up --recursive --new-file linux-include-mips-2.4.22-20031115.macro/include/asm-mips/page.h linux-include-mips-2.4.22-20031115/include/asm-mips/page.h
--- linux-include-mips-2.4.22-20031115.macro/include/asm-mips/page.h	2003-10-17 02:57:33.000000000 +0000
+++ linux-include-mips-2.4.22-20031115/include/asm-mips/page.h	2003-11-21 09:29:52.000000000 +0000
@@ -12,6 +12,8 @@
 
 #include <linux/config.h>
 
+#ifdef __KERNEL__
+
 /*
  * PAGE_SHIFT determines the page size
  */
@@ -27,8 +29,6 @@
 #define PAGE_SIZE	(1L << PAGE_SHIFT)
 #define PAGE_MASK	(~(PAGE_SIZE-1))
 
-#ifdef __KERNEL__
-
 #ifndef __ASSEMBLY__
 
 #include <asm/cacheflush.h>
diff -up --recursive --new-file linux-include-mips-2.4.22-20031115.macro/include/asm-mips64/page.h linux-include-mips-2.4.22-20031115/include/asm-mips64/page.h
--- linux-include-mips-2.4.22-20031115.macro/include/asm-mips64/page.h	2003-10-17 02:57:34.000000000 +0000
+++ linux-include-mips-2.4.22-20031115/include/asm-mips64/page.h	2003-11-21 09:30:10.000000000 +0000
@@ -11,6 +11,8 @@
 
 #include <linux/config.h>
 
+#ifdef __KERNEL__
+
 /*
  * PAGE_SHIFT determines the page size
  */
@@ -26,8 +28,6 @@
 #define PAGE_SIZE	(1UL << PAGE_SHIFT)
 #define PAGE_MASK	(~(PAGE_SIZE-1))
 
-#ifdef __KERNEL__
-
 #ifndef __ASSEMBLY__
 
 #include <asm/cacheflush.h>


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux