On 5/28/19 4:47 PM, Daniel Borkmann wrote:
> Hi Rong, [+Yonghong]
>
> On 05/28/2019 03:31 AM, kernel test robot wrote:
>> FYI, we noticed the following commit (built with gcc-7):
>>
>> commit: b915ebe6d9c8c6b5427e606c0ecee53df921382b ("bpf, selftest: test
global data/bss/rodata sections")
>>
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
>>
>> in testcase: kernel_selftests
>> with following parameters:
>>
>> group: kselftests-00
>>
>> test-description: The kernel contains a set of "self tests" under the
tools/testing/selftests/ directory. These are intended to be small unit tests to exercise
individual code paths in the kernel.
>>
test-url:https://www.kernel.org/doc/Documentation/kselftest.txt
>>
>>
>> on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 4G
>>
>> caused below changes (please refer to attached dmesg/kmsg for entire
log/backtrace):
>>
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kernel test robot<rong.a.chen(a)intel.com>
>>
>>
>> 2019-04-12 21:28:33 make run_tests -C bpf
>> make: Entering directory
'/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/testing/selftests/bpf'
>> make -C ../../../lib/bpf
OUTPUT=/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/testing/selftests/bpf/
>> make[1]: Entering directory
'/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/lib/bpf'
>>
>> Auto-detecting system features:
>> ... libelf: [ ^[[32mon^[[m ]
>> ... bpf: [ ^[[32mon^[[m ]
> [...]
>> llc -march=bpf -mcpu=probe -filetype=obj -o
/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/testing/selftests/bpf/test_global_data.o
>> LLVM ERROR: Unsupported relocation: try to compile with -O2 or above, or check
your static variable usage
>> Makefile:204: recipe for target
'/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/testing/selftests/bpf/test_global_data.o'
failed
>> make: ***
[/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/testing/selftests/bpf/test_global_data.o]
Error 1
>> make: Leaving directory
'/usr/src/perf_selftests-x86_64-rhel-7.6-b915ebe6d9c8c6b5427e606c0ecee53df921382b/tools/testing/selftests/bpf'
> Looks like your LLVM version is too old for compiling the selftest.
Hi Daniel,
We could compile the selftest successfully with llvm-6, but failed with llvm-7 starting
from this commit.
Do you mean we should update llvm?
Probably Yonghong might know better into which official stable release this fix went.
Thanks,
Daniel