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

rimage/cmake: add find_package(OpenSSL ...) #8349

Closed
wants to merge 1 commit into from

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Oct 18, 2023

Support unusual locations and prepares for OpenSSL 1 deprecation (as previously attempted in thesofproject/rimage#157)

Support unusual locations and deprecates OpenSSL 1 (as previously
attempted in thesofproject/rimage#157)

Will remove the OpenSSL 1 code later to give people some time to
upgrade.

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Oct 18, 2023

Without specifying any version, all Windows builds failed like this one https://github.com/thesofproject/sof/actions/runs/6567376740/job/17839955554?pr=8349

cmd.exe /C "cd . && D:\a\_temp\msys64\usr\bin\cc.exe -g  CMakeFiles/rimage.dir/src/file_simple.c.obj CMakeFiles/rimage.dir/src/cse.c.obj CMakeFiles/rimage.dir/src/css.c.obj CMakeFiles/rimage.dir/src/plat_auth.c.obj CMakeFiles/rimage.dir/src/hash.c.obj CMakeFiles/rimage.dir/src/pkcs1_5.c.obj CMakeFiles/rimage.dir/src/manifest.c.obj CMakeFiles/rimage.dir/src/ext_manifest.c.obj CMakeFiles/rimage.dir/src/rimage.c.obj CMakeFiles/rimage.dir/src/toml_utils.c.obj CMakeFiles/rimage.dir/src/adsp_config.c.obj CMakeFiles/rimage.dir/src/misc_utils.c.obj CMakeFiles/rimage.dir/src/file_utils.c.obj CMakeFiles/rimage.dir/src/elf_file.c.obj CMakeFiles/rimage.dir/src/module.c.obj CMakeFiles/rimage.dir/tomlc99/toml.c.obj -o rimage.exe -Wl,--out-implib,librimage.dll.a -Wl,--major-image-version,0,--minor-image-version,0  \
"C:/Program Files/OpenSSL/lib/libcrypto.lib"  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
/usr/lib/gcc/x86_64-pc-msys/11.3.0/../../../../x86_64-pc-msys/bin/ld: internal error: aborting at ../../binutils-2.40/ld/ldlang.c:527 in compare_section
/usr/lib/gcc/x86_64-pc-msys/11.3.0/../../../../x86_64-pc-msys/bin/ld: please report this bug
collect2: error: ld returned 1 exit status

"C:/Program Files/OpenSSL/lib/libcrypto.lib" is version "1.1.1w" as found below. It most likely comes from Github: https://github.com/actions/runner-images/blob/win22/20230918.1/images/win/Windows2022-Readme.md

Tests on device are OK https://sof-ci.01.org/sofpr/PR8349/build165/devicetest/index.html

@marc-hb
Copy link
Collaborator Author

marc-hb commented Oct 19, 2023

Without specifying any version,
https://sof-ci.01.org/sofpr/PR8349/build163/build is successful but (found version "1.1.1f")

https://quickbuild.igk.intel.com/build/12982331 is the same Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.1f")

@marc-hb marc-hb force-pushed the rimage-find-openssl branch from 1e39f62 to 4e60c9f Compare October 19, 2023 00:12
@marc-hb
Copy link
Collaborator Author

marc-hb commented Oct 19, 2023

When requesting version 3-3.999

  • jenkins fails like this (sof_config_build/5512, sofbld08)
17:18:12    Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
17:18:12    system variable OPENSSL_ROOT_DIR: Found unsuitable version "1.1.1f",
17:18:12    required range is "3...3.9999" (found
17:18:12    /usr/lib/x86_64-linux-gnu/libcrypto.so, )

Github's Windows misses the MSYS version and fails like this:

https://github.com/thesofproject/sof/actions/runs/6568042556/job/17841835347?pr=8349

-- No CMAKE_BUILD_TYPE, defaulting to Debug
CMake Error at C:/Strawberry/c/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:2[30](https://github.com/thesofproject/sof/actions/runs/6568042556/job/17841835347?pr=8349#step:19:31) (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
-- Configuring incomplete, errors occurred!
  system variable OPENSSL_ROOT_DIR: Found unsuitable version "1.1.1w",
  required range is "3...3.9999" (found C:/Program
  Files/OpenSSL/lib/libcrypto.lib, )
Call Stack (most recent call first):
  C:/Strawberry/c/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA_FAILURE_MESSAGE)
  C:/Strawberry/c/share/cmake-3.26/Modules/FindOpenSSL.cmake:670 (find_package_handle_standard_args)
  CMakeLists.txt:62 (find_package)

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marc-hb I think there is OpenSSL1 C code that also need to be ripped out, IIUC its behind an #ifdef today and is not enabled as default config is OpenSSL3

@marc-hb
Copy link
Collaborator Author

marc-hb commented Oct 20, 2023

I think there is OpenSSL1 C code that also need to be ripped out,

Yes, this PR would be the first step (blocked by many build systems too old). thesofproject/rimage#157 tried to solve too many problems at once.

IIUC its behind an #ifdef today

Not exactly: #if OPENSSL_VERSION_NUMBER < 0x10100000L

and is not enabled as default config is OpenSSL3

There is no default config in the source, the source code automatically adjusts to whatever OpenSSL version CMake points it at. Both version 1 and version 3 are equally supported with no preference or precedence right now.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Sep 5, 2024

Filed new issue:

@marc-hb marc-hb closed this Sep 5, 2024
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