This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/21908] dynamic linker broke on ia64 (mmap2 consolidation is the suspect)


https://sourceware.org/bugzilla/show_bug.cgi?id=21908

--- Comment #3 from Sergei Trofimovich <slyfox at inbox dot ru> ---
(In reply to Andreas Schwab from comment #2)
> Generically, mmap2 is supposed to take units of 4K, but a few architectures
> got this wrong, including m68k and ia64.  Copy from
> sysdeps/unix/sysv/linux/m68k/mmap_internal.h.

That was my first attempt, yes. But does m68k work?
MMAP2_PAGE_SHIFT is not used anywhere in glibc source code at all.
I suspect mmap_internal.h should have set MMAP2_PAGE_UNIT to -1
to have any effect on pagesize detection.

But if I apply that for m68 (or ia64):

--- a/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
+++ b/sysdeps/unix/sysv/linux/m68k/mmap_internal.h
@@ -24,3 +24,3 @@
    dynamically with getpagesize.  */
-#define MMAP2_PAGE_SHIFT -1
+#define MMAP2_PAGE_UNIT -1

build fails as:

m68k-unknown-linux-gnu-gcc ../sysdeps/unix/sysv/linux/mmap64.c -c -std=gnu11
-fgnu89-inline  -O2 -Wall -Werror -Wundef -Wwrite-strings -fmerge-all-constants
-fno-stack-protector -frounding-math -g -Wstrict-prototypes
-Wold-style-definition     -ftls-model=initial-exec   -U_FORTIFY_SOURCE  
-I../include -I/home/slyfox/dev/git/glibc-build-m68k/misc 
-I/home/slyfox/dev/git/glibc-build-m68k 
-I../sysdeps/unix/sysv/linux/m68k/m680x0  -I../sysdeps/unix/sysv/linux/m68k 
-I../sysdeps/m68k/nptl  -I../sysdeps/unix/sysv/linux/include
-I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread 
-I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv 
-I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/m68k/m680x0/m68020 
-I../sysdeps/m68k/m680x0/fpu  -I../sysdeps/m68k/m680x0 
-I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96 
-I../sysdeps/m68k/fpu  -I../sysdeps/m68k  -I../sysdeps/wordsize-32 
-I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/ieee754 
-I../sysdeps/generic  -I.. -I../libio -I.   -D_LIBC_REENTRANT -include
/home/slyfox/dev/git/glibc-build-m68k/libc-modules.h -DMODULE_NAME=libc
-include ../include/libc-symbols.h       -DTOP_NAMESPACE=glibc -o
/home/slyfox/dev/git/glibc-build-m68k/misc/mmap64.o -MD -MP -MF
/home/slyfox/dev/git/glibc-build-m68k/misc/mmap64.o.dt -MT
/home/slyfox/dev/git/glibc-build-m68k/misc/mmap64.o
../sysdeps/unix/sysv/linux/mmap64.c: In function '__mmap64':
../sysdeps/unix/sysv/linux/mmap64.c:30:29: error: result of '2 << 31u' requires
34 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
   ((-(MMAP2_PAGE_UNIT << 1) << (8 * sizeof (off_t) - 1)))
                             ^
../sysdeps/unix/sysv/linux/mmap64.c:32:24: note: in expansion of macro
'MMAP_OFF_HIGH_MASK'
 #define MMAP_OFF_MASK (MMAP_OFF_HIGH_MASK | MMAP_OFF_LOW_MASK)
                        ^~~~~~~~~~~~~~~~~~
../sysdeps/unix/sysv/linux/mmap64.c:44:16: note: in expansion of macro
'MMAP_OFF_MASK'
   if (offset & MMAP_OFF_MASK)
                ^~~~~~~~~~~~~

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]