Forum > Linux

linking errors compiling on aarch64

(1/3) > >>

dieselnutjob:
Hi
I am trying to compile lazarus for my pinebook pro (KDE on Manjaro on aarch64).

I used this file

--- Code: ---wget https://gitlab.com/freepascal.org/lazarus/lazarus/-/archive/main/lazarus-main.zip

--- End code ---

This is what I got (the last bit)

--- Code: ---make --assume-new=lazres.pp lazres
make[2]: Entering directory '/home/philip/fpc/source/lazarus-main/tools'
Makefile:2956: warning: overriding recipe for target '.'
Makefile:2954: warning: ignoring old recipe for target '.'
/usr/local/bin/ppca64 -gl -Fu. -Fu../components/lazutils/lib/aarch64-linux -Fu../lcl/units/aarch64-linux -Fu../lcl/units/aarch64-linux/nogui -Fu/usr/local/lib/fpc/3.2.2/units/aarch64-linux/rtl -FE. -FU. -Flinclude -Fl/etc/ld.so.conf.d/*.conf -daarch64 lazres.pp
Free Pascal Compiler version 3.2.2 [2021/05/23] for aarch64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for AArch64
Compiling lazres.pp
lazres.pp(65,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(81,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(95,11) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(98,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(109,11) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(112,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(121,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(124,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(261,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(275,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(257,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(231,7) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(233,7) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(208,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(180,11) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(306,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(308,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(321,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(348,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(361,7) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
Assembling lazres
Linking ./lazres
lazres.pp(395) Warning: "crtbegin.o" not found, this will probably cause a linking failure
lazres.pp(395) Warning: "crtend.o" not found, this will probably cause a linking failure
/bin/ld: /usr/local/lib/fpc/3.2.2/units/aarch64-linux/rtl/cprt0.o: in function `_start':
(.text+0x54): undefined reference to `__libc_csu_init'
/bin/ld: (.text+0x58): undefined reference to `__libc_csu_init'
/bin/ld: (.text+0x5c): undefined reference to `__libc_csu_fini'
/bin/ld: (.text+0x60): undefined reference to `__libc_csu_fini'
lazres.pp(395) Error: Error while linking
lazres.pp(395) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[2]: *** [Makefile:2964: lazres] Error 1
make[2]: Leaving directory '/home/philip/fpc/source/lazarus-main/tools'
make[1]: *** [Makefile:3394: all] Error 2
make[1]: Leaving directory '/home/philip/fpc/source/lazarus-main/tools'
make: *** [Makefile:3803: lazbuild] Error 2

--- End code ---

any help would be appreciated

trev:

1) Locate the missing object files (I'm assuming they exist in your file system)
2) Add -va as an option for details of where FPC is looking for the missing object files
3) Add the location of the missing object files -or- link them to where FPC is looking.

If the missing object files do not exist, I'm told installing libgcc should resolve that one.

dbannon:
These files exist (assuming you have gcc installed, its a dependency of fpc, along with binutils, make) in places like


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.oBut the '9' depends on the version of gcc you have and the "x86_64-linux-gnu" depends on your cpu and the "/usr/lib" depends on your distribution! Sigh ...

So, find out where your (eg) crtbegin.o really is


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---find / -name "crtbegin.o" 2> /dev/null <enter>
and either edit your fpc.cfg file or (better IMHO) add a symlink.  I have a line in my fpc.cfg that looks like this -


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----Fl/usr/lib/gcc/x86_64-linux-gnu/9
You should have something vaguely similar.

Davo

dieselnutjob:

--- Quote from: dbannon on March 28, 2022, 01:25:54 am ---These files exist (assuming you have gcc installed, its a dependency of fpc, along with binutils, make) in places like


--- Code: Text  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---/usr/lib/gcc/x86_64-linux-gnu/9/crtbegin.oBut the '9' depends on the version of gcc you have and the "x86_64-linux-gnu" depends on your cpu and the "/usr/lib" depends on your distribution! Sigh ...

So, find out where your (eg) crtbegin.o really is


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---find / -name "crtbegin.o" 2> /dev/null <enter>
and either edit your fpc.cfg file or (better IMHO) add a symlink.  I have a line in my fpc.cfg that looks like this -


--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ----Fl/usr/lib/gcc/x86_64-linux-gnu/9
You should have something vaguely similar.

Davo

--- End quote ---

Thanks.  Your answer got rid of some of the errors.
Specifically, I added this line in /etc/fpc.cfg

--- Code: ---# path to the gcclib
-Fl/usr/lib/gcc/aarch64-unknown-linux-gnu/11.2.0

--- End code ---

However I still have this:-

--- Code: ---Free Pascal Compiler version 3.2.2 [2022/01/24] for aarch64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for AArch64
Compiling lazres.pp
lazres.pp(65,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(81,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(95,11) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(98,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(109,11) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(112,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(121,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(124,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(261,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(275,3) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(257,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(231,7) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(233,7) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(208,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(180,11) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(306,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(308,5) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(321,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(348,9) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
lazres.pp(361,7) Note: Call to subroutine "function GetDebugLogger:TLazLogger;" marked as inline is not inlined
Assembling lazres
Linking ./lazres
/bin/ld: /usr/local/lib/fpc/3.2.2/units/aarch64-linux/rtl/cprt0.o: in function `_start':
(.text+0x54): undefined reference to `__libc_csu_init'
/bin/ld: (.text+0x58): undefined reference to `__libc_csu_init'
/bin/ld: (.text+0x5c): undefined reference to `__libc_csu_fini'
/bin/ld: (.text+0x60): undefined reference to `__libc_csu_fini'
lazres.pp(395) Error: Error while linking
lazres.pp(395) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
make[2]: *** [Makefile:2964: lazres] Error 1
make[2]: Leaving directory '/home/philip/fpc/source/lazarus-main/tools'
make[1]: *** [Makefile:3394: all] Error 2
make[1]: Leaving directory '/home/philip/fpc/source/lazarus-main/tools'
make: *** [Makefile:3803: lazbuild] Error 2
--- End code ---

I have since discovered that lazarus and freepascal can now be installed from pacman.  When I first got my pinebook pro this wasn't the case and so I had to compile from source.

So now I have two installations of fpc, one in /usr/local/bin which I installed using the install.sh from direct download of fpc, and one in /usr/bin which pacman put there.

If there was an uninstall.sh I would probably run it....

dbannon:

--- Quote from: dieselnutjob on March 28, 2022, 01:13:26 pm ---...
However I still have this:-

--- Code: ---
/bin/ld: /usr/local/lib/fpc/3.2.2/units/aarch64-linux/rtl/cprt0.o: in function `_start':
(.text+0x54): undefined reference to `__libc_csu_init'
...

--- End code ---

--- End quote ---
Just to be sure, you have installed the dependencies listed on, eg, https://wiki.freepascal.org/Installing_the_Free_Pascal_Compiler#FPC_Tar_Balls  ?

--- Quote ---If there was an uninstall.sh I would probably run it....

--- End quote ---

Bit late to tell you now but when you install from the FPC Tarball, you do not have to install into /usr/ - I install into a dir in my home dir, set it all up in there and can easily blow it away when ever I feel like it. Thats what the example on the wiki shows ...

Davo

Navigation

[0] Message Index

[#] Next page

Go to full version