summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-24 21:26:37 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-25 10:02:15 +0100
commit962c7209b6f8b708d0b9337cbe5072aa52cda1bb (patch)
tree194a978909dd2265db068c51099103f9ac9da450
parent0a345d8e9765f4c84056355ec54908167721ec37 (diff)
make mips (and others?) pass java extension smoketest with gcj's libjvm
i.e. force the __data_start symbol to exist in any executables that link against libuno_sal so that dlopening of the libgcj provided libjvm.so on some platforms where it needs that symbol will succeed. e.g. Debian mips/lenny with gcc 4.3. With this in place the smoketest succeeds with libgcj provided java. Quite possibly also required/helpful for s390x/s390 and maybe some others. Without it the dlopen of libjvm.so will fail with __data_start not found Change-Id: I01a4de3d7e72d000a8d56a1b9101a187c26a1751
-rw-r--r--sal/osl/unx/util.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sal/osl/unx/util.c b/sal/osl/unx/util.c
index fd69c0dab8db..b344f2b9c520 100644
--- a/sal/osl/unx/util.c
+++ b/sal/osl/unx/util.c
@@ -349,4 +349,21 @@ void osl_interlockedCountCheckForSingleCPU(void)
#endif /* defined(_SC_NPROCESSORS_CONF) */
#endif
+#if defined(__GNUC__)
+//force the __data_start symbol to exist in any executables that link against
+//libuno_sal so that dlopening of the libgcj provided libjvm.so on some
+//platforms where it needs that symbol will succeed. e.g. Debian mips/lenny
+//with gcc 4.3. With this in place the smoketest succeeds with libgcj provided
+//java. Quite possibly also required/helpful for s390x/s390 and maybe some
+//others. Without it the dlopen of libjvm.so will fail with __data_start
+//not found
+#pragma weak __data_start
+extern int __data_start[];
+#pragma weak data_start
+extern int data_start[];
+#pragma weak _end
+extern int _end[];
+static void *dummy[] __attribute__((used)) = {__data_start, data_start, _end};
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */