Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 761385 - dev-libs/aws-c-cal fails to compile (zlib -lz missing)
Summary: dev-libs/aws-c-cal fails to compile (zlib -lz missing)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Sven Eden
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-12-23 15:53 UTC by Alexander Puchmayr
Modified: 2023-09-18 15:53 UTC (History)
3 users (show)

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


Attachments
build log (build.log,13.12 KB, text/x-log)
2020-12-23 15:53 UTC, Alexander Puchmayr
Details
emerge --info (emerge.info,7.59 KB, application/x-info)
2020-12-23 15:54 UTC, Alexander Puchmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Puchmayr 2020-12-23 15:53:16 UTC
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'
...
Comment 1 Alexander Puchmayr 2020-12-23 15:54:58 UTC
Created attachment 679329 [details]
emerge --info
Comment 2 Alexander Puchmayr 2020-12-23 15:59:39 UTC
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.
Comment 3 Sven Eden 2021-03-14 15:41:53 UTC
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"
Comment 4 Larry the Git Cow gentoo-dev 2021-03-27 05:50:27 UTC
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(-)
Comment 5 Lucio Sauer 2023-09-18 15:53:03 UTC
To reproduce this bug, build OpenSSL with tls-compression support (via zlib). This may be obvious, but it wasn't to me :D