Bug 167010 - Build fails with poppler version <= 24.x after commit 4f13305178c1bf88dffceb42ec15d0944b808a5c
Summary: Build fails with poppler version <= 24.x after commit 4f13305178c1bf88dffceb4...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
25.2.4.3 release
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:26.2.0 target:25.8.0.0.beta2 t...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-14 03:48 UTC by OldCoder
Modified: 2025-06-27 11:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Patch for LO 25.2.4.X that permits it to build using clang 20.1.6 or 20.1.7 (2.30 KB, patch)
2025-06-14 03:48 UTC, OldCoder
Details
A build log related to the issue as requested (2.79 MB, text/plain)
2025-06-16 20:27 UTC, OldCoder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description OldCoder 2025-06-14 03:48:06 UTC
Created attachment 201269 [details]
Patch for LO 25.2.4.X that permits it to build using clang 20.1.6 or 20.1.7

I'm unable to build LibreOffice 25.2.4.2 or 25.2.4.3 using clang 20.1.6 or 20.1.7 unless a recent commit to LibreOffice is partly reverted.

The patch that I'm using is attached. If the patch is used, the build issue doesn't occur.

The issue might be due to clang 20.1.6 and 20.1.7 being more strict than 20.1.5.

If LibreOffice isn't patched, builds of the types listed above fail with multiple occurrences of the following error message:

error: invalid argument type 'void' to unary expression

The errors occur in "pdfioutdev_gpl.cxx" and "pnghelper.cxx". They're related to code of the following form:

if (!something->reset()) ...

"clang" objects to "!" being applied to the "something". For more information, see the attached patch.

I regret that I've misplaced the commit ID for the LibreOffice commit that was responsible for the issue.
Comment 1 Buovjaga 2025-06-16 14:16:49 UTC
Comment on the dev chat: that is likely not about clang, but about poppler API
Comment 2 Buovjaga 2025-06-16 15:20:00 UTC
The whole build log would be nice, if you attached it here.
Comment 3 OldCoder 2025-06-16 20:25:36 UTC
(In reply to Buovjaga from comment #1)
> Comment on the dev chat: that is likely not about clang, but about poppler
> API

It's about clang in that the issue is a recent commit to LO that was intended to address a poppler API issue. The commit modified LO so that a build could be done against a newer poppler API but it seems to have broken compatibility with the next older poppler API.

To put it another way, the combination listed below worked before, and would work now, if the LO commit was partly reverted as indicated in the attached patch. However, this would probably break compatibility with the newer API again. The proper fix is presumably to update the recent LO change so that LO can be built against either of the poppler APIs.

(a) LO 25.2.4.X
(b) clang 20.1.6 or 20.1.7
(c) poppler 24.08.X

The attached patch therefore isn't submitted as correct and to be merged. It only indicates the minimum change that is presently needed in order for the combination to be able to build.

poppler 24 is only one major release back from the currently recommended major release of 25. It's therefore believed to still be in wide use and support by LO in the context of newer clang releases is recommended.
Comment 4 OldCoder 2025-06-16 20:27:23 UTC
Created attachment 201316 [details]
A build log related to the issue as requested
Comment 5 OldCoder 2025-06-16 20:30:31 UTC
(In reply to Buovjaga from comment #2)
> The whole build log would be nice, if you attached it here.

Here you go
Request for log of build is fulfilled
No tale of woe
You'll find that to comply this coder is thrilled
Comment 6 OldCoder 2025-06-16 20:33:25 UTC
P.S. To see the issue, grep the build log for the word "unary".
Comment 7 OldCoder 2025-06-16 20:41:00 UTC
Looking again, my wording that starts with "It's about clang in that ..." is a little tangled. Excuse me. The point is simpler. A recent LO git commit should be modified so as to permit LO to build in a distro configuration that is likely to be common.
Comment 8 Mike Kaganski 2025-06-17 06:28:53 UTC
Nothing to do with compiler at all. Regression after commit 4f13305178c1bf88dffceb42ec15d0944b808a5c. Respective  #if POPPLER_CHECK_VERSION(x, y, z) are needed, as usual, when we have changes in poppler like those; we must not just assume everyone uses the new version.
Comment 9 OldCoder 2025-06-17 06:40:54 UTC
The connection to the compiler is that upstream there modified it to be more strict as of release 20.1.6. However, yes, this is a problem per se with LO.

If a LO person who is more experienced than I am doesn't integrate the call suggested by the previous poster, I'll attempt to do so in due course.
Comment 10 Xisco Faulí 2025-06-17 06:49:23 UTC
(In reply to Mike Kaganski from comment #8)
> Nothing to do with compiler at all. Regression after commit
> 4f13305178c1bf88dffceb42ec15d0944b808a5c. Respective  #if
> POPPLER_CHECK_VERSION(x, y, z) are needed, as usual, when we have changes in
> poppler like those; we must not just assume everyone uses the new version.

yep, sorry for that.
I'll submit a fix
Comment 11 Xisco Faulí 2025-06-17 09:02:08 UTC
@OldCoder, https://gerrit.libreoffice.org/c/core/+/186599 should fix it. Could you please give it a try and give me feedback ? Thanks in advance
Comment 12 OldCoder 2025-06-17 11:10:05 UTC
(In reply to Xisco Faulí from comment #11)
> @OldCoder, https://gerrit.libreoffice.org/c/core/+/186599 should fix it.
> Could you please give it a try and give me feedback ? Thanks in advance

Certainly. It's about 4:00am local time and I should catch some Z's first. But I'll try to complete the test either today or tomorrow [in my time zone].
Comment 13 OldCoder 2025-06-17 22:57:02 UTC
(In reply to Xisco Faulí from comment #11)
> @OldCoder, https://gerrit.libreoffice.org/c/core/+/186599 should fix it.
> Could you please give it a try and give me feedback ? Thanks in advance

I downloaded "de68ee1.diff.zip", replaced my patch with the one in the ZIP, and built LO 25.2.4.3 using clang 20.1.7 and poppler 24.08.0. There were no build errors and the resulting copy of LO runs for me.

Thumbs up. Thank you for the patch.
Comment 14 Xisco Faulí 2025-06-18 06:47:19 UTC
(In reply to OldCoder from comment #13)
> (In reply to Xisco Faulí from comment #11)
> > @OldCoder, https://gerrit.libreoffice.org/c/core/+/186599 should fix it.
> > Could you please give it a try and give me feedback ? Thanks in advance
> 
> I downloaded "de68ee1.diff.zip", replaced my patch with the one in the ZIP,
> and built LO 25.2.4.3 using clang 20.1.7 and poppler 24.08.0. There were no
> build errors and the resulting copy of LO runs for me.
> 
> Thumbs up. Thank you for the patch.

Thanks for testing it. Pushing the patch then
Comment 15 Commit Notification 2025-06-18 06:48:26 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/04b92e6eab3d58e90efa04165dec4f04e9131690

tdf#167010: fix build when poppler is older than 25.2.0

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2025-06-18 08:23:14 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/1d09352fc7a49e177375ce753f2cf99c89062ac9

tdf#167010: fix build when poppler is older than 25.2.0

It will be available in 25.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 17 Commit Notification 2025-06-27 11:02:39 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/dd67bacd021916952008ac15955628f2dc9ad1c2

tdf#167010: fix build when poppler is older than 25.2.0

It will be available in 25.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.