Building failed with --enable-lto on Debian, but succeeded on Ubuntu/Rocky Linux

Franklin Weng franklin at
Sun Jun 18 00:27:36 UTC 2023


I was trying to build latest LibreOffice core on Debian Bullseye and 
failed, while the other one could build successfully on Rocky Linux 8.  
So I tried to dig a bit deeper to find out why.

Then I found that if I enable link-time optimization while running, it would fail :

Start from line 27641, while linking something with libharfbuzz.a, some 
symbols in libgraphite2.a were missing. libgraphite2.a was there, but 
all the makefiles didn't include them.

If I use --disable-lto or simply comment out or remove the --enable-lto 
when running, it would succeed, but I'm still not sure if it 
linked libgraphite2 or not.

Then I tried to build it on Ubuntu Jammy.  It succeeded even with 

Well, problem solved since I could build it, but I'm still curious why 
it would fail only on Debian.

I run all the compiling works in "pure" environment created by docker.  
The Dockerfiles for Debian and Ubuntu are simple like this:

<file Dockerfile>

|FROM debian:bullseye ||
||### Install system ||
||COPY sources.list /etc/apt/sources.list ||
||RUN mkdir /opt/git ||
||RUN apt update ||
||RUN apt install -y --no-install-recommends vim vim-runtime \ ||
||                       bash \ ||
||              \ ||
||                       locales locales-all \ ||
||                       libkrb5-dev \ ||
||                       curl \ ||
||                       ssh \ ||
||                       git ||
||RUN locale-gen zh_TW.UTF-8 ||
||RUN locale-gen en_US.UTF-8 ||
||RUN apt build-dep -y libreoffice|

</file Dockerfile>

Any clue or possible reason why I would only fail on Debian with lto 
enabled?  Or why it would not link with libgraphite.a which was indeed 
presented under workdir/LinkTarget/StaticLibrary/libgraphite.a?



Franklin Weng
Member, Certification Committee
The Document Foundation, Kurfürstendamm 188, 10707 Berlin, DE
Gemeinnützige rechtsfähige Stiftung des bürgerlichen Rechts
Legal details:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the LibreOffice mailing list