Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939515 - x11-libs/gtk+-3.24.41-r1: fails to build with LTO, dev-util/sysprof-capture headers broken (sysprof-capture-writer.h:162:23: error: type of ‘sysprof_capture_writer_define_counters’ does not match original declaration [-Werror=lto-type-mismatch])
Summary: x11-libs/gtk+-3.24.41-r1: fails to build with LTO, dev-util/sysprof-capture h...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2024-09-12 08:40 UTC by monad
Modified: 2024-09-21 02:03 UTC (History)
1 user (show)

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


Attachments
emerge --info for my system (emerge-info,23.41 KB, text/plain)
2024-09-12 08:42 UTC, monad
Details
build.log for the package (build.log,442.47 KB, text/x-log)
2024-09-12 08:48 UTC, monad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description monad 2024-09-12 08:40:24 UTC
I was recompiling my system with these compiler flags "-march=native -O3 -flto -pipe" x11-libs/gtk+-3.24.41-r1 failed to compile and I had to set it's flags to "-march=native -O2 -pipe" to make it compile properly. 

Reproducible: Always

Steps to Reproduce:
1. set compiler flags to
WARNING_FLAGS="-Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
COMMON_FLAGS="-O3 -pipe -march=native -flto ${WARNING_FLAGS}"

2. emerge x11-libs/gtk+-3.24.41-r1
Actual Results:  
The package failed to compile

Expected Results:  
The package should have compiled with my flags properly
Comment 1 monad 2024-09-12 08:42:55 UTC
Created attachment 902698 [details]
emerge --info for my system
Comment 2 monad 2024-09-12 08:48:11 UTC
Created attachment 902699 [details]
build.log for the package
Comment 3 monad 2024-09-12 11:12:52 UTC
The package compiles with -O3 optimization level, therefore I can assume the issue is lto related.
Comment 4 monad 2024-09-12 11:57:06 UTC
The package version 3.24.42-r1 works with compiler flags "-O3 -pipe -march=native -flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-09-12 13:37:21 UTC
/usr/include/sysprof-4/sysprof-capture-writer.h:169:23: error: type of ‘sysprof_capture_writer_set_counters’ does not match original declaration [-Werror=lto-type-mismatch]
  169 | bool                  sysprof_capture_writer_set_counters                    (SysprofCaptureWriter              *self,
      |                       ^
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1218:1: note: return value type mismatch
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1218:1: note: type ‘gboolean’ should match type ‘_Bool’
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1218:1: note: ‘sysprof_capture_writer_set_counters’ was previously declared here
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1218:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/usr/include/sysprof-4/sysprof-capture-writer.h:112:23: error: type of ‘sysprof_capture_writer_add_mark’ does not match original declaration [-Werror=lto-type-mismatch]
  112 | bool                  sysprof_capture_writer_add_mark                        (SysprofCaptureWriter              *self,
      |                       ^
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:608:1: note: return value type mismatch
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:608:1: note: type ‘gboolean’ should match type ‘_Bool’
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:608:1: note: ‘sysprof_capture_writer_add_mark’ was previously declared here
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:608:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
/usr/include/sysprof-4/sysprof-capture-writer.h:162:23: error: type of ‘sysprof_capture_writer_define_counters’ does not match original declaration [-Werror=lto-type-mismatch]
  162 | bool                  sysprof_capture_writer_define_counters                 (SysprofCaptureWriter              *self,
      |                       ^
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1168:1: note: return value type mismatch
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1168:1: note: type ‘gboolean’ should match type ‘_Bool’
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1168:1: note: ‘sysprof_capture_writer_define_counters’ was previously declared here
../../../../dev-util/sysprof-capture-3.36.0-r1/work/sysprof-3.36.0-abi_x86_64.amd64/../sysprof-3.36.0/src/libsysprof-capture/sysprof-capture-writer.c:1168:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/libexec/gcc/x86_64-pc-linux-gnu/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status