Discussion:
CustomDrawn, Android: Crash on Device
Lukas Gradl
2011-12-02 16:13:03 UTC
Permalink
Hi,

tried to run the androidlcl example out of
http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Compiling_the_example_LCL_Android_Application

I can compile the app (after changing -Fl) and create the apk using ant.

After installing on my device (a galaxy tab 10.1 using android 3.1 and a
galaxy s using android 2.3.5) the app can't be started,

I did:
file liblclapp.so:
liblclapp.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV),
dynamically linked, not stripped

ldd liblclapp.so:
das Programm ist nicht dynamisch gelinkt (means: the program isn't
linked dynamically)

AFAIK this seems to be right.




But on the device, via adb logcat on the Galaxy Tab I get:

D/dalvikvm(28803): Trying to load lib
/data/data/com.pascal.lcltest/lib/liblclapp.so 0x4072a520
D/WindowManager( 290): Setting visibility of AppWindowToken{42643ba8
token=ActivityRecord{41473368
com.android.packageinstaller/.InstallAppProgress}}: false
D/WindowManager( 290): Setting visibility of AppWindowToken{419af608
token=ActivityRecord{416e0458
com.estrongs.android.pop/.view.FileExplorerActivity}}: false
I/DEBUG ( 223): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG ( 223): Build fingerprint:
'samsung/GT-P7500/GT-P7500:3.1/HMJ37/XWKHC:user/release-keys'
I/DEBUG ( 223): pid: 28803, tid: 28803 >>> com.pascal.lcltest <<<
I/DEBUG ( 223): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr
00000004
I/DEBUG ( 223): r0 00000000 r1 00000004 r2 be964afc r3 00000000
I/DEBUG ( 223): r4 00000001 r5 00000000 r6 819aae98 r7 00014260
I/DEBUG ( 223): r8 b0014bc8 r9 81d21000 10 0052e000 fp be964ab4
I/DEBUG ( 223): ip be964ab8 sp be964938 lr 818f2d7c pc 818f2e0c
cpsr 80000010
I/DEBUG ( 223): d0 000000a043200000 d1 3ff0000043200000
I/DEBUG ( 223): d2 4e17618442bdda33 d3 42c8000000660ff0
I/DEBUG ( 223): d4 000001fd0060e240 d5 3fe999999999999a
I/DEBUG ( 223): d6 3fe8000000000000 d7 3f8000003f4ccccd
I/DEBUG ( 223): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 223): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 223): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 223): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 223): scr 60000012
I/DEBUG ( 223):
V/AudioPolicyManager( 227): stopOutput() output 1, stream 1, session
244 mPhoneState 0
V/AudioPolicyManager( 227): getNewDevice() selected device 0
V/AudioPolicyManager( 227): setOutputDevice() output 1 device 0 delayMs 0
V/AudioPolicyManager( 227): setOutputDevice() setting same device 0 or
null device for output 1
I/SurfaceFlinger( 224): id=340 Removed
com.estrongs.android.pop/com.estrongs.android.pop.view.FileExplorerActivity
idx=1 Map Size=4
I/AudioFlinger( 227): stop output streamType (0, 1) for 1
D/AudioHardware( 227): AudioStreamOutALSA::setParameters()
stop_output_streamtype=1
I/SurfaceFlinger( 224): id=340 Removed
com.estrongs.android.pop/com.estrongs.android.pop.view.FileExplorerActivity
idx=-2 Map Size=4
I/SurfaceFlinger( 224): id=359 Removed
com.android.packageinstaller/com.android.packageinstaller.InstallAppProgress
idx=1 Map Size=3
I/SurfaceFlinger( 224): id=359 Removed
com.android.packageinstaller/com.android.packageinstaller.InstallAppProgress
idx=-2 Map Size=3
I/DEBUG ( 223): #00 pc 000f2e0c
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 223): #01 lr 818f2d7c
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 223):
I/DEBUG ( 223): libc base address: aff00000
I/DEBUG ( 223):
I/DEBUG ( 223): code around pc:
I/DEBUG ( 223): 818f2dec e1540000 aa000018 e3a05000 ea000000
I/DEBUG ( 223): 818f2dfc e2855001 e59f008c e5900000 e1a01104
I/DEBUG ( 223): 818f2e0c e7900001 e7d00005 e3500000 1afffff7
I/DEBUG ( 223): 818f2e1c e1a01005 e51b002c ebff9534 e3550000
I/DEBUG ( 223): 818f2e2c da00000e e51b002c ebff95d5 e1a01000
I/DEBUG ( 223):
I/DEBUG ( 223): code around lr:
I/DEBUG ( 223): 818f2d5c e1a04001 e3a00000 e50b0068 e24b2038
I/DEBUG ( 223): 818f2d6c e24b1060 e3a00001 ebffb9f5 ebffce5c
I/DEBUG ( 223): 818f2d7c e50b0064 e3500000 1a000038 e3540000
I/DEBUG ( 223): 818f2d8c 1a000012 e24b0068 ebff934b e3a00000
I/DEBUG ( 223): 818f2d9c e50b0068 e24b0f5a e3a01000 ebfff9ee das
Programm ist nicht dynamisch gelinkt
I/DEBUG ( 223):
I/DEBUG ( 223): stack:
I/DEBUG ( 223): be9648f8 00113fc0
I/DEBUG ( 223): be9648fc 00000063
I/DEBUG ( 223): be964900 aca89831 /system/lib/libdvm.so
I/DEBUG ( 223): be964904 00000002
I/DEBUG ( 223): be964908 be964f0a
I/DEBUG ( 223): be96490c b00094e8
I/DEBUG ( 223): be964910 aca912da /system/lib/libdvm.so
I/DEBUG ( 223): be964914 00000001
I/DEBUG ( 223): be964918 aca81797 /system/lib/libdvm.so
I/DEBUG ( 223): be96491c 00000003
I/DEBUG ( 223): be964920 000be000
I/DEBUG ( 223): be964924 00000001
I/DEBUG ( 223): be964928 00000001
I/DEBUG ( 223): be96492c 819aae98
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 223): be964930 00014260
I/DEBUG ( 223): be964934 818f2d78
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 223): #00 be964938 be964b28
I/DEBUG ( 223): be96493c 00000000
I/DEBUG ( 223): be964940 adee01e0
I/DEBUG ( 223): be964944 00113fd4
I/DEBUG ( 223): be964948 ffffffff
I/DEBUG ( 223): be96494c 73752f14
I/DEBUG ( 223): be964950 68732f72
I/DEBUG ( 223): be964954 2f657261
I/DEBUG ( 223): be964958 656e6f7a
I/DEBUG ( 223): be96495c 6f666e69
I/DEBUG ( 223): be964960 be964b2f
I/DEBUG ( 223): be964964 ad9c0201 /system/lib/libicui18n.so
I/DEBUG ( 223): be964968 04140025
I/DEBUG ( 223): be96496c be964900
I/DEBUG ( 223): be964970 00000000
I/DEBUG ( 223): be964974 00000000
I/DEBUG ( 223): be964978 00000020
I/DEBUG ( 223): be96497c be964910
I/DEBUG ( 223): dumpstate /data/log/dumpstate_app_native.txt


hoping for an Idea how to proceed,

Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Felipe Monteiro de Carvalho
2011-12-02 16:33:40 UTC
Permalink
From the log I'd say that it crashes inside Pascal code in the
initialization of the library.

Things are changing so fast that it is hard to say something without
knowing the exact code that you have. I would start by making sure
that you have the latest svn of both the example and the lcl

Then try it in the emulator too.

Then try adding some verbose options to get more info:
http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface#Conditional_defines_accepted_by_LCL-CustomDrawn

Try also the X11 backend to see if it works for you. For the android
example there is also a nonandroid lpi. The Cocoa and Win32 backends
are temporarely off because I started unifying the form Handle types
and they will need adaptation.
--
Felipe Monteiro de Carvalho

--
Felipe Monteiro de Carvalho
2011-12-02 16:42:06 UTC
Permalink
rev33908, the very latest, works for me in Android.
--
Felipe Monteiro de Carvalho

--
Lukas Gradl
2011-12-02 17:10:50 UTC
Permalink
Post by Felipe Monteiro de Carvalho
rev33908, the very latest, works for me in Android.
I used eev 33906 and just updated to 33908.
I just tried to compile the example provided with lazarus, only change
is the -Fl path pointing to my ndk (I use ndk r7), and removing the -WR
parameter from project options as the compiler says: "Error: Illegal
parameter: -WR".

As a compiler I use the latest fixes2_6 branch svn.

I'm just setting up an emulator, but never had one so need to work that
out first...


regards
Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Felipe Monteiro de Carvalho
2011-12-02 17:21:40 UTC
Permalink
Post by Lukas Gradl
As a compiler I use the latest fixes2_6 branch svn.
Bad choice, I just added some info in the wiki explaining why people
should use FPC from 19th January:

http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Free_Pascal_Bugs_on_Android_Support
--
Felipe Monteiro de Carvalho

--
Lukas Gradl
2011-12-02 17:38:02 UTC
Permalink
Post by Felipe Monteiro de Carvalho
Post by Lukas Gradl
As a compiler I use the latest fixes2_6 branch svn.
Bad choice, I just added some info in the wiki explaining why people
http://wiki.lazarus.freepascal.org/Custom_Drawn_Interface/Android#Free_Pascal_Bugs_on_Android_Support
Just switched to that compiler and it seems like i can start it on the
android device. I get a title bar saying "LCL Test" but the rest of the
window keeps black.

So as a next step I'll try to get the emulator up and running....

regards
Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Lukas Gradl
2011-12-02 17:52:41 UTC
Permalink
Post by Lukas Gradl
Just switched to that compiler and it seems like i can start it on the
android device. I get a title bar saying "LCL Test" but the rest of the
window keeps black.
So as a next step I'll try to get the emulator up and running....
Tested in an emulator emulating android 2.2, I could install it and
start it, but got the same black window as well.

When clicking in that black window I get a SIGSEV again.

I/ActivityManager( 58): Starting activity: Intent {
act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
flg=0x10200000 cmp=com.pascal.lcltest/.LCLActivity }
I/ActivityManager( 58): Start proc com.pascal.lcltest for activity
com.pascal.lcltest/.LCLActivity: pid=264 uid=10036 gids={}
I/ARMAssembler( 58): generated
scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at
[0x358500:0x35860c] in 475898 ns
I/lclproject( 264): Trying to load liblclapp.so
D/dalvikvm( 264): Trying to load lib
/data/data/com.pascal.lcltest/lib/liblclapp.so 0x44ede248
D/dalvikvm( 264): Added shared lib
/data/data/com.pascal.lcltest/lib/liblclapp.so 0x44ede248
I/lclapp ( 264): JNI_OnLoad called
I/lclapp ( 264): Reading our Activity Class
D/dalvikvm( 264): GC_EXTERNAL_ALLOC freed 796 objects / 57152 bytes in 60ms
I/ActivityManager( 58): Displayed activity
com.pascal.lcltest/.LCLActivity: 1215 ms (total 1215 ms)
D/dalvikvm( 119): GC_EXPLICIT freed 217 objects / 10416 bytes in 69ms
I/DEBUG ( 30): *** *** *** *** *** *** *** *** *** *** *** *** ***
*** *** ***
I/DEBUG ( 30): Build fingerprint:
'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
I/DEBUG ( 30): pid: 264, tid: 264 >>> com.pascal.lcltest <<<
I/DEBUG ( 30): signal 11 (SIGSEGV), fault addr 00000008
I/DEBUG ( 30): r0 00000124 r1 00000000 r2 00000124 r3 00000000
I/DEBUG ( 30): r4 00000000 r5 00000000 r6 000000d2 r7 4186bb98
I/DEBUG ( 30): r8 be8f491c r9 4186bb8c 10 4186bb74 fp be8f4914
I/DEBUG ( 30): ip 81418c18 sp be8f48b0 lr 810c9948 pc 810f30d0
cpsr 20000010
I/DEBUG ( 30): #00 pc 000f30d0
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 30): #01 lr 810c9948
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 30):
I/DEBUG ( 30): code around pc:
I/DEBUG ( 30): 810f30b0 e1a06000 e51b102c e24b0040 ebff463d
I/DEBUG ( 30): 810f30c0 e51b0040 e51b103c ebff74aa e1a02000
I/DEBUG ( 30): 810f30d0 e5941008 e5940004 e1a03006 eb018f83
I/DEBUG ( 30): 810f30e0 e1a06000 e51b1030 e24b0040 ebff4631
I/DEBUG ( 30): 810f30f0 e51b0040 e51b103c ebff749e e1a07000
I/DEBUG ( 30):
I/DEBUG ( 30): code around lr:
I/DEBUG ( 30): 810c9928 ebffe2c0 e1a05000 ea000005 e59d3008
I/DEBUG ( 30): 810c9938 e59d200c e59d1000 e59d0004 ebffe2b9
I/DEBUG ( 30): 810c9948 e1a05000 e1a00005 e28dd014 e8bd8030
I/DEBUG ( 30): 810c9958 e92d4010 e24dd010 e58d0000 e58d1004
I/DEBUG ( 30): 810c9968 e58d2008 e58d300c e59d0000 e59d1004
I/DEBUG ( 30):
I/DEBUG ( 30): stack:
I/DEBUG ( 30): be8f4870 00000000
I/DEBUG ( 30): be8f4874 00000124
I/DEBUG ( 30): be8f4878 00000000
I/DEBUG ( 30): be8f487c 810d0490
/data/data/com.pascal.lcltest/lib/liblclapp.so
I/DEBUG ( 30): be8f4880 00000000
I/DEBUG ( 30): be8f4884 40724000
I/DEBUG ( 30): be8f4888 00000000
I/DEBUG ( 30): be8f488c 00000000
I/DEBUG ( 30): be8f4890 00000000
I/DEBUG ( 30): be8f4894 00000000
I/DEBUG ( 30): be8f4898 00000000
I/DEBUG ( 30): be8f489c 00000000
I/DEBUG ( 30): be8f48a0 00000000
I/DEBUG ( 30): be8f48a4 000000d2
I/DEBUG ( 30): be8f48a8 df002777
I/DEBUG ( 30): be8f48ac e3a070ad
I/DEBUG ( 30): #00 be8f48b0 afd40328 /system/lib/libc.so
I/DEBUG ( 30): be8f48b4 41903b50
/dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG ( 30): be8f48b8 be8f4928 [stack]
I/DEBUG ( 30): be8f48bc 00000068
I/DEBUG ( 30): be8f48c0 00000002
I/DEBUG ( 30): be8f48c4 80866791 /system/lib/libdvm.so
I/DEBUG ( 30): be8f48c8 41903b50
/dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG ( 30): be8f48cc 8085d123 /system/lib/libdvm.so
I/DEBUG ( 30): be8f48d0 400187e8
/dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
I/DEBUG ( 30): be8f48d4 00000000
I/DEBUG ( 30): be8f48d8 40724000
I/DEBUG ( 30): be8f48dc 80860201 /system/lib/libdvm.so
I/DEBUG ( 30): be8f48e0 be8f4940 [stack]
I/DEBUG ( 30): be8f48e4 43520000
/system/framework/framework-res.apk
I/DEBUG ( 30): be8f48e8 43920000
I/DEBUG ( 30): be8f48ec 00000000
I/DEBUG ( 30): be8f48f0 be8f4920 [stack]
I/DEBUG ( 30): be8f48f4 400187e8
/dev/ashmem/mspace/dalvik-heap/zygote/0 (deleted)
D/Zygote ( 32): Process 264 terminated by signal (11)
I/ActivityManager( 58): Process com.pascal.lcltest (pid 264) has died.
I/WindowManager( 58): WIN DEATH: Window{4503ba50
com.pascal.lcltest/com.pascal.lcltest.LCLActivity paused=false}
I/WindowManager( 58): WIN DEATH: Window{450537f8 SurfaceView paused=false}
I/UsageStats( 58): Unexpected resume of com.android.launcher while
already resumed in com.pascal.lcltest
W/InputManagerService( 58): Got RemoteException sending
setActive(false) notification to pid 264 uid 10036


regards
Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Felipe Monteiro de Carvalho
2011-12-02 18:05:25 UTC
Permalink
I just tested in my 2.3 emulator and it worked fine. It also works in
my HTC Wildfire 2.2

Try:

cd lazarus
svn diff

To check for local changes, it should show only the -dAndroid in lclbase.lpk

Now we can see from the log that it processes the initialization
I/lclproject(  264): Trying to load liblclapp.so
D/dalvikvm(  264): Trying to load lib
/data/data/com.pascal.lcltest/lib/liblclapp.so 0x44ede248
D/dalvikvm(  264): Added shared lib
/data/data/com.pascal.lcltest/lib/liblclapp.so 0x44ede248
I/lclapp  (  264): JNI_OnLoad called
I/lclapp  (  264): Reading our Activity Class
But I can't tell if it crashes inside JNI_OnLoad or after it.

You can open the file
lcl/interfaces/customdrawn/customdrawnobject_android.inc and add more
debug calls to JNI_OnLoad to see if it finishes.

If it finishes correctly, then try adding some -dVerbose* to lcl.lpk
like previously said to get more info.
--
Felipe Monteiro de Carvalho

--
Felipe Monteiro de Carvalho
2011-12-02 18:07:58 UTC
Permalink
On Fri, Dec 2, 2011 at 7:05 PM, Felipe Monteiro de Carvalho
Post by Felipe Monteiro de Carvalho
To check for local changes, it should show only the -dAndroid in lclbase.lpk
This brings and interresting question: Did you add -dAndroid to your
lclbase.lpk?
--
Felipe Monteiro de Carvalho

--
Lukas Gradl
2011-12-02 18:27:50 UTC
Permalink
Post by Felipe Monteiro de Carvalho
On Fri, Dec 2, 2011 at 7:05 PM, Felipe Monteiro de Carvalho
Post by Felipe Monteiro de Carvalho
To check for local changes, it should show only the -dAndroid in lclbase.lpk
This brings and interresting question: Did you add -dAndroid to your
lclbase.lpk?
Yes.

And the svn diff actually showed the problem: While working with the
fixes2_6 compiler I had to comment out the last block in
customdrawnobject_android.inc cause of FPC_SHARED_LIB_START beeing
already defined. Removed the comments - and it worked!

So current status:

works on Android 2.2 emulator and Android 3.1 Tablet!

Regards

Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Lukas Gradl
2011-12-02 18:28:52 UTC
Permalink
Post by Felipe Monteiro de Carvalho
On Fri, Dec 2, 2011 at 7:05 PM, Felipe Monteiro de Carvalho
Post by Felipe Monteiro de Carvalho
To check for local changes, it should show only the -dAndroid in lclbase.lpk
This brings and interresting question: Did you add -dAndroid to your
lclbase.lpk?
UUUPs - forgot to append a big, big, big THANK YOU!

regards
Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Mattias Gaertner
2011-12-02 19:00:34 UTC
Permalink
On Fri, 2 Dec 2011 19:07:58 +0100
Post by Felipe Monteiro de Carvalho
On Fri, Dec 2, 2011 at 7:05 PM, Felipe Monteiro de Carvalho
Post by Felipe Monteiro de Carvalho
To check for local changes, it should show only the -dAndroid in lclbase.lpk
This brings and interresting question: Did you add -dAndroid to your
lclbase.lpk?
The LCLBase must only contain widgetset independent IDFEFs.
That means the {$IF defined(Android)} must be replaced with some FPC
macros or the code must be moved to the widgetsets.

Is there is an FPC define to figure out if CWString can be used on arm?

Mattias


--
Felipe Monteiro de Carvalho
2011-12-02 19:50:36 UTC
Permalink
On Fri, Dec 2, 2011 at 8:00 PM, Mattias Gaertner
Post by Mattias Gaertner
The LCLBase must only contain widgetset independent IDFEFs.
That means the {$IF defined(Android)} must be replaced with some FPC
macros or the code must be moved to the widgetsets.
It cannot be moved to the widgetset because it does not simply add
something. It also removes something. It removes the usage of Iconv
and cwstring. If it is moved to the widgetsets, then we need to move
the code which is using iconv in LCLBase to the widgetsets too.

The root of the problem is that lclbase is depending on iconv, while
it should not IMHO.
Post by Mattias Gaertner
Is there is an FPC define to figure out if CWString can be used on arm?
No, and more: cwstring is never guaranteed to work. It depends on
iconv to do the real work, so it is a dependency just like gtk2 or qt,
which may or may not be installed or supported in a particular device.
It is not part of the Linux kernel. And iconv is not supported in
Android, it is not part of the NDK.

Android supports only the following libraries in API level 8:

1> libc.so
2> libdl.so (linker)
3> OpenGL ES 1
4> OpenGL ES 2
5> libjnigraphics.so
6> liblog.so
7> libm.so
8> libz.so
9> libthread_db.so
10> libstdc++.so

I checked level 14 and iconv is not there either.

LCL-CustomDrawn-Android uses libjnigraphics.so and liblog.so at the moment.
--
Felipe Monteiro de Carvalho

--
Mattias Gaertner
2011-12-02 20:21:53 UTC
Permalink
On Fri, 2 Dec 2011 20:50:36 +0100
Post by Felipe Monteiro de Carvalho
On Fri, Dec 2, 2011 at 8:00 PM, Mattias Gaertner
Post by Mattias Gaertner
The LCLBase must only contain widgetset independent IDFEFs.
That means the {$IF defined(Android)} must be replaced with some FPC
macros or the code must be moved to the widgetsets.
It cannot be moved to the widgetset because it does not simply add
something. It also removes something. It removes the usage of Iconv
and cwstring. If it is moved to the widgetsets, then we need to move
the code which is using iconv in LCLBase to the widgetsets too.
Yes. Apparently this code depends on the widgetset, so it should be
there.
Post by Felipe Monteiro de Carvalho
The root of the problem is that lclbase is depending on iconv, while
it should not IMHO.
Post by Mattias Gaertner
Is there is an FPC define to figure out if CWString can be used on arm?
No, and more: cwstring is never guaranteed to work. It depends on
iconv to do the real work, so it is a dependency just like gtk2 or qt,
which may or may not be installed or supported in a particular device.
With the important difference, that the iconv lib is only opened
if it is installed, using dlopen.

And btw, lconvencoding always defines DisableIconv, so it never uses
iconv.

I simplified the lconvencoding directives with a simple IFDEF
EnableIconvEnc.

Mattias

--
Felipe Monteiro de Carvalho
2011-12-02 20:38:18 UTC
Permalink
On Fri, Dec 2, 2011 at 9:21 PM, Mattias Gaertner
Post by Mattias Gaertner
With the important difference, that the iconv lib is only opened
if it is installed, using dlopen.
That is also dangerous for Android, it might exist in a device because
a manufacturer put it there, but it should still not be used.
Post by Mattias Gaertner
And btw, lconvencoding always defines DisableIconv, so it never uses
iconv.
I simplified the lconvencoding directives with a simple IFDEF
EnableIconvEnc.
The problem is not lconvencoding, since lconvencoding isn't even added
to the executable. The problem is that lclproc and translations use
cwstring.
--
Felipe Monteiro de Carvalho

--
Felipe Monteiro de Carvalho
2011-12-02 20:50:19 UTC
Permalink
I wonder if it would be safe to move the usage of cwstring to LCL-Qt,
LCL-Carbon, LCL-Cocoa and LCL-Gtk2, then LCL-CustomDrawn could add
paswstring and we can remove the need for the define.
--
Felipe Monteiro de Carvalho

--
Mattias Gaertner
2011-12-02 20:55:56 UTC
Permalink
On Fri, 2 Dec 2011 21:50:19 +0100
Post by Felipe Monteiro de Carvalho
I wonder if it would be safe to move the usage of cwstring to LCL-Qt,
LCL-Carbon, LCL-Cocoa and LCL-Gtk2, then LCL-CustomDrawn could add
paswstring and we can remove the need for the define.
Yes, please do so.

Mattias


--
Mattias Gaertner
2011-12-02 21:04:11 UTC
Permalink
On Fri, 2 Dec 2011 21:55:56 +0100
Post by Mattias Gaertner
On Fri, 2 Dec 2011 21:50:19 +0100
Post by Felipe Monteiro de Carvalho
I wonder if it would be safe to move the usage of cwstring to LCL-Qt,
LCL-Carbon, LCL-Cocoa and LCL-Gtk2, then LCL-CustomDrawn could add
paswstring and we can remove the need for the define.
Yes, please do so.
In unit interfaces.

Mattias

--
Felipe Monteiro de Carvalho
2011-12-02 23:02:35 UTC
Permalink
On Fri, Dec 2, 2011 at 10:04 PM, Mattias Gaertner
Post by Mattias Gaertner
Post by Mattias Gaertner
Yes, please do so.
In unit interfaces.
Done in rev 33921

Indeed much better now that the LCL can be compiled without special
defines for Android =)
--
Felipe Monteiro de Carvalho

--
Lukas Gradl
2011-12-02 17:19:22 UTC
Permalink
Post by Felipe Monteiro de Carvalho
Try also the X11 backend to see if it works for you. For the android
example there is also a nonandroid lpi. The Cocoa and Win32 backends
are temporarely off because I started unifying the form Handle types
and they will need adaptation.
Just tried nonandroid.lpi on my X86_64 Linux and it works as expected...

regards
Lukas
--
--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 5
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------

--
Loading...