[Solved] Assembler not found when crosscompiling the IDE for arm-linux lazarus / 1-Linux ---------------------------------------------------------------------- Cigydd · 2013-10-06 15:22 Hello everybody, I try to cross-compile my application for arm-linux (Nokia N900). I followed this tutorial: http://wiki.freepascal.org/Setup_Cross_Compile_For_ARM I got to the point where I try to compile Lazarus units for arm-linux. This is the output that I got: Code: [Select]Hint: Start of reading config file /home/maemo/.fpc.cfg Hint: Start of reading config file /etc/fpc.cfg Hint: End of reading config file /etc/fpc.cfg Hint: End of reading config file /home/maemo/.fpc.cfg Free Pascal Compiler version 2.6.2 [2013/10/01] for arm Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling fcllaz.pas Compiling registerfcl.pas Compiling lazaruspackageintf.pas Assembling lazaruspackageintf /home/maemo/lazarus/packager/registration/lazaruspackageintf.pas(110) Error: Assembler /home/maemo/lazarus/fpc/binutils/as not found, switching to external assembling /home/maemo/lazarus/packager/registration/lazaruspackageintf.pas(110) Fatal: There were 1 errors compiling module, stopping The assembler is there. The file /home/maemo/lazarus/fpc/binutils/as is a symbolic link to /usr/local/bin/arm-linux-as, which is a shell script that runs /usr/local/bin/arm-linux-as_org, the original binary file, with a parameter (-meabi=5). Can someone tell me what am I doing wrong? Edit: Lazarus 1.0.12, FPC 2.6.2, Ubuntu 10.04 LTS ---------------------------------------------------------------------- Cigydd · 2013-10-06 15:44 Excuse me, I solved it myself. I added -XParm-linux- in the Custom Options textbox and now Lazarus crosscompiles. ---------------------------------------------------------------------- Kushal · 2013-11-17 05:21 Hi, even im stuggling with same issue and did the above step but not working for me please help ---------------------------------------------------------------------- Leledumbo · 2013-11-17 06:30 Quoteeven im stuggling with same issue and did the above step but not working for meWithout seeing what you have done and what errors / obstacles you face, we can't help anything. ---------------------------------------------------------------------- Kushal · 2013-11-17 08:43 I ran lazarus with root privilages and it worked. but now issue is TMainIDE.ParseCmdLineOptions:   PrimaryConfigPath="/root/.lazarus"   SecondaryConfigPath="/etc/lazarus" NOTE: codetools config file not found - using defaults NOTE: help options config file not found - using defaults [TMainIDE.DoRunProject] INIT TMainIDE.DoInitProjectRun Check build ... TBuildManager.CheckIfProjectNeedsCompilation  SrcFile outdated Project TCompiler.Compile WorkingDir="/tmp/" CompilerFilename="/usr/bin/fpc" CompilerParams=" -MObjFPC -Scghi -O1 -Tlinux -Parm -g -gl -vewnhi -Filib/arm-linux -Fl/opt/gnome/lib -Fu/home/tlc/Lazarus/lcl/units/arm- linux/gtk2 -Fu/home/tlc/Lazarus/lcl/units/arm-linux -Fu/home/tlc/Lazarus/components/lazutils/lib/arm-linux -Fu/home/tlc/Lazarus/packager/units/arm-linux -FUlib/arm-linux/ -l -dLCL -dLCLgtk2 /tmp/project1.lpr" [TCompiler.Compile] CmdLine="/usr/bin/fpc -B  -MObjFPC -Scghi -O1 -Tlinux -Parm -g -gl -vewnhi -Filib/arm-linux -Fl/opt/gnome/lib -Fu/home/tlc/Lazarus/lcl/units/arm-linux/gtk2 -Fu/home/tlc/Lazarus/lcl/units/arm-linux -Fu/home/tlc/Lazarus/components/lazutils/lib/arm-linux -Fu/home/tlc/Lazarus/packager/units/arm-linux -FUlib/arm-linux/ -l -dLCL -dLCLgtk2 /tmp/project1.lpr" Hint: Start of reading config file /etc/fpc.cfg Hint: End of reading config file /etc/fpc.cfg Free Pascal Compiler version 2.6.1 [2013/01/06] for arm Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling /tmp/project1.lpr Compiling unit1.pas Assembling unit1 Assembling project1 Compiling resource lib/arm-linux/project1.or Linking /tmp/project1 /usr/local/bin/arm-linux-ld: warning: link.res contains output sections; did you forget -T? /usr/local/bin/arm-linux-ld: cannot find -lpthread project1.lpr(22) Error: Error while linking project1.lpr(22) Fatal: There were 1 errors compiling module, stopping TMessagesView.CollectLineParts WARNING: 14<>11 SrcLine=project1.lpr(22) Fatal: There were 1 errors compiling module, stopping TLazSourceFileManager.OpenEditorFile Fixing file name: /tmp/ -> /tmp TLazSourceFileManager.OpenEditorFile skipping directory /tmp TMainIDE.DoBuildProject Compile failed TLazSourceFileManager.OpenEditorFile Fixing file name: /tmp/ -> /tmp TLazSourceFileManager.OpenEditorFile skipping directory /tmp and i have copied all files from /lib, /usr/lib of my taret device in to libcross (its TI AM1808 ARM9 processor) but it still did not work Please help.... ---------------------------------------------------------------------- Kushal · 2013-11-17 08:50 im using fpc-2.6.1 on ubuntu 12.10 and binutils 2.20 is latest on -/fpc-2.6.2 recommended with 2.6.3? ---------------------------------------------------------------------- Leledumbo · 2013-11-17 12:56 Quote/usr/local/bin/arm-linux-ld: cannot find -lpthreadIsn't it clear enough that you need pthread libraries? Quoteis latest on -/fpc-2.6.2 recommended with 2.6.3?Latest stable is always recommended for commercial projects. 2.6.1 is the unfinished 2.6.2, better use 2.6.3 as it is 2.6.2 with bug fixes. ---------------------------------------------------------------------- Kushal · 2013-11-18 04:34 Hi, Thanq for your response. I have installed 2.6.2 and 2.6.3 above it. Regarding "-lpthread" - i have already have these target libs in the folders below /home/tlc/Lazarus/fpc/libcross/libpthread.so.0 /home/tlc/Lazarus/fpc/libcross/libpthread-2.8.so im not not understanding whether to rename these or....... ---------------------------------------------------------------------- Kushal · 2013-11-18 05:46 Current Binutils version id 2.20 I thought latest binutils would do good and installed it. now im recieving errors /usr/local/bin/arm-linux-ld: cannot find -lpthread /usr/local/bin/arm-linux-ld: cannot find -lX11 /usr/local/bin/arm-linux-ld: cannot find -lgdk_pixbuf-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgtk-x11-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgdk-x11-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgobject-2.0 /usr/local/bin/arm-linux-ld: cannot find -lglib-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgthread-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgmodule-2.0 /usr/local/bin/arm-linux-ld: cannot find -lpango-1.0 /usr/local/bin/arm-linux-ld: cannot find -lcairo /usr/local/bin/arm-linux-ld: cannot find -latk-1.0 /usr/local/bin/arm-linux-ld: cannot find -ldl /usr/local/bin/arm-linux-ld: cannot find -lc project1.lpr(22) Error: Error while linking .... the target board has QT framework-- here im compiling for gtk2.(Does this matter). so tried to build Lazarus with Qt , ARM ,Linux now recieved errors /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(10,44) Error: Identifier not found "QX11Info_isCompositingManagerRunning" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(16,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(42,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(45,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(93,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(98,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(127,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(132,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(170,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(175,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(229,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(233,34) Error: Identifier not found "QX11Info_appScreen" ---------------------------------------------------------------------- Kushal · 2013-11-18 06:17 Quote from: Kushal on November 18, 2013, 06:46:00 am /usr/local/bin/arm-linux-ld: cannot find -lpthread /usr/local/bin/arm-linux-ld: cannot find -lX11 /usr/local/bin/arm-linux-ld: cannot find -lgdk_pixbuf-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgtk-x11-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgdk-x11-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgobject-2.0 /usr/local/bin/arm-linux-ld: cannot find -lglib-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgthread-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgmodule-2.0 /usr/local/bin/arm-linux-ld: cannot find -lpango-1.0 /usr/local/bin/arm-linux-ld: cannot find -lcairo /usr/local/bin/arm-linux-ld: cannot find -latk-1.0 /usr/local/bin/arm-linux-ld: cannot find -ldl /usr/local/bin/arm-linux-ld: cannot find -lc project1.lpr(22) Error: Error while linking .... the target board has QT framework-- here im compiling for gtk2.(Does this matter). so tried to build Lazarus with Qt , ARM ,Linux now recieved errors /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(10,44) Error: Identifier not found "QX11Info_isCompositingManagerRunning" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(16,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(42,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(45,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(93,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(98,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(127,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(132,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(170,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(175,34) Error: Identifier not found "QX11Info_appScreen" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(229,30) Error: Identifier not found "QX11Info_display" /home/tlc/Lazarus/lcl/interfaces/qt/qtx11.inc(233,34) Error: Identifier not found "QX11Info_appScreen" Hi, The  above isses are partialy solved by adding '{$DEFINE QTOPIA}'(no quotes) at the starting of qtdefines.inc in lazarus/lcl/interfaces/qt dir and finally left with these errors Free Pascal Compiler version 2.6.3 [2013/11/16] for arm Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Linux for ARMEL Compiling lazarus.pp Assembling lazarus Compiling resource /root/.lazarus/units/arm-linux/qt/lazarus.or Linking /root/.lazarus/bin/arm-linux/lazarus /usr/local/bin/arm-linux-ld: warning: /root/.lazarus/bin/arm- linux/link.res contains output sections; did you forget -T? /usr/local/bin/arm-linux-ld: cannot find -lpthread /usr/local/bin/arm-linux-ld: cannot find -ldl /usr/local/bin/arm-linux-ld: skipping incompatible /usr/lib//libQt4Pas.so when searching for -lQt4Pas /usr/local/bin/arm-linux-ld: skipping incompatible /usr/lib/libQt4Pas.so when searching for -lQt4Pas /usr/local/bin/arm-linux-ld: cannot find -lQt4Pas /usr/local/bin/arm-linux-ld: cannot find -lc lazarus.pp(131,42) Error: Error while linking Note: i have built lazarus-> qt-> linux->i386  successfully Even i changed /usr/lib/libQt4Pas.so to /usr/lib/lQt4Pas with no success would be very happy if any hint provided here. Please. ---------------------------------------------------------------------- marcov · 2013-11-18 08:38 Quote from: Kushal on November 18, 2013, 07:17:02 amQuote from: Kushal on November 18, 2013, 06:46:00 am /usr/local/bin/arm-linux-ld: cannot find -lpthread /usr/local/bin/arm-linux-ld: cannot find -lX11 /usr/local/bin/arm-linux-ld: cannot find -lgdk_pixbuf-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgtk-x11-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgdk-x11-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgobject-2.0 /usr/local/bin/arm-linux-ld: cannot find -lglib-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgthread-2.0 /usr/local/bin/arm-linux-ld: cannot find -lgmodule-2.0 /usr/local/bin/arm-linux-ld: cannot find -lpango-1.0 /usr/local/bin/arm-linux-ld: cannot find -lcairo /usr/local/bin/arm-linux-ld: cannot find -latk-1.0 /usr/local/bin/arm-linux-ld: cannot find -ldl /usr/local/bin/arm-linux-ld: cannot find -lc project1.lpr(22) Error: Error while linking Those are because 1) the relevant libraries aren't there for the selected architecture 2) the relevant links or -dev(el) packages aren't there. 3) everything is there, but you didn't pass a path for them to be found. (e.g. with -Fl) Quote Compiling resource /root/.lazarus/units/arm-linux/qt/lazarus.or Linking /root/.lazarus/bin/arm-linux/lazarus /usr/local/bin/arm-linux-ld: warning: /root/.lazarus/bin/arm- linux/link.res contains output sections; did you forget -T? /usr/local/bin/arm-linux-ld: cannot find -lpthread /usr/local/bin/arm-linux-ld: cannot find -ldl /usr/local/bin/arm-linux-ld: skipping incompatible /usr/lib//libQt4Pas.so when searching for -lQt4Pas /usr/local/bin/arm-linux-ld: skipping incompatible /usr/lib/libQt4Pas.so when searching for -lQt4Pas /usr/local/bin/arm-linux-ld: cannot find -lQt4Pas /usr/local/bin/arm-linux-ld: cannot find -lc lazarus.pp(131,42) Error: Error while linking Why is it searching in i386 directories for ARM libraries? Something is not right there. Have a look at -Xd to avoid searching default directories, and only the ones you specify (with the arm libraries hopefully)