[llvmlinux] "make test" for x86_64 target just hung there, why?

PaX Team pageexec at gmail.com
Sun Sep 13 07:17:32 UTC 2015

On 13 Sep 2015 at 4:24, Sedat Dilek wrote:

> On Wed, Sep 9, 2015 at 10:24 PM, PaX Team <pageexec at gmail.com> wrote:
> > are you sure it's not lib/hweight.o instead? under gcc it's compiled
> > with special flags (CONFIG_ARCH_HWEIGHT_CFLAGS) which clang doesn't
> > support and we used to patch that out but i have no idea about the
> > current state of affairs.
> >
> Hi pipacs,
> YES, you are right!
> One of your patches for x86_64 got archived [1] but is still required
> to build x86_64 arch correctly.

interesting, Jan-Simon said that patch was still part of the llvmlinux
tree (it is really mandatory for clang) so i'm not sure what's going on.

> Shouldn't your patch go upstream?

well, certainly not in this form as it disables an otherwise useful
optimization (popcnt vs. call to helper). the real/best solution would
be if clang (or more like llvm in this case) added some support for
changing the calling conventions via the fcall-saved-REG (and other
similar) switches but IIRC there was a discussion (or bugzilla entry?)
about it and the devs weren't in favour of this gcc feature as it
punched a hole through too many abstraction layers for their taste.

on the linux side the best (as in, probably upstreamable) fix would be to
extend and make use of the thunking layer in arch/x86/entry/thunk_{32,64}.S
as they properly save/restore the necessary registers (modulo eax/rax
which are needed for the return value) that the above gcc switch would
induce too.

More information about the LLVMLinux mailing list