From 962c7209b6f8b708d0b9337cbe5072aa52cda1bb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 24 Jul 2012 21:26:37 +0100 Subject: 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 --- sal/osl/unx/util.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sal') 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: */ -- cgit