Created attachment 679326 [details] build log Emerge fails with /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block':undefined reference to `inflate' undefined reference to `deflateEnd' ...
Created attachment 679329 [details] emerge --info
From build log: [12/12] : && /usr/bin/x86_64-pc-linux-gnu-gcc -O2 -pipe -Wl,-O1 -Wl,--as-needed -rdynamic bin/sha256_profile/CMakeFiles/sha256_profile.dir/main.c.o -o bin/sha256_profile/sha256_profile libaws-c-cal.a /usr/lib64/libaws-c-common.a -lm -pthread -lrt /usr/lib64/libcrypto.a -ldl No "-lz" specified. When adding it manually (ie. by cd to build dir, pasting the command above and adding -lz) the program finally links.
You are building with static-libs? Why? However, this does not happen with USE="-static-libs", so I guess the dependency is gone somewhere on the way. I am adding a patch that explicitly adds -lz when merged with USE="static-libs"
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7131703c3d0024686f34ebfcb0ee4f72282b088e commit 7131703c3d0024686f34ebfcb0ee4f72282b088e Author: Sven Eden <sven.eden@prydeworx.com> AuthorDate: 2021-03-14 15:47:06 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2021-03-27 05:49:55 +0000 dev-libs/aws-c-cal: Fix building with USE="static-libs" (#761385) Whe building with USE="static-libs", the final linker stage fails with: ```` /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block': undefined reference to `inflate' undefined reference to `deflateEnd' ```` To fix this -lz is now explicitly added when merging with USE="static-libs" Closes: https://bugs.gentoo.org/761385 Package-Manager: Portage-3.0.17, Repoman-3.0.2 Signed-off-by: Sven Eden <sven.eden@prydeworx.com> Signed-off-by: Joonas Niilola <juippis@gentoo.org> dev-libs/aws-c-cal/aws-c-cal-0.4.5.ebuild | 11 +++-------- .../files/aws-c-cal-0.4.5-add_libz_for_static.patch | 12 ++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-)
To reproduce this bug, build OpenSSL with tls-compression support (via zlib). This may be obvious, but it wasn't to me :D