[PATCH] D15600: AArch64: Add option to use shared epilogues in compiler-rt

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 05:20:26 PST 2016


On 12 January 2016 at 08:36, Kristof Beyls <kristof.beyls at arm.com> wrote:
> I'm thinking of the case where object files compiled with different LLVM versions are linked together. If this isn't supported, it e.g. makes it pretty hard/impossible to distribute a library of binary code that can be linked with code generated by a number of different versions of LLVM. Allowing people that ship binary libraries to not have to ship a separate library for every single revision of clang/llvm seems like a good thing to me. Always requiring linking against the compiler-rt run-time library would probably also make it near-impossible to link together code produced by different compilers, unless these epilogue functions end up being defined in a de facto runtime library ABI?

This is a very strong point. Nothing stops us from changing one of
these 16 copies, intentionally or not.


> All in all, it seems simpler to me to not have these epilogue functions in compiler-rt, but rather produce them in every object file that relies on them.

That seems like a reasonable space-saving technique, with probably the
same yield as the original proposal. The epilogue emission would
probably have to be changed in the same way, but with a final
emitAllPrologues() method only printing the ones that were used. If
the epilogue symbols are weak, the linker will easily common them up
in a final binary, and linking old objects with new ones will at most
duplicate the epilogue code IFF the name has changed, which you'd only
do if the epilogue has changed too.

Looks like a much better solution to me.

cheers,
--renato


More information about the llvm-commits mailing list