VirtualBox Guest Addtions: fix build on x86_64

* kernel rejects vbox drivers with "Bad data" message, help needed.
* icons are missing from userland apps
This commit is contained in:
Sergei Reznikov
2017-01-23 17:58:58 +00:00
parent d57403e513
commit befb49f568
2 changed files with 33 additions and 11 deletions

View File

@@ -1,11 +1,11 @@
From c4b6e70754a3318ca4708fd2efc862b257231a64 Mon Sep 17 00:00:00 2001
From 1123a48d5af3c496133d14498f94b0937857ee21 Mon Sep 17 00:00:00 2001
From: Segey Reznikov <diver@gelios.net>
Date: Wed, 18 Jan 2017 00:26:11 +0000
Subject: Haiku fixes
diff --git a/Config.kmk b/Config.kmk
index 8637671..7c25b92 100644
index 8637671..9f61407 100644
--- a/Config.kmk
+++ b/Config.kmk
@@ -2746,8 +2746,8 @@ if $(KBUILD_TARGET) == "linux" \
@@ -25,7 +25,7 @@ index 8637671..7c25b92 100644
#TODO: sort this out
-TEMPLATE_VBOXR0DRV_LDFLAGS = -shared -no-undefined -dc -dy -lroot -rpath-link /boot/system/develop/lib/x86 --no-add-needed /boot/system/develop/lib/_KERNEL_ --no-add-needed /boot/system/develop/lib/haiku_version_glue.o
-TEMPLATE_VBOXR0DRV_CFLAGS = -fno-PIC \
+TEMPLATE_VBOXR0DRV_LDFLAGS = -shared -no-undefined -dc -dy -lstdc++ -lsupc++ -lroot -rpath-link /system/develop/lib --no-add-needed /system/develop/lib/_KERNEL_ --no-add-needed /system/develop/lib/haiku_version_glue.o
+TEMPLATE_VBOXR0DRV_LDFLAGS = -shared -no-undefined -dc -dy -lstdc++ -lsupc++ -lroot -rpath-link /system/develop/lib /system/develop/lib/_KERNEL_ /system/develop/lib/haiku_version_glue.o
+TEMPLATE_VBOXR0DRV_CFLAGS = -fPIC \
$(VBOX_GCC_WARN) -Wstrict-prototypes $(VBOX_GCC_Wno-pointer-sign) -Wno-sign-compare \
$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
@@ -167,6 +167,19 @@ index 7ba42a4..8722647 100644
return NULL;
}
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
index 26fcb2b..873b2a8 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
+++ b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR0LibSharedFolders.c
@@ -75,7 +75,7 @@ DECLVBGL(int) VbglR0SfConnect(PVBGLSFCLIENT pClient)
RT_ZERO(data);
data.result = VINF_SUCCESS;
data.Loc.type = VMMDevHGCMLoc_LocalHost_Existing;
-#if defined(RT_OS_LINUX)
+#if defined(RT_OS_LINUX) || defined(RT_OS_HAIKU)
strcpy(data.Loc.u.host.achName, "VBoxSharedFolders");
#else
RTStrCopy(data.Loc.u.host.achName, sizeof(data.Loc.u.host.achName), "VBoxSharedFolders");
diff --git a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp b/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
index 9510688..12ceb20 100644
--- a/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
@@ -194,10 +207,19 @@ index 07c9e61..6badd17 100644
int16 active_readers;
// Only > 0 while a writer is waiting: number
diff --git a/src/VBox/Additions/haiku/SharedFolders/vnode_cache.cpp b/src/VBox/Additions/haiku/SharedFolders/vnode_cache.cpp
index 92bee8f..fc1ebc2 100644
index 92bee8f..30fbc98 100644
--- a/src/VBox/Additions/haiku/SharedFolders/vnode_cache.cpp
+++ b/src/VBox/Additions/haiku/SharedFolders/vnode_cache.cpp
@@ -77,7 +77,7 @@ static ino_t g_nextVnid = 1;
@@ -46,6 +46,8 @@
#include "vboxsf.h"
#include "OpenHashTable.h"
+void* __dso_handle = NULL;
+
struct HashTableDefinition
{
typedef uint32 KeyType;
@@ -77,7 +79,7 @@ static ino_t g_nextVnid = 1;
mutex g_vnodeCacheLock;