[BUG] LCL on Kindle (arm eabi CPU) lazarus / 31-LCL ---------------------------------------------------------------------- mercury · 2016-09-27 13:37 Maybe I'm the first one to try run LCL on kindle in this forum, I mean that E-ink reader. Well, I followed the wiki ( wiki.lazarus.freepascal.org/Setup_Cross_Compile_For_ARM ). Actually the guide is not working for kindle without some mod. Here is what I did (using msys): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd /home/binutils-2.24./configure --target=arm-linux-gnueabi --disable- werrormakemake install copy the bin to “C:\MinGW\msys\1.0\home\fpc\binutils”, and rename to “ar”, “ld”,“as”. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cd C:\MinGW\msys\1.0\home\fpc\set path=C:\MinGW\msys\1.0\home\fpc\bin\i386-win32\;%path%make crossinstall CPU_TARGET=arm OS_TARGET=linux CROSSBINDIR=C:\MinGW\msys\1.0\home\fpc\binutils OPT=-dFPC_ARMEL INSTALL_PREFIX=C:\MinGW\msys\1.0\home CROSSOPT="-CpARMV7A -CfVFPV3" add these to fpc.cfg Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #IFDEF CPUARM-CpARMV7A-CfVFPV3#ENDIF Kindle use GTK2 and the title should be like this -> http://wiki.mobileread.com/wiki/Running_X_apps_on_Kindle_Touch Copy the lib form Kindle to computer through USBNetwork. Finally the FPC can compile for Kindle. Well, GTK is working. I should post a screenshot here, unfortunately I don’t why I can’t make a screenshot at that state. You can download my source and bin file below and try, a jailbreaked Kindle is needed. Now the problem is LCL is not working. Here is the output run from kindle-xterm: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i [FORMS.PP] ExceptionOccurred   Sender=EStringListError  Exception=String list does not allow duplicates  Stack trace:  $0004FDE4  $0014EB70  $0019BF38  $0013FB0C  $00131A90  $0014356C  $0002C470  $0002F218  $00192644  $0003B7A4TApplication.HandleException String list does not allow duplicates  Stack trace:  $0004FDE4  $0014EB70  ...... I really hope LCL can work on Kindle. Any ideas? Thank you very much. ---------------------------------------------------------------------- Thaddy · 2016-09-27 14:38 It is very bad practise to rename your cross binutils to their short names. There are other options for that, in your case: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i //add to make options:BINUTILSDIR= -XP ---------------------------------------------------------------------- mercury · 2016-09-28 03:17 Quote from: Thaddy on September 27, 2016, 04:38:08 pmIt is very bad practise to rename your cross binutils to their short names. I don't think it's really matter. Here is what wiki wrote. Quoteln -s /usr/local/bin/arm-linux-ar ~/lazarus/fpc/binutils/ar ln -s /usr/local/bin/arm-linux-ld ~/lazarus/fpc/binutils/ldAnyway the Kindle-test-GTK is working. I wonder what this means. And how to make LCL working. QuoteSender=EStringListError Exception=String list does not allow duplicatesThank you very much. ---------------------------------------------------------------------- molly · 2016-09-28 03:30 Quote from: mercury on September 28, 2016, 05:17:39 amI wonder what this means. And how to make LCL working. QuoteSender=EStringListError Exception=String list does not allow duplicatesThank you very much. Documentation says that TStringlist.duplicates is of type tduplicates and reads about this error: QuotedupError   Raise an error when an attempt is made to add a duplicate. ---------------------------------------------------------------------- mercury · 2016-09-28 03:35 How to fix it? ---------------------------------------------------------------------- molly · 2016-09-28 03:46 what application is generating that error ? Try to compile with debug and -gl for lineinfo to get a better stacktrace. ---------------------------------------------------------------------- mercury · 2016-09-28 05:14 Quote from: molly on September 28, 2016, 05:46:47 amwhat application is generating that error ? Please see Kindle-test-LCL-src.7z Quote from: molly on September 28, 2016, 05:46:47 amTry to compile with debug and -gl for lineinfo to get a better stacktrace. Yes, I did. But on Kindle, it doesn’t output like "$12345678 line 123 of unit1.pas". ---------------------------------------------------------------------- molly · 2016-09-28 05:59 Quote from: mercury on September 28, 2016, 07:14:28 amPlease see Kindle-test-LCL-src.7z Ok, thank you. In that case things went wrong inside LCL. Quote from: molly on September 28, 2016, 05:46:47 amYes, I did. But on Kindle, it doesn’t output like "$12345678 line 123 of unit1.pas". (cross)compile LCL in similar fashion, then your application again. Make sure to _not_ optimize and _not_ strip. Cross fingers for the exe to be small enough to be able to run :-) The only extra defines i know of are VerboseLCL and DebugLCLComponents, use that for lcl compilation as well. But, afaik these are enabled when compiled in debug-mode by default (please someone correct in case wrong). ---------------------------------------------------------------------- mercury · 2016-09-28 06:30 Quote from: molly on September 28, 2016, 07:59:53 am(cross)compile LCL in similar fashion, then your application again. Make sure to _not_ optimize and _not_ strip. Cross fingers for the exe to be small enough to be able to run :-) Of course, the bin is 24MB. I took a photo, see the attachment. And what is “Cross fingers”? Quote from: molly on September 28, 2016, 07:59:53 amThe only extra defines i know of are VerboseLCL and DebugLCLComponents, use that for lcl compilation as well. But, afaik these are enabled when compiled in debug-mode by default (please someone correct in case wrong). How to use these extra defines? Thank you very much. ---------------------------------------------------------------------- molly · 2016-09-28 06:39 Quote from: mercury on September 28, 2016, 08:30:18 amAnd what is “Cross fingers”? Well, besides being an music album made by de band "Architecture in Helsinki" it is an hand gesture, also phrased to wish some-one luck. wikipedia. QuoteHow to use these extra defines? If you want to manually define them use -dNameOfDefine1 -dNameOfDefine2 -dNameOfDefine3 etc. It is simply another compiler option. Problem is that i have no clue as of where debugln statements are being outputted on your kindle device :-/ ---------------------------------------------------------------------- mercury · 2016-09-28 07:04 Quote from: molly on September 28, 2016, 08:39:29 amWell, besides being an music album made by de band "Architecture in Helsinki" it is an hand gesture, also phrased to wish some-one luck. wikipedia. My poor English. (-_-) I add -dDebugLCLComponents, then it doesn't compile. (QAQ) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i gtk2wsbuttons.pp(194,47) Error: Identifier not found "dbgsName" Is that LCL works on Raspberry Pi? Although I don’t have an arm board. I think their CPU have the same architecture. They should be similar. ---------------------------------------------------------------------- molly · 2016-09-28 07:24 Quote from: mercury on September 28, 2016, 09:04:04 amI add -dDebugLCLComponents, then it doesn't compile. (QAQ) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i gtk2wsbuttons.pp(194,47) Error: Identifier not found "dbgsName"Hmz.. maybe you can try adding the define "WithOldDebugln" (without the quotes) and see if that helps ? QuoteIs that LCL works on Raspberry Pi? Although I don’t have an arm board. I think their CPU have the same architecture. They should be similar. LCL should work on the pi, see here but, there are some reports concerning pi and lazarus/lcl inside bugtracker. ---------------------------------------------------------------------- mercury · 2016-09-28 07:44 Quote from: molly on September 28, 2016, 09:24:48 amHmz.. maybe you can try adding the define "WithOldDebugln" (without the quotes) and see if that helps ? The result bin is totally same. Is there any way to remote debug? Through Wi-Fi, like Android. ---------------------------------------------------------------------- molly · 2016-09-28 07:57 Quote from: mercury on September 28, 2016, 09:44:09 amThe result bin is totally same. In that case, there should be a logfile named "lcldebug.log" somewhere when you run your application on your kindle. afaik debuglog is controlled with lazlogger, see also here. QuoteIs there any way to remote debug? Through Wi-Fi, like Android. Sure, with gdb. See also here (seems not entirely completed documentation). But, in all honesty. I'm not an expert on lazarus, let alone know anything about gtk2 widgetset. Perhaps someone else reading this has an idea or two that might be able to help you out (in a better way then i was able to so far)