latest linux/clang patches

hello everyone,

attached are the updated patches for llvm/clang trunk and linux 2.6.38.2(-pax) to build both
an i386 and amd64 kernel as well. since my last post several issues were reported in bugzilla,
some of them even got fixed while others have patches and some are lingering, so if anyone
feels like helping out, check out PR4068 that links to them.

the changes since last time:

1. amd64/vdso builds without patching the linux side now (must have been fixed in llvm/clang
   while i wasn't looking :wink:

2. clang needs a patch to fix mcount instrumentation, right now it looks like that inlined
   functions get instrumented first and then inlined, resulting in several calls to mcount
   in the outer function. furthermore the no_instrument_function attribute doesn't affect
   mcount whereas it does in gcc. the attached clang patch tries to fix these but i'm pretty
   sure the inline handling is a bad hack only, so feel free to help :).

   note that -finstrument-functions is meant to apply to inlined functions, it's only mcount
   that needs special handling.

3. i also fixed a small typo in how -fno-merge-all-constants was passed down from the driver
   (used to be needed for building the vdso, that's why i even noticed).

4. i changed the __builtin_object_size prototype to take a const pointer, otherwise there's
   lots of noise when const pointers are passed to it (not sure why gcc ever defined it as
   non-const since this builtin isn't meant to modify the target object).

so that's all for now, the work continues.

cheers,

PaX Team

llvm-amd64-kernel-pic.patch (6.81 KB)

clang-mregparm-fix.patch (14.9 KB)

pax-linux-2.6.38.2-test6-clang-only.patch (45.1 KB)

Wow, it looks like you have a lot of great patches here. Can you split these up into individual patches? I see that #4 went in, and the fast isel changes look fine. I applied #3, and the other patches look fine too but should be reviewed individually. Thanks for all the great work!

-Chris