Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 782721 - app-text/poppler-21.04.0 fails to build with clang due to poppler-20.12.0-respect-cflags.patch
Summary: app-text/poppler-21.04.0 fails to build with clang due to poppler-20.12.0-res...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Maciej Mrozowski
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-04-13 22:24 UTC by James Beddek
Modified: 2021-04-21 13:10 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
updated patch (poppler-21.04.0-respect-cflags.patch,5.60 KB, patch)
2021-04-13 22:24 UTC, James Beddek
Details | Diff
build.log (build.log,211.38 KB, text/x-log)
2021-04-13 22:32 UTC, James Beddek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Beddek 2021-04-13 22:24:00 UTC
Created attachment 699720 [details, diff]
updated patch

app-text/poppler fails to build with Clang for me when the patch poppler-20.12.0-respect-cflags.patch is applied (undefined symbols).

I narrowed this down to the patch removing the following:

if(CMAKE_COMPILER_IS_GNUCXX)
  poppler_check_link_flag("-Wl,--as-needed" GCC_HAS_AS_NEEDED)
  if(GCC_HAS_AS_NEEDED)
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
  endif(GCC_HAS_AS_NEEDED)
endif (CMAKE_COMPILER_IS_GNUCXX)

Clang does not support the -Wlogical-op flag which is also passed through due to the same patch.

Updated patch attached which removes -Wlogical-op and restores adding -Wl,--as-needed
Comment 1 James Beddek 2021-04-13 22:32:58 UTC
Created attachment 699723 [details]
build.log
Comment 2 Larry the Git Cow gentoo-dev 2021-04-21 13:10:44 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0fd92e2a9596191195ebd06d964e164a88a2f21a

commit 0fd92e2a9596191195ebd06d964e164a88a2f21a
Author:     Theo Anderson <telans@posteo.de>
AuthorDate: 2021-04-13 22:24:42 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2021-04-21 13:10:35 +0000

    app-text/poppler: update respect-cflags patch
    
    fix building on clang by restoring additions of -Wl,--as-needed
    
    Closes: https://bugs.gentoo.org/782721
    Signed-off-by: Theo Anderson <telans@posteo.de>
    Closes: https://github.com/gentoo/gentoo/pull/20370
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 ....patch => poppler-21.04.0-respect-cflags.patch} | 45 +++++++++++++---------
 app-text/poppler/poppler-21.02.0.ebuild            |  2 +-
 app-text/poppler/poppler-21.03.0.ebuild            |  2 +-
 app-text/poppler/poppler-21.04.0.ebuild            |  2 +-
 app-text/poppler/poppler-9999.ebuild               |  2 +-
 5 files changed, 31 insertions(+), 22 deletions(-)