Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 812461 - dev-util/umockdev-0.16.1-r1: build failure with -Wcast-align
Summary: dev-util/umockdev-0.16.1-r1: build failure with -Wcast-align
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: werror 810313
  Show dependency tree
 
Reported: 2021-09-10 14:04 UTC by Rolf Eike Beer
Modified: 2021-09-12 19:46 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer archtester 2021-09-10 14:04:50 UTC
I have -Wcast-align in my global build flags, and this leads to:

 * Package:    dev-util/umockdev-0.16.1-r1
 * Repository: gentoo
 * Maintainer: gnome@gentoo.org
 * USE:        elibc_glibc kernel_linux sparc test userland_GNU
 * FEATURES:   network-sandbox preserve-libs sandbox test userpriv usersandbox
 * Using python3.10 to build
[…]
Vala compiler for the host machine: /usr/bin/valac-0.52 (valac 0.52.4)
Host machine cpu family: sparc64
Host machine cpu: sparc64
../umockdev-0.16.1/meson.build:24: WARNING: Consider using the built-in werror option instead of using "-Werror".
Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler)
[…]
>>> Compiling source in /var/tmp/portage/dev-util/umockdev-0.16.1-r1/work/umockdev-0.16.1 ...
 * .sparc32: running multilib-minimal_abi_src_compile
meson compile -C /var/tmp/portage/dev-util/umockdev-0.16.1-r1/work/umockdev-0.16.1-.sparc32 --jobs 20 --load-average 40 --verbose
[1/51] sparc-unknown-linux-gnu-gcc -Ilibumockdev-preload.so.0.0.0.p -I. -I../umockdev-0.16.1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -Werror=missing-prototypes -Werror=strict-prototypes -Werror=nested-externs -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=unused-variable -Werror=return-type -Werror=uninitialized -O2 -mcpu=niagara2 -pipe -Wcast-align -fPIC -fvisibility=default -MD -MQ libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -MF libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o.d -o libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -c ../umockdev-0.16.1/src/libumockdev-preload.c
FAILED: libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o 
sparc-unknown-linux-gnu-gcc -Ilibumockdev-preload.so.0.0.0.p -I. -I../umockdev-0.16.1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -Werror=missing-prototypes -Werror=strict-prototypes -Werror=nested-externs -Werror=pointer-arith -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=unused-variable -Werror=return-type -Werror=uninitialized -O2 -mcpu=niagara2 -pipe -Wcast-align -fPIC -fvisibility=default -MD -MQ libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -MF libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o.d -o libumockdev-preload.so.0.0.0.p/src_libumockdev-preload.c.o -c ../umockdev-0.16.1/src/libumockdev-preload.c
../umockdev-0.16.1/src/libumockdev-preload.c: In function ?netlink_recvmsg?:
../umockdev-0.16.1/src/libumockdev-preload.c:418:27: error: cast increases required alignment of target type [-Werror=cast-align]
  418 |      struct ucred *cred = (struct ucred *)CMSG_DATA(cmsg);
      |                           ^
cc1: all warnings being treated as errors
Comment 1 Mike Gilbert gentoo-dev 2021-09-10 19:53:00 UTC
Unfortunately, they are passing -Werror via project arguments instead of using the werror project option. I created a PR to fix that.

https://github.com/martinpitt/umockdev/pull/146

Once applied, we can disable Werror by passing -Dwerror=false to meson setup.
Comment 2 Mike Gilbert gentoo-dev 2021-09-10 20:00:24 UTC
Also, you should probably report that alignment issue upstream.
Comment 3 Mike Gilbert gentoo-dev 2021-09-12 03:41:04 UTC
(In reply to Mike Gilbert from comment #2)
> Also, you should probably report that alignment issue upstream.

https://github.com/martinpitt/umockdev/issues/147
Comment 4 Rolf Eike Beer archtester 2021-09-12 19:19:30 UTC
I'm not sure if there actually is a problem with the code, sometimes these warnings are wrong because they took care to pass only valid data. At the moment it just fails to build.
Comment 5 Larry the Git Cow gentoo-dev 2021-09-12 19:46:30 UTC
The bug has been closed via the following commit(s):

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

commit ff21acef711a9a7c6f686d131bf87ebad89593c2
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2021-09-12 19:45:36 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2021-09-12 19:45:36 +0000

    dev-util/umockdev: drop -Werror from project arguments
    
    Closes: https://bugs.gentoo.org/812461
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../umockdev/files/umockdev-0.16.1-Werror.patch    | 24 ++++++++++++++++++++++
 dev-util/umockdev/umockdev-0.16.1-r1.ebuild        |  3 +++
 dev-util/umockdev/umockdev-0.16.2.ebuild           |  3 +++
 3 files changed, 30 insertions(+)