Bug#1010716: llvm-toolchain-14: autopkgtest failure on arm64/armhf

Pino Toscano pino at debian.org
Sun May 8 07:43:55 BST 2022


Source: llvm-toolchain-14
Version: 1:14.0.3-1
Severity: important
Tags: patch
X-Debbugs-Cc: sylvestre at debian.org

Hi,

the qualify-clang.sh script, invoked as one of the autopkgtests, fails
to complete successfully on arm64 & armhf for llvm-toolchain-14.

The reason for this is because the output of the preprocessing of the
"#include <fenv.h>" source shrank a lot; when looking at arm64, the
difference between the output with llvm-13 and llvm-14 are solely the
empty lines:
- llvm-13: 165 lines, 71 non-empty lines
- llvm-14: 74 lines, 71 non-empty lines
- there is no difference in the non-empty lines

Compared to e.g. amd64, there are less lines due to the different fenv.h
provided by glibc:
- FE_TONEAREST, FE_DOWNWARD, FE_UPWARD, and FE_TOWARDZERO are
  implemented as macros on arm64 (while as single enum on amd64), thus
  disappearing after the preprocessing
- the fenv_t struct has much less fields: 14 on amd64 vs 2 on arm64
- femode_t is a simple typedef on arm64, rather than a struct

Similar comparisons can be done on armhf.

Hence,I believe a possible way forward is the following:
- remove the empty lines when counting the lines in the output of the
  "#include <fenv.h>" preprocessing
- reduce the number of required lines from 100 to 60; I don't know why
  100 was chosen, as the commit that adds that [1] does not explain it;
  since the current value of non-empty lines on arm64 is 71, I chose 60
  rather than 70 mostly to keep room for a minimal removal

[1] https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/4f47c2ac959dd05399da8fd2c40084ee86c25267#b53c2fe1e367d55eb53a487fda5ca85af65594aa_0_32

Attached there is a patch that implements both the changes described
above; with that, qualify-clang.sh fully completes successfully on
arm64.

Thanks,
-- 
Pino
-------------- next part --------------
--- a/debian/qualify-clang.sh
+++ b/debian/qualify-clang.sh
@@ -350,9 +350,9 @@ void increment(atomic_size_t *arg) {
 clang-$VERSION -v -c foo.c &> /dev/null
 
 echo "#include <fenv.h>" > foo.cc
-NBLINES=$(clang++-$VERSION -P -E foo.cc|wc -l)
-if test $NBLINES -lt 100; then
-    echo "Error: more than 100 lines should be returned"
+NBLINES=$(clang++-$VERSION -P -E foo.cc|grep .|wc -l)
+if test $NBLINES -lt 60; then
+    echo "Error: more than 60 non-empty lines should be returned"
     echo "output:"
     clang++-$VERSION -P -E foo.cc
     exit 42


More information about the Pkg-llvm-team mailing list