Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917497 - 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]
Summary: media-gfx/gimp-2.10.36 fails to compile (lto): gimppalette-load.c:1098:24: er...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sergey Torokhov
URL: https://gitlab.gnome.org/GNOME/gimp/-...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2023-11-17 12:59 UTC by ppw0
Modified: 2023-12-05 10:32 UTC (History)
1 user (show)

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


Attachments
build log (media-gfx:gimp-2.10.36:20231117-124941.log.gz,72.14 KB, application/gzip)
2023-11-17 12:59 UTC, ppw0
Details
emerge --info (emerge_info.log,7.67 KB, text/x-log)
2023-11-17 13:00 UTC, ppw0
Details
build log (media-gfx:gimp-2.10.36:20231118-180804.log.gz,180.50 KB, application/gzip)
2023-11-18 18:21 UTC, ppw0
Details
patch (gimp-2.10.36-strict-aliasing.patch,456 bytes, patch)
2023-11-18 18:23 UTC, ppw0
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(+)