Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 854837 - app-pda/libplist-2.2.0-r3 fails to compile (lto): bplist.c:980:47: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Summary: app-pda/libplist-2.2.0-r3 fails to compile (lto): bplist.c:980:47: error: der...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-06-28 11:23 UTC by Agostino Sarubbo
Modified: 2022-07-25 18:50 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,99.66 KB, text/plain)
2022-06-28 11:23 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-06-28 11:23:03 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-pda/libplist-2.2.0-r3 fails to compile (lto).
Discovered on: amd64 (internal ref: lto_tinderbox)

NOTE:
This machine uses lto with CFLAGS=-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Comment 1 Agostino Sarubbo gentoo-dev 2022-06-28 11:23:05 UTC
Created attachment 788363 [details]
build.log

build log and emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-28 12:15:26 UTC
They seem to build with -Wno-strict-aliasing but not -fno-strict-aliasing: https://github.com/libimobiledevice/libplist/blob/f3c65feb0e1f4e177a75ba936d0730f7c3f4b076/configure.ac#L167.

... is it because they're aware of false positives, or a mistake and they want to turn off the optimisation? :)
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-28 12:15:49 UTC
(In reply to Sam James from comment #2)
> They seem to build with -Wno-strict-aliasing but not -fno-strict-aliasing:
> https://github.com/libimobiledevice/libplist/blob/
> f3c65feb0e1f4e177a75ba936d0730f7c3f4b076/configure.ac#L167.
> 
> ... is it because they're aware of false positives, or a mistake and they
> want to turn off the optimisation? :)

https://github.com/libimobiledevice/libplist/commit/cf9836196cbabd6d40e8c1c8018417ef31df5f46 suggests it's an FP.
Comment 4 Matthew Smith gentoo-dev 2022-07-25 17:51:44 UTC
> float floatval = (float)val;
> *(uint32_t*)(buff+8) = float_bswap32(*(uint32_t*)&floatval);

Unfortunately not a false positive.
Comment 5 Larry the Git Cow gentoo-dev 2022-07-25 18:50:38 UTC
The bug has been closed via the following commit(s):

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

commit 75e60fe3e8e5b618c6a37d95e6e1d64ea173f8c3
Author:     Matthew Smith <matthew@gentoo.org>
AuthorDate: 2022-07-25 18:24:10 +0000
Commit:     Matthew Smith <matthew@gentoo.org>
CommitDate: 2022-07-25 18:50:04 +0000

    app-pda/libplist: fix strict aliasing violations
    
    Apply a patch that was also sent upstream, and also:
    
    * Bump to EAPI-8.
    * Correct LICENSE variable.
    
    Closes: https://bugs.gentoo.org/854837
    Signed-off-by: Matthew Smith <matthew@gentoo.org>

 .../files/libplist-2.2.0-strict-aliasing.patch     |  32 ++++++
 app-pda/libplist/libplist-2.2.0-r4.ebuild          | 114 +++++++++++++++++++++
 2 files changed, 146 insertions(+)