You are not logged in.

#1 2023-04-27 14:15:32

PeterBB
Member
Registered: 2014-11-06
Posts: 27

[SOLVED] Rebuilding lazarus

https://archlinux.org/packages/communit … 4/lazarus/

Lazarus official package is several weeks out of date now,
so I tried to update to 2.2.6 locally.
Usually this works fine, just bump the pkgver and update the checksums.

Lazarus seemed to build OK, but the package was about 30% smaller than expected.
When I tried to use it, packages built with the new Lazarus failed to link with
buckets of undefined DBG... symbols, but I was not trying to build debug packages.

I then tried to rebuild 2.2.4, and had exactly the same problem!
That is the official PKGBUILD for Lazarus either no longer works, or something is broken on my system.
(I've checked both /etc/fpc.cfg and /etc/makepkg.conf)

Seems this issue can be fixed by including !strip in the options.

Wondering what is going on here and when the official PKGBUILD is likely to be updated.


Cheers,
Peter

P.S.
I raised the issue upstream (with no response) and posted an updated PKGBUILD there.
https://forum.lazarus.freepascal.org/in … 893.0.html

Last edited by PeterBB (2023-05-09 11:01:10)

Offline

#2 2023-04-27 16:53:35

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,069

Re: [SOLVED] Rebuilding lazarus

I had the same symptoms with an aur package.  Investigation between working & non-working versions revealed the issue had nothing to do with debug symbols or strip but everything with Link-Time Optimzation (lto) which is enabled by default since a while.

Try adding !lto to the options= array, then rebuild and test .

Last edited by Lone_Wolf (2023-04-27 16:53:58)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2023-04-27 18:10:31

PeterBB
Member
Registered: 2014-11-06
Posts: 27

Re: [SOLVED] Rebuilding lazarus

Hi, thanks for looking at this. I tried adding !lto to my lazarus builds and the build of lazarus itself, but its not fixing the issue.
Adding !strip to the Lazarus build is the only fix I have found so far.

When did lto come in as a default?  The official build of lazarus built OK on 5-Oct-2022.
Something seems to have changed since then.

Offline

#4 2023-04-28 10:57:37

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,069

Re: [SOLVED] Rebuilding lazarus

Repo pacakges are built using devtools, and it looks like lto became default with https://gitlab.archlinux.org/archlinux/ … f86f0b0222 .

The first devtools version with that commit in it appears to have been released on nov 29 2021 .
Was your lazarus build in a clean chroot ?

If not, check https://wiki.archlinux.org/title/Develo … ean_chroot and set it up  .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2023-04-30 10:52:02

PeterBB
Member
Registered: 2014-11-06
Posts: 27

Re: [SOLVED] Rebuilding lazarus

I have now rebuilt lazarus 2.2.4 in a chroot, and still have the same issue.

Anyway, there is a simple workaround, adding '!strip' to the PKGBUILD options.
It will be interesting to see what the maintainer does.

Cheers,
Peter

Offline

#6 2023-04-30 11:15:20

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,069

Re: [SOLVED] Rebuilding lazarus

The downside of that workaround is that strip and debug are supposed to be used together so debug symbols are stored in a separate package .

Using !strip will likely result in adding the debug symbols to your binaries increasing the size of it by a lot* .
You should consider disabling both with !strip and !debug .

*
How much is a lot ?
one of my aur packages builds a 11.5 MB  tarball for the application and a 256.7 MB tarball with the debuginfo .

Last edited by Lone_Wolf (2023-04-30 11:15:55)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2023-05-08 16:05:15

PeterBB
Member
Registered: 2014-11-06
Posts: 27

Re: [SOLVED] Rebuilding lazarus

The official lazarus package has been updated now.
However, the options haven't changed regarding debug and strip, and I still have the same problem.
My local packages are usually stripped, but I realise now that lazarus always tries to build a debug package unless specifically
disabled within lazarus. Package builds therefore generally break, as the symbols are no longer available within lazarus itself.

Looks to me that this is all related somehow to this change
https://archlinux.org/news/debug-packag … ebuginfod/

There is now a lazarus debug symbols package, which I have installed, but I have no idea how
to incorporate these symbols into a build. The above link refers to gdb, but using gdb is moot
when the package won't build in the first place, and fpc/lazarus packages don't need gdb to produce
a useful backtrace (when unstripped).

Offline

#8 2023-05-09 09:36:24

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,069

Re: [SOLVED] Rebuilding lazarus

It looks like the maintainer realised there were issues and made changes to the PKGBUILD, https://github.com/archlinux/svntogit-c … 9f1deb84e9

Try with 2.2.6-2 .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2023-05-09 11:00:27

PeterBB
Member
Registered: 2014-11-06
Posts: 27

Re: [SOLVED] Rebuilding lazarus

Lone_Wolf wrote:

It looks like the maintainer realised there were issues and made changes to the PKGBUILD, https://github.com/archlinux/svntogit-c … 9f1deb84e9

Try with 2.2.6-2 .

Thanks for the heads up
The workaround I suggested in #5 has been adopted.


Cheers,
Peter

Offline

Board footer

Powered by FluxBB