Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936061 - dev-libs/wayland-1.23.0: build failure in gui-libs/wlroots-0.18.0 with clang-18: /usr/include/wayland-server-core.h:680:41: error: 'deprecated' attribute cannot be applied to types
Summary: dev-libs/wayland-1.23.0: build failure in gui-libs/wlroots-0.18.0 with clang-...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 937885
  Show dependency tree
 
Reported: 2024-07-14 19:46 UTC by Alfred Wingate
Modified: 2024-08-29 19:08 UTC (History)
6 users (show)

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


Attachments
emerge --info (emerge--info.txt,8.96 KB, text/plain)
2024-07-14 19:46 UTC, Alfred Wingate
Details
gui-libs/wlroots-0.18.0 build.log (xz compressed) (wlroots-0.18.0:20240714-190228.log.xz,6.46 KB, application/x-xz)
2024-07-14 19:46 UTC, Alfred Wingate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wingate 2024-07-14 19:46:15 UTC
Created attachment 897628 [details]
emerge --info

wlroots-18 upgraded to C23 leading to a build failure with clang due to dev-libs/wayland using a different code path with the newer C standard.

https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/85875c47d9234c2ad61bf3af97fca133fe3ffa78
https://gitlab.freedesktop.org/wayland/wayland/-/blob/1.23.0/src/wayland-util.h?ref_type=tags#L51

Unmerged PR that addresses this in dev-libs/wayland: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/401

FAILED: libwlroots-0.18.so.p/render_wlr_renderer.c.o 
clang -Ilibwlroots-0.18.so.p -I. -I../wlroots-0.18.0 -Iinclude -I../wlroots-0.18.0/include -Iprotocol -Irender/gle
s2/shaders -Irender/vulkan/shaders -Ibackend/drm -I/usr/lib64/libffi/include -I/usr/include/libdrm -I/usr/include/
pixman-1 -I/usr/include/elogind -flto=thin -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -
Wextra -std=c23 -D_POSIX_C_SOURCE=200809L -DWLR_USE_UNSTABLE -DWLR_LITTLE_ENDIAN=1 -DWLR_BIG_ENDIAN=0 -Wundef -Wmi
ssing-include-dirs -Wold-style-definition -Wpointer-arith -Winit-self -Wstrict-prototypes -Wendif-labels -Wstrict-
aliasing=2 -Woverflow -Wmissing-prototypes -Walloca -Wno-missing-braces -Wno-missing-field-initializers -Wno-unuse
d-parameter -fmacro-prefix-map=../wlroots-0.18.0/= -O3 -pipe -march=znver3 -Werror=odr -Werror=strict-aliasing -fP
IC -MD -MQ libwlroots-0.18.so.p/render_wlr_renderer.c.o -MF libwlroots-0.18.so.p/render_wlr_renderer.c.o.d -o libw
lroots-0.18.so.p/render_wlr_renderer.c.o -c ../wlroots-0.18.0/render/wlr_renderer.c
In file included from ../wlroots-0.18.0/render/wlr_renderer.c:6:
In file included from ../wlroots-0.18.0/include/wlr/render/interface.h:13:
/usr/include/wayland-server-core.h:680:41: error: 'deprecated' attribute cannot be applied to types
  680 |                      int32_t stride, uint32_t format) WL_DEPRECATED;
      |                                                       ^
/usr/include/wayland-util.h:52:25: note: expanded from macro 'WL_DEPRECATED'
   52 | #define WL_DEPRECATED [[deprecated]]
      |                         ^
In file included from ../wlroots-0.18.0/render/wlr_renderer.c:6:
In file included from ../wlroots-0.18.0/include/wlr/render/interface.h:14:
In file included from ../wlroots-0.18.0/include/wlr/render/wlr_renderer.h:14:
In file included from ../wlroots-0.18.0/include/wlr/render/pass.h:15:
In file included from ../wlroots-0.18.0/include/wlr/util/box.h:19:
In file included from /usr/include/wayland-server-protocol.h:8:
Comment 1 Alfred Wingate 2024-07-14 19:46:50 UTC
Created attachment 897629 [details]
gui-libs/wlroots-0.18.0 build.log (xz compressed)
Comment 2 wolfgang 2024-08-06 15:20:02 UTC
I can confirm that building wlroots with gcc (per https://wiki.gentoo.org/wiki/Clang#GCC_fallback_environment) resolves this problem.
Comment 3 Paul Zander 2024-08-06 18:23:53 UTC
(In reply to wolfgang from comment #2)
> I can confirm that building wlroots with gcc (per
> https://wiki.gentoo.org/wiki/Clang#GCC_fallback_environment) resolves this
> problem.

Hardly resolves it. It mitigates it for the time being.
Comment 4 Mark Wood 2024-08-14 23:27:15 UTC
I would suggest anyone on the LLVM profile looking for a workaround use a package.env for =gui-libs/wlroots-0.18.0 to use CFLAGS=“${CFLAGS} -std=c17” as it’s safe to assume the next version bump will carry the upstream fix. Details on using package.env can be found here https://wiki.gentoo.org/wiki//etc/portage/package.env
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-08-14 23:59:28 UTC
The fix has been merged upstream now so we can backport it.
Comment 6 Larry the Git Cow gentoo-dev 2024-08-22 14:50:03 UTC
The bug has been closed via the following commit(s):

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

commit bdd989aff6fbe6b1137aa5a9228009a8aa4154dd
Author:     Alfred Wingate <parona@protonmail.com>
AuthorDate: 2024-07-14 20:04:55 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-08-22 14:48:42 +0000

    dev-libs/wayland: fix revdep clang builds with C23
    
    Closes: https://bugs.gentoo.org/936061
    Signed-off-by: Alfred Wingate <parona@protonmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/37554
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/wayland-1.23.0-c23-clang-fix.patch       | 146 +++++++++++++++++++++
 dev-libs/wayland/wayland-1.23.0-r1.ebuild          |  70 ++++++++++
 2 files changed, 216 insertions(+)