Hello,

During VirtualBox-3.2.4 building to ALTLinux Sisyphus I found a
problem with xorg drivers linkage.
http://git.altlinux.org/tasks/25568/task/log.3
       i586: NEW bad_elf_symbols detected:
xorg-x11-drv-vboxmouse-3.2.4-alt2.i586.rpm
/usr/lib/X11/modules/input/vboxmouse_drv.so     U       rtThreadGet
xorg-x11-drv-vboxvideo-3.2.4-alt2.i586.rpm
/usr/lib/X11/modules/drivers/vboxvideo_drv.so   U       rtThreadGet
       x86_64: NEW bad_elf_symbols detected:
xorg-x11-drv-vboxmouse-3.2.4-alt2.x86_64.rpm
/usr/lib64/X11/modules/input/vboxmouse_drv.so   U       rtThreadGet
xorg-x11-drv-vboxvideo-3.2.4-alt2.x86_64.rpm
/usr/lib64/X11/modules/drivers/vboxvideo_drv.so U       rtThreadGet
2010-Jun-10 22:52:02 :: ELF symbols check FAILED
2010-Jun-10 22:52:02 :: task #25568 for sisyphus FAILED

The problem comes from RuntimeGuestR3Mini linkage without including
thread.o, but with RT_WITH_ICONV_CACHE defined.

RuntimeGuestR3Mini includes src/VBox/Runtime/r3/posix/utf8-posix.cpp,
which consists next code:

DECLINLINE(int) rtStrConvertWrapper(const char *pchInput, size_t
cchInput, const char *pszInputCS,
                                    char **ppszOutput, size_t
cbOutput, const char *pszOutputCS,
                                    unsigned cFactor, RTSTRICONV
enmCacheIdx)
{
#ifdef RT_WITH_ICONV_CACHE
    RTTHREAD hSelf = RTThreadSelf();
    if (hSelf != NIL_RTTHREAD)
    {
        PRTTHREADINT pThread = rtThreadGet(hSelf);
        if (   pThread
            && (pThread->fIntFlags & (RTTHREADINT_FLAGS_ALIEN |
RTTHREADINT_FLAGS_MAIN)) != RTTHREADINT_FLAGS_ALIEN)
            return rtstrConvertCached(pchInput, cchInput, pszInputCS,
                                      (void **)ppszOutput, cbOutput,
pszOutputCS,
                                      cFactor, (iconv_t
*)&pThread->ahIconvs[enmCacheIdx]);
    }
#endif
    return rtStrConvertUncached(pchInput, cchInput, pszInputCS,
                                (void **)ppszOutput, cbOutput,
pszOutputCS,
                                cFactor);
}

I solved this problem with includes patch.
In this patch I replace rtThreadGet() function into common
threadbasic.cpp, which includes into RuntimeGuestR3 and
RuntimeGuestR3Mini.

-- 
Sin (Sinelnikov Evgeny)
diff --git a/VirtualBox/src/VBox/Runtime/Makefile.kmk b/VirtualBox/src/VBox/Runtime/Makefile.kmk
index 01de4ba..a32210c 100644
--- a/VirtualBox/src/VBox/Runtime/Makefile.kmk
+++ b/VirtualBox/src/VBox/Runtime/Makefile.kmk
@@ -276,6 +276,7 @@ RuntimeR3_SOURCES       = \
 	common/misc/semspingpong.cpp \
 	common/misc/sg.cpp \
 	common/misc/thread.cpp \
+	common/misc/threadbasic.cpp \
 	common/misc/zip.cpp \
 	common/misc/term.cpp \
 	common/misc/tar.cpp \
@@ -949,6 +950,9 @@ RuntimeGuestR3Mini_SOURCES.linux = \
 	r3/posix/fileio-posix.cpp \
 	r3/posix/path-posix.cpp \
 	r3/posix/utf8-posix.cpp
+# due rtStrConvertWrapper() with RT_WITH_ICONV_CACHE
+RuntimeGuestR3Mini_SOURCES.linux += \
+ 	common/misc/threadbasic.cpp
 RuntimeGuestR3Mini_SOURCES.solaris = \
 	r3/posix/alloc-posix.cpp \
 	r3/posix/env-posix.cpp \
diff --git a/VirtualBox/src/VBox/Runtime/common/misc/thread.cpp b/VirtualBox/src/VBox/Runtime/common/misc/thread.cpp
index b36f2e1..53cc659 100644
--- a/VirtualBox/src/VBox/Runtime/common/misc/thread.cpp
+++ b/VirtualBox/src/VBox/Runtime/common/misc/thread.cpp
@@ -500,32 +500,6 @@ PRTTHREADINT rtThreadGetByNative(RTNATIVETHREAD NativeThread)
 
 
 /**
- * Gets the per thread data structure for a thread handle.
- *
- * @returns Pointer to the per thread data structure for Thread.
- *          The caller must release the thread using rtThreadRelease().
- * @returns NULL if Thread was not found.
- * @param   Thread      Thread id which structure is to be returned.
- */
-PRTTHREADINT rtThreadGet(RTTHREAD Thread)
-{
-    if (    Thread != NIL_RTTHREAD
-        &&  VALID_PTR(Thread))
-    {
-        PRTTHREADINT pThread = (PRTTHREADINT)Thread;
-        if (    pThread->u32Magic == RTTHREADINT_MAGIC
-            &&  pThread->cRefs > 0)
-        {
-            ASMAtomicIncU32(&pThread->cRefs);
-            return pThread;
-        }
-    }
-
-    AssertMsgFailed(("Thread=%RTthrd\n", Thread));
-    return NULL;
-}
-
-/**
  * Release a per thread data structure.
  *
  * @returns New reference count.
diff --git a/VirtualBox/src/VBox/Runtime/common/misc/threadbasic.cpp b/VirtualBox/src/VBox/Runtime/common/misc/threadbasic.cpp
new file mode 100644
index 0000000..e8ef8a2
--- /dev/null
+++ b/VirtualBox/src/VBox/Runtime/common/misc/threadbasic.cpp
@@ -0,0 +1,63 @@
+/* $Id: thread.cpp $ */
+/** @file
+ * IPRT - Threads, basic routines.
+ */
+
+/*
+ * Copyright (C) 2006-2010 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+
+/*******************************************************************************
+*   Header Files                                                               *
+*******************************************************************************/
+#define LOG_GROUP RTLOGGROUP_THREAD
+#include <iprt/thread.h>
+#include "internal/iprt.h"
+
+#include <iprt/asm.h>
+#include "internal/thread.h"
+
+
+/**
+ * Gets the per thread data structure for a thread handle.
+ *
+ * @returns Pointer to the per thread data structure for Thread.
+ *          The caller must release the thread using rtThreadRelease().
+ * @returns NULL if Thread was not found.
+ * @param   Thread      Thread id which structure is to be returned.
+ */
+PRTTHREADINT rtThreadGet(RTTHREAD Thread)
+{
+    if (    Thread != NIL_RTTHREAD
+        &&  VALID_PTR(Thread))
+    {
+        PRTTHREADINT pThread = (PRTTHREADINT)Thread;
+        if (    pThread->u32Magic == RTTHREADINT_MAGIC
+            &&  pThread->cRefs > 0)
+        {
+            ASMAtomicIncU32(&pThread->cRefs);
+            return pThread;
+        }
+    }
+
+    AssertMsgFailed(("Thread=%RTthrd\n", Thread));
+    return NULL;
+}
_______________________________________________
vbox-dev mailing list
[email protected]
http://vbox.innotek.de/mailman/listinfo/vbox-dev

Reply via email to