jump_label: move 'asm goto' support test to Kconfig

Sedat Dilek sedat.dilek at gmail.com
Fri Jan 4 20:56:23 AEDT 2019


On Thu, Jan 3, 2019 at 1:36 AM Masahiro Yamada
<yamada.masahiro at socionext.com> wrote:
>
> On Wed, Jan 2, 2019 at 9:14 PM Sedat Dilek <sedat.dilek at gmail.com> wrote:
> >
> > Hi,
> >
> > I was not aware that CONFIG_JUMP_LABEL Kconfig setting depends on the
> > support of asm-goto.
> >
> > Currently, I am doing experiments with clang-7 and a snapshot of
> > clang-8 on Linux/x86.
> > These compilers have no asm-goto support.
> >
> > What is your recommendation for Linux >= v4.20?
> > I am asking as it is possible to set CONFIG_JUMP_LABEL=y when
> > compiling with clang - which has no effect.
> > This is confusing.
> >
> > Thanks, this patch makes things clearer and protects users from
> > setting "wrong" in the sense of non-functional settings.
> >
> > I have tested this against recent Linus tree where kbuild/kconfig Git
> > pulls were latest commits.
> >
> > Tested-by: Sedat Dilek <sedat.dilek at gmail.com> [ x86 with LLVM/Clang
> > v7 and v8 (snapshot) ]
>
>
> Which part was tested?
>
> x86 kernel cannot be compiled with Clang
> since it lacks the asm-goto support.
>
>
> $ make CC=clang
> Compiler lacks asm-goto support.
> arch/x86/Makefile:293: recipe for target 'checkbin' failed
> make: *** [checkbin] Error 1
>

Yes, this needs a workaround (see attachment).

As a base I took kbuid.git#for-next on top of Linux v4.20...

$ git log --oneline -2
58609f06cfb6 (HEAD -> 4.20.0-2-amd64-cbl) x86: Workaround clang does
not support asm-goto
68af7c873957 (for-4.20/kbuild-next-20190103) kbuild: remove
unnecessary stubs for archheader and archscripts

...and includes:

f44251005047 jump_label: move 'asm goto' support test to Kconfig

My compiler is clang-7 from Debian/testing.

$ git log --oneline -2
58609f06cfb6 (HEAD -> 4.20.0-2-amd64-cbl) x86: Workaround clang does
not support asm-goto
68af7c873957 (for-4.20/kbuild-next-20190103) kbuild: remove
unnecessary stubs for archheader and archscripts

It's compile-tested only on Debian/testing AMD64.

I cannot boot into bare metal.

This might have other root causes.

- Sedat -

P.S.: Additional informations

Booting in QEMU 3.1 shows...

$ ./run_qemu.sh
Probing EDD (edd=off to disable)... ok


XZ-compressed data is corrupt

 -- System haltedqemu-system-x86_64: terminating on signal 2

$ cat run_qemu.sh
KPATH=$(pwd)

qemu-system-x86_64 -enable-kvm -M pc -kernel $KPATH/bzImage -initrd
$KPATH/initrd.img -m 512 -net none -serial stdio -append
"root=/dev/ram0 console=ttyS0 hung_task_panic=1
earlyprintk=ttyS0,115200"

NOTE: I can boot a Linux v4.20 kernel with this QEMU version.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Workaround-clang-does-not-support-asm-goto.patch
Type: text/x-patch
Size: 3300 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20190104/15e4113b/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config-4.20.0-2-amd64-cbl
Type: application/octet-stream
Size: 207628 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20190104/15e4113b/attachment-0001.obj>


More information about the Linuxppc-dev mailing list