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:
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.
Recently, I started using
lld
as the default linker for my applications. It is a very faster replacement for the defaultgold
linker, included at the binutils package.After first compilation using
lld
as the linker, this package started givingImportError
s such as this one:This error can be reproduced by installing
lld
and adding the following line beforetarget_compile_options
(currently, line 28) onCMakeLists.txt
:After playing a little with the compilation flags, it seems that adding the flag
-ffat-lto-objects
totarget_compile_options
onCMakeLists.txt
fixes the problem.This pull request addresses this issue, while keeping backward compatibility with other linkers.