Forum > Linux

linking errors compiling on aarch64

<< < (2/3) > >>

PascalDragon:

--- Quote from: dieselnutjob on March 27, 2022, 07:01:15 pm ---any help would be appreciated

--- End quote ---

This is a known problem. To solve it you need the source code for FPC 3.2.2 if you don't have it already. There you navigate to rtl/linux/aarch64 and edit the file cprt0.as (around line 40):


--- Code: ASM  [+][-]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";}};} ---        /* __libc_start_main(main, argc, argv,                             init, fini, rtld_fini, stack_end) */        adrp    x0,:got:PASCALMAIN        ldr     x0,[x0,#:got_lo12:PASCALMAIN]        adrp    x3,:got:__libc_csu_init        ldr     x3,[x3,#:got_lo12:__libc_csu_init]        adrp    x4,:got:__libc_csu_fini        ldr     x4,[x4,#:got_lo12:__libc_csu_fini]        bl      __libc_start_main 
Replace this with the following:


--- Code: ASM  [+][-]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";}};} ---        /* __libc_start_main(main, argc, argv,                             init, fini, rtld_fini, stack_end) */        adrp    x0,:got:PASCALMAIN        ldr     x0,[x0,#:got_lo12:PASCALMAIN]        mov     x3,xzr        mov     x4,xzr        bl      __libc_start_main 
And then go one directory up (to rtl/linux) and execute


--- Code: ---make CPU_TARGET=aarch64 OS_TARGET=linux cprt0.o
--- End code ---

Finally copy the file rtl/units/aarch64-linux/cport0.o to /usr/local/lib/fpc/3.2.2/units/aarch64-linux/rtl/cprt0.o, replacing the original file there.

dbannon:
Wow, so that means that as the new glibc is rolled out, we can expect FPC to stop working on  aarch64, ppc64le and even poor old i386 ?

Thats going to be interesting ....

Davo

PascalDragon:

--- Quote from: dbannon on March 30, 2022, 12:58:51 am ---Wow, so that means that as the new glibc is rolled out, we can expect FPC to stop working on  aarch64, ppc64le and even poor old i386 ?
--- End quote ---

FPC itself will continue to work, cause it doesn't link to the C library on Linux. However anything that links in the C library will trigger this. This is something we'll have to fix before 3.2.4 is released.

dieselnutjob:

--- Quote from: PascalDragon on March 29, 2022, 10:21:45 am ---
--- Quote from: dieselnutjob on March 27, 2022, 07:01:15 pm ---any help would be appreciated

--- End quote ---

This is a known problem. To solve it you need the source code for FPC 3.2.2 if you don't have it already. There you navigate to rtl/linux/aarch64 and edit the file cprt0.as (around line 40):


--- Code: ASM  [+][-]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";}};} ---        /* __libc_start_main(main, argc, argv,                             init, fini, rtld_fini, stack_end) */        adrp    x0,:got:PASCALMAIN        ldr     x0,[x0,#:got_lo12:PASCALMAIN]        adrp    x3,:got:__libc_csu_init        ldr     x3,[x3,#:got_lo12:__libc_csu_init]        adrp    x4,:got:__libc_csu_fini        ldr     x4,[x4,#:got_lo12:__libc_csu_fini]        bl      __libc_start_main 
Replace this with the following:


--- Code: ASM  [+][-]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";}};} ---        /* __libc_start_main(main, argc, argv,                             init, fini, rtld_fini, stack_end) */        adrp    x0,:got:PASCALMAIN        ldr     x0,[x0,#:got_lo12:PASCALMAIN]        mov     x3,xzr        mov     x4,xzr        bl      __libc_start_main 
And then go one directory up (to rtl/linux) and execute


--- Code: ---make CPU_TARGET=aarch64 OS_TARGET=linux cprt0.o
--- End code ---

Finally copy the file rtl/units/aarch64-linux/cport0.o to /usr/local/lib/fpc/3.2.2/units/aarch64-linux/rtl/cprt0.o, replacing the original file there.

--- End quote ---

this worked thanks.
The only note I would add for future victims is that in Manjaro that the source is in /usr/lib/fpc/src and that once the new cprt is compiled the command to actually install it is then (if you installed fpc, fpc-src and lazarus using the package manager):-

--- Code: ---cp /usr/lib/fpc/src/rtl/units/aarch64-linux/cprt0.o /usr/lib/fpc/3.2.2/units/aarch64-linux/rtl/

--- End code ---

dieselnutjob:
I reported it as a bug here
https://bugs.archlinux.org/task/74281

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version