Skip to content

Linkage error on linux : undefined reference to 'c_zeroize(void*, unsigned long)' #150

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

Closed
dyumin opened this issue Feb 25, 2025 · 4 comments · Fixed by #153
Closed

Linkage error on linux : undefined reference to 'c_zeroize(void*, unsigned long)' #150

dyumin opened this issue Feb 25, 2025 · 4 comments · Fixed by #153

Comments

@dyumin
Copy link

dyumin commented Feb 25, 2025

Hi
There seems to be a linkage error on linux if you add HomomorphicEncryption as a dependency to a binary target and will try to build release configuration.

Error description:

live-caller-id-lookup-example/.build/x86_64-unknown-linux-gnu/release/PIRService.build/ReloadService.swift.o:Application+build.swift.o:function $s21HomomorphicEncryption3BfvO10dotProduct10ciphertext4withAA6PolyRqVyxAA5CoeffCGAA10CiphertextVyACyxGAA4EvalCG_AA9SecretKeyCyANGtKFZs6UInt32V_Tgm5Tf4xn_n:(.text+0x31bf2): error: undefined reference to 'c_zeroize(void*, unsigned long)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[1/2] Linking PIRService

 *  The terminal process terminated with exit code: 1. 

Debug configuration builds fine

@fboemer
Copy link
Contributor

fboemer commented Feb 26, 2025

Thanks @dyumin , I haven't been able to reproduce this.
Can you share some more information to help us investigate?

@dyumin
Copy link
Author

dyumin commented Mar 3, 2025

Hi @fboemer
I was able to reproduce this issue with minimal changes
It has something to do with SwiftSetting.interoperabilityMode(.Cxx)

I guess symbol mangling begin to differ

Please see 49f9e0a

And https://github.com/dyumin/swift-homomorphic-encryption/actions/runs/13635274272/job/38112383226

@fboemer
Copy link
Contributor

fboemer commented Mar 5, 2025

@dyumin, can you confirm #150 fixes your issue?

fboemer added a commit that referenced this issue Mar 5, 2025
@dyumin
Copy link
Author

dyumin commented Mar 17, 2025

Yep, it is fixed, thank you very much.

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 a pull request may close this issue.

2 participants