diff mbox series

UBUNTU SAUCE: ubuntu_bpf: llvm10 breaks tests_maps, revert to llvm9

Message ID 20200414131519.70521-1-paolo.pisati@canonical.com
State New
Headers show
Series UBUNTU SAUCE: ubuntu_bpf: llvm10 breaks tests_maps, revert to llvm9 | expand

Commit Message

Paolo Pisati April 14, 2020, 1:15 p.m. UTC
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@canonical.com>
---
 ubuntu_bpf/ubuntu_bpf.py | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

Comments

Sean Feole April 14, 2020, 2:23 p.m. UTC | #1
Thanks,
-Sean

On 4/14/20 9:15 AM, Paolo Pisati wrote:
> 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@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)
diff mbox series

Patch

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)