Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 917497

Summary: media-gfx/gimp-2.10.36 fails to compile (lto): gimppalette-load.c:1098:24: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
Product: Gentoo Linux Reporter: ppw0
Component: Current packagesAssignee: Sergey Torokhov <torokhov-s-a>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gitlab.gnome.org/GNOME/gimp/-/issues/10359
See Also: https://github.com/gentoo/gentoo/pull/34009
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 618550    
Attachments: build log
emerge --info
build log
patch

Description ppw0 2023-11-17 12:59:50 UTC
Created attachment 874930 [details]
build log

In a stricter lto environment, media-gfx/gimp-2.10.36 will fail to compile with the following error:

```
gimppalette-load.c: In function ‘gimp_palette_load_ase’:
gimppalette-load.c:1098:24: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing[https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstrict-aliasing]]
 1098 |           pixels[j] = *(gfloat *) &tmp;
      |                        ^~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[4]: *** [Makefile:1704: gimppalette-load.o] Error 1
make[4]: *** Waiting for unfinished jobs....
```

Attaching logs.
Comment 1 ppw0 2023-11-17 13:00:24 UTC
Created attachment 874931 [details]
emerge --info
Comment 3 Sergey Torokhov 2023-11-18 17:48:34 UTC
Could you please check upstream issue https://gitlab.gnome.org/GNOME/gimp/-/issues/10359#note_1920361 and try to apply suggested changes?

Sorry, currently I can't check the patch at least until 24 Nov.
Comment 4 ppw0 2023-11-18 18:21:57 UTC
Created attachment 875157 [details]
build log

Looks OK.
Comment 5 ppw0 2023-11-18 18:23:43 UTC
Created attachment 875158 [details, diff]
patch

(from the suggestion)
Comment 6 Larry the Git Cow gentoo-dev 2023-12-05 10:32:46 UTC
The bug has been closed via the following commit(s):

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

commit dfa6eed710ea8397860de55f3d078bd139d4eac9
Author:     Sergey Torokhov <torokhov-s-a@yandex.ru>
AuthorDate: 2023-11-26 20:02:31 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-12-05 10:32:07 +0000

    media-gfx/gimp: 2.10.36-r1, fix strict-aliasing build (upstream patch)
    
    Closes: https://bugs.gentoo.org/917497
    
    Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru>
    Closes: https://github.com/gentoo/gentoo/pull/34009
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/gimp-2.10.36_fix_strict-aliasing.patch   |  34 ++++
 media-gfx/gimp/gimp-2.10.36-r1.ebuild              | 215 +++++++++++++++++++++
 2 files changed, 249 insertions(+)