2016-06-19 01:53:25 +03:00
#!/bin/sh -ex
2018-12-25 02:46:43 +03:00
#
# Copyright (c) 2018 The strace developers.
# All rights reserved.
#
# SPDX-License-Identifier: GPL-2.0-or-later
2016-06-19 01:53:25 +03:00
2017-07-22 05:14:14 +03:00
DISTCHECK_CONFIGURE_FLAGS = '--disable-dependency-tracking'
export DISTCHECK_CONFIGURE_FLAGS
2016-06-19 01:53:25 +03:00
case " $CC " in
2017-04-12 06:06:32 +03:00
gcc*)
2016-12-22 01:20:29 +03:00
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --enable-gcc-Werror "
2016-06-19 01:53:25 +03:00
; ;
clang-*)
# clang -mx32 fails with the following error:
# clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
export st_cv_mx32_runtime = no
; ;
esac
case " ${ TARGET - } " in
x32)
CC = " $CC -mx32 "
; ;
x86)
CC = " $CC -m32 "
2016-12-22 01:20:29 +03:00
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu "
2016-12-18 03:12:48 +03:00
; ;
esac
ci: add more variants of unwinder to test matrices
Check x86_64 builds with libdw, with libunwind, and without stacktrace.
As Travis CI doesn't provide a suitable libdw, do not test libdw there.
* ci/install-dependencies.sh (common_packages): Remove libdw-dev.
Install libdw-dev or libunwind8-dev depending on $STACKTRACE.
* ci/run-build-and-tests.sh: Specify --with-libdw=yes,
--with-libunwind=yes, or --without-stacktrace depending on $STACKTRACE.
* .gitlab-ci.yml (gcc-x86_64): Rename to gcc-x86_64-libdw,
add STACKTRACE=libdw.
(gcc-x86): Rename to gcc-x86-nounwind, add STACKTRACE=no.
(clang-x86_64): Rename to clang-x86_64-libdw, add STACKTRACE=libdw.
(clang-x86): Rename to clang-x86-nounwind, add STACKTRACE=no.
(gcc-x86_64-libunwind, gcc-x86_64-nounwind, gcc-x86-nounwind,
clang-x86_64-libunwind, clang-x86_64-nounwind, clang-x86-nounwind):
New test matrix entries.
* .travis.yml: Add STACKTRACE=libunwind to all x86_64 test matrix
entries except musl-gcc, add STACKTRACE=no to other matrix entries,
add test matrix entries with STACKTRACE=no variants on x86_64.
2018-05-05 02:13:45 +03:00
case " ${ STACKTRACE - } " in
libdw| libunwind)
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --with- $STACKTRACE "
; ;
no)
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --disable-stacktrace "
; ;
esac
2018-08-19 13:26:18 +03:00
CPPFLAGS =
2017-04-13 21:24:09 +03:00
case " $KHEADERS " in
*/*)
CPPFLAGS = '-isystem /opt/kernel/include'
export CPPFLAGS
; ;
esac
2016-12-18 03:12:48 +03:00
case " ${ CHECK - } " in
coverage)
2016-12-22 01:20:29 +03:00
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --enable-code-coverage "
2016-12-18 03:12:48 +03:00
CFLAGS = '-g -O0'
CFLAGS_FOR_BUILD = " $CFLAGS "
export CFLAGS CFLAGS_FOR_BUILD
2016-06-19 01:53:25 +03:00
; ;
2017-07-22 21:46:16 +03:00
valgrind)
DISTCHECK_CONFIGURE_FLAGS = " $DISTCHECK_CONFIGURE_FLAGS --enable-valgrind "
; ;
2016-06-19 01:53:25 +03:00
esac
2017-07-21 01:03:31 +03:00
echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION'
uname -a | head -1
libc = " $( ldd /bin/sh | sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' | head -1) "
$libc | head -1
file -L /bin/sh
$CC --version | head -1
2017-11-29 06:52:27 +03:00
$CC -print-multi-lib || :
2017-07-21 01:03:31 +03:00
make --version | head -1
autoconf --version | head -1
automake --version | head -1
2018-08-19 13:26:18 +03:00
kver = " $( printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC $CPPFLAGS -E -P -) "
2017-07-21 01:03:31 +03:00
printf 'kernel-headers %s.%s.%s\n' $(( $kver / 65536 )) $(( $kver / 256 % 256 )) $(( $kver % 256 ))
echo 'END OF BUILD ENVIRONMENT INFORMATION'
2016-06-19 01:53:25 +03:00
export CC_FOR_BUILD = " $CC "
./git-set-file-times
./bootstrap
2016-12-18 03:12:48 +03:00
./configure --enable-maintainer-mode \
${ DISTCHECK_CONFIGURE_FLAGS - } \
2017-11-29 06:52:27 +03:00
|| {
rc = $?
cat config.log
2018-03-13 18:12:14 +03:00
echo " $CC -dumpspecs follows "
$CC -dumpspecs
2017-11-29 06:52:27 +03:00
exit $rc
}
2016-06-19 01:53:25 +03:00
j = -j` getconf _NPROCESSORS_ONLN 2> /dev/null` || j =
2016-12-18 03:12:48 +03:00
case " ${ CHECK - } " in
coverage)
make -k $j all VERBOSE = ${ VERBOSE - }
make -k $j check VERBOSE = ${ VERBOSE - }
codecov --gcov-args= -abcp || :
2017-04-13 07:43:46 +03:00
echo 'BEGIN OF TEST SUITE INFORMATION'
tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log
echo 'END OF TEST SUITE INFORMATION'
2016-12-18 03:12:48 +03:00
; ;
2017-07-22 21:46:16 +03:00
valgrind)
make -k $j all VERBOSE = ${ VERBOSE - }
rc = $?
for n in ${ VALGRIND_TOOLS :- memcheck helgrind drd } ; do
make -k $j -C " ${ VALGRIND_TESTDIR :- . } " \
check-valgrind-$n VERBOSE = ${ VERBOSE - } ||
rc = $?
done
echo 'BEGIN OF TEST SUITE INFORMATION'
tail -n 99999 -- tests*/test-suite*.log tests*/ksysent.log ||
rc = $?
echo 'END OF TEST SUITE INFORMATION'
[ " $rc " -eq 0 ]
; ;
2016-12-18 03:12:48 +03:00
*)
make -k $j distcheck VERBOSE = ${ VERBOSE - }
; ;
esac