Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 456298 - LLVM assumes sign extension for parameters and return values (breaking some packages like libffi)
Summary: LLVM assumes sign extension for parameters and return values (breaking some p...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://github.com/atgreen/libffi/iss...
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang 427330 427338
  Show dependency tree
 
Reported: 2013-02-09 12:59 UTC by Dirkjan Ochtman (RETIRED)
Modified: 2013-02-12 04:16 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirkjan Ochtman (RETIRED) gentoo-dev 2013-02-09 12:59:41 UTC
https://github.com/atgreen/libffi/commit/6a790129427121f7db2d876e7218a3104e6d2741 fixes a problem in libffi that caused the blocked bugs in python's ctypes tests. It would be nice if someone can test the fix.
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2013-02-09 20:54:57 UTC
This needs to be fixed in llvm.  libffi isn't the only place you're going to run into issues with this.
Comment 2 Ryan Hill (RETIRED) gentoo-dev 2013-02-09 21:01:48 UTC
http://gcc.gnu.org/ml/gcc/2013-01/msg00447.html
Comment 3 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-02-09 21:20:37 UTC
Have you seen http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942 and http://llvm.org/bugs/show_bug.cgi?id=15153?
Comment 4 Ryan Hill (RETIRED) gentoo-dev 2013-02-09 22:16:53 UTC
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.
Comment 5 SpanKY gentoo-dev 2013-02-10 08:19:02 UTC
(In reply to comment #0)

even libffi themselves say this isn't a fix bug a workaround
Comment 6 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-02-10 11:19:20 UTC
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?
Comment 7 Ryan Hill (RETIRED) gentoo-dev 2013-02-12 04:16:50 UTC
This patch is in 3.0.12.