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

Add -ffat-lto-objects compile option #14

Merged
merged 1 commit into from
Aug 15, 2022
Merged

Conversation

marcoffee
Copy link
Contributor

Recently, I started using lld as the default linker for my applications. It is a very faster replacement for the default gold linker, included at the binutils package.

After first compilation using lld as the linker, this package started giving ImportErrors such as this one:

ImportError: dynamic module does not define module export function (PyInit_SymSpellCppPy)

This error can be reproduced by installing lld and adding the following line before target_compile_options (currently, line 28) on CMakeLists.txt:

target_link_options(SymSpellCppPy PRIVATE -fuse-ld=lld)

After playing a little with the compilation flags, it seems that adding the flag -ffat-lto-objects to target_compile_options on CMakeLists.txt fixes the problem.

This pull request addresses this issue, while keeping backward compatibility with other linkers.

Fixes ImportError when compiled with lld as linker
@viig99 viig99 merged commit 6f86c9f into viig99:master Aug 15, 2022
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