dongjianqiang2 wrote:

> -mlong-calls is an old-fashioned compiler option. I think it was added before 
> linkers knew range extension thunks (aka stubs, veneers, etc).
> 
> Can you use -fno-plt instead? It works with both SelectionDAG and GlobalISel. 
> You will get GOT-generating code sequence that can be optimized to adrp+add 
> by the linker. You can use --emit-relocs to get relocations in the 
> executable. We could implement `__attribute__((noplt))`, if you want the 
> patching to be per-function.
> 
> The proposed -mlong-calls is -fno-pic hack that works with limited scenarios 
> with a large performance downside. I don't think we should support it.

Yes, we are indeed still using the -mlong-calls option in our older embedded 
systems. This is necessary due to the lack of support for GOT-based relocation 
types in these environments. As a result, we have incorporated this option to 
ensure compatibility and functionality.

Moving forward, it's important of adding support in SelectionDAG and GlobalISel 
for these scenarios. 

https://github.com/llvm/llvm-project/pull/142982
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to