Hi,

On Mon, 2020-03-23 at 15:08 +0100, Mark Wielaard wrote:
> Well, that is odd. Both are 32bit arches. The failure is the same in
> run-lfs-symbols.sh
> 
>    FAIL: run-lfs-symbols.sh
>    ========================
>    ./testfile-nolfs contains non-lfs symbols: fopen
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_i386.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_sh.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_x86_64.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_ia64.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_alpha.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_arm.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_aarch64.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_sparc.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_ppc.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_ppc64.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_s390.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_tilegx.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_m68k.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_bpf.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_riscv.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/src/nm: cannot
> open
>    '/srv/buildbot/worker/elfutils-debian-
>    i386/build/backends/libebl_csky.so': No such file or directory
>    /srv/buildbot/worker/elfutils-debian-i386/build/tests/getphdrnum
>    contains non-lfs symbols: open
>    FAIL run-lfs-symbols.sh (exit status: 1)
> 
> The backends shared libraries don't exist anymore and should be
> removed
> from the testcase.

Which the attached patch does. It also explicitly fails if a file
doesn't exist and 

> But I don't immediately see what/where I forgot which flags to make
> the new getphdrnum check program picks up the wrong "open".

It simply was a missing #include "config.h" which defines
_FILE_OFFSET_BITS without which you don't get lfs symbols... doh.

Both issues, plus some extra logging in run-lfs-symbols.sh fixed by the
attached patch which I just pushed.

Cheers,

Mark
From 7db645ba72f5711174dbf712003b9600009e5ea7 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <m...@klomp.org>
Date: Mon, 23 Mar 2020 23:57:51 +0100
Subject: [PATCH] tests: Fix getphdrnum and run-lfs-symbols.sh testcase.

getphdrnum.c didn't include config.h which is why run-lfs-symbols.sh
flagged it for containing bad (non-lfs) symbols.

run-lfs-symbols.sh was still checking the libebl modules, which we
don't create anymore. But it didn't fail the test for non-existing
tests. Add some extra logging and explicitly check files exist.

Signed-off-by: Mark Wielaard <m...@klomp.org>
---
 tests/ChangeLog          |  6 ++++++
 tests/getphdrnum.c       |  2 ++
 tests/run-lfs-symbols.sh | 27 +++++++++++++++------------
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 44ea1c44..d0d32a87 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-23  Mark Wielaard  <m...@klomp.org>
+
+	* getphdrnum.c: Include config.h.
+	* run-lfs-symbols.sh: Also check that file exists. Add more logs.
+	Remove ebl modules check.
+
 2020-03-22  Omar Sandoval  <osan...@fb.com>
 	    Mark Wielaard  <m...@klomp.org>
 
diff --git a/tests/getphdrnum.c b/tests/getphdrnum.c
index 4d4bb397..07f75db0 100644
--- a/tests/getphdrnum.c
+++ b/tests/getphdrnum.c
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <fcntl.h>
 #include <libelf.h>
 #include <stdio.h>
diff --git a/tests/run-lfs-symbols.sh b/tests/run-lfs-symbols.sh
index f0894405..b65391b6 100755
--- a/tests/run-lfs-symbols.sh
+++ b/tests/run-lfs-symbols.sh
@@ -46,41 +46,44 @@ makeprint() {
 }
 
 testrun_lfs() {
-  bad=$(testrun ${abs_top_builddir}/src/nm -u "$1" | awk "$LFS")
-  if [ -n "$bad" ]; then
-    echo "$1 contains non-lfs symbols:" $bad
+  echo "checking $1"
+  if [ -e "$1" ]; then
+    bad=$(testrun ${abs_top_builddir}/src/nm -u "$1" | awk "$LFS")
+    if [ -n "$bad" ]; then
+      echo "$1 contains non-lfs symbols:" $bad
+      exit_status=1
+    fi
+  else
+    echo "$1 doesn't exist"
     exit_status=1
   fi
 }
 
-# First sanity-check that LFS detection works.
+echo First sanity-check that LFS detection works.
 exit_status=0
 testrun_lfs ./testfile-nolfs
 if [ $exit_status -eq 0 ]; then
   echo "Didn't detect any problem with testfile-nolfs!"
   exit 99
 fi
+echo
 
 exit_status=0
 
-# Check all normal build targets.
+echo Check all normal build targets.
 for dir in libelf libdw libasm libcpu src; do
   dir=${abs_top_builddir}/$dir
   for program in $(makeprint PROGRAMS $dir); do
     testrun_lfs $dir/$program
   done
 done
+echo
 
-# Check all libebl modules.
-dir=${abs_top_builddir}/backends
-for module in $(makeprint modules $dir); do
-  testrun_lfs $dir/libebl_$module.so
-done
-
-# Check all test programs.
+echo Check all test programs.
 dir=${abs_builddir}
 for program in $(makeprint check_PROGRAMS $dir); do
   testrun_lfs $dir/$program
 done
+echo
 
 exit $exit_status
-- 
2.18.2

Reply via email to