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

CMake: link openssl 3.x with clamsubmit on macOS (1.0.2) #973

Conversation

micahsnyder
Copy link
Contributor

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.
@micahsnyder micahsnyder merged commit c398096 into Cisco-Talos:dev/1.0.2 Aug 4, 2023
6 of 24 checks passed
@micahsnyder micahsnyder deleted the CLAM-2298-openssl-3-weirdness-1.0 branch August 4, 2023 22:53
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.

None yet

1 participant