Closed fredvs closed 4 months ago
Thanks for your work on this issue ! However, I will not implement the brandelf fix. Reason. FPC must generate an elf binary with the right signature for FreeBSD. So, a patch must be made for FPC to get things right ! Its not the task of fpcupdeluxe to change the signature. So, I am thankful for your work, but this is 100% an issue that needs to be addressed by FP itself ! Can you agree with this ?
Hello Don. OK, I agree with you.
Hello.
Congratulation for the cross-compiler Linux amd64 to FreeBSD aarch64, I was able to compile (complicated graphic + audio MSEgui) projects. And the binary runs nearly out-of-the-box on a real Rpi FreeBSD 14.0 aarch64 machine. The only thing needed is to do, on the real machine:
$ brandelf -t freebsd <TheCrosscompiledBinary>
Could it be possible to do a "brandelf" at cross-compiling? But I did not find any "brandelf" for Linux, maybe there is a other solution?
Note that re-compiling fpc 3.3.1 fails on a real FreeBSD 14.0 aarch64 because in the /compiler/Makefile after each pre-compiler brandelf is missing and so the pre-compiler can not run.
Here a /compiler/Makefile patched to enable compilation of the compiler on a real FreeBSD 14.0 machine: Makefile_fpc331_compiler_freebsd_aarch64.zip
Note too that compilation of fpc on a real FreeBSD 14.0 machine fails when trying to assemble system.ppu but this is a other story, it is not about cross-compilation.
So to resume, fpc himself at the moment can be done only by cross-compilation.
Also, it would be great if the /compiler/systems/t_bsd.pas uses the correct linker and does the "brandelf" at end of compilation: Line 156 add this:
and line 560 add this:
The patched t_bsd.pas solve it, I tried it and with it people can compile the app on the real machine and dont need to do anything after compilation/linking. t_bsd.pas.zip
Here fpc 3.3.1.freebsd aarch64 binary with the patch for t_bsd.pas: https://github.com/fredvs/test/releases/tag/fpc323 See asset: fpc-331_freebsd-aarch64_fix_linker_ld-elf_so_1.zip
Fre;D