Closed josefsachsconning closed 8 years ago
@yuyichao how hard would it be to just implement the "rich mans PLT"? It seems to me like that would require very little assembly and be easy to write for each platform we care about (and thus be easier to support than the musttail attribute)
Getting this on Power:
/home/vinchhid/julia/base/precompile.jl
LLVM ERROR: failed to perform tail call elimination on a call site marked musttail
*** This error is usually fixed by running `make clean`. If the error persists, try `make cleanall`. ***
make[1]: *** [/home/vinchhid/julia/usr/lib/julia/sys.o] Error 1
make: *** [julia-sysimg-release] Error 2
Should we revert this PR?
cc @yuyichao @vtjnash
I am tagging this as 0.5 so that we make sure we fix build breakage on both architectures before the release.
The relevant PR I believe is: #17260
how hard would it be to just implement the "rich mans PLT"
Should be possible with module level inline asm? It might also need some assembly in C so I guess I can try to implement it for x86 and arm with it disabled on MSVC.
Can we have some other generic fallback for other architectures?
generic fallback
Disable it.
The musttail
is basically the generic fallback, although apparently it's so broken on anything other than x86 and aarch64 which is not mentioned in the document.......
I thought the PLT could be pretty much all in a .S
file to push/pop all of the argument registers and update the callee site.
push/pop all of the argument registers
I can't think of how this can be implemented without writing assembly (the C part).
update the callee site.
As well as knowing which function it is calling requires finding the right GOT entry and the information about the library/symbol to use. This is the LLVM module level asm part since the whole function (two or three instructions) needs to be written in assembly to avoid llvm to clubber random registers.
It is possible that we can get rid of the second part by looking at the return address but that requires a complete map for all the callsite and it doesn't work for tailcall.
If we fix this (for the build), we can support both arm and power in the 0.5 release.
Not release blocking, however since it can be fixed in 0.5.1 without disrupting anything.
Same as #17312. Using master branch of julia, after
make cleanall
. My last successful build was at 45400d0.