On Sun, Aug 25, 2024 at 01:23:51PM -0700, Yonghong Song wrote: > > On 8/24/24 4:21 PM, Tony Ambardar wrote: [snip] > > > > Test '#525 verif_scale_pyperf600:FAIL' was caused by clang miscompilation > > exposed by my use of clang-19 and clang-20. The test passes when built > > with clang-17 (used by BPF CI) or clang-18 which I switched to use. > > x86 has the same issue where clang19 generated code will cause verification > failure. Eduard is working on this. > > > > > One symptom of the problem is easily seen by manually compiling: > > > > $ clang-18 -g -Wall -Werror -D__TARGET_ARCH_s390 -mbig-endian -Itools/testing/selftests/bpf/tools/include -Itools/testing/selftests/bpf -Itools/include/uapi -Itools/testing/selftests/usr/include -Wno-compare-distinct-pointer-types -idirafter /usr/lib/llvm-18/lib/clang/18/include -idirafter /usr/local/include -idirafter /usr/lib/gcc-cross/s390x-linux-gnu/11/../../../../s390x-linux-gnu/include -idirafter /usr/include/s390x-linux-gnu -idirafter /usr/include -DENABLE_ATOMICS_TESTS -O2 --target=bpfeb -c tools/testing/selftests/bpf/progs/pyperf600.c -mcpu=v3 -o pyperf600.clang18.bpf.o > > > > $ clang-19 -g -Wall -Werror -D__TARGET_ARCH_s390 -mbig-endian -Itools/testing/selftests/bpf/tools/include -Itools/testing/selftests/bpf -Itools/include/uapi -Itools/testing/selftests/usr/include -Wno-compare-distinct-pointer-types -idirafter /usr/lib/llvm-19/lib/clang/19/include -idirafter /usr/local/include -idirafter /usr/lib/gcc-cross/s390x-linux-gnu/11/../../../../s390x-linux-gnu/include -idirafter /usr/include/s390x-linux-gnu -idirafter /usr/include -DENABLE_ATOMICS_TESTS -O2 --target=bpfeb -c tools/testing/selftests/bpf/progs/pyperf600.c -mcpu=v3 -o pyperf600.clang19.bpf.o > > > > $ llvm-readelf-18 -S pyperf600.clang{18,19}.bpf.o |grep .symtab > > [27] .symtab SYMTAB 0000000000000000 1739d0 01ad60 18 1 4572 8 > > [27] .symtab SYMTAB 0000000000000000 14f048 0001e0 18 1 12 8 > > > > Notice that the .symtab has shrunk by ~200X for example going to clang-19! > > (CCing llvm maintainers) > > This is a known issue. In llvm18, all labels (to identify basic blocks) are in symbol table. > Those labels are removed from symbol table in llvm19. Glad to hear this a known issue being looked at now. A quick search on my part found nothing, so sorry for the noise and thanks for clarifying. > > > > > > > Kind regards, > > Tony > >