Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 860063 - [guru] media-gfx/oxipng-5.0.1 fails to compile (lto): undefined reference to deflateEnd
Summary: [guru] media-gfx/oxipng-5.0.1 fails to compile (lto): undefined reference to ...
Status: RESOLVED FIXED
Alias: None
Product: GURU
Classification: Unclassified
Component: Package issues (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: YOSHIOKA Takuma
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: lto
  Show dependency tree
 
Reported: 2022-07-22 11:32 UTC by Agostino Sarubbo
Modified: 2023-12-26 09:18 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,213.80 KB, text/plain)
2022-07-22 11:32 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-07-22 11:32:18 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: media-gfx/oxipng-5.0.1 fails to compile (lto).
Discovered on: amd64 (internal ref: guru_tinderbox)

NOTE:
This machine uses lto with CFLAGS=-flto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
Comment 1 Agostino Sarubbo gentoo-dev 2022-07-22 11:32:21 UTC
Created attachment 793157 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-07-22 11:32:22 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cloudflare_zlib.c521b3d4-cgu.8:(.text._ZN15cloudflare_zlib3def7Deflate17compress_internal17hbe585d6f2210bbadE+0x1a9): undefined reference to `deflate'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cloudflare_zlib.c521b3d4-cgu.8:(.text._ZN15cloudflare_zlib3def7Deflate17compress_internal17hbe585d6f2210bbadE+0x2ca): undefined reference to `deflate'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cloudflare_zlib.c521b3d4-cgu.8:(.text._ZN15cloudflare_zlib3def7Deflate17compress_internal17hbe585d6f2210bbadE+0x37a): undefined reference to `deflate'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: oxipng.f9e99ada-cgu.11:(.text._ZN6oxipng7deflate8deflater7deflate17h70394946385f1190E+0x10f): undefined reference to `libdeflate_free_compressor'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: oxipng.f9e99ada-cgu.11:(.text._ZN6oxipng7deflate8deflater7deflate17h70394946385f1190E+0x90): undefined reference to `libdeflate_zlib_compress'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: oxipng.f9e99ada-cgu.4:(.text._ZN6oxipng7deflate6cfzlib14cfzlib_deflate17h9ad7604b0fa3e2c4E+0x361): undefined reference to `deflateEnd'
          /usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: oxipng.f9e99ada-cgu.4:(.text._ZN6oxipng7deflate6cfzlib14cfzlib_deflate17h9ad7604b0fa3e2c4E+0x413): undefined reference to `deflateEnd'
          cloudflare_zlib.c521b3d4-cgu.8:(.text._ZN15cloudflare_zlib3def7Deflate12new_with_vec17h7d67898bc34199eeE+0xab): undefined reference to `deflateInit2_'
          cloudflare_zlib.c521b3d4-cgu.8:(.text._ZN15cloudflare_zlib3def7Deflate17compress_internal17hbe585d6f2210bbadE+0xa9): undefined reference to `deflate'
          oxipng.f9e99ada-cgu.11:(.text._ZN4core3ptr44drop_in_place$LT$libdeflater..Compressor$GT$17he89cdd5e3ab6e494E+0x5): undefined reference to `libdeflate_free_compressor'
          oxipng.f9e99ada-cgu.11:(.text._ZN6oxipng7deflate8deflater7deflate17h70394946385f1190E+0x20): undefined reference to `libdeflate_alloc_compressor'
          oxipng.f9e99ada-cgu.4:(.text._ZN4core3ptr50drop_in_place$LT$cloudflare_zlib..def..Deflate$GT$17heedc9b37b1603be9E+0xc): undefined reference to `deflateEnd'
          oxipng.f9e99ada-cgu.4:(.text._ZN6oxipng7deflate6cfzlib14cfzlib_deflate17h9ad7604b0fa3e2c4E+0x2db): undefined reference to `deflateEnd'
error: linking with `x86_64-pc-linux-gnu-gcc` failed: exit status: 1
Comment 3 YOSHIOKA Takuma 2022-07-22 13:30:09 UTC
`-flto` was enough to reproduce.
It seems like `CFLAGS=-flto` is not expected to work with gcc? (cf. <https://github.com/rust-lang/cargo/issues/2014#issuecomment-145189477>)

As an workaround, appending `-flto` to CFLAGS will work.
(Of cource it forcibly disables LTO in this case.)
Comment 4 YOSHIOKA Takuma 2022-07-22 13:36:47 UTC
> As an workaround, appending `-flto` to CFLAGS will work.

Sorry, appending `-fno-lto` will work.
(Worked in my environment.)

I think this should be resolved on cargo.eclass side, but I'm not sure.
Comment 5 Viorel Munteanu gentoo-dev 2023-12-26 09:18:50 UTC
All versions since this package has been moved to ::gentoo contain filter-lto, I'll mark this bug as fixed.