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

Added shared library and pkg-config support for libspdm #2402

Merged
merged 4 commits into from
Oct 31, 2023

Conversation

uvinrg
Copy link
Contributor

@uvinrg uvinrg commented Oct 10, 2023

Changes:

  • added pkg-config libspdm.pc.in file for cmake to use as template

CMakeLists.txt changes:

  • added BUILD_SHARED_LIB cmake parameter (ON/OFF) to enable/disable building of libspdm.so in addition to the static libraries
  • added two build paths for libspdm.so that generate distinct pkg-config pc files, for runtime linking with either mbedtls or openssl

Changes:
- spdm_device_secret_lib_sample has its own dump_hex_str_sample method
- added pkg-config libspdm.pc.in file for cmake to use as template

CMakeLists.txt changes:
- added BUILD_SHARED_LIB cmake parameter (ON/OFF) to enable/disable building of libspdm.so in addition to the static libraries
- added two build paths for libspdm.so that generate distinct pkg-config pc files, for runtime linking with either mbedtls or openssl

Signed-off-by: Ionut Ursachi <[email protected]>
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
os_stub/spdm_device_secret_lib_sample/lib.c Outdated Show resolved Hide resolved
@steven-bellock steven-bellock added the enhancement New feature or request label Oct 10, 2023
…initions related to it in the same cmake block.

Updated pkg-config pc.in file to fix a small path naming error.

Signed-off-by: Ionut Ursachi <[email protected]>
@uvinrg
Copy link
Contributor Author

uvinrg commented Oct 11, 2023

Hi, thank you for reviewing my change and for the feedback. I added some comments above and fixed some of the issues raised.

@steven-bellock
Copy link
Contributor

@uvinrg what is the use case for this? Will this primarily be used to construct SPDM Requesters, Responders, or both?

@uvinrg
Copy link
Contributor Author

uvinrg commented Oct 16, 2023

Hi Steven, the intent is to package libspdm as a regular shared library on linux distributions for future work around SPDM attestation. Depending on target platform and usecase, the libspdm shared library can act as either requester or responder.
Thank you for all the feedback, I responded to some of the comments and concerns raised and I will make the changes in the next commit.

…generated and installed: libspdm.so libspdm_platform.so and libspdm_crypto.so. Added more information about them in build.md documentation.

Shared libraries now properly link with their dependencies at runtime.

Signed-off-by: Ionut Ursachi <[email protected]>
@uvinrg
Copy link
Contributor Author

uvinrg commented Oct 29, 2023

Sorry for the delay, I committed the new change with three shared libraries, one for libspdm, one for the platform code and one for the crypto libraries interfaces. Thank you.

doc/build.md Outdated Show resolved Hide resolved
doc/build.md Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
os_stub/spdm_device_secret_lib_sample/lib.c Outdated Show resolved Hide resolved
@steven-bellock steven-bellock changed the title Added shared library and pkg-config support for LibSPDM. Added shared library and pkg-config support for libspdm Oct 31, 2023
@steven-bellock steven-bellock merged commit f029916 into DMTF:main Oct 31, 2023
90 checks passed
@Kendidi
Copy link

Kendidi commented Dec 25, 2024

Is it possible to add support to build shared libraries for Windows platform? Thanks a lot in advance.

@uvinrg
Copy link
Contributor Author

uvinrg commented Dec 26, 2024

Is it possible to add support to build shared libraries for Windows platform? Thanks a lot in advance.

Unfortunately, I only used libspdm under linux, so I don't have the know-how. Feel free to add the Windows support if you need it.

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

Successfully merging this pull request may close these issues.

4 participants