Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 885355 - media-libs/fdk-aac-2.0.2 fails to compile (lto): tpdec_adts.h:141:8: error: type 'struct STRUCT_ADTS' violates the C++ One Definition Rule [-Werror=odr]
Summary: media-libs/fdk-aac-2.0.2 fails to compile (lto): tpdec_adts.h:141:8: error: t...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-12-10 15:28 UTC by Kostadin Shishmanov
Modified: 2024-02-29 23:55 UTC (History)
4 users (show)

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


Attachments
emerge --info and build log (build.log,672.84 KB, text/x-log)
2022-12-10 15:28 UTC, Kostadin Shishmanov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kostadin Shishmanov 2022-12-10 15:28:59 UTC
Created attachment 841269 [details]
emerge --info and build log

media-libs/fdk-aac-2.0.2 fails to compile with CFLAGS=-flto=auto -Werror=odr -Werror-lto-type-mismatch -Werror=strict-aliasing and LDFLAGS="-Werror=odr -Werror-lto-type-mismatch -Werror=strict-aliasing"

/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPDec/src/tpdec_adts.h:141:8: error: type 'struct STRUCT_ADTS' violates the C++ One Definition Rule [-Werror=odr]
  141 | struct STRUCT_ADTS {
      |        ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPEnc/src/tpenc_adts.h:133:3: note: a different type is defined in another translation unit
  133 | } STRUCT_ADTS;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPDec/src/tpdec_adts.h:142:18: note: the first difference of corresponding definitions is field 'bs'
  142 |   STRUCT_ADTS_BS bs;
      |                  ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPEnc/src/tpenc_adts.h:111:7: note: a field with different name is defined in another translation unit
  111 |   INT sample_freq;
      |       ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPDec/src/tpdec_latm.h:126:3: error: type 'struct LATM_LAYER_INFO' violates the C++ One Definition Rule [-Werror=odr]
  126 | } LATM_LAYER_INFO;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPEnc/src/tpenc_latm.h:130:3: note: a different type is defined in another translation unit
  130 | } LATM_LAYER_INFO;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPDec/src/tpdec_latm.h:122:8: note: the first difference of corresponding definitions is field 'm_frameLengthType'
  122 |   UINT m_frameLengthType;
      |        ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libMpegTPEnc/src/tpenc_latm.h:126:14: note: a field with different name is defined in another translation unit
  126 |   signed int frameLengthType;
      |              ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSACdec/src/sac_dec.h:201:3: error: type 'struct LOSSLESSDATA' violates the C++ One Definition Rule [-Werror=odr]
  201 | } LOSSLESSDATA;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSACenc/src/sacenc_bitstream.h:241:3: note: a different type is defined in another translation unit
  241 | } LOSSLESSDATA;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSACdec/src/sac_dec.h:196:9: note: the first difference of corresponding definitions is field 'bsXXXDataMode'
  196 |   SCHAR bsXXXDataMode[MAX_PARAMETER_SETS];
      |         ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSACenc/src/sacenc_bitstream.h:236:9: note: a field of same name but different type is defined in another translation unit
  236 |   UCHAR bsXXXDataMode[SACENC_MAX_NUM_BOXES][MAX_NUM_PARAMS];
      |         ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSACdec/src/sac_dec.h:201:3: note: array types have different bounds
  201 | } LOSSLESSDATA;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/bit_sbr.h:131:8: error: type 'struct SBR_HEADER_DATA' violates the C++ One Definition Rule [-Werror=odr]
  131 | struct SBR_HEADER_DATA {
      |        ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRdec/src/env_extr.h:295:3: note: a different type is defined in another translation unit
  295 | } SBR_HEADER_DATA;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/bit_sbr.h:132:11: note: the first difference of corresponding definitions is field 'sbr_amp_res'
  132 |   AMP_RES sbr_amp_res;
      |           ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRdec/src/env_extr.h:271:3: note: a field with different name is defined in another translation unit
  271 |   syncState; /*!< The current initialization status of the header */
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/ton_corr.h:131:3: error: type 'struct PATCH_PARAM' violates the C++ One Definition Rule [-Werror=odr]
  131 | } PATCH_PARAM;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRdec/src/lpp_tran.h:187:3: note: a different type is defined in another translation unit
  187 | } PATCH_PARAM;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/ton_corr.h:120:7: note: the first difference of corresponding definitions is field 'sourceStartBand'
  120 |   INT sourceStartBand; /*!< first band in lowbands where to take the samples
      |       ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRdec/src/lpp_tran.h:174:9: note: a field of same name but different type is defined in another translation unit
  174 |   UCHAR sourceStartBand; /*!< first band in lowbands where to take the samples
      |         ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/ton_corr.h:131:3: note: type 'INT' should match type 'UCHAR'
  131 | } PATCH_PARAM;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/sbr.h:129:16: error: type 'struct SBR_CHANNEL' violates the C++ One Definition Rule [-Werror=odr]
  129 | typedef struct SBR_CHANNEL {
      |                ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRdec/src/sbr_dec.h:173:3: note: a different type is defined in another translation unit
  173 | } SBR_CHANNEL;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRenc/include/../src/sbr.h:130:22: note: the first difference of corresponding definitions is field 'hEnvChannel'
  130 |   struct ENV_CHANNEL hEnvChannel;
      |                      ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSBRdec/src/sbr_dec.h:170:18: note: a field with different name is defined in another translation unit
  170 |   SBR_FRAME_DATA frameData[(1) + 1];
      |                  ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libFDK/include/nlc_dec.h:129:3: error: type 'DATA_TYPE' violates the C++ One Definition Rule [-Werror=odr]
  129 | } DATA_TYPE;
      |   ^
/var/tmp/portage/media-libs/fdk-aac-2.0.2/work/fdk-aac-2.0.2/libSACenc/src/sacenc_nlc_enc.h:120:3: note: an enum with different number of values is defined in another translation unit
  120 | } DATA_TYPE;
      |   ^
lto1: some warnings being treated as errors
lto-wrapper: fatal error: x86_64-pc-linux-gnu-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [Makefile:1490: libfdk-aac.la] Error 1
Comment 1 Miroslav Šulc gentoo-dev 2024-01-22 10:43:30 UTC
still having that issue with 2.0.3?
Comment 2 Anthony Ryan 2024-01-22 11:59:14 UTC
Confirmed 2.0.3 is still affected. Also no progress on the upstream bug.
Comment 3 Larry the Git Cow gentoo-dev 2024-02-29 23:55:48 UTC
The bug has been closed via the following commit(s):

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

commit b1819ee24f13b5786f5da5824112050a852035c5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-02-29 23:55:20 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-02-29 23:55:20 +0000

    media-libs/fdk-aac: filter LTO (ODR violations)
    
    ODR violations and no progress on upstream bug.
    
    Bug: https://github.com/mstorsjo/fdk-aac/issues/156
    Closes: https://bugs.gentoo.org/885355
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/fdk-aac/fdk-aac-2.0.3.ebuild | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)