Skip to content

Fails to build on OpenSSL-4.x-dev #491

@mouse07410

Description

@mouse07410

Problem

OpenSSL-4 officially removed support for Engine API from the code. As a result, attempt to build this repo with OpenSSL-4-dev fails:

/opt/local/bin/cmake -S/Users/ur20980/src/grasshopper-engine -B/Users/ur20980/src/grasshopper-engine/build --check-build-system CMakeFiles/Makefile.cmake 0
/opt/local/bin/cmake -E cmake_progress_start /Users/ur20980/src/grasshopper-engine/build/CMakeFiles /Users/ur20980/src/grasshopper-engine/build//CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/test_digest.dir/build.make CMakeFiles/test_digest.dir/depend
cd /Users/ur20980/src/grasshopper-engine/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/ur20980/src/grasshopper-engine /Users/ur20980/src/grasshopper-engine /Users/ur20980/src/grasshopper-engine/build /Users/ur20980/src/grasshopper-engine/build /Users/ur20980/src/grasshopper-engine/build/CMakeFiles/test_digest.dir/DependInfo.cmake "--color="
/Applications/Xcode.app/Contents/Developer/usr/bin/make  -f CMakeFiles/test_digest.dir/build.make CMakeFiles/test_digest.dir/build
[  1%] Building C object CMakeFiles/test_digest.dir/test_digest.c.o
/opt/local/bin/clang -DENGINE_DIR=\"/Users/ur20980/src/grasshopper-engine/build/bin\" -DL_ENDIAN -isystem /Users/ur20980/openssl-4/include -O3 -std=gnu18 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -O2 -std=gnu90 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk -Werror -Wall -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Qunused-arguments -Wno-deprecated-declarations "-Wno-error=#warnings" -MD -MT CMakeFiles/test_digest.dir/test_digest.c.o -MF CMakeFiles/test_digest.dir/test_digest.c.o.d -o CMakeFiles/test_digest.dir/test_digest.c.o -c /Users/ur20980/src/grasshopper-engine/test_digest.c
In file included from /Users/ur20980/src/grasshopper-engine/test_digest.c:33:
/Users/ur20980/src/grasshopper-engine/gost_lcl.h:34:5: warning: "Gost-engine is built against not fully supported version of OpenSSL. EVP_CTRL_SET_TLSTREE_PARAMS definition in OpenSSL is expected." [-W#warnings]
   34 | #   warning "Gost-engine is built against not fully supported version of OpenSSL. \
      |     ^
/Users/ur20980/src/grasshopper-engine/gost_lcl.h:46:5: warning: "Gost-engine is built against not fully supported version of OpenSSL. NID_magma_mgm definition in OpenSSL is expected. No magma mgm functionality is guaranteed." [-W#warnings]
   46 | #   warning "Gost-engine is built against not fully supported version of OpenSSL. \
      |     ^
/Users/ur20980/src/grasshopper-engine/gost_lcl.h:59:5: warning: "Gost-engine is built against not fully supported version of OpenSSL. NID_kuznyechik_mgm definition in OpenSSL is expected. No kuznyechik mgm functionality is guaranteed." [-W#warnings]
   59 | #   warning "Gost-engine is built against not fully supported version of OpenSSL. \
      |     ^
3 warnings generated.
[  2%] Linking C executable bin/test_digest
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/test_digest.dir/link.txt --verbose=1
Undefined symbols for architecture arm64:
  "_ENGINE_by_id", referenced from:
      _warn_all_untested in test_digest.c.o
  "_ENGINE_finish", referenced from:
      _warn_all_untested in test_digest.c.o
  "_ENGINE_free", referenced from:
      _engine_is_available in test_digest.c.o
      _warn_all_untested in test_digest.c.o
      _warn_all_untested in test_digest.c.o
  "_ENGINE_get_digest", referenced from:
      _warn_all_untested in test_digest.c.o
  "_ENGINE_get_digests", referenced from:
      _warn_all_untested in test_digest.c.o
  "_ENGINE_get_first", referenced from:
      _engine_is_available in test_digest.c.o
      _warn_all_untested in test_digest.c.o
  "_ENGINE_get_id", referenced from:
      _engine_is_available in test_digest.c.o
      _warn_all_untested in test_digest.c.o
  "_ENGINE_get_next", referenced from:
      _engine_is_available in test_digest.c.o
      _warn_all_untested in test_digest.c.o
  "_ENGINE_init", referenced from:
      _warn_all_untested in test_digest.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
/opt/local/bin/clang -O3 -std=gnu18 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -O2 -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.2.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/test_digest.dir/test_digest.c.o -o bin/test_digest  /Users/ur20980/openssl-4/lib/libcrypto.dylib
make[2]: *** [bin/test_digest] Error 1
make[1]: *** [CMakeFiles/test_digest.dir/all] Error 2
make: *** [all] Error 2

In case configuration matters:

-- The C compiler identification is AppleClang 17.0.0.17000603
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/local/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenSSL: /Users/ur20980/openssl-4/lib/libcrypto.dylib (found suitable version "4.0.0", minimum required is "3.4")
-- Found OpenSSL 4.0..
CMAKE_BUILD_TYPE = Release
-- Found OpenSSL includes:   /Users/ur20980/openssl-4/include
-- Found OpenSSL crypto lib: /Users/ur20980/openssl-4/lib/libcrypto.dylib
-- Found OpenSSL application: 
-- Found OpenSSL application: /Users/ur20980/openssl-4/bin/openssl
-- Looking for clock_gettime
-- Looking for clock_gettime - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- LITTLE_ENDIAN
-- Performing Test ADDCARRY_U64
-- Performing Test ADDCARRY_U64 - Failed
-- Performing Test RELAXED_ALIGNMENT
-- Performing Test RELAXED_ALIGNMENT - Success
-- No Test2::V0 perl module (engine and provider tests skipped)
CMake Deprecation Warning at libprov/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


CMake Warning (dev) at CMakeLists.txt:493 (install):
  Target lib_gost_engine has PUBLIC_HEADER files but no PUBLIC_HEADER
  DESTINATION.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (1.4s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/ur20980/src/grasshopper-engine/build

Proposed solution

Split cleanly between Engine and Provider build - make it possible to build one or the other, via make target, and describe this process in the README.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions