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

Build error when Linux, openssl (plus -DCOMPILED_LIBCRYPTO_PATH), shared lib, toolchain NONE #2962

Open
lordaule opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working build Build system

Comments

@lordaule
Copy link

The code below, in CMakeLists.txt, modifies the library linking:

1092         elseif(CRYPTO STREQUAL "openssl")
1093             set(CRYPTO_DEPS "-lssl -lcrypto")
1094             if(TOOLCHAIN STREQUAL "NONE")
1095                 target_link_libraries(${LIB_NAME}_crypto
1096                     PUBLIC openssllib
1097                     PUBLIC cryptlib_openssl
1098                 )
1099             else()
1100                 target_link_libraries(${LIB_NAME}_crypto
1101                     PUBLIC ssl
1102                     PUBLIC crypto
1103                 )
1104             endif()
1105         endif()

This results in the following build error:

[ 30%] Linking C shared library lib/libspdm_crypto.so
/xxx/crosscompiler/gcc-4.9__150325/arm/bin/../lib/gcc-cross/arm-linux-gnueabi/4.9/../../../../arm-linux-gnueabi/bin/ld: cannot find -lopenssllib
collect2: error: ld returned 1 exit status

If we remove lines 1094-1099 (and the resulting dangling endif at 1104), libspdm builds without error.

Note that we provide Cmake flags COMPILED_LIBSSL_PATH and COMPILED_LIBCRYPTO_PATH to point to our externally compiled libcrypto.so and libssl.so

@steven-bellock steven-bellock added bug Something isn't working build Build system labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Build system
Projects
None yet
Development

No branches or pull requests

2 participants