Re: [fpc-devel] About building JNI library for arm-linux

2016-11-01 Thread Yury Sidorov

On 11/1/2016 3:42 AM, Gennady Agranov wrote:

Why do you use LCL in your JNI library?
Try a simple library without LCL and check if it loads.


It works!

Great Thanks!

Does anyone know what to do about:

Java HotSpot(TM) Client VM warning: You have loaded library
/media/pi/Transcend/cypress-release/pas2jni_policing64/policing64/policing.so
which might have disabled stack guard. The VM will try to fix the stack
guard now.
It's highly recommended that you fix the library with 'execstack -c
', or link it with '-z noexecstack'.

Should I run execstack?

Should I run every time I build a shared object - or there is a better way?


Just pass this option the linker using the following FPC switch:
-k"-z noexecstack"

Yury.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] About building JNI library for arm-linux

2016-10-31 Thread Gennady Agranov

>>> Why do you use LCL in your JNI library?
>>> Try a simple library without LCL and check if it loads.

It works!

Great Thanks!

Does anyone know what to do about:

Java HotSpot(TM) Client VM warning: You have loaded library 
/media/pi/Transcend/cypress-release/pas2jni_policing64/policing64/policing.so 
which might have disabled stack guard. The VM will try to fix the stack 
guard now.
It's highly recommended that you fix the library with 'execstack -c 
', or link it with '-z noexecstack'.


Should I run execstack?

Should I run every time I build a shared object - or there is a better way?

Thanks!


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] About building JNI library for arm-linux

2016-10-31 Thread Yury Sidorov

On 10/31/2016 10:01 PM, Gennady Agranov wrote:


I have an issue with loading JNI library for Raspberry :(

I do compile with -Cg -WX and stack checking on (and also without).

But even this method is not called :(

function JNI_OnLoad(vm: PJavaVM; reserved: pointer): jint; {$ifdef
linux}cdecl{$else}stdcall{$endif};
begin
  writeln('lll');
  exit(0);
end;

Any suggestions?

Thanks,
Gennady

Java HotSpot(TM) Client VM warning: You have loaded library
/media/pi/Transcend/cypress-release/pas2jni_policing64/policing64/policing.so
which might have disabled stack guard. The VM will try to fix the stack
guard now.

It's highly recommended that you fix the library with 'execstack -c
', or link it with '-z noexecstack'.

[FORMS.PP] ExceptionOccurred


Why do you use LCL in your JNI library?
Try a simple library without LCL and check if it loads.
Also do not add any extra compiler switches.
In FPC 3.0 -Cg is broken for ARM.

Yury.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] About building JNI library for arm-linux

2016-10-31 Thread Jonas Maebe
Gennady Agranov wrote:
> I thought that "reply" and changing the subject to a new one will do the
> trick...
> 
> Is "topic" stored somewhere in the mail headers?

There is an "In-Reply-To" header, which states to which message your
message is a reply. All related replies are grouped into the same topic
by most mail clients.


Jonas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] About building JNI library for arm-linux

2016-10-31 Thread Gennady Agranov
I thought that "reply" and changing the subject to a new one will do the 
trick...


Is "topic" stored somewhere in the mail headers?

Sorry,
Gennady

On 10/31/2016 4:42 PM, wkitt...@windstream.net wrote:

On 10/31/2016 04:01 PM, Gennady Agranov wrote:

Hi,

I have an issue with loading JNI library for Raspberry :(


what does this have to do with the "A generic function for (multicore) 
cache flush?" topic you attached it to by replying to that topic? you 
should use the [write] or [post] button and then type in the name of 
the mailing list or news group... then the subject and the post 
instead of trying to take shortcuts and hijacking a topic...




___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] About building JNI library for arm-linux

2016-10-31 Thread Gennady Agranov

Hi,

I have an issue with loading JNI library for Raspberry :(

I do compile with -Cg -WX and stack checking on (and also without).

But even this method is not called :(

function JNI_OnLoad(vm: PJavaVM; reserved: pointer): jint; {$ifdef 
linux}cdecl{$else}stdcall{$endif};

begin
  writeln('lll');
  exit(0);
end;

Any suggestions?

Thanks,
Gennady

Java HotSpot(TM) Client VM warning: You have loaded library 
/media/pi/Transcend/cypress-release/pas2jni_policing64/policing64/policing.so 
which might have disabled stack guard. The VM will try to fix the stack 
guard now.


It's highly recommended that you fix the library with 'execstack -c 
', or link it with '-z noexecstack'.


[FORMS.PP] ExceptionOccurred

  Sender=EStackOverflow

  Exception=Stack overflow

  Stack trace:

  $62E6CF48  fpc_stackcheck,  line 832 of 
/home/pi/development/fpc/rtl/inc/system.inc


TApplication.HandleException Stack overflow

  Stack trace:

  $62E6CF48  fpc_stackcheck,  line 832 of 
/home/pi/development/fpc/rtl/inc/system.inc


Exception at 62E6CF48: EStackOverflow:

Stack overflow.


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel