[fpc-pascal] Re: Strange arm-linux cross-compilation errors

2011-04-12 Thread herux
I think we should change the file crt0.as, as described in the following link 
http://honeypod.blogspot.com/2007/12/initialize-libc-for-android.html


I have not done so, I'm doing another job first.

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Strange-arm-linux-cross-compilation-errors-tp4269189p4297396.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] android share library with classes unit

2011-04-12 Thread herux
I managed to compile and run the library for android on emulator, which I
compile the project just a libhellojni.so

compile using paramater like this

ppcarm -Scghi -O1 -Parm -gl -b -B -XX -Xc -XD -CpARMv6 -CfSOFT -dandroid 
-vewnhi -l -XParm-linux-
-Fi/home/herux/workspace/hellojni/jni/lib/arm-linux/ -Fu. -FUlib/arm-linux/
-o../libs/armeabi/libhellojni.so -FD/usr/share/fpcsrc/binutils/ 
hellojni.lpr

on Kubuntu 10.04 x86_64

library code:

library hellojni;
{$ ifdef fpc}
  {$ mode delphi}
{$ endif}

uses
 JNI, log;

Java_com_herux_hellojni_MainActivity_Hellojni function (env: PJNIEnv; Thiz:
jobject): jstring; cdecl;
begin
   result: = env ^. NewStringUTF (env, PChar ('Hello JNI from FreePascal
..'));
end;
exports
Java_com_herux_hellojni_MainActivity_Hellojni name
'Java_com_herux_hellojni_MainActivity_Hellojni';
begin
end;

then I try to use classes unit or sysutils, the project succeeded in
compiling, but the library did not loaded by the emulator. there is an error
SIGSEGV

D/dalvikvm( 1082): Trying to load lib
/data/data/com.herux.hellojni/lib/libhellojni.so 0x44e7ea48
I/DEBUG   (   31): *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*** ***
I/DEBUG   (   31): Build fingerprint:
'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
I/DEBUG   (   31): pid: 1082, tid: 1082  >>> com.herux.hellojni <<<
I/DEBUG   (   31): signal 11 (SIGSEGV), fault addr 7eb67b08
I/DEBUG   (   31):  r0 7eb67b08  r1 7eb67b08  r2   r3 003d
I/DEBUG   (   31):  r4 0006  r5 809aa4cc  r6 b001037c  r7 
I/DEBUG   (   31):  r8 80813b00  r9 ccb0  10 4186b904  fp beb1986c
I/DEBUG   (   31):  ip beb19870  sp beb19818  lr 809ab5d4  pc 809ab56c  cpsr
6010
I/DEBUG   (   31):  #00  pc 000ab56c 
/data/data/com.herux.hellojni/lib/libhellojni.so
I/DEBUG   (   31):  #01  lr 809ab5d4 
/data/data/com.herux.hellojni/lib/libhellojni.so
I/DEBUG   (   31): 
I/DEBUG   (   31): code around pc:

if anyone has ever experienced it? or is it a bug?

thanks


-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-share-library-with-classes-unit-tp4297859p4297859.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Re: android share library with classes unit

2011-04-12 Thread herux
I use this binutils http://www.gnu.org/software/binutils/
using this command to build crosscompiler

make clean crossinstall CPU_TARGET=arm OS_TARGET=linux
CROSSBINDIR=/usr/share/fpcsrc/binutils/ OPT="-dFPC_ARMEL -O- -gl"
CROSSOPT="-dANDROID -CpARMv6 -gl -CfSOFT -O-"

I may have to repeat it

thank u

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-share-library-with-classes-unit-tp4297859p4299510.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: android share library with classes unit

2011-04-13 Thread herux
My problem is resolved, I apply the patch contained in that link. reported by
Dejan Boras.
then rebuild cross compiler with this:

make clean crossinstall CPU_TARGET=arm OS_TARGET=linux
CROSSBINDIR="/usr/share/fpcsrc/binutils" OPT="-dFPC_ARMEL -O- -gl"
CROSSOPT="-dANDROID -CpARMv5 -gl -CfSOFT -O-"

now it's work. libhellojni.so loaded succesfully.

thanks

herux

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-share-library-with-classes-unit-tp4297859p4300489.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] android JNI JString to String

2011-04-26 Thread herux
I have a strange problem, I pass data from the android String via JNI. pass
data from FreePascal wideString successfully using the following code

NewString: function (Env: PJNIEnv; const Unicode: PJChar; Len: JSize):
JString; cdecl; 
GetStringChars:function(Env:PJNIEnv;Str:JString;IsCopy:PJBoolean):PJChar;
cdecl;

function JNI_WideStringToJString(Env: PJNIEnv; const WStr: WideString):
JString;
begin
  Result := Env^.NewString(Env, Pointer(WStr), Length(WStr));
end;

but when passing data JString to widestring, using this code :

function JNI_JStringToWideString(Env: PJNIEnv; JStr: JString): WideString;
var
  IsCopy: JBoolean;
  Chars: PJChar;
begin
  if (JStr = nil) then begin
Result := '';
Exit;
  end;

  Chars := Env^.GetStringChars(Env, JStr, IsCopy);
  if (Chars = nil) then begin
Result := ''
  end else begin
Result := WideString(Chars);
Env^.ReleaseStringChars(Env, JStr, Chars);
  end;
end;

return only 1 character leading. 
if anyone has ever experienced ? or there's something wrong with JNI header
?

thanks


-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-JNI-JString-to-String-tp4340388p4340388.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: RE : [fpc-pascal] android JNI JString to String

2011-04-26 Thread herux
thanks for the response.

I am doing what you suggest. but it's still the same.

I debug this line of code using android log

Chars := Env^.GetStringChars(Env, AJString, nil);
__android_log_write(ANDROID_LOG_DEBUG,'proj_debug',PChar(Chars)); 

and the log I retrieved :

04-26 17:53:17.942: DEBUG/proj_debug(711): e <--- only "e" character

from input AJString =
eNp9zt0KwjAMBeBXCecBrApeCEmG+iRzdrX+dKMrMn16Y0G8M5Cr75ATbub7jR4+T3FIgtViiUa5VS5xGPsfrA2c8lG5o5NghrJX7ikInqCzYCo5pgCKgq3NJ1x1+KuvqjEVH3yuXGuc3b4oX2knAO2tfgM6fNHEdbb2jGv1DUfmNOA=

so I thought, this is not about that. but I do not know why



-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-JNI-JString-to-String-tp4340388p4340649.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: RE : RE : [fpc-pascal] android JNI JString to String

2011-04-26 Thread herux
Yes, there's bug. thanks you.
I using GetStringUTFChars 

function JNI_JStringToString(Env: PJNIEnv; JStr: jstring): String;
var
  IsCopy: Pjboolean;
  Chars: PChar;
begin
  if JStr = nil then
  begin
Result := '';
Exit;
  end;

  Chars:= Env^.GetStringUTFChars(Env, JStr, IsCopy);
  if Chars = nil then
 Result := ''
  else
Begin
  Result := String(Chars);
  Env^.ReleaseStringUTFChars(Env, JStr, Chars);
end;
end; 

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/android-JNI-JString-to-String-tp4340388p4342883.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Chrome Browser apps with Native Code

2011-05-29 Thread herux
Hello,
Do you think FreePascal can be used to compile applications for google
chrome browser, such as the following link?

http://code.google.com/chrome/nativeclient/

thanks

herux


-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Chrome-Browser-apps-with-Native-Code-tp4436566p4436566.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] compiling turbo power lockbox on ubuntu 64

2011-07-26 Thread herux
Hi,
I use RSA encryption library lockbox turbo power.
in a windows environment I managed to compile and the apps working well, I
use {$ mode delphi}. 
but when I compile it on ubuntu 64bit, there is an error when compiling


component/LockBox/LbCipher.pas(708,10) Error: Unknown identifier "EBX"
component/LockBox/LbCipher.pas(708,10) Warning: No size specified and unable
to determine the size of the operands, using DWORD as default
component/LockBox/LbCipher.pas(709,10) Error: Unknown identifier "EAX"
component/LockBox/LbCipher.pas(709,10) Warning: No size specified and unable
to determine the size of the operands, using DWORD as default
component/LockBox/LbCipher.pas(710,13) Error: Unknown identifier "EAX"
component/LockBox/LbCipher.pas(710,15) Error: Assembler syntax error in
operand
component/LockBox/LbCipher.pas(710,19) Error: Unknown identifier "EAX"
component/LockBox/LbCipher.pas(710,19) Error: Assembler syntax error in
operand
component/LockBox/LbCipher.pas(711,12) Error: Unknown identifier "BH"
component/LockBox/LbCipher.pas(711,14) Error: Unknown identifier "AL"
component/LockBox/LbCipher.pas(712,12) Error: Unknown identifier "BL"
component/LockBox/LbCipher.pas(712,14) Error: Unknown identifier "AH"
component/LockBox/LbCipher.pas(713,13) Error: Unknown identifier "EBX"
so on ...

asm delphi like code doesn't compiled right ? but why on windows compiled ?

I am trying to cross compile it in windows, for linux x86_64, and produces
the same error.
whether the asm code is not supported for 64bit?

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/compiling-turbo-power-lockbox-on-ubuntu-64-tp4634016p4634016.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: RE : [fpc-pascal] compiling turbo power lockbox on ubuntu 64

2011-07-26 Thread herux
thanks for the info for you guys, 
where can I read the complete freepascal asm document for 64bit ?

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/compiling-turbo-power-lockbox-on-ubuntu-64-tp4634016p4634787.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: RE : [fpc-pascal] compiling turbo power lockbox on ubuntu 64

2011-07-26 Thread herux
I was thinking about the best alternative
yes, I think you're right. better to write it into native. 

thank you

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/compiling-turbo-power-lockbox-on-ubuntu-64-tp4634016p4635040.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] get method params and its type

2011-09-24 Thread herux
How to get a list of parameters of an object method, if we only know the name
of the object and its methods?

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/get-method-params-and-its-type-tp4837859p4837859.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: fpweb and reading the contents of a request

2011-10-18 Thread herux
Try using Indy or Synapse as HttpClient to send data content  using HTTP POST
with the parameters as you mean. my FPWeb success to do it using PHP via
CURL.

I guess this is not a limitation of HTTP, just not the standard for web
scripting

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/fpweb-and-reading-the-contents-of-a-request-tp4909915p4913056.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Finished full JVM Android application

2012-01-02 Thread herux
good job. I will learn it.
thank you

-
-
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Finished-full-JVM-Android-application-tp5103112p5116210.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal