Skip to content

CMake: link openssl 3.x with clamsubmit on macOS (1.1.1)#972

Merged
val-ms merged 1 commit intoCisco-Talos:dev/1.1.1from
val-ms:CLAM-2298-openssl-3-weirdness-1.1
Aug 4, 2023
Merged

CMake: link openssl 3.x with clamsubmit on macOS (1.1.1)#972
val-ms merged 1 commit intoCisco-Talos:dev/1.1.1from
val-ms:CLAM-2298-openssl-3-weirdness-1.1

Conversation

@val-ms
Copy link
Contributor

@val-ms val-ms commented Jul 11, 2023

When switching to openssl 3.x, linking with clamsubmit fails with undefined openssl symbols. The error message from Xcode is crazy obtuse:

ld: initializer '_OPENSSL_cpuid_setup' is >4GB from start of image in 'anon' from /Users/clamav_jenkins_svc/clamav-mussels-cookbook/test/install-x86_64/lib/libcrypto.a(libcrypto-lib-x86_64cpuid.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Anyhow... It seems that we must explicitly link clamsubmit with openssl now in order for this to work.

In addition to this change, I also found that the CMake FindRust.cmake module breaks the ability to build specifically for just x86_64 or arm64 (i.e. possibly cross-compiling.
This commit includes a change to accommodate that scenario.

When switching to openssl 3.x, linking with clamsubmit fails with
undefined openssl symbols. The error message from Xcode is crazy obtuse:

ld: initializer '_OPENSSL_cpuid_setup' is >4GB from start of image in 'anon' from /Users/clamav_jenkins_svc/clamav-mussels-cookbook/test/install-x86_64/lib/libcrypto.a(libcrypto-lib-x86_64cpuid.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Anyhow... It seems that we must explicitly link clamsubmit with openssl
now in order for this to work.

In addition to this change, I also found that the CMake FindRust.cmake 
module breaks the ability to build specifically for just x86_64 or arm64
(i.e. possibly cross-compiling. 
This commit includes a change to accommodate that scenario.
@val-ms val-ms merged commit 482d5e9 into Cisco-Talos:dev/1.1.1 Aug 4, 2023
@val-ms val-ms deleted the CLAM-2298-openssl-3-weirdness-1.1 branch August 4, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant