diff --git a/tests/simple-rpm/runtest.sh b/tests/simple-rpm/runtest.sh index 07afcd5..d911a2b 100755 --- a/tests/simple-rpm/runtest.sh +++ b/tests/simple-rpm/runtest.sh @@ -6,3 +6,5 @@ dnf -y build-dep test.spec rpmbuild --define '_sourcedir .' --define '_builddir .' -bb test.spec dnf -y build-dep test.spec -D "_with_ld_lld 1" rpmbuild --with ld_lld --define '_sourcedir .' --define '_builddir .' -bb test.spec +dnf -y build-dep test.spec -D "_with_clang 1" +rpmbuild --with clang --define '_sourcedir .' --define '_builddir .' -bb test.spec diff --git a/tests/simple-rpm/test.spec b/tests/simple-rpm/test.spec index c5de261..155a352 100644 --- a/tests/simple-rpm/test.spec +++ b/tests/simple-rpm/test.spec @@ -1,9 +1,13 @@ %bcond_with ld_lld +%bcond_with clang %if %{with ld_lld} %global extra_ldflags -fuse-ld=lld %global _package_note_linker lld %endif +%if %{with clang} +%global toolchain clang +%endif Name: test Version: 1 @@ -11,7 +15,11 @@ Release: 1 Summary: Test package for checking package notes License: MIT +%if %{with clang} +BuildRequires: clang +%else BuildRequires: gcc +%endif # For %check BuildRequires: binutils BuildRequires: jq @@ -24,10 +32,10 @@ Test package for checking package notes %build echo 'int main(int argc, char **argv) { return 0; }' | %{build_cc} ${CFLAGS} -x c -c - -o main.o -%{build_cc} ${LDFLAGS} %{?extra_ldflags} main.o -o main +%{build_cc} -Werror ${LDFLAGS} %{?extra_ldflags} main.o -o main -# Package notes not supported with lld, so the the build succeeding is enough. -%if %{without ld_lld} +# Package notes not supported with clang, so the the build succeeding is enough. +%if %{without clang} %check # avoid any attempt to access the network by readelf export DEBUGINFOD_URLS=