octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java support in MXE build


From: Anirudha Bose
Subject: Re: Java support in MXE build
Date: Mon, 8 Jul 2013 17:30:48 +0530


On Mon, Jul 8, 2013 at 3:24 AM, PhilipNienhuis <address@hidden> wrote:
Michael Goffioul wrote
> On Tue, Jul 2, 2013 at 7:09 AM, PhilipNienhuis &lt;

> pr.nienhuis@

> &gt;wrote:
>
>> >>> ./usr/bin/i686-pc-mingw32-nm
>> >>> tmp-octave/octave-3.7.5/.build/libinterp/.libs/liboctinterp.dll.a |
>> grep
>> >>> '
>> >>> T '
>> >>>
>> >>
>> >> Yes. I got the following output:
>> >>
>> >> 00000000 T address@hidden
>> >> 00000000 T address@hidden
>> >> 00000000 T address@hidden
>> >> 00000000 T address@hidden
>> >> 00000000 T address@hidden
>> >>
>> >>
>> > Ok, I think I figured out the issue. This is better explained here [1].
>> > Basically, the linker export all symbols by default. When
>> > --export-all-symbols is not explicitly given on the command line, it
>> may
>> > not export all symbols if some symbols are marked with dllexport. And
>> this
>> > is the case when you enable Java support, through the JNIEXPORT macro
>> in
>> > ov-java.cc. As a result, you end up with a DLL where *only* the JNI
>> > functions are exported.
>>
>> Note that the same happens when llvm is enabled (with the --enable-jit
>> configure option in MXE builds).
>> I described this as well in the original post on the maintainers ML.
>>
>> So, does llvm also have macros stripping out these linker flags?
>>
>
> Note that it's not stripping linker flags. In the case of Java, it's just
> the linker behaving differently when it sees dllexport in the object files
> (it doesn't do automatic symbol export). For LLVM, I'm not sure. Try to
> run
> the "nm" command above to see what symbols are exported by
> liboctinterp.dll.a.

It seems you did pinpoint the issue.

Before building Octave today (cloned from repo) on MinGW using MXE-built
dependencies, I did (from MinGW home subdir):

export LDFLAGS=-Wl,--export-all-symbols
export JAVA_HOME=<...path to JDK...>
source mxe-octave/tools/set_mxe_env.sh    ## by John D, to set needed
environment vars

...and then the usual bootstrap / configure --enable-docs=no --enable-jit /
make

Hi Philip.
I did what you instructed above while cross-building mxe-octave, but I am still getting the same errors. I will now try the same natively on Windows. Did you successfully cross-compile Octave with Java and JIT support?


which in the end yielded an octave.exe ('./run-octave &') with properly
working Java and LLVM support built-in.

So, where should the "-Wl,--export-all-symbols" flag be entered? I looked
around in the various Makefile.* & configure.* files; as you say this flag
is present in the MinGW section in configure.ac but that doesn't seem to
survive for libinterp.
In the Java section (L.2508 and up) LDFLAGS is processed for OSX; could a
similar trick work for MinGW?

FTR, the fix isn't needed only for MXE/native but rather for any MinGW build
of Octave.

Philip




--
View this message in context: http://octave.1599824.n4.nabble.com/Java-support-in-MXE-build-tp4652996p4655306.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]