[llvmlinux] Rebasing llvmlinux kernel patches to more current kernels

Bernhard Rosenkränzer bernhard.rosenkranzer at linaro.org
Wed Apr 6 02:09:18 UTC 2016


Hi,
some good news - Linaro is now officially interested in building kernels
with clang.

Our initial target will be getting the HiKey board booting AOSP with both
kernel and userland compiled with clang.

I've created a git repository, initially rebasing the llvmlinux patches to
the HiKey kernel (which is essentially 4.4.0 + AOSP patches + some extra
hardware support patches - while untested, it should be possible to just
build that kernel for x86 as well) at

git://android-git.linaro.org/kernel/hikey-clang.git

The interesting branch is android-hikey-linaro-4.4-clang - the upstream
non-clang-buildable kernel sits in the android-hikey-linaro-4.4 branch in
case anyone wants to git format-patch or the likes.

The patchset is quite a bit smaller than what's on llvmlinux-current -
almost half the patches that used to be there have either been merged or
obsoleted.

My rebased tree is almost buildable again (at least in the HiKey config) -
with clang 3.8, the HiKey target compiles, but fails during linking stage.

I'm currently at ELC and won't have a lot of time to continue from there
for a couple of days - has anyone run into (or even fixed) these errors
before?

arch/arm64/kernel/built-in.o: In function `debug_monitors_arch':
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:36: undefined
reference to `mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:36:(.text+0xc):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:37: undefined
reference to `mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:37:(.text+0x20):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
arch/arm64/kernel/built-in.o: In function `cpuid_feature_extract_field':
/home/bero/repos/linux/./arch/arm64/include/asm/cpufeature.h:128: undefined
reference to `mcount'
/home/bero/repos/linux/./arch/arm64/include/asm/cpufeature.h:128:(.text+0x24):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
arch/arm64/kernel/built-in.o: In function `create_debug_debugfs_entry':
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:66: undefined
reference to `mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:66:(.text+0x40):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
arch/arm64/kernel/built-in.o: In function `enable_debug_monitors':
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:88: undefined
reference to `mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:88:(.text+0x80):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
arch/arm64/kernel/built-in.o:/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:91:
more undefined references to `mcount' follow
arch/arm64/kernel/built-in.o: In function `enable_debug_monitors':
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:91:(.text+0x84):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
arch/arm64/kernel/built-in.o: In function `preempt_count':
/home/bero/repos/linux/include/asm-generic/preempt.h:10:(.text+0x88):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
arch/arm64/kernel/built-in.o: In function `enable_debug_monitors':
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:91:(.text+0x9c):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:91:(.text+0xa4):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:93:(.text+0xbc):
relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol
`mcount'
/home/bero/repos/linux/arch/arm64/kernel/debug-monitors.c:93:(.text+0xc4):
additional relocation overflows omitted from the output
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
aarch64-mandriva-linux-gnu-ld: Dwarf Error: Info pointer extends beyond end
of attributes
drivers/built-in.o: In function `__acpi_processor_start':
/home/bero/repos/linux/drivers/acpi/processor_driver.c:250: undefined
reference to `acpi_idle_driver'
/home/bero/repos/linux/drivers/acpi/processor_driver.c:250: undefined
reference to `acpi_idle_driver'
/home/bero/repos/linux/drivers/acpi/processor_driver.c:251: undefined
reference to `mcount'
/home/bero/repos/linux/drivers/acpi/processor_driver.c:253: undefined
reference to `mcount'
/home/bero/repos/linux/drivers/acpi/processor_driver.c:263: undefined
reference to `mcount'
drivers/built-in.o: In function `acpi_processor_notify':
/home/bero/repos/linux/drivers/acpi/processor_driver.c:70: undefined
reference to `mcount'
/home/bero/repos/linux/drivers/acpi/processor_driver.c:78: undefined
reference to `mcount'
drivers/built-in.o:/home/bero/repos/linux/drivers/acpi/processor_driver.c:89:
more undefined references to `mcount' follow


Build instructions for HiKey are pretty much as expected:
make CC=clang HOSTCC=clang CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64
hikey_defconfig
make CC=clang HOSTCC=clang CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 -j24

Once HiKey is working, will also rebase the patches to master.

There's a gerrit server connected to the repository as well,
http://android-review.linaro.org/ - if anyone has patches to contribute,
please submit them either there or send a pull request or use the ML.

ttyl
bero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxfoundation.org/pipermail/llvmlinux/attachments/20160406/b6cfc4ac/attachment.html>


More information about the LLVMLinux mailing list