Some projects use the constructor attribute on functions that also
return values. In this case we just ignore them.
The error was reported in the libgpg-error project that marks
gpg_err_init with the __constructor__ attribute.
Differential D81962
[lld][WebAssembly] Allow ctors functions that return values sbc100 on Jun 16 2020, 12:48 PM. Authored by
Details Some projects use the constructor attribute on functions that also The error was reported in the libgpg-error project that marks
Diff Detail
Event TimelineComment Actions This change looks fine to me, though if you wanted to minimize the amount of code being emitted by the linker, another option would be to look into whether LLVM's FixFunctionBitcasts could handle this -- there should be a bitcast in the llvm.global_ctors array. Comment Actions Interesting.. currently FixFunctionBitcasts only considered casts that are arguments to call instructions. Other kinds of casts such as ones that are used in stores we assume instead that that reverse cast will be applied when they are used. Do you think its better to modify FixFunctionBitcasts to add this special case? (assuming I can). Comment Actions ping.. Having looked at FixFunctionBitcasts it this fix is more appropriate. FixFunctionBitcasts is designed for callsites only (at least today). |