Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 305785 - sys-libs/glibc not exposing newer madvise() defines
Summary: sys-libs/glibc not exposing newer madvise() defines
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo QEMU Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-18 18:03 UTC by Romik
Modified: 2010-05-01 19:17 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch enable KMS (qemu-kvm-0.12-kms.patch,352 bytes, patch)
2010-02-18 18:06 UTC, Romik
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Romik 2010-02-18 18:03:52 UTC
in exec.c

#ifdef MADV_MERGEABLE
        madvise(new_block->host, size, MADV_MERGEABLE);
#endif

MADV_MERGEABLE undefined, KMS not work

need added this patch to ebuild -

--- qemu-kvm-0.12.2_orig/exec.c>2010-02-18 19:04:32.000000000 +0200
+++ qemu-kvm-0.12.2/exec.c<---->2010-02-18 19:10:39.000000000 +0200
@@ -22,6 +22,7 @@
 #else
 #include <sys/types.h>
 #include <sys/mman.h>
+#include <asm-generic/mman-common.h>
 #endif
 #include <stdlib.h>
 #include <stdio.h>
Comment 1 Romik 2010-02-18 18:06:12 UTC
Created attachment 220197 [details, diff]
patch enable KMS
Comment 2 Luca Barbato gentoo-dev 2010-02-18 18:31:40 UTC
it doesn't look correct, probably we just need to update the system headers a bit
Comment 3 Romik 2010-02-18 19:13:30 UTC
(In reply to comment #2)
> it doesn't look correct, probably we just need to update the system headers a
> bit 

i am use latest linux-headers (2.6.32)

MADV_MERGEABLE defined only in asm-generic/mman-common.h (included in asm/mman.h)
in sys/mman.h not defined

properly be include <asm/mman.h>.....

ps: sorry for my english)
Comment 4 Luca Barbato gentoo-dev 2010-02-18 20:41:48 UTC
asm/mman.h should be included already through the sys/mman.h ... strange
Comment 5 Romik 2010-02-18 21:01:40 UTC
I do not think so -

$ grep asm/mman.h /usr/include/sys/mman.h 
$ grep /mman.h /usr/include/sys/mman.h 
#include <bits/mman.h>
#endif	/* sys/mman.h */

$ qfile /usr/include/sys/mman.h 
sys-libs/glibc-2.11-r1 (/usr/include/sys/mman.h)

$ qfile /usr/include/asm/mman.h 
sys-kernel/linux-headers-2.6.32 (/usr/include/asm/mman.h)


may be developers forgot to add <asm/mman.h> ?
or it is should be included in other versions of glibc ?
Comment 6 Romik 2010-02-18 21:11:23 UTC
> may be developers forgot to add <asm/mman.h> ?

qemu-kvm developers )
Comment 7 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2010-02-18 21:47:22 UTC
Did you remember to rebuild glibc after updating linux-headers?
Comment 8 Romik 2010-02-18 23:16:55 UTC
(In reply to comment #7)
> Did you remember to rebuild glibc after updating linux-headers?
> 

yes, glibc has been rebuild after updating linux-headers...
Comment 9 Doug Goldstein (RETIRED) gentoo-dev 2010-03-02 16:35:23 UTC
I can confirm that glibc isn't pulling in the correct bits after a recompile. This issue however isn't with qemu-kvm needing to pull in more headers, its the fact that glibc needs to expose these defines properly to user-space.
Comment 10 SpanKY gentoo-dev 2010-03-07 01:06:53 UTC
these have been added to upstream glibc's mman.h, but you probably want to have things working today rather than in a few months.  so i suggest you do something like:
#include <sys/mman.h>
#ifndef MADV_MERGEABLE
#include <asm/mman.h>
#endif
Comment 11 Thomas Sachau gentoo-dev 2010-04-03 13:52:50 UTC
Fixed with 0.12.3-r1
Comment 12 Paul Tobias 2010-05-01 11:44:37 UTC
Please note this has been fixed upstream with glibc 2.11.1 which is in the tree now, see gentoo bug #315477:
        [BZ #10972]
        * sysdeps/unix/sysv/linux/powerpc/bits/mman.h: Add new MADV_*
        constants from recent kernels.
        * sysdeps/unix/sysv/linux/i386/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/x86_64/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/s390/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/sparc/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/sh/bits/mman.h: Likewise.
        * sysdeps/unix/sysv/linux/ia64/bits/mman.h: Likewise.

I recommend removing the patch and maybe adding an elog message, that KSM will only work with >=sys-kernel/linux-headers-2.6.32 and >=sys-libs/glibc-2.11.1
Comment 13 Thomas Sachau gentoo-dev 2010-05-01 19:17:21 UTC
Why should we change the currently working versions with the patch also working with glibc-2.11.1?

If we require those versions, that would not be an elog message, but a dependency. But why do you want to force testing versions on users, when the stable ones do also work? ;-)

So as short answer: No, we wont change the ebuilds now, but might drop the patch, once glibc-2.11.1 got stable on all relevant arches.