Forum > Other

Building Lazarus 3.4 with FreePascal 3.2.2 fails under OpenBSD 7.5

<< < (3/27) > >>

TCH:
The whys are still foggy for me. If the removal of syscall() is the cause of the crashing of the Lazarus compiled on older OpenBSD, then Lazarus should die immediately after OpenBSD got upgraded. But it only dies, when the harfbuzz package is upgraded, after the OS/kernel upgrade. Even if Lazarus did not use syscall() directly, the old harfbuzz lib should be incompatible with the new kernel and thus cause Lazarus to crash anyway.
So, for me, it seems, that the problem is with the new harfbuzz package, for instance, because of the changed ABI, Lazarus passes stuff to harfbuzz in the wrong way and crashes because it. Or, it's something else.

It also does not explain the cnetdb problem at compiling Lazarus.

But maybe it could explain the atexit.c and exit.c errors with Lazarus from the ports; the compiler might try to call into syscall() at one point. Or i don't know.

marcov:
As far as I can see from a comment in rtl/openbsd/makefile.fpc, openbsd is libc based.

Start testing with smaller programs.  Lazarus is too large and unwieldy. If you get glib errors, try to link with glib.

This is one of cases where FPC libc ports are fragile. With syscall ports you can get a minimal part working easier, get the compiler recompiling, and only then tackle dynamical linking and what changed in libc now.

With libc ports that must be done all at once to get a functioning binary.

I can't really help, I haven't worked on net/openbsd in a decade.

marcov:
I walked through unmerged revisions and found some for openbsd:

commit c249495e2df2c695fe8f97a17cdd5de0a02aa501
Author: Pierre Muller <pierre@freepascal.org>
Date:   Mon Jul 17 10:50:29 2023 +0200

    Add '%note' to .note.openbsd.ident section

M       rtl/openbsd/i386/openbsd_ident.inc
M       rtl/openbsd/i386/prt0.as
M       rtl/openbsd/x86_64/openbsd_ident.inc
M       rtl/openbsd/x86_64/prt0.as

commit d621cef9883623c065ff5dd4d97dbb4cd49a26d4
Author: Pierre Muller <pierre@freepascal.org>
Date:   Wed Nov 29 18:21:08 2023 +0000

    Reenable semaphore support for NetBSD and OpenBSD in syncobjs unit

M       packages/fcl-base/src/syncobjs.pp


The last one might also depend on other revisions. You could try to download the first revision as a patch and have a look and try to apply it against fixes.

TCH:
Well, at least i figured out a workaround for the cnetdb problem. For testing i intentonally made syntax errors in /usr/share/fpcsrc/3.2.2/packages/fcl-net/fpmake.pp, but Lazarus did not notice, even after a cleanup. It simply does not even touches the file. So, i've checked where is netdb.pp and then
--- 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";}};} ---ln -s "/usr/share/fpcsrc/3.2.2/packages/fcl-net/src/cnetdb.pp" "/usr/lib/fpc/3.2.2/units/x86_64-openbsd/fcl-net/cnetdb.pp"And the cnetdb problem went away.

The compilation still crashes though...
At this time, with different error messages:
--- Code: ---gmake -C ide bigide
gmake[1]: Entering directory '/tmp/lazarus/ide'
/bin/mkdir -p ../units/x86_64-openbsd/gtk2
../tools/svn2revisioninc .. revision.inc
Created /tmp/lazarus/ide/revision.inc for revision: Unversioned directory
An unhandled exception occurred at $000003CFF7F87EF2:
EAccessViolation:
  $000003CFF7F87EF2 line 177 of /usr/src/lib/libc/stdlib/atexit.c
  $000003CFF7FD0EC5 line 54 of /usr/src/lib/libc/stdlib/exit.c
  $000003CDDEEAAF53  _FPC_PROC_HALTPROC,  line 72 of x86_64/si_c.inc

An unhandled exception occurred at $000003CDDEEC6140:
EAccessViolation:
  $000003CDDEEC6140  SYSFREEMEM,  line 1222 of ../inc/heap.inc
  $000003CFF7FD0EC5 line 54 of /usr/src/lib/libc/stdlib/exit.c
  $000003CDDEEAAF53  _FPC_PROC_HALTPROC,  line 72 of x86_64/si_c.inc
--- End code ---
Whoops, you've posted in the meantime:
--- Quote from: marcov on June 10, 2024, 09:56:12 pm ---The last one might also depend on other revisions. You could try to download the first revision as a patch and have a look and try to apply it against fixes.
--- End quote ---
Thanks for the tip, i'll try to reverse those changes.

marcov:
 Note also that svn2revision is not crucial. Probably it only tries to execute git to get some revision to put in about. Probably the makefiles allow it to ski pit.

Making random symlinks and mixing sources is _NEVER_ good.   Find out why it doesn't work.  In thise case, you modified FPC, not lazarus, so you need to recompile fpc, and then lazarus.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version