fpc subversion trunk installation on raspberry PI lazarus / 1-Linux ---------------------------------------------------------------------- nomorelogic · 2014-04-19 18:18 hi all I'm trying to install the fpc trunk compiler from subversion on my raspberry. The distro is gentoo and I've used following commands: Code: [Select]1) su 2) mkdir /usr/local/fpc 3) cd /usr/local/fpc 4) wget http://sourceforge.net/projects/freepascal/files/Bootstrap/2.6.2/arm- linux-ppcarm.bz2/download 5) mv download ppcarm.bz2 6) bunzip2 ppcarm.bz2 7) svn co http://svn.freepascal.org/svn/fpc/trunk trunk 8) svn export --force trunk trunktmp 9) cd trunktmp 10) make all OPT='-gl -O3p3' -j 8 FPMAKEOPT="-T 8" FPC=/usr/local/fpc/ppcarm >/usr/local/fpc/makeall.log when "make all" ends, I get an error. Attached is the stdout while below you can see other messages printed on shell Code: [Select]trunktmp # make all OPT='-gl -O3p3' -j 8 FPMAKEOPT="-T 8" FPC=/usr/local/fpc/ppcarm >/usr/local/fpc/makeall.log /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: ./link.res contains output sections; did you forget -T? /usr/bin/ld: warning: link.res contains output sections; did you forget -T? make[2]: ./fpmake: Command not found make[2]: *** [smart] Error 127 make[1]: *** [packages_smart] Error 2 make: *** [build-stamp.arm-linux] Error 2 Any idea about the error? thanks in advantage nomorelogic ---------------------------------------------------------------------- marcov · 2014-04-21 09:52 The warnings are normal.  The error is that it can't find the build tool fpmake. which should be built as part of the build process. ---------------------------------------------------------------------- nomorelogic · 2014-04-22 13:43 well looking at last lines in log: Quotemake[3]: Leaving directory `/usr/local/fpc/trunktmp/packages/fpmkunit' /usr/local/fpc/trunktmp/compiler/ppcarm fpmake.pp  -Fu/usr/local/fpc/trunktmp/packages/fpmkunit/units_bs/arm-linux -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux  -gl -O3p3 ./fpmake compile -T 8 --localunitdir=.. --os=linux --cpu=arm -o -Ur -o -Xs -o -O2 -o -n -o -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux -o -gl -o -O3p3 -o -darm -o -dRELEASE --compiler=/usr/local/fpc/trunktmp/compiler/ppcarm -bu -o -XX -o -CX make[2]: Leaving directory `/usr/local/fpc/trunktmp/packages' make[1]: Leaving directory `/usr/local/fpc/trunktmp' I repeated manually last commands: once in '/usr/local/fpc/trunktmp/packages' folder I executed Code: [Select]/usr/local/fpc/trunktmp/compiler/ppcarm fpmake.pp [...]and I've got a warning: Quote/usr/bin/ld: warning: link.res contains output sections; did you forget -T?anyway fpmake was builted: Code: [Select]ls fpmake -lQuote-rwxr-xr-x 1 root root 4140367 Apr 25 15:34 fpmake after that I executed (just to check existence) Code: [Select]./fpmakeand the answer is: Quote-bash: ./fpmake: No such file or directory something went wrong in fpmake compilation? Edit: reading here http://stackoverflow.com/questions/3949161/no-such-file-or-directory- but-it-exists I have checked fpmake with some tools, follow results Code: [Select]pastoo packages # file ./fpmake ./fpmake: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.0.0, not stripped pastoo packages # ldd ./fpmake /usr/bin/ldd: line 115: ./fpmake: No such file or directory pastoo packages # pastoo packages # readelf -hl ./fpmake ELF Header:   Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00   Class:                             ELF32   Data:                              2's complement, little endian   Version:                           1 (current)   OS/ABI:                            UNIX - System V   ABI Version:                       0   Type:                              EXEC (Executable file)   Machine:                           ARM   Version:                           0x1   Entry point address:               0x8490   Start of program headers:          52 (bytes into file)   Start of section headers:          3147912 (bytes into file)   Flags:                             0x5000002, has entry point, Version5 EABI   Size of this header:               52 (bytes)   Size of program headers:           32 (bytes)   Number of program headers:         9   Size of section headers:           40 (bytes)   Number of section headers:         27   Section header string table index: 24 Program Headers:   Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align   PHDR           0x000034 0x00008034 0x00008034 0x00120 0x00120 R E 0x4   INTERP         0x000154 0x00008154 0x00008154 0x00013 0x00013 R   0x1       [Requesting program interpreter: /lib/ld-linux.so.3]   LOAD           0x000000 0x00008000 0x00008000 0x14a5f4 0x14a5f4 R E 0x8000   LOAD           0x14af20 0x0015af20 0x0015af20 0x092b0 0x0e5e8 RW  0x8000   DYNAMIC        0x14af20 0x0015af20 0x0015af20 0x000e0 0x000e0 RW  0x4   NOTE           0x000170 0x00008170 0x00008170 0x00020 0x00020 R   0x10   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4   GNU_RELRO      0x14af20 0x0015af20 0x0015af20 0x000e0 0x000e0 R   0x1   PAX_FLAGS      0x000000 0x00000000 0x00000000 0x00000 0x00000     0x4  Section to Segment mapping:   Segment Sections...    00       01     .interp    02     .interp .note.ABI-tag .hash .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .rel.plt .init .plt .text .fini .rodata    03     .dynamic .got .data .bss    04     .dynamic    05     .note.ABI-tag    06       07     .dynamic    08    thanks in advantage ---------------------------------------------------------------------- nomorelogic · 2014-04-28 13:07 a little step forward looking at readelf output in my previous post, I noted: '[Requesting program interpreter: /lib/ld-linux.so.3]' well, this library is present as: /lib/ld-linux-armhf.so.3 so I created a link with following command: Code: [Select]ln -s ld-linux-armhf.so.3 ld-linux.so.3 now the error is different (and less cryptic): Code: [Select]# ./fpmake The installer encountered the following error: Access violation then I tried the entire rebuild and the error was exactly as expected Code: [Select]./fpmake compile -T 8 --localunitdir=.. --os=linux --cpu=arm -o -Ur -o -Xs -o -O2 -o -n -o -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux -o -gl -o -O3p3 -o -darm -o -dRELEASE --compiler=/usr/local/fpc/trunktmp/compiler/ppcarm -bu -o -XX -o -CX The installer encountered the following error: Access violation make[2]: *** [smart] Error 1 make[2]: Leaving directory `/usr/local/fpc/trunktmp/packages' make[1]: *** [packages_smart] Error 2 make[1]: Leaving directory `/usr/local/fpc/trunktmp' make: *** [build-stamp.arm-linux] Error 2 well, inspecting with strace I found something, but, since in the meantime 2.6.4 (for arm) was posted, I'll repeat all using the latest version (now I'm trying with 2.6.2) . ---------------------------------------------------------------------- Loesje · 2014-04-28 14:23 Where did you get your fpc-version from? The default arm-versions of the compiler are for armel. As your ld-linux.so has an 'hf' suffix, I doubt that your system is armel-based. (uname -a will give more information) You could try to install the fpc-packages from Fedora, which are using hf. (http://koji.fedoraproject.org/koji/buildinfo?buildID=455287) You can download the patches which are used to build fpc-2.6.2 for Fedora here: http://pkgs.fedoraproject.org/cgit/fpc.git/tree/ In one of those patches the path to the default linker is changed. But it's still different then the name of the linker you found on your system ( /lib/ld-linux-armhf.so.3). You could try to set the name of the dynamic-linker in your fpc.cfg (add the line: -FL/lib/ld-linux-armhf.so.3) Or to your make options: make all [your stuff here] OPT=-FL/lib/ld-linux-armhf.so.3 ---------------------------------------------------------------------- nomorelogic · 2014-04-28 17:50 Quote from: Loesje on April 28, 2014, 04:23:37 pmWhere did you get your fpc-version from? The default arm-versions of the compiler are for armel. As your ld-linux.so has an 'hf' suffix, I doubt that your system is armel-based. (uname -a will give more information) fpc downloaded here http://sourceforge.net/projects/freepascal/files/Linux/2.6.4/ uname Code: [Select]pastoo trunktmp # uname -a Linux pastoo 3.10.37+ #669 PREEMPT Tue Apr 15 14:44:32 BST 2014 armv6l BCM2708 GNU/Linux ok I'm a bit confused ld-linux.so has hf suffix but armv6l means armel? ---------------------------------------------------------------------- Loesje · 2014-04-29 19:33 I'm not 100% sure, but hf just means hardware-floatingpoint support. That's in principle possible with armel *and* armb. During the bootstrap-process, fpmake is the first application which is build by the new compiler and which is also run. (Except from the compiler itself, but that one doesn't use dynamic linking) For some reason the compiler you've build does not work very well... You have to find out what's wrong with it. ---------------------------------------------------------------------- nomorelogic · 2014-04-30 07:43 in fact ppcarm 2.7.1 is built but I have not yet compiled any source: I would do the job without errors. If someone has a raspberry and want to try install the fpc trunk, I can share my ssd image (gentoo). ---------------------------------------------------------------------- nomorelogic · 2014-04-30 10:06 a little step forvard, using this command: Code: [Select]# make all OPT='-gl -O3p3' -j 8 FPMAKEOPT="-T 8" FPC=/usr/local/lib/fpc/2.6.4/ppcarm OPT=-FL/lib/ld-linux-armhf.so.3 fpmake was built! but I've got another error related to assembler (see at the end) Code: [Select][...] [ 70%] Compiled package rtl-extra        Compiling ./opengl/src/glu.pp        Compiling ./rtl-unicode/src/collations/collation_ko.pas        Compiling ./opengl/src/glut.pp        Compiling ./opengl/src/freeglut.pp        Compiling ./libxml/src/xmlxsd.pas        Compiling ./paszlib/src/unzip.pas        Compiling ./rtl-unicode/src/collations/collation_ru.pas [ 71%] Compiled package libxml2        Compiling ./opengl/src/glx.pp        Compiling ./paszlib/src/zipper.pp        Compiling ./paszlib/src/zstream.pp        Compiling ./rtl-unicode/src/collations/collation_sv.pas [ 72%] Compiled package opengl [ 72%] Compiled package paszlib        Compiling ./rtl-unicode/src/collations/collation_zh.pas        Compiling ./rtl-unicode/src/inc/cpbuildu.pp        Compiling ./rtl-unicode/src/inc/cp932.pas        Compiling ./rtl-unicode/src/inc/cp936.pas        Compiling ./rtl-unicode/src/inc/cp949.pas        Compiling ./rtl-unicode/src/inc/cp950.pas [ 73%] Compiled package rtl-unicode The installer encountered the following error: External command "/usr/local/fpc/trunktmp/compiler/ppcarm -Tlinux -FUfcl-base/units/arm-linux/ -Fu/usr/local/fpc/trunktmp/rtl/units/arm- linux/ -Fu/usr/local/fpc/trunktmp/packages/fcl-res/units/arm-linux/ -Fu/usr/local/fpc/trunktmp/packages/rtl-objpas/units/arm-linux/ -Fufcl-base/src -Fifcl-base/src -Fifcl-base/src/linux -Fifcl- base/src/unix -Fifcl-base/src/dummy -Ur -Xs -O2 -n -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux -FL/lib/ld-linux- armhf.so.3 -darm -dRELEASE -XX -CX -viq fcl- base/BuildUnit_fcl_base.pp" failed with exit code 256. Console output: Target OS: Linux for ARMEL Compiling fcl-base/BuildUnit_fcl_base.pp Compiling ./fcl-base/src/ascii85.pp Assembling ascii85 Compiling ./fcl-base/src/avl_tree.pp Assembling avl_tree Compiling ./fcl-base/src/base64.pp Assembling base64 Compiling ./fcl-base/src/fpobserver.pp Compiling ./fcl-base/src/contnrs.pp Writing Resource String Table file: contnrs.rsj Assembling contnrs Writing Resource String Table file: fpobserver.rsj Assembling fpobserver Compiling ./fcl-base/src/blowfish.pp Writing Resource String Table file: blowfish.rsj Assembling blowfish Compiling ./fcl-base/src/bufstream.pp Writing Resource String Table file: bufstream.rsj Assembling bufstream Compiling ./fcl-base/src/cachecls.pp Writing Resource String Table file: cachecls.rsj Assembling cachecls Compiling ./fcl-base/src/custapp.pp Writing Resource String Table file: custapp.rsj Assembling custapp Compiling ./fcl-base/src/eventlog.pp Writing Resource String Table file: eventlog.rsj Assembling eventlog Compiling ./fcl-base/src/fptimer.pp Assembling fptimer Compiling ./fcl-base/src/gettext.pp Assembling gettext gettext.pp(403) Error: Can't call the assembler, error -1 switching to external assembling gettext.pp(403) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted make[2]: *** [smart] Error 1 make[2]: Leaving directory `/usr/local/fpc/trunktmp/packages' make[1]: *** [packages_smart] Error 2 make[1]: Leaving directory `/usr/local/fpc/trunktmp' make: *** [build-stamp.arm-linux] Error 2 seems that the "assembler error" is raised after some assembling statemens attached you can found the full log can anyone help me? thanks in advantage Edit: related to the build of fpmake, in full log I've found this Code: [Select]/usr/local/fpc/trunktmp/compiler/ppcarm fpmake.pp  -Fu/usr/local/fpc/trunktmp/packages/fpmkunit/units_bs/arm-linux -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux  -FL/lib/ld-linux- armhf.so.3 Free Pascal Compiler version 2.7.1 [2014/04/30] for arm Copyright (c) 1993-2014 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling fpmake.pp fpmake.pp(16,3) Note: Local variable "T" is assigned but never used Assembling fpmake Linking fpmake fpmake.pp(46) Warning: "crtbegin.o" not found, this will probably cause a linking failure fpmake.pp(46) Warning: "crtend.o" not found, this will probably cause a linking failure /usr/bin/ld: warning: link.res contains output sections; did you forget -T? 14122 lines compiled, 36.1 sec 2 warning(s) issued 1 note(s) issued ---------------------------------------------------------------------- marcov · 2014-04-30 15:01 crtbegin/end are part of general Linux development packages (iirc on debian and derivatives it is in a package "build-essentials" or so) P.s. do you REALLY have an 8 core ARM that can uses all cores at the same time? (so not 4.4 little.BIG ?) ---------------------------------------------------------------------- nomorelogic · 2014-04-30 15:51 Quote from: marcov on April 30, 2014, 05:01:58 pmP.s. do you REALLY have an 8 core ARM that can uses all cores at the same time? (so not 4.4 little.BIG ?) emh... no  I just copy/paste from a script found here http://www.michellcomputing.co.uk/blog/2012/11/lazarus-on-the- raspberry-pi/ I have not actually checked the parameters as I thought they were correct ---------------------------------------------------------------------- nomorelogic · 2014-04-30 16:06 another little step forward! Quote from: marcov on April 30, 2014, 05:01:58 pmcrtbegin/end are part of general Linux development packages (iirc on debian and derivatives it is in a package "build-essentials" or so) found in: /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.7.3 so I executed Code: [Select]pastoo trunktmp # make all OPT='-gl -O3p3' -j 8 FPMAKEOPT="-T 8" FPC=/usr/local/lib/fpc/2.6.4/ppcarm OPT=-FL/lib/ld- linux-armhf.so.3 OPT=-Fo/usr/lib/gcc/armv6j-hardfloat-linux- gnueabi/4.7.3/ and the process is up to 83%... found some: Warning: Unable to determine the libgcc path. but now I'm blocked on rtl-unicode Code: [Select][ 83%] Compiled package ptc        Compiling ./rtl-unicode/src/inc/cpbuildu.pp        Compiling ./rtl-unicode/src/inc/cp932.pas        Compiling ./rtl-unicode/src/inc/cp936.pas        Compiling ./rtl-unicode/src/inc/cp949.pas        Compiling ./rtl-unicode/src/inc/cp950.pas [ 84%] Compiled package rtl-unicode The installer encountered the following error: External command "/usr/local/fpc/trunktmp/compiler/ppcarm -Tlinux -FUfv/units/arm-linux/ -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux/ -Fu/usr/local/fpc/trunktmp/packages/rtl-console/units/arm-linux/ -Fu/usr/local/fpc/trunktmp/packages/rtl-extra/units/arm-linux/ -Fufv/src -Fifv/src -Ur -Xs -O2 -n -Fu/usr/local/fpc/trunktmp/rtl/units/arm-linux -Fo/usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.7.3/ -darm -dRELEASE -XX -CX -viq fv/BuildUnit_fv.pp" failed with exit code 256. Console output: Target OS: Linux for ARMEL Compiling fv/BuildUnit_fv.pp Compiling ./fv/src/fvcommon.pas Assembling fvcommon Compiling ./fv/src/sysmsg.pas Assembling sysmsg Compiling ./fv/src/fvconsts.pas Compiling ./fv/src/drivers.pas Assembling drivers Compiling ./fv/src/views.pas Assembling views Compiling ./fv/src/menus.pas Assembling menus Compiling ./fv/src/histlist.pas Assembling histlist Compiling ./fv/src/msgbox.pas Compiling ./fv/src/dialogs.pas Compiling ./fv/src/validate.pas Compiling ./fv/src/msgbox.pas Compiling ./fv/src/dialogs.pas Compiling ./fv/src/app.pas Compiling ./fv/src/msgbox.pas Compiling ./fv/src/app.pas Writing Resource String Table file: app.rsj Assembling app Writing Resource String Table file: msgbox.rsj Assembling msgbox Writing Resource String Table file: dialogs.rsj Assembling dialogs Assembling validate validate.pas(1049) Error: Can't call the assembler, error -1 switching to external assembling validate.pas(1049) Fatal: There were 2 errors compiling module, stopping Fatal: Compilation aborted make[2]: *** [smart] Error 1 make[2]: Leaving directory `/usr/local/fpc/trunktmp/packages' make[1]: *** [packages_smart] Error 2 make[1]: Leaving directory `/usr/local/fpc/trunktmp' make: *** [build-stamp.arm-linux] Error 2 Edit: in fact I can't find BuildUnit_fv.pp ---------------------------------------------------------------------- marcov · 2014-04-30 16:51 Try adding that -Fo in OPT also to fpmakeopt. ---------------------------------------------------------------------- nomorelogic · 2014-05-02 11:03 compilation success! now I'm doing some test, I'll post the results ---------------------------------------------------------------------- nomorelogic · 2014-05-07 18:14 thank you all again for your help I wrote this guide http://forum.lazarus.freepascal.org/index.php/topic,24508.0.html