gollvm: error: undefined reference to 'runtime.strhash..f.1' #52899
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The error can be reproduced with the test case and the trunk.
Func_descriptor_expression::do_get_backend
deals with function declaration and definition differently, which can request the backend twice to create global variables representing the function pointer. Unfortunately, the GOLLVM bridge usesmodule_->getGlobalVariable(gname)
(without parameterAllowLocal
) to check existing globals, which cannot findGlobalVariable
with local linkage. To fix this issue, we should setis_hidden = false
inFunc_descriptor_expression::do_get_backend
if theFunction
orFunction_declaration
has a non-emptyasm_name
.Moreover, we need to set
AllowLocal = true
when trying to find globals viamodule_->getGlobalVariable
and resolve linkage/type conflicts if necessary in GOLLVM bridge. Otherwise, the LLVM backend will rename the global by itself, which will lead to undefined reference errors.The text was updated successfully, but these errors were encountered: