Summary: | LLVM assumes sign extension for parameters and return values (breaking some packages like libffi) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Dirkjan Ochtman (RETIRED) <djc> |
Component: | New packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | fsvm88, mgorny, ryao, voyageur |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
URL: | https://github.com/atgreen/libffi/issues/29 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 408963, 427330, 427338 |
Description
Dirkjan Ochtman (RETIRED)
![]() This needs to be fixed in llvm. libffi isn't the only place you're going to run into issues with this. Have you seen http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942 and http://llvm.org/bugs/show_bug.cgi?id=15153? The code gcc produces doesn't _rely_ on the extension taking place. They do extension to avoid partial register stalls, but that's an optimization, not a requirement. The bug you reference refers to the fact that they sign-extend at both the caller and callee, which is redundant. But the bug in LLVM is not whether they extend at the caller or the callee, it's that they assume that the extension has to happen. That said I don't mind carrying a temporary workaround for llvm compatibility in libffi until it gets fixed or the ABI is changed. (In reply to comment #0) even libffi themselves say this isn't a fix bug a workaround Yeah, after reading the mailing list thread referenced above, you're right. I've relayed the information to the LLVM team, so it should get fixed in a future version of LLVM. Perhaps we should cherry-pick an LLVM patch instead of this libffi patch in the meantime? This patch is in 3.0.12. |