Forum > Other

FreeBSD 13.1 cprt0.o error

<< < (2/3) > >>

marcov:
I reworked some FreeBSD support in post 3.2.2 fixes and trunk. BSDers are recommended to upgrade asap.

To bootstrap, you need to make "ld.bfd" default (symlink to "ld"), and then bootstrap. After the bootstrap, the compiler will execute "ld.bfd" rather than "ld".

llvm ld is not workable at this moment, it seems to have no error handling, and simply silently omit everything it doesn't understand.

p.s. bootstrap experience might vary depending if you installed "COMPAT"systems while installing Freebsd or not.

Fred vS:

--- Quote from: marcov on January 17, 2023, 08:47:56 pm ---I reworked some FreeBSD support in post 3.2.2 fixes and trunk. BSDers are recommended to upgrade asap.

To bootstrap, you need to make "ld.bfd" default (symlink to "ld"), and then bootstrap. After the bootstrap, the compiler will execute "ld.bfd" rather than "ld".

llvm ld is not workable at this moment, it seems to have no error handling, and simply silently omit everything it doesn't understand.

p.s. bootstrap experience might vary depending if you installed "COMPAT"systems while installing Freebsd or not.

--- End quote ---

Ha, nice, thanks, I will try.
To make fpc 3.2.2. work on my FreeBSD machine I had to change in /compiler/systems/t_bsd.pas, procedure TLinkerBSD.SetDefaultInfo :


--- Code: Pascal  [+][-]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";}};} --- if (target_info.system in (systems_openbsd+[system_x86_64_dragonfly]))  or  (target_info.system in (systems_freebsd+[system_x86_64_freebsd]))  // add this  then LdProgram:='ld.bfd';
And recompile fpc and then all was ok.

marcov:
Check you generated a real FreeBSD 13 binary (either file or elfdump -n).

This is what the post 3.2.2 fixes aim to solve, creating Free BSD 12/13 native binaries. (depending on the ELF identifier in rtl/freebsd/cprt0 etc)

Fred vS:

--- Quote from: marcov on January 18, 2023, 04:22:30 pm ---Check you generated a real FreeBSD 13 binary (either file or elfdump -n).

This is what the post 3.2.2 fixes aim to solve, creating Free BSD 12/13 native binaries. (depending on the ELF identifier in rtl/freebsd/cprt0 etc)

--- End quote ---

Hello Marco.

Doing this of a binary file compiled with fpc official release 3.2.2 + my patch on a FreeBSD 13.1 system (last GhostBSD):


--- 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";}};} ---$ file strumpract
gives this:


--- Quote ---strumpract: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked, interpreter /usr/libexec/ld-elf.so.1, stripped
--- End quote ---

elfdump -n strumpract gives nothing.

How can I see if it was a real FreeBSD 13 binary?

marcov:
Probably the elfdump failure is a sign. -n dumps note sections, and the note sections changed in newer FreeBSD.

So that is probably an older -compat binary.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version