[PATCH] UBUNTU SAUCE: ubuntu_bpf: llvm10 breaks tests_maps, revert to llvm9

Paolo Pisati paolo.pisati at canonical.com
Tue Apr 14 13:15:19 UTC 2020


BugLink: https://bugs.launchpad.net/bugs/1872708

Focal selftest/bpf test_maps failt when built with Clang & Llvm 10, revert to
Clang & Llvm 9.

Signed-off-by: Paolo Pisati <paolo.pisati at canonical.com>
---
 ubuntu_bpf/ubuntu_bpf.py | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/ubuntu_bpf/ubuntu_bpf.py b/ubuntu_bpf/ubuntu_bpf.py
index fee3cf29..cd32cb1f 100644
--- a/ubuntu_bpf/ubuntu_bpf.py
+++ b/ubuntu_bpf/ubuntu_bpf.py
@@ -9,18 +9,22 @@ class ubuntu_bpf(test.test):
 
     def install_required_pkgs(self):
         arch   = platform.processor()
+        series = platform.dist()[2]
 
         pkgs = [
             'build-essential',
-            'clang',
             'git',
             'libcap-dev',
             'libelf-dev',
-            'llvm',
         ]
         gcc = 'gcc' if arch in ['ppc64le', 'aarch64', 's390x'] else 'gcc-multilib'
         pkgs.append(gcc)
 
+        if series == 'focal':
+            pkgs.extend(['clang-9', 'llvm-9'])
+        else:
+            pkgs.extend(['clang', 'llvm'])
+
         cmd = 'apt-get install --yes --force-yes ' + ' '.join(pkgs)
         self.results = utils.system_output(cmd, retain_output=True)
 
@@ -47,11 +51,30 @@ class ubuntu_bpf(test.test):
         # Assist local testing by restoring the linux repo to vanilla.
         self.extract()
         os.chdir(self.srcdir)
+
+        series = platform.dist()[2]
+        if series == 'focal':
+            os.environ["CLANG"] = "clang-9"
+            os.environ["LLC"] = "llc-9"
+            os.environ["LLVM_OBJCOPY"] = "llvm-objcopy-9"
+            os.environ["LLVM_READELF"] = "llvm-readelf-9"
+
         utils.make('-C linux/tools/testing/selftests TARGETS=bpf clean all')
 
     def run_once(self, test_name):
         if test_name == 'setup':
             return
+
+        #
+        # llvm10 breaks bpf test_maps, revert to llvm9 instead
+        #
+        series = platform.dist()[2]
+        if series == 'focal':
+            os.environ["CLANG"] = "clang-9"
+            os.environ["LLC"] = "llc-9"
+            os.environ["LLVM_OBJCOPY"] = "llvm-objcopy-9"
+            os.environ["LLVM_READELF"] = "llvm-readelf-9"
+
         os.chdir(os.path.join(self.srcdir, 'linux/tools/testing/selftests/bpf'))
         cmd = './%s' % test_name
         self.results = utils.system_output(cmd, retain_output=True)
-- 
2.25.1




More information about the kernel-team mailing list