Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions extra/csmith/APKBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Alphin Maintainer: Daniel Sabogal <dsabogalcc@gmail.com>
# Maintainer: Narayana Murthy <nnarayanamurthy@qnx.com>
pkgname=csmith
pkgver=2.3.0
pkgrel=0
pkgdesc="Tool for generating random C programs"
url="https://embed.cs.utah.edu/csmith/"
arch="all"
license="BSD-2-Clause"
makedepends="cmake m4"
subpackages="$pkgname-dev"
source="https://github.com/csmith-project/csmith/archive/refs/tags/csmith-$pkgver.tar.gz
add_qnx_support.patch
"
builddir="$srcdir/$pkgname-$pkgname-$pkgver"

prepare() {
default_prepare
}

build() {
# bind2nd/ptr_fun removed in C++17; enum bitset non-constexpr with clang
# Suppress unused QNX-specific flags not supported on Alpine/musl
export CFLAGS="$CFLAGS \
-Wno-unused-command-line-argument"
export CXXFLAGS="$CXXFLAGS \
-std=c++14 \
-Wno-unused-command-line-argument \
-Wno-deprecated-declarations"

./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var
make
}

check() {
export CSMITH_HOME="$builddir"
cd scripts
perl compiler_test.pl 10 compiler_test.in

# perl compiler_test.pl <test_count> compiler_test.in [--with-wrong-code-bugs]

# Where:
# <test_count> is the number of tests to run (0 for unlimited)
# compiler_test.in is a file containing compiler commands to test
# --with-wrong-code-bugs enables testing for wrong-code bugs (not just crashes)
}

package() {
make DESTDIR="$pkgdir" install

# scripts depend on source tree to be available
rm "$pkgdir"/usr/bin/*.pl "$pkgdir"/usr/bin/*.in
}

sha512sums="
063dc6442a9e850fdd0557d1c7bdb199d5a762daad3418d6730dae6155101b2a11841d5eaf885f76dbea8eb212bdacedf31da7e171b4ac58f530acd435c969f9 csmith-2.3.0.tar.gz
f1df644b4bb204bd550606ec064dc325b7aab7cdb38c3932d1a26cd16dc221a2ecc1d26b04e19db7da5b08fd9ac685b878a56f4161fa56767b0aed96168a99d0 add_qnx_support.patch
"
14 changes: 14 additions & 0 deletions extra/csmith/add_qnx_support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- csmith-csmith-2.3.0.orig/src/Filter.h 2026-03-06 10:32:58.000000000 +0000
+++ csmith-csmith-2.3.0/src/Filter.h 2026-03-06 10:33:24.000000000 +0000
@@ -35,9 +35,10 @@
enum FilterKind {
fDefault,
fDFS,
+fFilterKindCount
};

-#define MAX_FILTER_KIND_SIZE ((FilterKind) (fDFS + 1))
+#define MAX_FILTER_KIND_SIZE (fFilterKindCount)

// Filter base class
class Filter