So, you're using gcc 4.5. You have to apply the patch below to your UML kernel.
Anyway, consider using a recent UML kernel. Or at least one which an
active stable tree.

commit 534e3adbd22efa327e6ff27cf2d8ebaad8382ecd
Author: Richard Weinberger <rich...@nod.at>
Date:   Wed Apr 27 15:26:54 2011 -0700

    um: adjust current_thread_info() for newer gcc versions

    In some cases gcc >= 4.5.2 will optimize away current_thread_info().  To
    prevent gcc from doing so the stack address has to be obtained via inline
    asm.

    Signed-off-by: Richard Weinberger <rich...@nod.at>
    Acked-by: Kirill A. Shutemov <kir...@shutemov.name>
    Signed-off-by: Andrew Morton <a...@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>

diff --git a/arch/um/include/asm/thread_info.h
b/arch/um/include/asm/thread_info.h
index e2cf786..5bd1bad 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -49,7 +49,10 @@ static inline struct thread_info *current_thread_info(void)
 {
        struct thread_info *ti;
        unsigned long mask = THREAD_SIZE - 1;
-       ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
+       void *p;
+
+       asm volatile ("" : "=r" (p) : "0" (&ti));
+       ti = (struct thread_info *) (((unsigned long)p) & ~mask);
        return ti;
 }

-- 
Thanks,
//richard

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to