%global debug_package %{nil} Name: uke-kernel-migration-check Version: 7.3.5 Release: 48.uke_q6apm_object4%{?dist} Summary: Uke AudioReach playback queue source check License: GPL-2.0-only Source0: q6apm-playback-object.tar.xz BuildRequires: bc bison clang compiler-rt curl elfutils-libelf-devel flex gcc git-core lld llvm make openssl-devel xz ExclusiveArch: aarch64 %description A source-only check of the bounded AudioReach PCM playback queue for Uke. %prep %setup -q -n source-check file=sound/soc/qcom/qdsp6/q6apm-dai.c echo '7dab9c7cf1f0ef6542ab0a20401223ae5cdccd4e68e25d634e5916f5b1f366cc '"$file" | sha256sum --strict -c cp "$file" original.c git apply --whitespace=error 0050-q6apm-bound-playback-queue.patch echo '54828421256aad8b505c3193c1c5b927ad14bab1b6f1fb3520e862159d9688b1 '"$file" | sha256sum --strict -c %build export ARCH=arm64 LLVM=1 ulimit -c 0 test "$(df -Pk . | awk 'END {print $4}')" -gt 3000000 inode_total=$(df -Pi . | awk 'END {print $2}') if [[ "$inode_total" =~ ^[1-9][0-9]*$ ]]; then test "$(df -Pi . | awk 'END {print $4}')" -gt 100000 fi curl -fLsS --max-time 120 --max-filesize 170000000 -o linux.tar.xz https://cdn.kernel.org/pub/linux/kernel/v7.x/linux-7.3.5.tar.xz echo '8f293f83d54f0b7b9be56863ebc5e4ea79d73e530b4ae55c572be97ef39f0990 linux.tar.xz' | sha256sum --strict -c tar -xJf linux.tar.xz rm linux.tar.xz (cd overlay && sha256sum --strict -c ../object-headers.sha256) cp -a overlay/. linux-7.3.5/ install -m644 sound/soc/qcom/qdsp6/q6apm-dai.c linux-7.3.5/sound/soc/qcom/qdsp6/q6apm-dai.c cd linux-7.3.5 make -s defconfig scripts/config -e SND -e SND_SOC -e SND_PCM make -s olddefconfig make -j4 sound/soc/qcom/qdsp6/q6apm-dai.o obj=sound/soc/qcom/qdsp6/q6apm-dai.o llvm-readelf -h "$obj" | grep -E 'Machine:.*AArch64' llvm-nm -u "$obj" > ../object.imports for symbol in snd_pcm_stream_lock_irq snd_pcm_stream_unlock_irq q6apm_write_async cancel_work_sync system_unbound_wq; do grep -E " U $symbol\$" ../object.imports done sha256sum "$obj" > ../object.sha256 %install install -d %{buildroot}%{_datadir}/uke-q6apm-playback-check cat > %{buildroot}%{_datadir}/uke-q6apm-playback-check/receipt <<'RECEIPT' source_validation=qualified-native-object source_commit=88ff9721545ad35574e2ab1ad8bd031553384472 parent_build=11373931 playback_queue_cases=18 checks=gcc,clang,gcc-asan-ubsan,clang-asan-ubsan,patch-inverse scope=source-function-fixtures-and-aarch64-object RECEIPT install -m644 object.sha256 %{buildroot}%{_datadir}/uke-q6apm-playback-check/ %check file=sound/soc/qcom/qdsp6/q6apm-dai.c for cc in gcc clang; do for sanitize in 0 1; do CC="$cc" SANITIZE="$sanitize" bash tests/q6apm-playback-queue.sh "$file" done done git apply --reverse --whitespace=error 0050-q6apm-bound-playback-queue.patch cmp original.c "$file" echo 'Exact AudioReach source reversal passed.' %files %{_datadir}/uke-q6apm-playback-check/