<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p><br>
    </p>
    <p>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.</p>
    <p>Then I found that if I enable link-time optimization while
      running autogen.sh, it would fail :</p>
    <p><a class="moz-txt-link-freetext" href="https://pastebin.com/Pt0zfEF2">https://pastebin.com/Pt0zfEF2</a></p>
    <p>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.</p>
    <p>If I use --disable-lto or simply comment out or remove the
      --enable-lto when running autogen.sh, it would succeed, but I'm
      still not sure if it linked libgraphite2 or not.</p>
    <p><a class="moz-txt-link-freetext" href="https://pastebin.com/1FdeMsXr">https://pastebin.com/1FdeMsXr</a></p>
    <p>Then I tried to build it on Ubuntu Jammy.  It succeeded even with
      --enable-lto.</p>
    <p>Well, problem solved since I could build it, but I'm still
      curious why it would fail only on Debian.<br>
    </p>
    <p>I run all the compiling works in "pure" environment created by
      docker.  The Dockerfiles for Debian and Ubuntu are simple like
      this:</p>
    <p><file Dockerfile><br>
    </p>
    <p><code><span style="font-family:monospace"><span
            style="color:#000000;background-color:#ffffff;">FROM
            debian:bullseye
          </span></span></code><code><br>
      </code><code><span style="font-family:monospace"></span></code><code><br>
      </code><code><span style="font-family:monospace">### Install
          system
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
        </span></code><code><br>
      </code><code><span style="font-family:monospace">COPY sources.list
          /etc/apt/sources.list
        </span></code><code><br>
      </code><code><span style="font-family:monospace">RUN mkdir
          /opt/git
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
        </span></code><code><br>
      </code><code><span style="font-family:monospace">RUN apt update
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
        </span></code><code><br>
      </code><code><span style="font-family:monospace">RUN apt install
          -y --no-install-recommends vim vim-runtime \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 bash \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 docker.io \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 locales locales-all \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 libkrb5-dev \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 curl \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 ssh \
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
                                 git
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
        </span></code><code><br>
      </code><code><span style="font-family:monospace">RUN locale-gen
          zh_TW.UTF-8
        </span></code><code><br>
      </code><code><span style="font-family:monospace">RUN locale-gen
          en_US.UTF-8
        </span></code><code><br>
      </code><code><span style="font-family:monospace">
        </span></code><code><br>
      </code><code><span style="font-family:monospace">RUN apt build-dep
          -y libreoffice</span></code><br>
      <span style="font-family:monospace"></span><span
        style="font-family:monospace"> <br>
      </span></p>
    <p></file Dockerfile></p>
    <p>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?</p>
    <p><br>
    </p>
    <p>Thanks,</p>
    <p>Franklin<br>
    </p>
    <pre class="moz-signature" cols="72">-- 
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: <a class="moz-txt-link-freetext" href="https://www.documentfoundation.org/imprint">https://www.documentfoundation.org/imprint</a></pre>
  </body>
</html>