Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/CMakeLists.txt: fix static build with openssl #64

Merged
merged 1 commit into from
Mar 27, 2020
Merged

src/CMakeLists.txt: fix static build with openssl #64

merged 1 commit into from
Mar 27, 2020

Conversation

ffontaine
Copy link
Contributor

As usual, cmake is unable to correctly handle static dependencies by its
own and as a result a static build with openssl will fail on:

/home/naourr/work/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/naourr/work/instance-0/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block':
/home/naourr/work/instance-0/output-1/build/libopenssl-1.1.1d/crypto/comp/c_zlib.c:201: undefined reference to `inflate'

To fix this, use pkg-config to retrieve openssl dependencies such as -lz
or -latomic and fallback on existing mechanism

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

As usual, cmake is unable to correctly handle static dependencies by its
own and as a result a static build with openssl will fail on:

/home/naourr/work/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/naourr/work/instance-0/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libcrypto.a(c_zlib.o): in function `zlib_stateful_expand_block':
/home/naourr/work/instance-0/output-1/build/libopenssl-1.1.1d/crypto/comp/c_zlib.c:201: undefined reference to `inflate'

To fix this, use pkg-config to retrieve openssl dependencies such as -lz
or -latomic and fallback on existing mechanism

Fixes:
 - http://autobuild.buildroot.org/results/6105b69d8598f0033044a26f53a768e2d4b2915e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@zhaojh329 zhaojh329 merged commit 751cbfe into zhaojh329:master Mar 27, 2020
@zhaojh329
Copy link
Owner

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants