delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/04/12/11:19:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,TW_UU,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Hans Horn <hannes AT 2horns DOT com>
Subject: Re: 64bit (g)fortran JNI
Date: Tue, 12 Apr 2011 08:19:28 -0700
Lines: 57
Message-ID: <io1qi6$snp$1@dough.gmane.org>
References: <io1o4k$euu$1 AT dough DOT gmane DOT org> <BANLkTikh=3DLDE7s-yVOYo=CZ6u9GNvfXw AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9
In-Reply-To: <BANLkTikh=3DLDE7s-yVOYo=CZ6u9GNvfXw@mail.gmail.com>
Cc: mingw-w64-public AT lists DOT sourceforge DOT net
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 4/12/2011 7:48 AM, Kai Tietz wrote:
> 2011/4/12 Hans Horn<hannes AT 2horns DOT com>:
>> Folks,
>>
>> has anybody got any experience interfacing (g)fortran routines with Java via
>> JNI?
>>
>> I'm on 64bit Windows7 using cygwin
>> x86_64-w64-mingw32-gcc and x86_64-w64-mingw32-gfortran, both v4.5.2
>>
>> Java: jdk-6u24-windows-x64
>>
>> Even though I can statically link the JNI code successfully (using gfortran
>> as linker), calling any native method from Java crashes the JVM - even when
>> no fortran code is called at all.
>>
>> my compiler/linker flags are:
>>
>> gcc_opt = -O3 -std=c99 -DCYGWIN -Wl,--kill-at -mno-cygwin -shared
>> -I${JAVA_HOME}/include/win32 -m64
>>
>> gfc_opt = -O3 -fno-underscoring -fno-f2c -W -Wunused -Wuninitialized -m64
>>
>> ld_opt = -luuid -lole32 -m64
>>
>>
>> Any clues?
>>
>> Thx.,
>> H.
>>
>>
>> P.S. I'd posted this on the gfortran list, but the chaps there were too
>> busy.
>
> Hans,
>
> this issues you see here might be reasoned by the gcc version you are
> using. There is no SEH unwinding information generated for 4.5.2 gcc.
> This feature was added to gcc 4.6.0 version for windows x64 target.
> But it might help to use here -fno-omit-frame-pointer option.  At
> least this helped me once to call JNI via Obj-C in a working way.
>
> For x64 Windows releated target questions it would be better if you
> are posting to mingw-w64's ML: I redirect this thread to this list.
>
> Regards,
> Kai

Kai,

adding -fno-omit-frame-pointer to the gcc, gfc and ld options did not 
affect the JVM crashes.

Thx.,
H.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019