Re: [llvmlinux] percpu | bitmap issue? (Cannot boot on bare metal due to a kernel NULL pointer dereference)

From: Sedat Dilek
Date: Sat Sep 12 2015 - 17:23:20 EST


On Wed, Sep 9, 2015 at 2:54 PM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> On Wed, Sep 09, 2015 at 12:05:50PM +0200, Sedat Dilek wrote:
>> I can boot into a CLANG v3.7 compiled Linux-kernel when lib/bitmap is
>> compiled with GCC (here: v4.9).
>>
>> CONFIG_OPTIMIZE_INLINING has no effect on this.
>>
>> Attached are the single llvmlinux patch for AMD64 (x86_64), my
>> kernel-config and 2 objdumps with bitmap.o file alltogether.
>
> I suggest you go tell the LLVM people their compiler is broken.

It looks like an inline-optimization bug in CLANG when the compiler's
optimization-level is higher than -O2.

Level -O0 and -O1 are OK - I can boot in such Linux-kernel v4.2.

With Level -Oz when CONFIG_CC_OPTIMIZE_FOR_SIZE=y (equivalent to GCC's
-Os) the objdump looked sane but I cannot boot on bare metal.
Re-compiling lib/bitmap with -O0 or -O1 is fine again.

- Sedat -

[1] http://lists.linuxfoundation.org/pipermail/llvmlinux/2015-September/001355.html
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/