| |
@@ -0,0 +1,50 @@
|
| |
+ #!/usr/bin/sh -ex
|
| |
+
|
| |
+ # Test the compatibility of the current libLLVM with specific versions that
|
| |
+ # have been previously generated.
|
| |
+ # The artifacts used as input in this test are maintained in this git-lfs
|
| |
+ # repo: https://gitlab.com/tuliom-rh/llvm-fedora-el-abi
|
| |
+
|
| |
+ is_fedora=`rpm -E %{fedora}`
|
| |
+ arch=`rpm -E %{_arch}`
|
| |
+
|
| |
+ case $(rpm -E %dist) in
|
| |
+ .fc*) dist_prefix=fc;;
|
| |
+ .el*) dist_prefix=el;;
|
| |
+ *) echo "Error: which distro is this ($(rpm -E %dist))?" >&2
|
| |
+ esac
|
| |
+
|
| |
+ # Download ABI dumps from previous versions.
|
| |
+ wget -q https://gitlab.com/tuliom-rh/llvm-fedora-el-abi/-/archive/main/llvm-fedora-el-abi-main.tar.gz
|
| |
+ tar xzf llvm-fedora-el-abi-main.tar.gz --strip-components=1 '*/libLLVM.*.abi.xz'
|
| |
+
|
| |
+ for f in *.abi.xz; do
|
| |
+ unxz $f
|
| |
+ done
|
| |
+
|
| |
+ abi_files=$(ls libLLVM*.$dist_prefix*.$arch.abi)
|
| |
+
|
| |
+ abi_file=libLLVM.$(rpm -q llvm-libs | sed 's/~//g').abi
|
| |
+ version=$(rpm -q --qf "%{V}-%{R}.%{ARCH}\n" llvm-libs)
|
| |
+ library=$(rpm -ql llvm-libs | grep -E 'libLLVM-.*.so' | sort | head -n 1)
|
| |
+ debuginfo=$(rpm -ql llvm-libs-debuginfo | grep -E 'libLLVM-.*\.so.*\.debug')
|
| |
+
|
| |
+ nm $debuginfo \
|
| |
+ | awk '/T _LLVM/ || /T LLVM/ { print $3 }' \
|
| |
+ | sort -u \
|
| |
+ | sed -e 's/^_//g' | cut -d ' ' -f 3 > llvm.symbols
|
| |
+
|
| |
+ # Create the ABI dump from the current version. This takes a long time.
|
| |
+ abi-dumper -quiet -symbols-list llvm.symbols \
|
| |
+ -lver $version \
|
| |
+ -skip-cxx \
|
| |
+ -public-headers /usr/include/llvm-c \
|
| |
+ --search-debuginfo=/usr/lib/debug \
|
| |
+ -o $abi_file $library
|
| |
+
|
| |
+ sed -i 's/LLVM_[0-9]\+/LLVM_NOVERSION/' $abi_file
|
| |
+
|
| |
+ for old_abi_file in $abi_files; do
|
| |
+ abi-compliance-checker -symbols-list llvm.symbols \
|
| |
+ -l libLLVM.so -old $old_abi_file -new $abi_file
|
| |
+ done
|
| |
This test uses abi-compliance-checker in order to compare the ABI of the
current libLLVM.so with previous versions that are stored in a separate
git-lfs repository.
This new test can take very long to complete (100 minutes on a small
VMs) and consumes far more RAM than previous tests (up to 10 GiB).