Summary: | media-sound/audacity-3.3.3 fails to compile (lto): ffmpeg-2.3.6-single-header.h:2847:16: error: type ‘struct AVCodecContext’ violates the C++ One Definition Rule [-Werror=odr] | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | ppw0 |
Component: | Current packages | Assignee: | Professional Audio Applications Maintainers <proaudio> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gentoo, richard |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=860441 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 618550 | ||
Attachments: |
build log
emerge --info |
Created attachment 872212 [details]
emerge --info
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54238035c9abd9b278e2fd14312e893922c3be5f commit 54238035c9abd9b278e2fd14312e893922c3be5f Author: Eli Schwartz <eschwartz93@gmail.com> AuthorDate: 2024-03-05 00:49:58 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-05 04:47:49 +0000 media-sound/audacity: mark as LTO-unsafe, strict-aliasing unsafe Bug report says ODR violations, but I could not reproduce since I hit strict-aliasing issues first. I'm assuming both are an issue, but on the other hand either one is a good reason to turn off LTO. Closes: https://bugs.gentoo.org/915226 Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Sam James <sam@gentoo.org> media-sound/audacity/audacity-3.3.3.ebuild | 9 ++++++++- media-sound/audacity/audacity-9999.ebuild | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) |
Created attachment 872211 [details] build log In a stricter lto environment, media-sound/audacity-3.3.3 will fail to compile with the following errors: ``` /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/55/../../ffmpeg-2.3.6-single-header.h:2847:16: error: type ‘struct AVCodecContext’ violates the C++ One Definition Rule [-Werror=odr] 2847 | typedef struct AVCodecContext { | ^ /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/57/../../ffmpeg-3.4.8-single-header.h:2680:16: note: a different type is defined in another translation unit 2680 | typedef struct AVCodecContext { | ^ /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/55/../../ffmpeg-2.3.6-single-header.h:2869:9: note: the first difference of corresponding definitions is field ‘bit_rate’ 2869 | int bit_rate; | ^ /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/57/../../ffmpeg-3.4.8-single-header.h:2703:13: note: a field of same name but different type is defined in another translation unit 2703 | int64_t bit_rate; | ^ . . . /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/55/../../ffmpeg-2.3.6-single-header.h:4330:6: error: type ‘AVStreamParseType’ violates the C++ One Definition Rule [-Werror=odr] 4330 | enum AVStreamParseType { | ^ /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/58/../../ffmpeg-4.2.4-single-header.h:4593:6: note: an enum with different value name is defined in another translation unit 4593 | enum AVStreamParseType { | ^ /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/55/../../ffmpeg-2.3.6-single-header.h:4336:5: note: name ‘AVSTREAM_PARSE_FULL_RAW’ is defined to 1463898624 while another translation unit defines it as 5 4336 | AVSTREAM_PARSE_FULL_RAW=MKTAG(0,'R','A','W'), | ^ /var/tmp/portage/media-sound/audacity-3.3.3/work/audacity-Audacity-3.3.3/libraries/lib-ffmpeg-support/impl/avcodec/58/../../ffmpeg-4.2.4-single-header.h:4599:5: note: mismatching definition 4599 | AVSTREAM_PARSE_FULL_RAW, | ^ lto1: some warnings being treated as errors lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. ``` Attaching logs. (stricter lto means with -flto -Werror=odr -Werror=strict-aliasing -Werror=lto-type-mismatch enabled)