opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

Commit: 86e43d67e3a004ac2fca2d11ca99e6a2c51506af
Author: Randy Palamar
Date:   Sun, 24 Sep 2023 14:01:49 -0600

initial commit

Diffstat:
A.gitignore | 6++++++
A.gitmodules | 21+++++++++++++++++++++
ALICENSE | 30++++++++++++++++++++++++++++++
AREADME.md | 17+++++++++++++++++
Abuild.ninja | 2++
Aconfig.def.lua | 47+++++++++++++++++++++++++++++++++++++++++++++++
Agen.lua | 41+++++++++++++++++++++++++++++++++++++++++
Aninja.lua | 508+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/admin/gen.lua | 2++
Apkg/admin/pwgen/gen.lua | 17+++++++++++++++++
Apkg/admin/pwgen/src | 1+
Apkg/admin/pwgen/ver | 1+
Apkg/crypt/b3sum/.gitignore | 1+
Apkg/crypt/b3sum/gen.lua | 36++++++++++++++++++++++++++++++++++++
Apkg/crypt/b3sum/src | 1+
Apkg/crypt/b3sum/ver | 1+
Apkg/crypt/gen.lua | 1+
Apkg/devel/fspec-sync/.gitignore | 1+
Apkg/devel/fspec-sync/gen.lua | 28++++++++++++++++++++++++++++
Apkg/devel/fspec-sync/src | 1+
Apkg/devel/fspec-sync/ver | 1+
Apkg/devel/gen.lua | 4++++
Apkg/devel/linux-headers/.gitignore | 3+++
Apkg/devel/linux-headers/arm64.lua | 23+++++++++++++++++++++++
Apkg/devel/linux-headers/base.lua | 913+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/linux-headers/fetch.sh | 27+++++++++++++++++++++++++++
Apkg/devel/linux-headers/gen.lua | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/linux-headers/header.sed | 7+++++++
Apkg/devel/linux-headers/patch/0001-Only-use-inline-asm-in-headers-on-GNU-compatible-com.patch | 32++++++++++++++++++++++++++++++++
Apkg/devel/linux-headers/patch/0002-Revert-change-of-BPF_F_-to-enum-constants.patch | 32++++++++++++++++++++++++++++++++
Apkg/devel/linux-headers/patch/0003-Prevent-zero-length-array-members-in-asound.h.patch | 77+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/linux-headers/patch/0004-Make-struct-bpf_timer-include-a-named-member.patch | 32++++++++++++++++++++++++++++++++
Apkg/devel/linux-headers/patch/0005-nfc-uapi-remove-stray-semicolon-in-struct-declaratio.patch | 26++++++++++++++++++++++++++
Apkg/devel/linux-headers/sha256 | 1+
Apkg/devel/linux-headers/unistd.awk | 18++++++++++++++++++
Apkg/devel/linux-headers/url | 1+
Apkg/devel/linux-headers/ver | 1+
Apkg/devel/linux-headers/version.awk | 8++++++++
Apkg/devel/linux-headers/x86.lua | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/samurai/gen.lua | 20++++++++++++++++++++
Apkg/devel/samurai/src | 1+
Apkg/devel/samurai/ver | 1+
Apkg/devel/strace/.gitignore | 3+++
Apkg/devel/strace/README.md | 6++++++
Apkg/devel/strace/config.h | 489+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/gen.lua | 394+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/mpers.txt | 45+++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0001-Don-t-return-expression-in-void-function.patch | 25+++++++++++++++++++++++++
Apkg/devel/strace/patch/0002-Use-__typeof__-spelling-of-typeof.patch | 355+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0003-Make-tcp_sysent-a-static-inline-function.patch | 33+++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0004-Avoid-empty-initializer-lists.patch | 229+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0005-Avoid-pointer-arithmetic-on-void.patch | 152+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0006-Avoid-empty-struct-definition.patch | 38++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0007-Don-t-omit-second-operand-to-operator.patch | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0008-Avoid-unnecessary-VLAs.patch | 100+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0009-Avoid-index-ranges-and-empty-initializer-lists-in-sy.patch | 1048+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0010-Use-alloca-when-VLAs-aren-t-available.patch | 31+++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/0011-Avoid-index-ranges.patch | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/patch/1001-Prevent-zero-sized-arrays.patch | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/devel/strace/printerdecls.awk | 11+++++++++++
Apkg/devel/strace/printerdefs.awk | 8++++++++
Apkg/devel/strace/printers.awk | 19+++++++++++++++++++
Apkg/devel/strace/scno.awk | 11+++++++++++
Apkg/devel/strace/sen.awk | 16++++++++++++++++
Apkg/devel/strace/sha256 | 1+
Apkg/devel/strace/url | 1+
Apkg/devel/strace/ver | 1+
Apkg/editors/gen.lua | 2++
Apkg/editors/vis/gen.lua | 85+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/editors/vis/lua.txt | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/editors/vis/patch/0001-HACK-Avoid-wide-string-literals-for-now.patch | 27+++++++++++++++++++++++++++
Apkg/editors/vis/src | 1+
Apkg/editors/vis/ver | 1+
Apkg/gen.lua | 6++++++
Apkg/lang/awk/.gitignore | 1+
Apkg/lang/awk/gen.lua | 28++++++++++++++++++++++++++++
Apkg/lang/awk/src | 1+
Apkg/lang/awk/ver | 1+
Apkg/lang/gen.lua | 2++
Apkg/lang/lua/.gitignore | 2++
Apkg/lang/lua/gen.lua | 26++++++++++++++++++++++++++
Apkg/lang/lua/sha256 | 1+
Apkg/lang/lua/url | 1+
Apkg/lang/lua/ver | 1+
Apkg/libs/gen.lua | 3+++
Apkg/libs/libtermkey/.gitignore | 2++
Apkg/libs/libtermkey/gen.lua | 16++++++++++++++++
Apkg/libs/libtermkey/sha256 | 1+
Apkg/libs/libtermkey/url | 1+
Apkg/libs/libtermkey/ver | 1+
Apkg/libs/lpeg/.gitignore | 2++
Apkg/libs/lpeg/gen.lua | 17+++++++++++++++++
Apkg/libs/lpeg/sha256 | 1+
Apkg/libs/lpeg/url | 1+
Apkg/libs/lpeg/ver | 1+
Apkg/libs/netbsd-curses/.gitignore | 1+
Apkg/libs/netbsd-curses/gen.lua | 143+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/libs/netbsd-curses/patch/0001-Use-__fpurge-from-stdio_ext.h.patch | 33+++++++++++++++++++++++++++++++++
Apkg/libs/netbsd-curses/patch/0002-Remove-duplicate-keymap-sequences-from-st-terminfo.patch | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/libs/netbsd-curses/patch/0003-Revert-Fix-for-PR-lib-56224.patch | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/libs/netbsd-curses/patch/0004-Don-t-wrap-when-adding-past-last-line-in-non-scrolli.patch | 119+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/libs/netbsd-curses/patch/0005-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch | 28++++++++++++++++++++++++++++
Apkg/libs/netbsd-curses/src | 1+
Apkg/libs/netbsd-curses/ver | 1+
Aprobe/HAVE_EMMINTRIN_H | 4++++
Aprobe/HAVE_IMMINTRIN_H | 4++++
Aprobe/HAVE_INLINE_ASM | 4++++
Aprobe/HAVE_MMINTRIN_H | 4++++
Aprobe/HAVE__MM_MOVEMASK_EPI8 | 6++++++
Aprobe/HAVE__THREAD_LOCAL | 4++++
Aprobe/HAVE___BUILTIN_ASSUME_ALIGNED | 4++++
Aprobe/HAVE___BUILTIN_CHOOSE_EXPR | 3+++
Aprobe/HAVE___BUILTIN_CLZ | 4++++
Aprobe/HAVE___BUILTIN_CTZL | 4++++
Aprobe/HAVE___BUILTIN_POPCOUNT | 4++++
Aprobe/PIC | 3+++
Aprobe/SIZEOF_LONG | 1+
Aprobe/SIZEOF_SIZE_T | 2++
Aprobe/SIZEOF_TIME_T | 2++
Aprobe/gen.lua | 24++++++++++++++++++++++++
Arules.ninja | 132+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ascripts/checksum.sh | 10++++++++++
Ascripts/commit.sh | 29+++++++++++++++++++++++++++++
Ascripts/extract.sh | 18++++++++++++++++++
Ascripts/fetch-curl.sh | 28++++++++++++++++++++++++++++
Ascripts/fetch-git.sh | 13+++++++++++++
Ascripts/hash.sh | 23+++++++++++++++++++++++
Ascripts/outdated.py | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ascripts/perms.awk | 23+++++++++++++++++++++++
Ascripts/probe-size.sh | 22++++++++++++++++++++++
Ascripts/probe.sh | 13+++++++++++++
Ascripts/prune-config.sed | 9+++++++++
Ascripts/rsp.awk | 34++++++++++++++++++++++++++++++++++
Ascripts/tree.sh | 24++++++++++++++++++++++++
Asets.lua | 15+++++++++++++++
Asetup.lua | 145+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Atemplate/config | 8++++++++
Atemplate/hooks/post-checkout | 15+++++++++++++++
Atemplate/hooks/post-merge | 3+++
Atemplate/info/attributes | 2++
Atemplate/info/exclude | 1+
Atemplate/info/sparse-checkout | 4++++
142 files changed, 6966 insertions(+), 0 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -0,0 +1,6 @@ +/config.ninja +/config.lua +/out +fetch +local.ninja +.*.swp diff --git a/.gitmodules b/.gitmodules @@ -0,0 +1,21 @@ +[submodule "pkg/admin/pwgen/src"] + path = pkg/admin/pwgen/src + url = https://github.com/tytso/pwgen.git +[submodule "pkg/crypt/b3sum/src"] + path = pkg/crypt/b3sum/src + url = https://git.sr.ht/~mcf/b3sum +[submodule "pkg/crypt/fspec-sync/src"] + path = pkg/devel/fspec-sync/src + url = https://github.com/oasislinux/fspec-sync.git +[submodule "pkg/devel/samurai/src"] + path = pkg/devel/samurai/src + url = https://github.com/michaelforney/samurai.git +[submodule "pkg/editors/vis/src"] + path = pkg/editors/vis/src + url = https://github.com/martanne/vis.git +[submodule "pkg/lang/awk/src"] + path = pkg/lang/awk/src + url = https://github.com/onetrueawk/awk.git +[submodule "pkg/libs/netbsd-curses/src"] + path = pkg/libs/netbsd-curses/src + url = https://github.com/oasislinux/netbsd-curses.git diff --git a/LICENSE b/LICENSE @@ -0,0 +1,30 @@ +Copyright © 2016-2023 Michael Forney +Copyright © 2023 Randy Palamar + +Permission to use, copy, modify, and/or distribute this software for any purpose +with or without fee is hereby granted, provided that the above copyright notice +and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. +-------------------------------------------------------------------------------- +Several packages include one or more patch files in a patch/ directory that are +applied before building the software. All of these patches can be used under the +same terms as the files they change or are derived from in the respective +projects. Unless specified below, these patches are original work, taken +directly from upstream, or generated directly from scripts within the package's +source tree. + +pkg/unzip/patch/* + Taken from Debian's unzip package, + http://http.debian.net/debian/pool/main/u/unzip/unzip_6.0-16+deb8u2.debian.tar.xz +-------------------------------------------------------------------------------- +Many packages contain header files, usually named config.h or something along +those lines, are derived from files generated by the respective project's +configure scripts and/or Makefiles. They can be used under the terms of the +project to which they correspond. diff --git a/README.md b/README.md @@ -0,0 +1,17 @@ +opkg +==== + +This repo is adapted from [oasis][] and but rather then installing as +an OS it is meant to be installed alongside your existing system. + +The majority of things are unchanged. Most notably: + +* All packages are *statically linked!* + +Changes +------- +* Packages have been moved to sorted directories. +* Man pages are installed uncompressed. +* The set of packages is curated to my personal preferences. + +[oasis]: https://github.com/oasislinux/oasis diff --git a/build.ninja b/build.ninja @@ -0,0 +1 @@ +local.ninja +\ No newline at end of file diff --git a/config.def.lua b/config.def.lua @@ -0,0 +1,47 @@ +local sets = dofile(basedir..'/sets.lua') + +-- configuration table +local C = {} + +-- build output directory +C.builddir = 'out' + +--[[ +package/file selection + +Each entry contains a list of packages, a list of patterns to +include, and a list of patterns to exclude. If no patterns +are specified, all files from the package are included. + +You may also specify a list of patterns to include or exclude +for any packages not matching any entries. If no patterns are +specified, all files from the package are excluded. +include={...}, exclude={...}, +--]] +C.fs = { + { sets.bin, exclude = {'^include/', '^lib/.*%.a$'} }, + { sets.lib }, +} + +-- target toolchain and flags +C.target = { + platform='x86_64-gentoo-linux-musl', + cflags='-Os -fPIE -pipe', + ldflags='-s -static-pie', +} + +-- host toolchain and flags +C.host = { cflags = '-O2 -pipe', ldflags = '', } + +-- output git repository +C.repo = { + path='$builddir/root.git', + flags='--bare', + tag='tree', + branch='master', +} + +-- GPU driver (possible_values: amdgpu intel nouveau) +-- C.video_drivers={intel=true} + +return C diff --git a/gen.lua b/gen.lua @@ -0,0 +1,41 @@ +set('ninja_required_version', '1.8') + +set('basedir', basedir) +set('builddir', config.builddir) +set('dir', '$basedir') +set('outdir', '$builddir') + +set('repo', config.repo.path) +set('repo_flags', config.repo.flags) +set('repo_tag', config.repo.tag) +set('repo_branch', config.repo.branch) + +include '$basedir/rules.ninja' + +toolchain(config.target) + +subgen('probe') +subgen('pkg') + +build('awk', '$outdir/root.perms', {'$outdir/tree.fspec', '|', '$basedir/scripts/perms.awk'}, { + expr='-f $basedir/scripts/perms.awk', +}) +gitfile('.perms', '644', '$outdir/root.perms') + +build('git-init', '$outdir/root.stamp') +build('git-tree', '$outdir/root.tree', {'$outdir/root.index', '|', '$basedir/scripts/tree.sh', '||', '$outdir/root.stamp'}) +build('git-commit', '$outdir/root.commit', {'|', '$outdir/root.tree'}) +build('phony', 'commit', '$builddir/root.commit') + +build('fspec-sort', '$outdir/root.fspec', {'$outdir/tree.fspec', '|', '$builddir/pkg/devel/fspec-sync/host/fspec-sort'}) +build('fspec-tar', '$outdir/root.tar.zst', {'$outdir/root.fspec', '|', '$builddir/pkg/devel/fspec-sync/host/fspec-tar'}) + +--build('awk', '$outdir/root.sqfslist', {'$outdir/root.fspec', '|', '$basedir/scripts/squashfs.awk'}, { +-- expr='-f $basedir/scripts/squashfs.awk', +--}) +--rule('gensquashfs', 'gensquashfs -F $in -D . -f -c gzip $out') +--build('gensquashfs', '$outdir/root.squashfs', {'$outdir/root.sqfslist'}) + +build('phony', 'build.ninja', 'ninja', {generator='1'}) + +io.write('default $builddir/root.tree\n') diff --git a/ninja.lua b/ninja.lua @@ -0,0 +1,508 @@ +-- +-- utility functions +-- + +function string.hasprefix(s, prefix) + return s:sub(1, #prefix) == prefix +end + +function string.hassuffix(s, suffix) + return s:sub(-#suffix) == suffix +end + +-- collects the results of an iterator into a table +local function collect(f, s, i) + local t = {} + for v in f, s, i do + t[#t + 1] = v + end + return t +end + +-- collects the keys of a table into a sorted table +function table.keys(t, f) + local keys = collect(next, t) + table.sort(keys, f) + return keys +end + +-- iterates over the sorted keys and values of a table +function sortedpairs(t, f) + return function(s, i) + local k = s[i] + return k and i + 1, k, t[k] + end, table.keys(t, f), 1 +end + +-- yields string values of table or nested tables +local function stringsgen(t) + for _, val in ipairs(t) do + if type(val) == 'string' then + coroutine.yield(val) + else + stringsgen(val) + end + end +end + +function iterstrings(x) + return coroutine.wrap(stringsgen), x +end + +function strings(s) + return collect(iterstrings(s)) +end + +-- yields strings generated by concateting all strings in a table, for every +-- combination of strings in subtables +local function expandgen(t, i) + while true do + local val + i, val = next(t, i) + if not i then + coroutine.yield(table.concat(t)) + break + elseif type(val) == 'table' then + for opt in iterstrings(val) do + t[i] = opt + expandgen(t, i) + end + t[i] = val + break + end + end +end + +function expand(t) + return collect(coroutine.wrap(expandgen), t) +end + +-- yields expanded paths from the given path specification string +local function pathsgen(s, i) + local results = {} + local first = not i + while true do + i = s:find('[^%s]', i) + local _, j, arch = s:find('^@([^%s()]*)%s*[^%s]?', i) + if arch then i = j end + if not i or s:sub(i, i) == ')' then + break + end + local parts, nparts = {}, 0 + local c + while true do + local j = s:find('[%s()]', i) + if not j or j > i then + nparts = nparts + 1 + parts[nparts] = s:sub(i, j and j - 1) + end + i = j + c = i and s:sub(i, i) + if c == '(' then + local opts, nopts = {}, 0 + local fn = coroutine.wrap(pathsgen) + local opt + opt, i = fn(s, i + 1) + while opt do + nopts = nopts + 1 + opts[nopts] = opt + opt, i = fn(s) + end + nparts = nparts + 1 + parts[nparts] = opts + if not i or s:sub(i, i) ~= ')' then + error('unmatched (') + end + i = i + 1 + c = s:sub(i, i) + else + break + end + end + if not arch or arch == config.target.platform:match('[^-]*') then + expandgen(parts) + end + if not c or c == ')' then + break + end + end + if first and i then + error('unmatched )') + end + return nil, i +end + +function iterpaths(s) + return coroutine.wrap(pathsgen), s +end + +function paths(s) + return collect(iterpaths(s)) +end + +-- yields non-empty non-comment lines in a file +local function linesgen(file) + for line in io.lines(file) do + if #line > 0 and not line:hasprefix('#') then + coroutine.yield(line) + end + end +end + +function iterlines(file, raw) + table.insert(pkg.inputs.gen, '$dir/'..file) + file = string.format('%s/%s/%s', basedir, pkg.gendir, file) + if raw then + return io.lines(file) + end + return coroutine.wrap(linesgen), file +end + +function lines(file, raw) + return collect(iterlines(file, raw)) +end + +function load(file) + table.insert(pkg.inputs.gen, '$dir/'..file) + return dofile(string.format('%s/%s/%s', basedir, pkg.gendir, file)) +end + +-- +-- base constructs +-- + +function set(var, val, indent) + if type(val) == 'table' then + val = table.concat(val, ' ') + end + io.write(string.format('%s%s = %s\n', indent or '', var, val)) +end + +function subninja(file) + if not file:match('^[$/]') then + file = '$gendir/'..file + end + io.write(string.format('subninja %s\n', file)) +end + +function include(file) + io.write(string.format('include %s\n', file)) +end + +local function let(bindings) + for var, val in pairs(bindings) do + set(var, val, ' ') + end +end + +function rule(name, cmd, bindings) + io.write(string.format('rule %s\n command = %s\n', name, cmd)) + if bindings then + let(bindings) + end +end + +function build(rule, outputs, inputs, bindings) + if type(outputs) == 'table' then + outputs = table.concat(strings(outputs), ' ') + end + if not inputs then + inputs = '' + elseif type(inputs) == 'table' then + local srcs, nsrcs = {}, 0 + for src in iterstrings(inputs) do + nsrcs = nsrcs + 1 + srcs[nsrcs] = src + if src:hasprefix('$srcdir/') then + pkg.inputs.fetch[src] = true + end + end + inputs = table.concat(srcs, ' ') + elseif inputs:hasprefix('$srcdir/') then + pkg.inputs.fetch[inputs] = true + end + io.write(string.format('build %s: %s %s\n', outputs, rule, inputs)) + if bindings then + let(bindings) + end +end + +-- +-- higher-level rules +-- + +function sub(name, fn) + local old = io.output() + io.output(pkg.gendir..'/'..name) + fn() + io.output(old) + subninja(name) +end + +function toolchain(tc) + set('ar', tc.ar or (tc.platform and tc.platform..'-ar') or 'ar') + set('as', tc.as or (tc.platform and tc.platform..'-as') or 'as') + set('cc', tc.cc or (tc.platform and tc.platform..'-cc') or 'cc') + set('ld', tc.ld or (tc.platform and tc.platform..'-ld') or 'ld') + set('objcopy', tc.objcopy or (tc.platform and tc.platform..'-objcopy') or 'objcopy') + set('mc', tc.mc or 'false') + + set('cflags', tc.cflags) + set('ldflags', tc.ldflags) +end + +function phony(name, inputs) + build('phony', '$gendir/'..name, inputs) +end + +function cflags(flags) + set('cflags', '$cflags '..table.concat(flags, ' ')) +end + +function nasmflags(flags) + set('nasmflags', '$nasmflags '..table.concat(flags, ' ')) +end + +function compile(rule, src, deps, args) + local obj = src..'.o' + if not src:match('^[$/]') then + src = '$srcdir/'..src + obj = '$outdir/'..obj + end + if not deps and pkg.deps then + deps = '$gendir/deps' + end + if deps then + src = {src, '||', deps} + end + build(rule, obj, src, args) + return obj +end + +function cc(src, deps, args) + return compile('cc', src, deps, args) +end + +function objects(srcs, deps, args) + local objs, nobjs = {}, 0 + local rules = { + c='cc', + s='cc', + S='cc', + cc='cc', + cpp='cc', + asm='nasm', + } + local fn + if type(srcs) == 'string' then + fn = coroutine.wrap(pathsgen) + else + fn = coroutine.wrap(stringsgen) + end + for src in fn, srcs do + local rule = rules[src:match('[^.]*$')] + if rule then + src = compile(rule, src, deps, args) + end + nobjs = nobjs + 1 + objs[nobjs] = src + end + return objs +end + +function link(out, files, args) + local objs = {} + local deps = {} + for _, file in ipairs(files) do + if not file:match('^[$/]') then + file = '$outdir/'..file + end + if file:hassuffix('.d') then + deps[#deps + 1] = file + else + objs[#objs + 1] = file + end + end + out = '$outdir/'..out + if not args then + args = {} + end + if next(deps) then + local rsp = out..'.rsp' + build('awk', rsp, {deps, '|', '$basedir/scripts/rsp.awk'}, {expr='-f $basedir/scripts/rsp.awk'}) + objs[#objs + 1] = '|' + objs[#objs + 1] = rsp + args.ldlibs = '@'..rsp + end + build('link', out, objs, args) + return out +end + +function ar(out, files) + out = '$outdir/'..out + local objs, nobjs = {}, 0 + local deps, ndeps = {out}, 1 + for _, file in ipairs(files) do + if not file:match('^[$/]') then + file = '$outdir/'..file + end + if file:find('%.[ad]$') then + ndeps = ndeps + 1 + deps[ndeps] = file + else + nobjs = nobjs + 1 + objs[nobjs] = file + end + end + build('ar', out, objs) + build('rsp', out..'.d', deps) +end + +function lib(out, srcs, deps) + return ar(out, objects(srcs, deps)) +end + +function exe(out, srcs, deps, args) + return link(out, objects(srcs, deps), args) +end + +function yacc(name, gram) + if not gram:match('^[$/]') then + gram = '$srcdir/'..gram + end + build('yacc', expand{'$outdir/', name, {'.tab.c', '.tab.h'}}, gram, { + yaccflags='-d -b $outdir/'..name, + }) +end + +function waylandproto(proto, outs, args) + proto = '$srcdir/'..proto + if outs.client then + build('wayland-proto', '$outdir/'..outs.client, proto, {type='client-header'}) + end + if outs.server then + build('wayland-proto', '$outdir/'..outs.server, proto, {type='server-header'}) + end + if outs.code then + local code = '$outdir/'..outs.code + build('wayland-proto', code, proto, {type='public-code'}) + cc(code, {'pkg/wayland/headers'}, args) + end +end + +function fetch(method) + local script + if method == 'local' then + script = '$dir/fetch.sh' + else + script = '$basedir/scripts/fetch-'..method..'.sh' + end + build('fetch', '$dir/fetch', {'|', '$dir/ver', script}, {script=script}) + if basedir ~= '.' then + build('phony', '$gendir/fetch', '$dir/fetch') + end + if next(pkg.inputs.fetch) then + build('phony', table.keys(pkg.inputs.fetch), '$dir/fetch') + end +end + +local function findany(path, pats) + for _, pat in pairs(pats) do + if path:find(pat) then + return true + end + end + return false +end + +local function specmatch(spec, path) + if spec.include and not findany(path, spec.include) then + return false + end + if spec.exclude and findany(path, spec.exclude) then + return false + end + return true +end + +local function fs(name, path) + for _, spec in ipairs(config.fs) do + for specname in iterstrings(spec) do + if name == specname then + return specmatch(spec, path) + end + end + end + return (config.fs.include or config.fs.exclude) and specmatch(config.fs, path) +end + +function gitfile(path, mode, src) + local out = '$builddir/root.hash/'..path + local perm = ('10%04o %s'):format(tonumber(mode, 8), path) + build('git-hash', out, {src, '|', '$basedir/scripts/hash.sh', '||', '$builddir/root.stamp'}, { + args=perm, + }) + table.insert(pkg.inputs.index, out) +end + +function file(path, mode, src) + if pkg.gendir:hasprefix('pkg/') and not fs(pkg.name, path) then + return + end + mode = ('%04o'):format(tonumber(mode, 8)) + pkg.fspec[path] = { + type='reg', + mode=mode, + source=src:gsub('^%$(%w+)', pkg, 1), + } + gitfile(path, mode, src) +end + +function dir(path, mode) + if pkg.gendir:hasprefix('pkg/') and not fs(pkg.name, path) then + return + end + pkg.fspec[path] = { + type='dir', + mode=('%04o'):format(tonumber(mode, 8)), + } +end + +function sym(path, target) + if pkg.gendir:hasprefix('pkg/') and not fs(pkg.name, path) then + return + end + pkg.fspec[path] = { + type='sym', + mode='0777', + target=target, + } + local out = '$builddir/root.hash/'..path + build('git-hash', out, {'|', '$basedir/scripts/hash.sh', '||', '$builddir/root.stamp'}, { + args=string.format('120000 %s %s', path, target), + }) + table.insert(pkg.inputs.index, out) +end + +function man(srcs, section) + for _, src in ipairs(srcs) do + if not src:match('^[$/]') then + src = '$srcdir/'..src + end + local i = src:find('/', 1, true) + local gz = '$outdir'..src:sub(i)..'.gz' + build('gzip', gz, src) + local srcsection = section or src:match('[^.]*$') + file('share/man/man'..srcsection..'/'..gz:match('[^/]*$'), '644', gz) + end +end + +function copy(outdir, srcdir, files) + local outs = {} + for i, file in ipairs(files) do + local out = outdir..'/'..file + outs[i] = out + build('copy', out, srcdir..'/'..file) + end + return outs +end diff --git a/pkg/admin/gen.lua b/pkg/admin/gen.lua @@ -0,0 +1 @@ +subgen('pwgen') +\ No newline at end of file diff --git a/pkg/admin/pwgen/gen.lua b/pkg/admin/pwgen/gen.lua @@ -0,0 +1,17 @@ +cflags({ + '-std=c99 -Wall -Wpedantic', + '-D _POSIX_C_SOURCE=200809L', +}) + +exe('pwgen', { + 'pwgen.c', + 'pw_phonemes.c', + 'pw_rand.c', + 'randnum.c', + 'sha1.c', + 'sha1num.c', +}) +file('bin/pwgen', '755', '$outdir/pwgen') +man({'pwgen.1'}) + +fetch('git') diff --git a/pkg/admin/pwgen/src b/pkg/admin/pwgen/src @@ -0,0 +1 @@ +Subproject commit c25787fce93b2c99efd87219585c0531e80b6d1c diff --git a/pkg/admin/pwgen/ver b/pkg/admin/pwgen/ver @@ -0,0 +1 @@ +2.08 r0 diff --git a/pkg/crypt/b3sum/.gitignore b/pkg/crypt/b3sum/.gitignore @@ -0,0 +1 @@ +/host.ninja diff --git a/pkg/crypt/b3sum/gen.lua b/pkg/crypt/b3sum/gen.lua @@ -0,0 +1,36 @@ +cflags({ + '-std=c99', '-Wall', '-Wpedantic', + '-D WITH_ASM', +}) + +pkg.hdrs = { + copy('$outdir/include', '$srcdir', {'blake3.h'}), + install=true, +} + +sub('host.ninja', function() + set('outdir', '$outdir/host') + toolchain(config.host) + + lib('libblake3.a', {'blake3.c', 'blake3_dispatch.c', 'blake3_portable.c'}) +end) + +lib('libblake3.a', [[ + blake3.c + blake3_dispatch.c + blake3_portable.c + @x86_64 ( + blake3_cpuid.S + blake3_avx2_x86-64_unix.S + blake3_avx512_x86-64_unix.S + blake3_sse2_x86-64_unix.S + blake3_sse41_x86-64_unix.S + ) +]]) +file('lib/libblake3.a', '644', '$outdir/libblake3.a') + +exe('b3sum', {'b3sum.c', 'libblake3.a'}) +file('bin/b3sum', '755', '$outdir/b3sum') +man({'b3sum.1'}) + +fetch('git') diff --git a/pkg/crypt/b3sum/src b/pkg/crypt/b3sum/src @@ -0,0 +1 @@ +Subproject commit cb4111ccc8061039b014fbb657c72f78984f1069 diff --git a/pkg/crypt/b3sum/ver b/pkg/crypt/b3sum/ver @@ -0,0 +1 @@ +1.3.1 r0 diff --git a/pkg/crypt/gen.lua b/pkg/crypt/gen.lua @@ -0,0 +1 @@ +subgen('b3sum') diff --git a/pkg/devel/fspec-sync/.gitignore b/pkg/devel/fspec-sync/.gitignore @@ -0,0 +1 @@ +/host.ninja diff --git a/pkg/devel/fspec-sync/gen.lua b/pkg/devel/fspec-sync/gen.lua @@ -0,0 +1,28 @@ +cflags({ + '-std=c99', '-Wall', '-Wpedantic', '-Wno-maybe-uninitialized', + '-isystem $builddir/pkg/crypt/b3sum/include', +}) + +sub('host.ninja', function() + set('outdir', '$outdir/host') + toolchain(config.host) + cflags({'-isystem $builddir/pkg/crypt/b3sum/include'}) + + lib('libcommon.a', {'fatal.c', 'parse.c', 'reallocarray.c'}) + exe('fspec-hash', {'fspec-hash.c', 'libcommon.a', '$builddir/pkg/crypt/b3sum/host/libblake3.a'}, {'pkg/crypt/b3sum/headers'}) + exe('fspec-sort', {'fspec-sort.c', 'libcommon.a'}) + exe('fspec-tar', {'fspec-tar.c', 'libcommon.a'}) +end) + +lib('libcommon.a', {'fatal.c', 'parse.c', 'reallocarray.c'}) + +exe('fspec-hash', {'fspec-hash.c', 'libcommon.a', '$builddir/pkg/crypt/b3sum/libblake3.a'}, {'pkg/crypt/b3sum/headers'}) +file('bin/fspec-hash', '755', '$outdir/fspec-hash') + +exe('fspec-sort', {'fspec-sort.c', 'libcommon.a'}) +file('bin/fspec-sort', '755', '$outdir/fspec-sort') + +exe('fspec-tar', {'fspec-tar.c', 'libcommon.a'}) +file('bin/fspec-tar', '755', '$outdir/fspec-tar') + +fetch('git') diff --git a/pkg/devel/fspec-sync/src b/pkg/devel/fspec-sync/src @@ -0,0 +1 @@ +Subproject commit a79592936c865e001ac3003dddc5f60f0bada97e diff --git a/pkg/devel/fspec-sync/ver b/pkg/devel/fspec-sync/ver @@ -0,0 +1 @@ +a79592936c r0 diff --git a/pkg/devel/gen.lua b/pkg/devel/gen.lua @@ -0,0 +1,4 @@ +subgen('fspec-sync') +subgen('linux-headers') +subgen('samurai') +subgen('strace') diff --git a/pkg/devel/linux-headers/.gitignore b/pkg/devel/linux-headers/.gitignore @@ -0,0 +1,3 @@ +/linux-6.4.tar.xz +/src +/tools.ninja diff --git a/pkg/devel/linux-headers/arm64.lua b/pkg/devel/linux-headers/arm64.lua @@ -0,0 +1,23 @@ +return { + -- <cd src/arch/arm64/include/uapi && find * -name '*.h' -exec printf "\t'%s',\n" {} + | LC_COLLATE=C sort + 'asm/auxvec.h', + 'asm/bitsperlong.h', + 'asm/bpf_perf_event.h', + 'asm/byteorder.h', + 'asm/fcntl.h', + 'asm/hwcap.h', + 'asm/kvm.h', + 'asm/mman.h', + 'asm/param.h', + 'asm/perf_regs.h', + 'asm/posix_types.h', + 'asm/ptrace.h', + 'asm/setup.h', + 'asm/sigcontext.h', + 'asm/signal.h', + 'asm/statfs.h', + 'asm/sve_context.h', + 'asm/ucontext.h', + 'asm/unistd.h', + unistd={}, +} diff --git a/pkg/devel/linux-headers/base.lua b/pkg/devel/linux-headers/base.lua @@ -0,0 +1,913 @@ +return { + -- <cd src/include/uapi && find * -name '*.h' -exec printf "\t'%s',\n" {} + | LC_COLLATE=C sort + 'asm-generic/auxvec.h', + 'asm-generic/bitsperlong.h', + 'asm-generic/bpf_perf_event.h', + 'asm-generic/errno-base.h', + 'asm-generic/errno.h', + 'asm-generic/fcntl.h', + 'asm-generic/hugetlb_encode.h', + 'asm-generic/int-l64.h', + 'asm-generic/int-ll64.h', + 'asm-generic/ioctl.h', + 'asm-generic/ioctls.h', + 'asm-generic/ipcbuf.h', + 'asm-generic/kvm_para.h', + 'asm-generic/mman-common.h', + 'asm-generic/mman.h', + 'asm-generic/msgbuf.h', + 'asm-generic/param.h', + 'asm-generic/poll.h', + 'asm-generic/posix_types.h', + 'asm-generic/resource.h', + 'asm-generic/sembuf.h', + 'asm-generic/setup.h', + 'asm-generic/shmbuf.h', + 'asm-generic/siginfo.h', + 'asm-generic/signal-defs.h', + 'asm-generic/signal.h', + 'asm-generic/socket.h', + 'asm-generic/sockios.h', + 'asm-generic/stat.h', + 'asm-generic/statfs.h', + 'asm-generic/swab.h', + 'asm-generic/termbits-common.h', + 'asm-generic/termbits.h', + 'asm-generic/termios.h', + 'asm-generic/types.h', + 'asm-generic/ucontext.h', + 'asm-generic/unistd.h', + 'drm/amdgpu_drm.h', + 'drm/armada_drm.h', + 'drm/drm.h', + 'drm/drm_fourcc.h', + 'drm/drm_mode.h', + 'drm/drm_sarea.h', + 'drm/etnaviv_drm.h', + 'drm/exynos_drm.h', + 'drm/habanalabs_accel.h', + 'drm/i915_drm.h', + 'drm/ivpu_accel.h', + 'drm/lima_drm.h', + 'drm/msm_drm.h', + 'drm/nouveau_drm.h', + 'drm/omap_drm.h', + 'drm/panfrost_drm.h', + 'drm/qaic_accel.h', + 'drm/qxl_drm.h', + 'drm/radeon_drm.h', + 'drm/tegra_drm.h', + 'drm/v3d_drm.h', + 'drm/vc4_drm.h', + 'drm/vgem_drm.h', + 'drm/virtgpu_drm.h', + 'drm/vmwgfx_drm.h', + 'linux/a.out.h', + 'linux/acct.h', + 'linux/acrn.h', + 'linux/adb.h', + 'linux/adfs_fs.h', + 'linux/affs_hardblocks.h', + 'linux/agpgart.h', + 'linux/aio_abi.h', + 'linux/am437x-vpfe.h', + 'linux/amt.h', + 'linux/android/binder.h', + 'linux/android/binderfs.h', + 'linux/apm_bios.h', + 'linux/arcfb.h', + 'linux/arm_sdei.h', + 'linux/aspeed-lpc-ctrl.h', + 'linux/aspeed-p2a-ctrl.h', + 'linux/aspeed-video.h', + 'linux/atalk.h', + 'linux/atm.h', + 'linux/atm_eni.h', + 'linux/atm_he.h', + 'linux/atm_idt77105.h', + 'linux/atm_nicstar.h', + 'linux/atm_tcp.h', + 'linux/atm_zatm.h', + 'linux/atmapi.h', + 'linux/atmarp.h', + 'linux/atmbr2684.h', + 'linux/atmclip.h', + 'linux/atmdev.h', + 'linux/atmioc.h', + 'linux/atmlec.h', + 'linux/atmmpc.h', + 'linux/atmppp.h', + 'linux/atmsap.h', + 'linux/atmsvc.h', + 'linux/audit.h', + 'linux/auto_dev-ioctl.h', + 'linux/auto_fs.h', + 'linux/auto_fs4.h', + 'linux/auxvec.h', + 'linux/ax25.h', + 'linux/batadv_packet.h', + 'linux/batman_adv.h', + 'linux/baycom.h', + 'linux/bcm933xx_hcs.h', + 'linux/bfs_fs.h', + 'linux/binfmts.h', + 'linux/blkpg.h', + 'linux/blktrace_api.h', + 'linux/blkzoned.h', + 'linux/bpf.h', + 'linux/bpf_common.h', + 'linux/bpf_perf_event.h', + 'linux/bpfilter.h', + 'linux/bpqether.h', + 'linux/bsg.h', + 'linux/bt-bmc.h', + 'linux/btf.h', + 'linux/btrfs.h', + 'linux/btrfs_tree.h', + 'linux/byteorder/big_endian.h', + 'linux/byteorder/little_endian.h', + 'linux/cachefiles.h', + 'linux/caif/caif_socket.h', + 'linux/caif/if_caif.h', + 'linux/can.h', + 'linux/can/bcm.h', + 'linux/can/error.h', + 'linux/can/gw.h', + 'linux/can/isotp.h', + 'linux/can/j1939.h', + 'linux/can/netlink.h', + 'linux/can/raw.h', + 'linux/can/vxcan.h', + 'linux/capability.h', + 'linux/capi.h', + 'linux/cciss_defs.h', + 'linux/cciss_ioctl.h', + 'linux/ccs.h', + 'linux/cdrom.h', + 'linux/cec-funcs.h', + 'linux/cec.h', + 'linux/cfm_bridge.h', + 'linux/cgroupstats.h', + 'linux/chio.h', + 'linux/cifs/cifs_mount.h', + 'linux/cifs/cifs_netlink.h', + 'linux/close_range.h', + 'linux/cn_proc.h', + 'linux/coda.h', + 'linux/coff.h', + 'linux/comedi.h', + 'linux/connector.h', + 'linux/const.h', + 'linux/coresight-stm.h', + 'linux/counter.h', + 'linux/cramfs_fs.h', + 'linux/cryptouser.h', + 'linux/cuda.h', + 'linux/cxl_mem.h', + 'linux/cyclades.h', + 'linux/cycx_cfm.h', + 'linux/dcbnl.h', + 'linux/dccp.h', + 'linux/devlink.h', + 'linux/dlm.h', + 'linux/dlm_device.h', + 'linux/dlm_plock.h', + 'linux/dlmconstants.h', + 'linux/dm-ioctl.h', + 'linux/dm-log-userspace.h', + 'linux/dma-buf.h', + 'linux/dma-heap.h', + 'linux/dns_resolver.h', + 'linux/dqblk_xfs.h', + 'linux/dvb/audio.h', + 'linux/dvb/ca.h', + 'linux/dvb/dmx.h', + 'linux/dvb/frontend.h', + 'linux/dvb/net.h', + 'linux/dvb/osd.h', + 'linux/dvb/version.h', + 'linux/dvb/video.h', + 'linux/dw100.h', + 'linux/edd.h', + 'linux/efs_fs_sb.h', + 'linux/elf-em.h', + 'linux/elf-fdpic.h', + 'linux/elf.h', + 'linux/errno.h', + 'linux/errqueue.h', + 'linux/erspan.h', + 'linux/ethtool.h', + 'linux/ethtool_netlink.h', + 'linux/eventpoll.h', + 'linux/ext4.h', + 'linux/f2fs.h', + 'linux/fadvise.h', + 'linux/falloc.h', + 'linux/fanotify.h', + 'linux/fb.h', + 'linux/fcntl.h', + 'linux/fd.h', + 'linux/fdreg.h', + 'linux/fib_rules.h', + 'linux/fiemap.h', + 'linux/filter.h', + 'linux/firewire-cdev.h', + 'linux/firewire-constants.h', + 'linux/fou.h', + 'linux/fpga-dfl.h', + 'linux/fs.h', + 'linux/fscrypt.h', + 'linux/fsi.h', + 'linux/fsl_hypervisor.h', + 'linux/fsl_mc.h', + 'linux/fsmap.h', + 'linux/fsverity.h', + 'linux/fuse.h', + 'linux/futex.h', + 'linux/gameport.h', + 'linux/gen_stats.h', + 'linux/genetlink.h', + 'linux/genwqe/genwqe_card.h', + 'linux/gfs2_ondisk.h', + 'linux/gpio.h', + 'linux/gsmmux.h', + 'linux/gtp.h', + 'linux/handshake.h', + 'linux/hash_info.h', + 'linux/hdlc.h', + 'linux/hdlc/ioctl.h', + 'linux/hdlcdrv.h', + 'linux/hdreg.h', + 'linux/hid.h', + 'linux/hiddev.h', + 'linux/hidraw.h', + 'linux/hpet.h', + 'linux/hsi/cs-protocol.h', + 'linux/hsi/hsi_char.h', + 'linux/hsr_netlink.h', + 'linux/hw_breakpoint.h', + 'linux/hyperv.h', + 'linux/i2c-dev.h', + 'linux/i2c.h', + 'linux/i2o-dev.h', + 'linux/i8k.h', + 'linux/icmp.h', + 'linux/icmpv6.h', + 'linux/idxd.h', + 'linux/if.h', + 'linux/if_addr.h', + 'linux/if_addrlabel.h', + 'linux/if_alg.h', + 'linux/if_arcnet.h', + 'linux/if_arp.h', + 'linux/if_bonding.h', + 'linux/if_bridge.h', + 'linux/if_cablemodem.h', + 'linux/if_eql.h', + 'linux/if_ether.h', + 'linux/if_fc.h', + 'linux/if_fddi.h', + 'linux/if_hippi.h', + 'linux/if_infiniband.h', + 'linux/if_link.h', + 'linux/if_ltalk.h', + 'linux/if_macsec.h', + 'linux/if_packet.h', + 'linux/if_phonet.h', + 'linux/if_plip.h', + 'linux/if_ppp.h', + 'linux/if_pppol2tp.h', + 'linux/if_pppox.h', + 'linux/if_slip.h', + 'linux/if_team.h', + 'linux/if_tun.h', + 'linux/if_tunnel.h', + 'linux/if_vlan.h', + 'linux/if_x25.h', + 'linux/if_xdp.h', + 'linux/ife.h', + 'linux/igmp.h', + 'linux/iio/buffer.h', + 'linux/iio/events.h', + 'linux/iio/types.h', + 'linux/ila.h', + 'linux/in.h', + 'linux/in6.h', + 'linux/in_route.h', + 'linux/inet_diag.h', + 'linux/inotify.h', + 'linux/input-event-codes.h', + 'linux/input.h', + 'linux/io_uring.h', + 'linux/ioam6.h', + 'linux/ioam6_genl.h', + 'linux/ioam6_iptunnel.h', + 'linux/ioctl.h', + 'linux/iommu.h', + 'linux/iommufd.h', + 'linux/ioprio.h', + 'linux/ip.h', + 'linux/ip6_tunnel.h', + 'linux/ip_vs.h', + 'linux/ipc.h', + 'linux/ipmi.h', + 'linux/ipmi_bmc.h', + 'linux/ipmi_msgdefs.h', + 'linux/ipmi_ssif_bmc.h', + 'linux/ipsec.h', + 'linux/ipv6.h', + 'linux/ipv6_route.h', + 'linux/irqnr.h', + 'linux/isdn/capicmd.h', + 'linux/iso_fs.h', + 'linux/isst_if.h', + 'linux/ivtv.h', + 'linux/ivtvfb.h', + 'linux/jffs2.h', + 'linux/joystick.h', + 'linux/kcm.h', + 'linux/kcmp.h', + 'linux/kcov.h', + 'linux/kd.h', + 'linux/kdev_t.h', + 'linux/kernel-page-flags.h', + 'linux/kernel.h', + 'linux/kernelcapi.h', + 'linux/kexec.h', + 'linux/keyboard.h', + 'linux/keyctl.h', + 'linux/kfd_ioctl.h', + 'linux/kfd_sysfs.h', + 'linux/kvm.h', + 'linux/kvm_para.h', + 'linux/l2tp.h', + 'linux/landlock.h', + 'linux/libc-compat.h', + 'linux/limits.h', + 'linux/lirc.h', + 'linux/llc.h', + 'linux/loadpin.h', + 'linux/loop.h', + 'linux/lp.h', + 'linux/lwtunnel.h', + 'linux/magic.h', + 'linux/major.h', + 'linux/map_to_14segment.h', + 'linux/map_to_7segment.h', + 'linux/matroxfb.h', + 'linux/max2175.h', + 'linux/mctp.h', + 'linux/mdio.h', + 'linux/media-bus-format.h', + 'linux/media.h', + 'linux/mei.h', + 'linux/mei_uuid.h', + 'linux/membarrier.h', + 'linux/memfd.h', + 'linux/mempolicy.h', + 'linux/mii.h', + 'linux/minix_fs.h', + 'linux/misc/bcm_vk.h', + 'linux/mman.h', + 'linux/mmc/ioctl.h', + 'linux/mmtimer.h', + 'linux/module.h', + 'linux/mount.h', + 'linux/mpls.h', + 'linux/mpls_iptunnel.h', + 'linux/mptcp.h', + 'linux/mqueue.h', + 'linux/mroute.h', + 'linux/mroute6.h', + 'linux/mrp_bridge.h', + 'linux/msdos_fs.h', + 'linux/msg.h', + 'linux/mtio.h', + 'linux/nbd-netlink.h', + 'linux/nbd.h', + 'linux/ncsi.h', + 'linux/ndctl.h', + 'linux/neighbour.h', + 'linux/net.h', + 'linux/net_dropmon.h', + 'linux/net_namespace.h', + 'linux/net_tstamp.h', + 'linux/netconf.h', + 'linux/netdev.h', + 'linux/netdevice.h', + 'linux/netfilter.h', + 'linux/netfilter/ipset/ip_set.h', + 'linux/netfilter/ipset/ip_set_bitmap.h', + 'linux/netfilter/ipset/ip_set_hash.h', + 'linux/netfilter/ipset/ip_set_list.h', + 'linux/netfilter/nf_conntrack_common.h', + 'linux/netfilter/nf_conntrack_ftp.h', + 'linux/netfilter/nf_conntrack_sctp.h', + 'linux/netfilter/nf_conntrack_tcp.h', + 'linux/netfilter/nf_conntrack_tuple_common.h', + 'linux/netfilter/nf_log.h', + 'linux/netfilter/nf_nat.h', + 'linux/netfilter/nf_synproxy.h', + 'linux/netfilter/nf_tables.h', + 'linux/netfilter/nf_tables_compat.h', + 'linux/netfilter/nfnetlink.h', + 'linux/netfilter/nfnetlink_acct.h', + 'linux/netfilter/nfnetlink_compat.h', + 'linux/netfilter/nfnetlink_conntrack.h', + 'linux/netfilter/nfnetlink_cthelper.h', + 'linux/netfilter/nfnetlink_cttimeout.h', + 'linux/netfilter/nfnetlink_hook.h', + 'linux/netfilter/nfnetlink_log.h', + 'linux/netfilter/nfnetlink_osf.h', + 'linux/netfilter/nfnetlink_queue.h', + 'linux/netfilter/x_tables.h', + 'linux/netfilter/xt_AUDIT.h', + 'linux/netfilter/xt_CHECKSUM.h', + 'linux/netfilter/xt_CLASSIFY.h', + 'linux/netfilter/xt_CONNMARK.h', + 'linux/netfilter/xt_CONNSECMARK.h', + 'linux/netfilter/xt_CT.h', + 'linux/netfilter/xt_DSCP.h', + 'linux/netfilter/xt_HMARK.h', + 'linux/netfilter/xt_IDLETIMER.h', + 'linux/netfilter/xt_LED.h', + 'linux/netfilter/xt_LOG.h', + 'linux/netfilter/xt_MARK.h', + 'linux/netfilter/xt_NFLOG.h', + 'linux/netfilter/xt_NFQUEUE.h', + 'linux/netfilter/xt_RATEEST.h', + 'linux/netfilter/xt_SECMARK.h', + 'linux/netfilter/xt_SYNPROXY.h', + 'linux/netfilter/xt_TCPMSS.h', + 'linux/netfilter/xt_TCPOPTSTRIP.h', + 'linux/netfilter/xt_TEE.h', + 'linux/netfilter/xt_TPROXY.h', + 'linux/netfilter/xt_addrtype.h', + 'linux/netfilter/xt_bpf.h', + 'linux/netfilter/xt_cgroup.h', + 'linux/netfilter/xt_cluster.h', + 'linux/netfilter/xt_comment.h', + 'linux/netfilter/xt_connbytes.h', + 'linux/netfilter/xt_connlabel.h', + 'linux/netfilter/xt_connlimit.h', + 'linux/netfilter/xt_connmark.h', + 'linux/netfilter/xt_conntrack.h', + 'linux/netfilter/xt_cpu.h', + 'linux/netfilter/xt_dccp.h', + 'linux/netfilter/xt_devgroup.h', + 'linux/netfilter/xt_dscp.h', + 'linux/netfilter/xt_ecn.h', + 'linux/netfilter/xt_esp.h', + 'linux/netfilter/xt_hashlimit.h', + 'linux/netfilter/xt_helper.h', + 'linux/netfilter/xt_ipcomp.h', + 'linux/netfilter/xt_iprange.h', + 'linux/netfilter/xt_ipvs.h', + 'linux/netfilter/xt_l2tp.h', + 'linux/netfilter/xt_length.h', + 'linux/netfilter/xt_limit.h', + 'linux/netfilter/xt_mac.h', + 'linux/netfilter/xt_mark.h', + 'linux/netfilter/xt_multiport.h', + 'linux/netfilter/xt_nfacct.h', + 'linux/netfilter/xt_osf.h', + 'linux/netfilter/xt_owner.h', + 'linux/netfilter/xt_physdev.h', + 'linux/netfilter/xt_pkttype.h', + 'linux/netfilter/xt_policy.h', + 'linux/netfilter/xt_quota.h', + 'linux/netfilter/xt_rateest.h', + 'linux/netfilter/xt_realm.h', + 'linux/netfilter/xt_recent.h', + 'linux/netfilter/xt_rpfilter.h', + 'linux/netfilter/xt_sctp.h', + 'linux/netfilter/xt_set.h', + 'linux/netfilter/xt_socket.h', + 'linux/netfilter/xt_state.h', + 'linux/netfilter/xt_statistic.h', + 'linux/netfilter/xt_string.h', + 'linux/netfilter/xt_tcpmss.h', + 'linux/netfilter/xt_tcpudp.h', + 'linux/netfilter/xt_time.h', + 'linux/netfilter/xt_u32.h', + 'linux/netfilter_arp.h', + 'linux/netfilter_arp/arp_tables.h', + 'linux/netfilter_arp/arpt_mangle.h', + 'linux/netfilter_bridge.h', + 'linux/netfilter_bridge/ebt_802_3.h', + 'linux/netfilter_bridge/ebt_among.h', + 'linux/netfilter_bridge/ebt_arp.h', + 'linux/netfilter_bridge/ebt_arpreply.h', + 'linux/netfilter_bridge/ebt_ip.h', + 'linux/netfilter_bridge/ebt_ip6.h', + 'linux/netfilter_bridge/ebt_limit.h', + 'linux/netfilter_bridge/ebt_log.h', + 'linux/netfilter_bridge/ebt_mark_m.h', + 'linux/netfilter_bridge/ebt_mark_t.h', + 'linux/netfilter_bridge/ebt_nat.h', + 'linux/netfilter_bridge/ebt_nflog.h', + 'linux/netfilter_bridge/ebt_pkttype.h', + 'linux/netfilter_bridge/ebt_redirect.h', + 'linux/netfilter_bridge/ebt_stp.h', + 'linux/netfilter_bridge/ebt_vlan.h', + 'linux/netfilter_bridge/ebtables.h', + 'linux/netfilter_ipv4.h', + 'linux/netfilter_ipv4/ip_tables.h', + 'linux/netfilter_ipv4/ipt_CLUSTERIP.h', + 'linux/netfilter_ipv4/ipt_ECN.h', + 'linux/netfilter_ipv4/ipt_LOG.h', + 'linux/netfilter_ipv4/ipt_REJECT.h', + 'linux/netfilter_ipv4/ipt_TTL.h', + 'linux/netfilter_ipv4/ipt_ah.h', + 'linux/netfilter_ipv4/ipt_ecn.h', + 'linux/netfilter_ipv4/ipt_ttl.h', + 'linux/netfilter_ipv6.h', + 'linux/netfilter_ipv6/ip6_tables.h', + 'linux/netfilter_ipv6/ip6t_HL.h', + 'linux/netfilter_ipv6/ip6t_LOG.h', + 'linux/netfilter_ipv6/ip6t_NPT.h', + 'linux/netfilter_ipv6/ip6t_REJECT.h', + 'linux/netfilter_ipv6/ip6t_ah.h', + 'linux/netfilter_ipv6/ip6t_frag.h', + 'linux/netfilter_ipv6/ip6t_hl.h', + 'linux/netfilter_ipv6/ip6t_ipv6header.h', + 'linux/netfilter_ipv6/ip6t_mh.h', + 'linux/netfilter_ipv6/ip6t_opts.h', + 'linux/netfilter_ipv6/ip6t_rt.h', + 'linux/netfilter_ipv6/ip6t_srh.h', + 'linux/netlink.h', + 'linux/netlink_diag.h', + 'linux/netrom.h', + 'linux/nexthop.h', + 'linux/nfc.h', + 'linux/nfs.h', + 'linux/nfs2.h', + 'linux/nfs3.h', + 'linux/nfs4.h', + 'linux/nfs4_mount.h', + 'linux/nfs_fs.h', + 'linux/nfs_idmap.h', + 'linux/nfs_mount.h', + 'linux/nfsacl.h', + 'linux/nfsd/cld.h', + 'linux/nfsd/debug.h', + 'linux/nfsd/export.h', + 'linux/nfsd/stats.h', + 'linux/nilfs2_api.h', + 'linux/nilfs2_ondisk.h', + 'linux/nitro_enclaves.h', + 'linux/nl80211-vnd-intel.h', + 'linux/nl80211.h', + 'linux/nsfs.h', + 'linux/nubus.h', + 'linux/nvme_ioctl.h', + 'linux/nvram.h', + 'linux/omap3isp.h', + 'linux/omapfb.h', + 'linux/oom.h', + 'linux/openat2.h', + 'linux/openvswitch.h', + 'linux/packet_diag.h', + 'linux/param.h', + 'linux/parport.h', + 'linux/patchkey.h', + 'linux/pci.h', + 'linux/pci_regs.h', + 'linux/pcitest.h', + 'linux/perf_event.h', + 'linux/personality.h', + 'linux/pfkeyv2.h', + 'linux/pfrut.h', + 'linux/pg.h', + 'linux/phantom.h', + 'linux/phonet.h', + 'linux/pidfd.h', + 'linux/pkt_cls.h', + 'linux/pkt_sched.h', + 'linux/pktcdvd.h', + 'linux/pmu.h', + 'linux/poll.h', + 'linux/posix_acl.h', + 'linux/posix_acl_xattr.h', + 'linux/posix_types.h', + 'linux/ppdev.h', + 'linux/ppp-comp.h', + 'linux/ppp-ioctl.h', + 'linux/ppp_defs.h', + 'linux/pps.h', + 'linux/pr.h', + 'linux/prctl.h', + 'linux/psample.h', + 'linux/psci.h', + 'linux/psp-sev.h', + 'linux/ptp_clock.h', + 'linux/ptrace.h', + 'linux/qemu_fw_cfg.h', + 'linux/qnx4_fs.h', + 'linux/qnxtypes.h', + 'linux/qrtr.h', + 'linux/quota.h', + 'linux/radeonfb.h', + 'linux/raid/md_p.h', + 'linux/raid/md_u.h', + 'linux/random.h', + 'linux/rds.h', + 'linux/reboot.h', + 'linux/reiserfs_fs.h', + 'linux/reiserfs_xattr.h', + 'linux/remoteproc_cdev.h', + 'linux/resource.h', + 'linux/rfkill.h', + 'linux/rio_cm_cdev.h', + 'linux/rio_mport_cdev.h', + 'linux/rkisp1-config.h', + 'linux/romfs_fs.h', + 'linux/rose.h', + 'linux/route.h', + 'linux/rpl.h', + 'linux/rpl_iptunnel.h', + 'linux/rpmsg.h', + 'linux/rpmsg_types.h', + 'linux/rseq.h', + 'linux/rtc.h', + 'linux/rtnetlink.h', + 'linux/rxrpc.h', + 'linux/scc.h', + 'linux/sched.h', + 'linux/sched/types.h', + 'linux/scif_ioctl.h', + 'linux/screen_info.h', + 'linux/sctp.h', + 'linux/seccomp.h', + 'linux/securebits.h', + 'linux/sed-opal.h', + 'linux/seg6.h', + 'linux/seg6_genl.h', + 'linux/seg6_hmac.h', + 'linux/seg6_iptunnel.h', + 'linux/seg6_local.h', + 'linux/selinux_netlink.h', + 'linux/sem.h', + 'linux/serial.h', + 'linux/serial_core.h', + 'linux/serial_reg.h', + 'linux/serio.h', + 'linux/sev-guest.h', + 'linux/shm.h', + 'linux/signal.h', + 'linux/signalfd.h', + 'linux/smc.h', + 'linux/smc_diag.h', + 'linux/smiapp.h', + 'linux/snmp.h', + 'linux/sock_diag.h', + 'linux/socket.h', + 'linux/sockios.h', + 'linux/sonet.h', + 'linux/sonypi.h', + 'linux/sound.h', + 'linux/soundcard.h', + 'linux/spi/spi.h', + 'linux/spi/spidev.h', + 'linux/stat.h', + 'linux/stddef.h', + 'linux/stm.h', + 'linux/string.h', + 'linux/sunrpc/debug.h', + 'linux/surface_aggregator/cdev.h', + 'linux/surface_aggregator/dtx.h', + 'linux/suspend_ioctls.h', + 'linux/swab.h', + 'linux/switchtec_ioctl.h', + 'linux/sync_file.h', + 'linux/synclink.h', + 'linux/sysctl.h', + 'linux/sysinfo.h', + 'linux/target_core_user.h', + 'linux/taskstats.h', + 'linux/tc_act/tc_bpf.h', + 'linux/tc_act/tc_connmark.h', + 'linux/tc_act/tc_csum.h', + 'linux/tc_act/tc_ct.h', + 'linux/tc_act/tc_ctinfo.h', + 'linux/tc_act/tc_defact.h', + 'linux/tc_act/tc_gact.h', + 'linux/tc_act/tc_gate.h', + 'linux/tc_act/tc_ife.h', + 'linux/tc_act/tc_ipt.h', + 'linux/tc_act/tc_mirred.h', + 'linux/tc_act/tc_mpls.h', + 'linux/tc_act/tc_nat.h', + 'linux/tc_act/tc_pedit.h', + 'linux/tc_act/tc_sample.h', + 'linux/tc_act/tc_skbedit.h', + 'linux/tc_act/tc_skbmod.h', + 'linux/tc_act/tc_tunnel_key.h', + 'linux/tc_act/tc_vlan.h', + 'linux/tc_ematch/tc_em_cmp.h', + 'linux/tc_ematch/tc_em_ipt.h', + 'linux/tc_ematch/tc_em_meta.h', + 'linux/tc_ematch/tc_em_nbyte.h', + 'linux/tc_ematch/tc_em_text.h', + 'linux/tcp.h', + 'linux/tcp_metrics.h', + 'linux/tdx-guest.h', + 'linux/tee.h', + 'linux/termios.h', + 'linux/thermal.h', + 'linux/time.h', + 'linux/time_types.h', + 'linux/timerfd.h', + 'linux/times.h', + 'linux/timex.h', + 'linux/tiocl.h', + 'linux/tipc.h', + 'linux/tipc_config.h', + 'linux/tipc_netlink.h', + 'linux/tipc_sockets_diag.h', + 'linux/tls.h', + 'linux/toshiba.h', + 'linux/tty.h', + 'linux/tty_flags.h', + 'linux/types.h', + 'linux/ublk_cmd.h', + 'linux/udf_fs_i.h', + 'linux/udmabuf.h', + 'linux/udp.h', + 'linux/uhid.h', + 'linux/uinput.h', + 'linux/uio.h', + 'linux/uleds.h', + 'linux/ultrasound.h', + 'linux/um_timetravel.h', + 'linux/un.h', + 'linux/unistd.h', + 'linux/unix_diag.h', + 'linux/usb/audio.h', + 'linux/usb/cdc-wdm.h', + 'linux/usb/cdc.h', + 'linux/usb/ch11.h', + 'linux/usb/ch9.h', + 'linux/usb/charger.h', + 'linux/usb/functionfs.h', + 'linux/usb/g_printer.h', + 'linux/usb/g_uvc.h', + 'linux/usb/gadgetfs.h', + 'linux/usb/midi.h', + 'linux/usb/raw_gadget.h', + 'linux/usb/tmc.h', + 'linux/usb/video.h', + 'linux/usbdevice_fs.h', + 'linux/usbip.h', + 'linux/user_events.h', + 'linux/userfaultfd.h', + 'linux/userio.h', + 'linux/utime.h', + 'linux/utsname.h', + 'linux/uuid.h', + 'linux/uvcvideo.h', + 'linux/v4l2-common.h', + 'linux/v4l2-controls.h', + 'linux/v4l2-dv-timings.h', + 'linux/v4l2-mediabus.h', + 'linux/v4l2-subdev.h', + 'linux/vbox_err.h', + 'linux/vbox_vmmdev_types.h', + 'linux/vboxguest.h', + 'linux/vdpa.h', + 'linux/vduse.h', + 'linux/veth.h', + 'linux/vfio.h', + 'linux/vfio_ccw.h', + 'linux/vfio_zdev.h', + 'linux/vhost.h', + 'linux/vhost_types.h', + 'linux/videodev2.h', + 'linux/virtio_9p.h', + 'linux/virtio_balloon.h', + 'linux/virtio_blk.h', + 'linux/virtio_bt.h', + 'linux/virtio_config.h', + 'linux/virtio_console.h', + 'linux/virtio_crypto.h', + 'linux/virtio_fs.h', + 'linux/virtio_gpio.h', + 'linux/virtio_gpu.h', + 'linux/virtio_i2c.h', + 'linux/virtio_ids.h', + 'linux/virtio_input.h', + 'linux/virtio_iommu.h', + 'linux/virtio_mem.h', + 'linux/virtio_mmio.h', + 'linux/virtio_net.h', + 'linux/virtio_pci.h', + 'linux/virtio_pcidev.h', + 'linux/virtio_pmem.h', + 'linux/virtio_ring.h', + 'linux/virtio_rng.h', + 'linux/virtio_scmi.h', + 'linux/virtio_scsi.h', + 'linux/virtio_snd.h', + 'linux/virtio_types.h', + 'linux/virtio_vsock.h', + 'linux/vm_sockets.h', + 'linux/vm_sockets_diag.h', + 'linux/vmcore.h', + 'linux/vsockmon.h', + 'linux/vt.h', + 'linux/vtpm_proxy.h', + 'linux/wait.h', + 'linux/watch_queue.h', + 'linux/watchdog.h', + 'linux/wireguard.h', + 'linux/wireless.h', + 'linux/wmi.h', + 'linux/wwan.h', + 'linux/x25.h', + 'linux/xattr.h', + 'linux/xdp_diag.h', + 'linux/xfrm.h', + 'linux/xilinx-v4l2-controls.h', + 'linux/zorro.h', + 'linux/zorro_ids.h', + 'misc/cxl.h', + 'misc/fastrpc.h', + 'misc/ocxl.h', + 'misc/pvpanic.h', + 'misc/uacce/hisi_qm.h', + 'misc/uacce/uacce.h', + 'misc/xilinx_sdfec.h', + 'mtd/inftl-user.h', + 'mtd/mtd-abi.h', + 'mtd/mtd-user.h', + 'mtd/nftl-user.h', + 'mtd/ubi-user.h', + 'rdma/bnxt_re-abi.h', + 'rdma/cxgb4-abi.h', + 'rdma/efa-abi.h', + 'rdma/erdma-abi.h', + 'rdma/hfi/hfi1_ioctl.h', + 'rdma/hfi/hfi1_user.h', + 'rdma/hns-abi.h', + 'rdma/ib_user_ioctl_cmds.h', + 'rdma/ib_user_ioctl_verbs.h', + 'rdma/ib_user_mad.h', + 'rdma/ib_user_sa.h', + 'rdma/ib_user_verbs.h', + 'rdma/irdma-abi.h', + 'rdma/mana-abi.h', + 'rdma/mlx4-abi.h', + 'rdma/mlx5-abi.h', + 'rdma/mlx5_user_ioctl_cmds.h', + 'rdma/mlx5_user_ioctl_verbs.h', + 'rdma/mthca-abi.h', + 'rdma/ocrdma-abi.h', + 'rdma/qedr-abi.h', + 'rdma/rdma_netlink.h', + 'rdma/rdma_user_cm.h', + 'rdma/rdma_user_ioctl.h', + 'rdma/rdma_user_ioctl_cmds.h', + 'rdma/rdma_user_rxe.h', + 'rdma/rvt-abi.h', + 'rdma/siw-abi.h', + 'rdma/vmw_pvrdma-abi.h', + 'scsi/cxlflash_ioctl.h', + 'scsi/fc/fc_els.h', + 'scsi/fc/fc_fs.h', + 'scsi/fc/fc_gs.h', + 'scsi/fc/fc_ns.h', + 'scsi/scsi_bsg_fc.h', + 'scsi/scsi_bsg_mpi3mr.h', + 'scsi/scsi_bsg_ufs.h', + 'scsi/scsi_netlink.h', + 'scsi/scsi_netlink_fc.h', + 'sound/asequencer.h', + 'sound/asoc.h', + 'sound/asound.h', + 'sound/asound_fm.h', + 'sound/compress_offload.h', + 'sound/compress_params.h', + 'sound/emu10k1.h', + 'sound/firewire.h', + 'sound/hdsp.h', + 'sound/hdspm.h', + 'sound/intel/avs/tokens.h', + 'sound/sb16_csp.h', + 'sound/sfnt_info.h', + 'sound/skl-tplg-interface.h', + 'sound/snd_ar_tokens.h', + 'sound/snd_sst_tokens.h', + 'sound/sof/abi.h', + 'sound/sof/fw.h', + 'sound/sof/header.h', + 'sound/sof/tokens.h', + 'sound/tlv.h', + 'sound/usb_stream.h', + 'video/edid.h', + 'video/sisfb.h', + 'video/uvesafb.h', + 'xen/evtchn.h', + 'xen/gntalloc.h', + 'xen/gntdev.h', + 'xen/privcmd.h', +} diff --git a/pkg/devel/linux-headers/fetch.sh b/pkg/devel/linux-headers/fetch.sh @@ -0,0 +1,27 @@ +set -e + +dir=$1 +shift + +cd "$dir" + +if [ -e src ] ; then + rm -rf src +fi + +if ! sh "$OLDPWD/scripts/checksum.sh" -c sha256 2>/dev/null ; then + curl -L -K url -O + sh "$OLDPWD/scripts/checksum.sh" -c sha256 +fi + +read -r _ archive <sha256 +sh "$OLDPWD/scripts/extract.sh" "$archive" -s ',^[^/]*,src,' \ + 'linux-*/Makefile' \ + 'linux-*/arch/*/include/uapi' \ + 'linux-*/arch/*/syscalls' \ + 'linux-*/include/uapi' \ + 'linux-*/scripts/unifdef.c' + +if [ -d patch ] ; then + git apply -v --whitespace=nowarn --directory "$dir/src" patch/* +fi diff --git a/pkg/devel/linux-headers/gen.lua b/pkg/devel/linux-headers/gen.lua @@ -0,0 +1,97 @@ +local arch = ({ + aarch64='arm64', + x86_64='x86', +})[config.target.platform:match('[^-]*')] +sub('tools.ninja', function() + toolchain(config.host) + exe('unifdef', {'scripts/unifdef.c'}) +end) + +rule('header', 'sed -E -f $dir/header.sed $in >$out.tmp && { $outdir/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $out.tmp >$out; [ $$? -le 1 ]; } && rm $out.tmp') +rule('wrapper', [[printf '#include <asm-generic/%s>\n' $file >$out]]) + +local function process(outdir, srcdir, files) + local outs = {} + for i, file in ipairs(files) do + local out = outdir..'/'..file + outs[i] = out + build('header', out, {srcdir..'/'..file, '|', '$dir/header.sed', '$outdir/unifdef'}) + end + return outs +end + +local mandatory = { + -- <awk '$1 == "mandatory-y" {printf "\\t'\'%s\'',\\n", $3}' src/include/uapi/asm-generic/Kbuild + 'auxvec.h', + 'bitsperlong.h', + 'bpf_perf_event.h', + 'byteorder.h', + 'errno.h', + 'fcntl.h', + 'ioctl.h', + 'ioctls.h', + 'ipcbuf.h', + 'mman.h', + 'msgbuf.h', + 'param.h', + 'poll.h', + 'posix_types.h', + 'ptrace.h', + 'resource.h', + 'sembuf.h', + 'setup.h', + 'shmbuf.h', + 'sigcontext.h', + 'siginfo.h', + 'signal.h', + 'socket.h', + 'sockios.h', + 'stat.h', + 'statfs.h', + 'swab.h', + 'termbits.h', + 'termios.h', + 'types.h', + 'unistd.h', +} + +local basefiles = load('base.lua') +local archfiles = load(arch..'.lua') + +build('awk', '$outdir/include/linux/version.h', {'$srcdir/Makefile', '|', '$dir/version.awk'}, { + expr='-f $dir/version.awk', +}) + +pkg.hdrs = { + '$outdir/include/linux/version.h', + process('$outdir/include', '$srcdir/include/uapi', basefiles), + process('$outdir/include', '$srcdir/arch/'..arch..'/include/uapi', archfiles), + install=true, +} + +for _, file in ipairs(archfiles) do + archfiles[file] = true +end +for _, file in ipairs(mandatory) do + if not archfiles['asm/'..file] then + local out = '$outdir/include/asm/'..file + build('wrapper', out, nil, {file=file}) + table.insert(pkg.hdrs, out) + end +end + +for _, spec in ipairs(archfiles.unistd) do + local out = '$outdir/include/asm/'..spec.dst + build('awk', out, {'$srcdir/'..spec.src, '|', '$dir/unistd.awk'}, { + expr={ + '-v arch='..arch, + '-v file='..spec.dst, + string.format([[-v abi='%s']], spec.abi), + '-v off='..(spec.off or ''), + '-f $dir/unistd.awk', + }, + }) + table.insert(pkg.hdrs, out) +end + +fetch('local') diff --git a/pkg/devel/linux-headers/header.sed b/pkg/devel/linux-headers/header.sed @@ -0,0 +1,7 @@ +# scripts/headers_install.sh +s/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g +s/__attribute_const__([[:space:]]|$)/\1/g +s@^#include <linux/compiler(_types)?.h>@@ +s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g +s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g +s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @ diff --git a/pkg/devel/linux-headers/patch/0001-Only-use-inline-asm-in-headers-on-GNU-compatible-com.patch b/pkg/devel/linux-headers/patch/0001-Only-use-inline-asm-in-headers-on-GNU-compatible-com.patch @@ -0,0 +1,32 @@ +From 0043f6d3073da1b4adc0cdfd9bf1768a58034353 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Mon, 17 Jun 2019 20:11:17 -0700 +Subject: [PATCH] Only use inline asm in headers on GNU-compatible compilers + +--- + arch/x86/include/uapi/asm/swab.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/arch/x86/include/uapi/asm/swab.h b/arch/x86/include/uapi/asm/swab.h +index cd3fd8ddbe9a..2074e5d7d94d 100644 +--- a/arch/x86/include/uapi/asm/swab.h ++++ b/arch/x86/include/uapi/asm/swab.h +@@ -5,6 +5,8 @@ + #include <linux/types.h> + #include <linux/compiler.h> + ++#ifdef __GNUC__ ++ + static inline __attribute_const__ __u32 __arch_swab32(__u32 val) + { + asm("bswapl %0" : "=r" (val) : "0" (val)); +@@ -34,4 +36,6 @@ static inline __attribute_const__ __u64 __arch_swab64(__u64 val) + } + #define __arch_swab64 __arch_swab64 + ++#endif /* __GNUC__ */ ++ + #endif /* _ASM_X86_SWAB_H */ +-- +2.25.0 + diff --git a/pkg/devel/linux-headers/patch/0002-Revert-change-of-BPF_F_-to-enum-constants.patch b/pkg/devel/linux-headers/patch/0002-Revert-change-of-BPF_F_-to-enum-constants.patch @@ -0,0 +1,32 @@ +From e373a645de1b2e57878dc17420dad3d0464694e6 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 2 Jun 2020 03:56:03 -0700 +Subject: [PATCH] Revert change of BPF_F_* to enum constants + +--- + include/uapi/linux/bpf.h | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h +index c994ff5b157c..ed8261560f2b 100644 +--- a/include/uapi/linux/bpf.h ++++ b/include/uapi/linux/bpf.h +@@ -5850,12 +5850,10 @@ enum { + /* BPF_FUNC_perf_event_output, BPF_FUNC_perf_event_read and + * BPF_FUNC_perf_event_read_value flags. + */ +-enum { +- BPF_F_INDEX_MASK = 0xffffffffULL, +- BPF_F_CURRENT_CPU = BPF_F_INDEX_MASK, ++#define BPF_F_INDEX_MASK 0xffffffffULL ++#define BPF_F_CURRENT_CPU BPF_F_INDEX_MASK + /* BPF_FUNC_perf_event_output for sk_buff input context. */ +- BPF_F_CTXLEN_MASK = (0xfffffULL << 32), +-}; ++#define BPF_F_CTXLEN_MASK (0xfffffULL << 32) + + /* Current network namespace */ + enum { +-- +2.37.3 + diff --git a/pkg/devel/linux-headers/patch/0003-Prevent-zero-length-array-members-in-asound.h.patch b/pkg/devel/linux-headers/patch/0003-Prevent-zero-length-array-members-in-asound.h.patch @@ -0,0 +1,77 @@ +From 4d7aad2421c783cf57f359638197f0ad2a32a287 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Mon, 30 Aug 2021 19:26:32 -0700 +Subject: [PATCH] Prevent zero-length array members in asound.h + +--- + include/uapi/sound/asound.h | 31 +++++++++++++++++++++---------- + 1 file changed, 21 insertions(+), 10 deletions(-) + +diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h +index 0aa955aa8246..2e7ca9236c7a 100644 +--- a/include/uapi/sound/asound.h ++++ b/include/uapi/sound/asound.h +@@ -550,22 +550,30 @@ struct __snd_pcm_sync_ptr { + } c; + }; + ++#if __BITS_PER_LONG == 32 + #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN) +-typedef char __pad_before_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; +-typedef char __pad_after_uframe[0]; ++#define __PAD_BEFORE_UFRAME(x) char x[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; + #endif + + #if defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN) +-typedef char __pad_before_uframe[0]; +-typedef char __pad_after_uframe[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; ++#define __PAD_AFTER_UFRAME(x) char x[sizeof(__u64) - sizeof(snd_pcm_uframes_t)]; ++#endif ++#endif ++ ++#ifndef __PAD_BEFORE_UFRAME ++#define __PAD_BEFORE_UFRAME(x) ++#endif ++ ++#ifndef __PAD_AFTER_UFRAME ++#define __PAD_AFTER_UFRAME(x) + #endif + + struct __snd_pcm_mmap_status64 { + snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */ + __u32 pad1; /* Needed for 64 bit alignment */ +- __pad_before_uframe __pad1; ++ __PAD_BEFORE_UFRAME(__pad1) + snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ +- __pad_after_uframe __pad2; ++ __PAD_AFTER_UFRAME(__pad2) + struct __snd_timespec64 tstamp; /* Timestamp */ + snd_pcm_state_t suspended_state;/* RO: suspended stream state */ + __u32 pad3; /* Needed for 64 bit alignment */ +@@ -573,16 +581,19 @@ struct __snd_pcm_mmap_status64 { + }; + + struct __snd_pcm_mmap_control64 { +- __pad_before_uframe __pad1; ++ __PAD_BEFORE_UFRAME(__pad1) + snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ +- __pad_before_uframe __pad2; // This should be __pad_after_uframe, but binary ++ __PAD_BEFORE_UFRAME(__pad2) // This should be __pad_after_uframe, but binary + // backwards compatibility constraints prevent a fix. + +- __pad_before_uframe __pad3; ++ __PAD_BEFORE_UFRAME(__pad3) + snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ +- __pad_after_uframe __pad4; ++ __PAD_AFTER_UFRAME(__pad4) + }; + ++#undef __PAD_BEFORE_UFRAME ++#undef __PAD_AFTER_UFRAME ++ + struct __snd_pcm_sync_ptr64 { + __u32 flags; + __u32 pad1; +-- +2.37.3 + diff --git a/pkg/devel/linux-headers/patch/0004-Make-struct-bpf_timer-include-a-named-member.patch b/pkg/devel/linux-headers/patch/0004-Make-struct-bpf_timer-include-a-named-member.patch @@ -0,0 +1,32 @@ +From 3685e3c0cb5029b4e17eee6a53d2214190738c24 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 2 Dec 2021 14:49:08 -0800 +Subject: [PATCH] Make struct bpf_timer include a named member + +A struct without any named members is undefined behavior by C11 +6.7.2.1p8. + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + include/uapi/linux/bpf.h | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h +index ed8261560f2b..fb60bc7bb305 100644 +--- a/include/uapi/linux/bpf.h ++++ b/include/uapi/linux/bpf.h +@@ -6968,9 +6968,8 @@ struct bpf_spin_lock { + }; + + struct bpf_timer { +- __u64 :64; +- __u64 :64; +-} __attribute__((aligned(8))); ++ __u64 reserved[2]; ++}; + + struct bpf_dynptr { + __u64 :64; +-- +2.37.3 + diff --git a/pkg/devel/linux-headers/patch/0005-nfc-uapi-remove-stray-semicolon-in-struct-declaratio.patch b/pkg/devel/linux-headers/patch/0005-nfc-uapi-remove-stray-semicolon-in-struct-declaratio.patch @@ -0,0 +1,26 @@ +From c421db7540796882a53d9b533862da16d7810ec3 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Fri, 18 Feb 2022 01:51:13 -0800 +Subject: [PATCH] nfc: uapi: remove stray semicolon in struct declaration + +Signed-off-by: Michael Forney <mforney@mforney.org> +--- + include/uapi/linux/nfc.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h +index 4fa4e979e948..8ab0833ed192 100644 +--- a/include/uapi/linux/nfc.h ++++ b/include/uapi/linux/nfc.h +@@ -277,7 +277,7 @@ struct sockaddr_nfc_llcp { + __u32 nfc_protocol; + __u8 dsap; /* Destination SAP, if known */ + __u8 ssap; /* Source SAP to be bound to */ +- char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */; ++ char service_name[NFC_LLCP_MAX_SERVICE_NAME]; /* Service name URI */ + __kernel_size_t service_name_len; + }; + +-- +2.34.1 + diff --git a/pkg/devel/linux-headers/sha256 b/pkg/devel/linux-headers/sha256 @@ -0,0 +1 @@ +8fa0588f0c2ceca44cac77a0e39ba48c9f00a6b9dc69761c02a5d3efac8da7f3 linux-6.4.tar.xz diff --git a/pkg/devel/linux-headers/unistd.awk b/pkg/devel/linux-headers/unistd.awk @@ -0,0 +1,18 @@ +BEGIN { + guard = toupper("_ASM_" arch "_" file) + gsub(/[^A-Za-z0-9_]/, "_", guard) + print "#ifndef " guard + print "#define " guard " 1" + print "" +} + +$0 ~ /^[^#]+/ && $2 ~ "^(" abi ")$" { + if (off != "") + $1 = "(" off " + " $1 ")" + print "#define __NR_" $3, $1 +} + +END { + print "" + print "#endif /* " guard " */" +} diff --git a/pkg/devel/linux-headers/url b/pkg/devel/linux-headers/url @@ -0,0 +1 @@ +url = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.4.tar.xz" diff --git a/pkg/devel/linux-headers/ver b/pkg/devel/linux-headers/ver @@ -0,0 +1 @@ +6.4 r0 diff --git a/pkg/devel/linux-headers/version.awk b/pkg/devel/linux-headers/version.awk @@ -0,0 +1,8 @@ +/^VERSION = / { version = $3 } +/^PATCHLEVEL = / { patchlevel = $3 } +/^SUBLEVEL = / { sublevel = $3 } + +END { + print "#define LINUX_VERSION_CODE " (version * 65536 + patchlevel * 256 + sublevel) + print "#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))" +} diff --git a/pkg/devel/linux-headers/x86.lua b/pkg/devel/linux-headers/x86.lua @@ -0,0 +1,68 @@ +return { + -- <cd src/arch/x86/include/uapi && find * -name '*.h' -exec printf "\t'%s',\n" {} + | LC_COLLATE=C sort + 'asm/a.out.h', + 'asm/amd_hsmp.h', + 'asm/auxvec.h', + 'asm/bitsperlong.h', + 'asm/boot.h', + 'asm/bootparam.h', + 'asm/byteorder.h', + 'asm/debugreg.h', + 'asm/e820.h', + 'asm/hw_breakpoint.h', + 'asm/hwcap2.h', + 'asm/ist.h', + 'asm/kvm.h', + 'asm/kvm_para.h', + 'asm/kvm_perf.h', + 'asm/ldt.h', + 'asm/mce.h', + 'asm/mman.h', + 'asm/msgbuf.h', + 'asm/msr.h', + 'asm/mtrr.h', + 'asm/perf_regs.h', + 'asm/posix_types.h', + 'asm/posix_types_32.h', + 'asm/posix_types_64.h', + 'asm/posix_types_x32.h', + 'asm/prctl.h', + 'asm/processor-flags.h', + 'asm/ptrace-abi.h', + 'asm/ptrace.h', + 'asm/sembuf.h', + 'asm/setup.h', + 'asm/sgx.h', + 'asm/shmbuf.h', + 'asm/sigcontext.h', + 'asm/sigcontext32.h', + 'asm/siginfo.h', + 'asm/signal.h', + 'asm/stat.h', + 'asm/statfs.h', + 'asm/svm.h', + 'asm/swab.h', + 'asm/ucontext.h', + 'asm/unistd.h', + 'asm/vm86.h', + 'asm/vmx.h', + 'asm/vsyscall.h', + unistd={ + { + dst='unistd_32.h', + src='arch/x86/entry/syscalls/syscall_32.tbl', + abi='i386', + }, + { + dst='unistd_x32.h', + src='arch/x86/entry/syscalls/syscall_64.tbl', + abi='common|x32', + off='__X32_SYSCALL_BIT', + }, + { + dst='unistd_64.h', + src='arch/x86/entry/syscalls/syscall_64.tbl', + abi='common|64', + }, + }, +} diff --git a/pkg/devel/samurai/gen.lua b/pkg/devel/samurai/gen.lua @@ -0,0 +1,20 @@ +cflags({'-std=c99', '-Wall', '-Wextra', '-Wpedantic', '-Wno-unused-parameter'}) + +exe('samu', { + 'build.c', + 'deps.c', + 'env.c', + 'graph.c', + 'htab.c', + 'log.c', + 'parse.c', + 'samu.c', + 'scan.c', + 'tool.c', + 'tree.c', + 'util.c', +}) +file('bin/samu', '755', '$outdir/samu') +man({'samu.1'}) + +fetch('git') diff --git a/pkg/devel/samurai/src b/pkg/devel/samurai/src @@ -0,0 +1 @@ +Subproject commit 217059f21e2d1f016f7ba044b36d12de95788cf3 diff --git a/pkg/devel/samurai/ver b/pkg/devel/samurai/ver @@ -0,0 +1 @@ +1.2-32-g217059f21e r0 diff --git a/pkg/devel/strace/.gitignore b/pkg/devel/strace/.gitignore @@ -0,0 +1,3 @@ +/src +/strace-6.4.tar.xz +/tools.ninja diff --git a/pkg/devel/strace/README.md b/pkg/devel/strace/README.md @@ -0,0 +1,6 @@ +# strace + +## config.h +Generated with + + ./configure --disable-mpers diff --git a/pkg/devel/strace/config.h b/pkg/devel/strace/config.h @@ -0,0 +1,489 @@ +/* #undef AARCH64 */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ +/* #undef ALPHA */ +/* #undef ARC */ +/* #undef ARM */ +#define ASM_SA_RESTORER 0x04000000 +#define ASM_SIGRTMIN 32 +/* #undef AVR32 */ +/* #undef BFIN */ +#define COPYRIGHT_YEAR "2023" +/* #undef CSKY */ +#define ENABLE_ARM_OABI 0 +/* #undef ENABLE_SECONTEXT */ +/* #undef ENABLE_STACKTRACE */ +#define HAVE_ACCEPT4 1 +/* #undef HAVE_ASM_CACHECTL_H */ +/* #undef HAVE_ASM_GUARDED_STORAGE_H */ +/* #undef HAVE_ASM_SIGCONTEXT_H */ +/* #undef HAVE_ASM_SYSMIPS_H */ +/* #undef HAVE_BE64TOH */ +/* #undef HAVE_BLUETOOTH_BLUETOOTH_H */ +#define HAVE_DECL_IEEE802154_ADDR_LONG 0 +#define HAVE_DECL_IEEE802154_ADDR_NONE 0 +#define HAVE_DECL_IEEE802154_ADDR_SHORT 0 +#define HAVE_DECL_LO_FLAGS_AUTOCLEAR 1 +#define HAVE_DECL_LO_FLAGS_DIRECT_IO 1 +#define HAVE_DECL_LO_FLAGS_PARTSCAN 1 +#define HAVE_DECL_LO_FLAGS_READ_ONLY 1 +#define HAVE_DECL_LO_FLAGS_USE_AOPS 0 +#define HAVE_DECL_NFEA_ACTIVITY_NOTIFY 0 +#define HAVE_DECL_NFEA_DONT_REFRESH 0 +#define HAVE_DECL_NFEA_UNSPEC 0 +#define HAVE_DECL_PTP_PF_EXTTS 0 +#define HAVE_DECL_PTP_PF_NONE 0 +#define HAVE_DECL_PTP_PF_PEROUT 0 +#define HAVE_DECL_PTP_PF_PHYSYNC 0 +#define HAVE_DECL_PTRACE_PEEKUSER 1 +#define HAVE_DECL_PTRACE_POKEUSER 1 +#define HAVE_DECL_P_ALL 1 +#define HAVE_DECL_P_PGID 1 +#define HAVE_DECL_P_PID 1 +#define HAVE_DECL_P_PIDFD 1 +#define HAVE_DECL_SYS_ERRLIST 0 +#define HAVE_DECL_TCA_ACT_COOKIE 1 +#define HAVE_DECL_TCA_ACT_FLAGS 1 +#define HAVE_DECL_TCA_ACT_HW_STATS 1 +#define HAVE_DECL_TCA_ACT_INDEX 1 +#define HAVE_DECL_TCA_ACT_IN_HW_COUNT 1 +#define HAVE_DECL_TCA_ACT_KIND 1 +#define HAVE_DECL_TCA_ACT_OPTIONS 1 +#define HAVE_DECL_TCA_ACT_PAD 1 +#define HAVE_DECL_TCA_ACT_STATS 1 +#define HAVE_DECL_TCA_ACT_UNSPEC 1 +#define HAVE_DECL_TCA_ACT_USED_HW_STATS 1 +#define HAVE_DECL_XFRM_MSG_ACQUIRE 1 +#define HAVE_DECL_XFRM_MSG_ALLOCSPI 1 +#define HAVE_DECL_XFRM_MSG_DELPOLICY 1 +#define HAVE_DECL_XFRM_MSG_DELSA 1 +#define HAVE_DECL_XFRM_MSG_EXPIRE 1 +#define HAVE_DECL_XFRM_MSG_FLUSHPOLICY 1 +#define HAVE_DECL_XFRM_MSG_FLUSHSA 1 +#define HAVE_DECL_XFRM_MSG_GETAE 1 +#define HAVE_DECL_XFRM_MSG_GETDEFAULT 1 +#define HAVE_DECL_XFRM_MSG_GETPOLICY 1 +#define HAVE_DECL_XFRM_MSG_GETSA 1 +#define HAVE_DECL_XFRM_MSG_GETSADINFO 1 +#define HAVE_DECL_XFRM_MSG_GETSPDINFO 1 +#define HAVE_DECL_XFRM_MSG_MAPPING 1 +#define HAVE_DECL_XFRM_MSG_MIGRATE 1 +#define HAVE_DECL_XFRM_MSG_NEWAE 1 +#define HAVE_DECL_XFRM_MSG_NEWPOLICY 1 +#define HAVE_DECL_XFRM_MSG_NEWSA 1 +#define HAVE_DECL_XFRM_MSG_NEWSADINFO 1 +#define HAVE_DECL_XFRM_MSG_NEWSPDINFO 1 +#define HAVE_DECL_XFRM_MSG_POLEXPIRE 1 +#define HAVE_DECL_XFRM_MSG_REPORT 1 +#define HAVE_DECL_XFRM_MSG_SETDEFAULT 1 +#define HAVE_DECL_XFRM_MSG_UPDPOLICY 1 +#define HAVE_DECL_XFRM_MSG_UPDSA 1 +/* #undef HAVE_DEMANGLE_H */ +#define HAVE_DLADDR 1 +/* #undef HAVE_ELFUTILS_LIBDWFL_H */ +#define HAVE_ELF_H 1 +#define HAVE_FALLOCATE 1 +#define HAVE_FANOTIFY_MARK 1 +/* #undef HAVE_FCNTL64 */ +/* #undef HAVE_FOPEN64 */ +#define HAVE_FORK 1 +#define HAVE_FPUTS_UNLOCKED 1 +#define HAVE_FSTATAT 1 +#define HAVE_FTRUNCATE 1 +#define HAVE_FUTIMENS 1 +#define HAVE_GCOV_H 1 +/* #undef HAVE_GNU_STUBS */ +/* #undef HAVE_GNU_STUBS_32_H */ +/* #undef HAVE_GNU_STUBS_X32_H */ +#define HAVE_ICONV_H 1 +#define HAVE_ICONV_OPEN 1 +#define HAVE_IF_INDEXTONAME 1 +#define HAVE_INTTYPES_H 1 +/* #undef HAVE_LIBIBERTY_DEMANGLE_H */ +/* #undef HAVE_LIBUNWIND_PTRACE_H */ +#define HAVE_LINUX_BPF_H 1 +#define HAVE_LINUX_IF_ALG_H 1 +#define HAVE_LINUX_IF_XDP_H 1 +#define HAVE_LINUX_IPC_H 1 +/* #undef HAVE_LINUX_IPX_H */ +#define HAVE_LINUX_KVM_H 1 +#define HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H 1 +#define HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H 1 +#define HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H 1 +#define HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H 1 +#define HAVE_LINUX_NFC_H 1 +#define HAVE_LINUX_QRTR_H 1 +#define HAVE_LINUX_RXRPC_H 1 +#define HAVE_LINUX_VM_SOCKETS_H 1 +/* #undef HAVE_M32_MPERS */ +/* #undef HAVE_M32_SELINUX_RUNTIME */ +/* #undef HAVE_M32_STRUCT_STAT */ +/* #undef HAVE_M32_STRUCT_STAT64 */ +/* #undef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC */ +/* #undef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC */ +#define HAVE_MEMORY_H 1 +#define HAVE_MEMPCPY 1 +#define HAVE_MQUEUE_H 1 +/* #undef HAVE_MX32_MPERS */ +/* #undef HAVE_MX32_SELINUX_RUNTIME */ +/* #undef HAVE_MX32_STRUCT_STAT */ +/* #undef HAVE_MX32_STRUCT_STAT64 */ +/* #undef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC */ +/* #undef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC */ +/* #undef HAVE_NETINET_SCTP_H */ +#define HAVE_NETINET_TCP_H 1 +#define HAVE_NETINET_UDP_H 1 +/* #undef HAVE_NETIPX_IPX_H */ +/* #undef HAVE_OPEN64 */ +#define HAVE_OPEN_MEMSTREAM 1 +#define HAVE_PATHS_H 1 +#define HAVE_PREADV 1 +#define HAVE_PROCESS_VM_READV 1 +#define HAVE_PROCESS_VM_WRITEV 1 +#define HAVE_PROGRAM_INVOCATION_NAME 1 +#define HAVE_PWRITEV 1 +#define HAVE_READAHEAD 1 +/* #undef HAVE_S390_COMPAT_REGS */ +#define HAVE_SCSI_SG_H 1 +/* #undef HAVE_SELINUX_RUNTIME */ +/* #undef HAVE_SELINUX_SELINUX_H */ +#define HAVE_SIGINFO_T_SI_ADDR_LSB 1 +#define HAVE_SIGINFO_T_SI_LOWER 1 +#define HAVE_SIGINFO_T_SI_OVERRUN 1 +/* #undef HAVE_SIGINFO_T_SI_PERF_DATA */ +/* #undef HAVE_SIGINFO_T_SI_PERF_FLAGS */ +/* #undef HAVE_SIGINFO_T_SI_PERF_TYPE */ +#define HAVE_SIGINFO_T_SI_PKEY 1 +#define HAVE_SIGINFO_T_SI_SYSCALL 1 +#define HAVE_SIGINFO_T_SI_TIMERID 1 +/* #undef HAVE_SIGINFO_T_SI_TRAPNO */ +#define HAVE_SIGINFO_T_SI_UPPER 1 +#define HAVE_SIGNALFD 1 +#define HAVE_SIG_ATOMIC_T 1 +#define HAVE_STATIC_ASSERT 1 +#define HAVE_STDINT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STPCPY 1 +#define HAVE_STRERROR 1 +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRNDUP 1 +#define HAVE_STRUCT_BPF_INSN 1 +#define HAVE_STRUCT_BPF_MAP_INFO 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_ID 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_KEY_TYPE_ID 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_VALUE_TYPE_ID 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_VMLINUX_VALUE_TYPE_ID 1 +#define HAVE_STRUCT_BPF_MAP_INFO_ID 1 +#define HAVE_STRUCT_BPF_MAP_INFO_IFINDEX 1 +#define HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE 1 +#define HAVE_STRUCT_BPF_MAP_INFO_MAP_EXTRA 1 +#define HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS 1 +#define HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES 1 +#define HAVE_STRUCT_BPF_MAP_INFO_NAME 1 +/* #undef HAVE_STRUCT_BPF_MAP_INFO_PAD */ +#define HAVE_STRUCT_BPF_MAP_INFO_TYPE 1 +#define HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE 1 +#define HAVE_STRUCT_BPF_PROG_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_BTF_ID 1 +#define HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID 1 +#define HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO_REC_SIZE 1 +#define HAVE_STRUCT_BPF_PROG_INFO_ID 1 +#define HAVE_STRUCT_BPF_PROG_INFO_IFINDEX 1 +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_FUNC_LENS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_KSYMS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO_REC_SIZE 1 +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN 1 +#define HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO_REC_SIZE 1 +#define HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME 1 +#define HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NAME 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_FUNC_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_FUNC_LENS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_KSYMS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_LINE_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_LINE_INFO 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_NR_PROG_TAGS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_PROG_TAGS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_RECURSION_MISSES 1 +#define HAVE_STRUCT_BPF_PROG_INFO_RUN_CNT 1 +#define HAVE_STRUCT_BPF_PROG_INFO_RUN_TIME_NS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_TAG 1 +#define HAVE_STRUCT_BPF_PROG_INFO_TYPE 1 +#define HAVE_STRUCT_BPF_PROG_INFO_VERIFIED_INSNS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN 1 +/* #undef HAVE_STRUCT_IA64_FPREG */ +#define HAVE_STRUCT_IOCB_AIO_FLAGS 1 +#define HAVE_STRUCT_IOCB_AIO_RW_FLAGS 1 +#define HAVE_STRUCT_KBDIACRSUC 1 +#define HAVE_STRUCT_KBDIACRUC 1 +#define HAVE_STRUCT_KVM_CPUID2 1 +#define HAVE_STRUCT_KVM_REGS 1 +#define HAVE_STRUCT_KVM_SREGS 1 +#define HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION 1 +#define HAVE_STRUCT_MMSGHDR 1 +/* #undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS */ +#define HAVE_STRUCT_PTRACE_SYSCALL_INFO 1 +/* #undef HAVE_STRUCT_PT_ALL_USER_REGS */ +#define HAVE_STRUCT_SIGCONTEXT 1 +#define HAVE_STRUCT_SOCKADDR_ALG_NEW 1 +/* #undef HAVE_STRUCT_SOCKADDR_HCI_HCI_CHANNEL */ +/* #undef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE */ +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 +#define HAVE_STRUCT_SOCKADDR_VM 1 +#define HAVE_STRUCT_SOCKADDR_VM_SVM_FLAGS 1 +#define HAVE_STRUCT_SOCKADDR_XDP 1 +/* #undef HAVE_STRUCT_STAT64 */ +/* #undef HAVE_STRUCT_STAT64_ST_MTIME_NSEC */ +#define HAVE_STRUCT_STATFS 1 +#define HAVE_STRUCT_STATFS64 1 +#define HAVE_STRUCT_STATFS64_F_FLAGS 1 +#define HAVE_STRUCT_STATFS64_F_FRSIZE 1 +#define HAVE_STRUCT_STATFS64_F_FSID_VAL 1 +/* #undef HAVE_STRUCT_STATFS64_F_FSID___VAL */ +#define HAVE_STRUCT_STATFS_F_FLAGS 1 +#define HAVE_STRUCT_STATFS_F_FRSIZE 1 +#define HAVE_STRUCT_STATFS_F_FSID_VAL 1 +/* #undef HAVE_STRUCT_STATFS_F_FSID___VAL */ +#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1 +#define HAVE_STRUCT_TCP_DIAG_MD5SIG 1 +#define HAVE_STRUCT_TERMIOS2 1 +/* #undef HAVE_STRUCT_TERMIOS_C_ISPEED */ +/* #undef HAVE_STRUCT_TERMIOS_C_OSPEED */ +#define HAVE_STRUCT_USER_DESC 1 +#define HAVE_STRUCT_USER_DESC_LM 1 +#define HAVE_STRUCT_UTSNAME_DOMAINNAME 1 +/* #undef HAVE_STRUCT___AIO_SIGSET */ +#define HAVE_STRUCT___KERNEL_SOCK_TIMEVAL 1 +#define HAVE_STRUCT___KERNEL_TIMESPEC 1 +#define HAVE_STRUCT___OLD_KERNEL_STAT 1 +#define HAVE_STRUCT___PTRACE_SYSCALL_INFO 1 +#define HAVE_SYNC_FILE_RANGE 1 +#define HAVE_SYS_EVENTFD_H 1 +#define HAVE_SYS_FANOTIFY_H 1 +#define HAVE_SYS_IPC_H 1 +#define HAVE_SYS_QUOTA_H 1 +#define HAVE_SYS_SIGNALFD_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_XATTR_H 1 +#define HAVE_TYPEOF 1 +#define HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD 1 +#define HAVE_UNION_BPF_ATTR_ATTACH_BTF_ID 1 +#define HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_ATTACH_PROG_FD 1 +#define HAVE_UNION_BPF_ATTR_ATTACH_TYPE 1 +#define HAVE_UNION_BPF_ATTR_BATCH_COUNT 1 +#define HAVE_UNION_BPF_ATTR_BATCH_ELEM_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_BATCH_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_BATCH_IN_BATCH 1 +#define HAVE_UNION_BPF_ATTR_BATCH_KEYS 1 +#define HAVE_UNION_BPF_ATTR_BATCH_MAP_FD 1 +#define HAVE_UNION_BPF_ATTR_BATCH_OUT_BATCH 1 +#define HAVE_UNION_BPF_ATTR_BATCH_VALUES 1 +#define HAVE_UNION_BPF_ATTR_BPF_FD 1 +#define HAVE_UNION_BPF_ATTR_BTF 1 +#define HAVE_UNION_BPF_ATTR_BTF_FD 1 +#define HAVE_UNION_BPF_ATTR_BTF_ID 1 +#define HAVE_UNION_BPF_ATTR_BTF_KEY_TYPE_ID 1 +#define HAVE_UNION_BPF_ATTR_BTF_LOG_BUF 1 +#define HAVE_UNION_BPF_ATTR_BTF_LOG_LEVEL 1 +#define HAVE_UNION_BPF_ATTR_BTF_LOG_SIZE 1 +#define HAVE_UNION_BPF_ATTR_BTF_SIZE 1 +#define HAVE_UNION_BPF_ATTR_BTF_VALUE_TYPE_ID 1 +#define HAVE_UNION_BPF_ATTR_BTF_VMLINUX_VALUE_TYPE_ID 1 +/* #undef HAVE_UNION_BPF_ATTR_DUMMY */ +#define HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE 1 +#define HAVE_UNION_BPF_ATTR_FD_ARRAY 1 +#define HAVE_UNION_BPF_ATTR_FILE_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_FUNC_INFO 1 +#define HAVE_UNION_BPF_ATTR_FUNC_INFO_CNT 1 +#define HAVE_UNION_BPF_ATTR_FUNC_INFO_REC_SIZE 1 +#define HAVE_UNION_BPF_ATTR_INFO_BPF_FD 1 +#define HAVE_UNION_BPF_ATTR_INFO_INFO 1 +#define HAVE_UNION_BPF_ATTR_INFO_INFO_LEN 1 +#define HAVE_UNION_BPF_ATTR_INNER_MAP_FD 1 +#define HAVE_UNION_BPF_ATTR_INSNS 1 +#define HAVE_UNION_BPF_ATTR_INSN_CNT 1 +#define HAVE_UNION_BPF_ATTR_KERN_VERSION 1 +#define HAVE_UNION_BPF_ATTR_KEY 1 +#define HAVE_UNION_BPF_ATTR_KEY_SIZE 1 +#define HAVE_UNION_BPF_ATTR_LICENSE 1 +#define HAVE_UNION_BPF_ATTR_LINE_INFO 1 +#define HAVE_UNION_BPF_ATTR_LINE_INFO_CNT 1 +#define HAVE_UNION_BPF_ATTR_LINE_INFO_REC_SIZE 1 +/* #undef HAVE_UNION_BPF_ATTR_LINK_CREATE_ADDRS */ +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_ATTACH_TYPE 1 +/* #undef HAVE_UNION_BPF_ATTR_LINK_CREATE_BPF_COOKIE */ +/* #undef HAVE_UNION_BPF_ATTR_LINK_CREATE_CNT */ +/* #undef HAVE_UNION_BPF_ATTR_LINK_CREATE_COOKIES */ +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_ITER_INFO 1 +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_ITER_INFO_LEN 1 +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_KPROBE_MULTI 1 +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_PERF_EVENT 1 +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_PROG_FD 1 +/* #undef HAVE_UNION_BPF_ATTR_LINK_CREATE_SYMS */ +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_TARGET_BTF_ID 1 +#define HAVE_UNION_BPF_ATTR_LINK_CREATE_TARGET_FD 1 +#define HAVE_UNION_BPF_ATTR_LINK_ID 1 +#define HAVE_UNION_BPF_ATTR_LINK_UPDATE_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_LINK_UPDATE_LINK_FD 1 +#define HAVE_UNION_BPF_ATTR_LINK_UPDATE_NEW_PROG_FD 1 +#define HAVE_UNION_BPF_ATTR_LINK_UPDATE_OLD_PROG_FD 1 +#define HAVE_UNION_BPF_ATTR_LOG_BUF 1 +#define HAVE_UNION_BPF_ATTR_LOG_LEVEL 1 +#define HAVE_UNION_BPF_ATTR_LOG_SIZE 1 +#define HAVE_UNION_BPF_ATTR_MAP_EXTRA 1 +#define HAVE_UNION_BPF_ATTR_MAP_FD 1 +#define HAVE_UNION_BPF_ATTR_MAP_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_MAP_ID 1 +#define HAVE_UNION_BPF_ATTR_MAP_IFINDEX 1 +#define HAVE_UNION_BPF_ATTR_MAP_NAME 1 +#define HAVE_UNION_BPF_ATTR_MAP_TYPE 1 +#define HAVE_UNION_BPF_ATTR_MAX_ENTRIES 1 +#define HAVE_UNION_BPF_ATTR_NEXT_ID 1 +#define HAVE_UNION_BPF_ATTR_NEXT_KEY 1 +#define HAVE_UNION_BPF_ATTR_NUMA_NODE 1 +#define HAVE_UNION_BPF_ATTR_OPEN_FLAGS 1 +/* #undef HAVE_UNION_BPF_ATTR_PAD */ +#define HAVE_UNION_BPF_ATTR_PATHNAME 1 +#define HAVE_UNION_BPF_ATTR_PROG_BTF_FD 1 +#define HAVE_UNION_BPF_ATTR_PROG_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_PROG_ID 1 +#define HAVE_UNION_BPF_ATTR_PROG_IFINDEX 1 +#define HAVE_UNION_BPF_ATTR_PROG_NAME 1 +#define HAVE_UNION_BPF_ATTR_PROG_TYPE 1 +#define HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE 1 +#define HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT 1 +#define HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS 1 +#define HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD 1 +#define HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME 1 +#define HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD 1 +#define HAVE_UNION_BPF_ATTR_REPLACE_BPF_FD 1 +#define HAVE_UNION_BPF_ATTR_START_ID 1 +#define HAVE_UNION_BPF_ATTR_TARGET_FD 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF_LEN 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD_TYPE 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PID 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_ADDR 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_OFFSET 1 +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROG_ID 1 +#define HAVE_UNION_BPF_ATTR_TEST_BATCH_SIZE 1 +#define HAVE_UNION_BPF_ATTR_TEST_CPU 1 +#define HAVE_UNION_BPF_ATTR_TEST_CTX_IN 1 +#define HAVE_UNION_BPF_ATTR_TEST_CTX_OUT 1 +#define HAVE_UNION_BPF_ATTR_TEST_CTX_SIZE_IN 1 +#define HAVE_UNION_BPF_ATTR_TEST_CTX_SIZE_OUT 1 +#define HAVE_UNION_BPF_ATTR_TEST_DATA_IN 1 +#define HAVE_UNION_BPF_ATTR_TEST_DATA_OUT 1 +#define HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN 1 +#define HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT 1 +#define HAVE_UNION_BPF_ATTR_TEST_DURATION 1 +#define HAVE_UNION_BPF_ATTR_TEST_FLAGS 1 +#define HAVE_UNION_BPF_ATTR_TEST_PROG_FD 1 +#define HAVE_UNION_BPF_ATTR_TEST_REPEAT 1 +#define HAVE_UNION_BPF_ATTR_TEST_RETVAL 1 +#define HAVE_UNION_BPF_ATTR_VALUE 1 +#define HAVE_UNION_BPF_ATTR_VALUE_SIZE 1 +#define HAVE_UNISTD_H 1 +/* #undef HAVE_USTAT_H */ +/* #undef HAVE__STATIC_ASSERT */ +/* probe HAVE___BUILTIN_POPCOUNT */ +#define HAVE___KERNEL_LONG_T 1 +#define HAVE___KERNEL_ULONG_T 1 +/* #undef HPPA */ +/* #undef I386 */ +/* #undef IA64 */ +/* #undef LINUX_MIPSN32 */ +/* #undef LINUX_MIPSN64 */ +/* #undef LINUX_MIPSO32 */ +/* #undef LOONGARCH64 */ +/* #undef M32_SIZEOF_KERNEL_LONG_T */ +/* #undef M32_SIZEOF_LONG */ +/* #undef M32_SIZEOF_STRUCT_MSQID64_DS */ +/* #undef M68K */ +/* #undef METAG */ +/* #undef MICROBLAZE */ +/* #undef MIPS */ +/* #undef MX32_SIZEOF_KERNEL_LONG_T */ +/* #undef MX32_SIZEOF_LONG */ +/* #undef MX32_SIZEOF_STRUCT_MSQID64_DS */ +/* #undef NIOS2 */ +/* #undef OR1K */ +#define PACKAGE "strace" +#define PACKAGE_BUGREPORT "strace-devel@lists.strace.io" +#define PACKAGE_NAME "strace" +#define PACKAGE_STRING "strace 6.4" +#define PACKAGE_TARNAME "strace" +#define PACKAGE_URL "https://strace.io" +#define PACKAGE_VERSION "6.4" +/* #undef POWERPC */ +/* #undef POWERPC64 */ +/* #undef POWERPC64LE */ +/* #undef RISCV64 */ +/* #undef S390 */ +/* #undef S390X */ +/* #undef SH */ +/* #undef SH64 */ +#define SIZEOF_KERNEL_LONG_T 8 +#define SIZEOF_LONG 8 +#define SIZEOF_LONG_LONG 8 +#define SIZEOF_OFF_T 8 +#define SIZEOF_STRUCT_I64_I32 16 +#define SIZEOF_STRUCT_MSQID64_DS 120 +#define SLM_MANPAGE_DATE "2022-01-01" +/* #undef SPARC */ +/* #undef SPARC64 */ +#define STDC_HEADERS 1 +#define STRACE_MANPAGE_DATE "2023-06-11" +/* #undef TILE */ +/* #undef USE_DEMANGLE */ +/* #undef USE_LIBDW */ +/* #undef USE_LIBUNWIND */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif +#ifndef _POSIX_PTHREAD_SEMANTICS +# define _POSIX_PTHREAD_SEMANTICS 1 +#endif +#ifndef _TANDEM_SOURCE +# define _TANDEM_SOURCE 1 +#endif +#ifndef __EXTENSIONS__ +# define __EXTENSIONS__ 1 +#endif +/* #undef USE_UNWINDER */ +#define VERSION "6.4" +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif +/* #undef X32 */ +#define X86_64 1 +/* #undef XTENSA */ +/* #undef _MINIX */ +/* #undef _POSIX_1_SOURCE */ +/* #undef _POSIX_SOURCE */ +/* #undef gid_t */ +/* #undef typeof */ +/* #undef uid_t */ diff --git a/pkg/devel/strace/gen.lua b/pkg/devel/strace/gen.lua @@ -0,0 +1,394 @@ +cflags({ + '-D HAVE_CONFIG_H', + '-D IN_STRACE', + -- it is important that the arch-specific directory is searched first + '-I $srcdir/src/linux/x86_64', + '-I $srcdir/src/linux/generic', + '-I $srcdir/src', + '-I $outdir', + '-isystem $builddir/pkg/devel/linux-headers/include', +}) + +build('cat', '$outdir/config.h', { + '$builddir/probe/HAVE___BUILTIN_POPCOUNT', + '$dir/config.h', +}) + +build('cpp', '$outdir/ioctl_iocdef.i', '$srcdir/src/ioctl_iocdef.c') +build('sed', '$outdir/ioctl_iocdef.h', '$outdir/ioctl_iocdef.i', { + expr=[[-n 's/^DEFINE HOST/#define /p']], +}) + +sub('tools.ninja', function() + toolchain(config.host) + cflags({ + '-D X86_64=1', + '-I $srcdir/src/linux/x86_64', + '-I $srcdir/src/linux', + '-I $outdir', + }) + + for i = 0, 2 do + build('cat', '$outdir/ioctls_all'..i..'.h', { + '$srcdir/src/linux/x86_64/ioctls_inc'..i..'.h', + '$srcdir/src/linux/x86_64/ioctls_arch'..i..'.h', + }) + build('cc', '$outdir/ioctlsort'..i..'.c.o', { + '$srcdir/src/ioctlsort.c', + '|', '$outdir/ioctl_iocdef.h', '$srcdir/ioctls_zfs.h', '$outdir/ioctls_all'..i..'.h', + }, {cflags=string.format([[$cflags -D 'IOCTLSORT_INC="ioctls_all%d.h"']], i)}) + exe('ioctlsort'..i, {'ioctlsort'..i..'.c.o'}) + rule('ioctlsort'..i, '$outdir/ioctlsort'..i..' >$out') + build('ioctlsort'..i, '$outdir/ioctlent'..i..'.h', {'|', '$outdir/ioctlsort'..i}) + end +end) + +local mpers = lines('mpers.txt') +for _, f in ipairs(mpers) do + build('cpp', '$outdir/'..f..'.mpers.i', {'$srcdir/src/'..f, '|', '$outdir/config.h'}, { + cflags='$cflags -DIN_MPERS_BOOTSTRAP', + }) +end + +local function makempers(name, script) + build('awk', '$outdir/'..name, {expand{'$outdir/', mpers, '.mpers.i'}, '|', '$dir/'..script}, { + expr='-f $dir/'..script, + }) +end + +makempers('printers.h', 'printers.awk') +makempers('native_printer_decls.h', 'printerdecls.awk') +makempers('native_printer_defs.h', 'printerdefs.awk') + +build('cpp', '$outdir/syscallent.i', '$srcdir/src/linux/x86_64/syscallent.h') +build('awk', '$outdir/scno-syscallent.h', {'$outdir/syscallent.i', '|', '$dir/scno.awk'}, { + expr='-f $dir/scno.awk', +}) +build('cat', '$outdir/scno.h', {'$srcdir/src/scno.head', '$outdir/scno-syscallent.h'}) + +-- this seems to be enough syscall headers to build +local syscalls = expand{'$srcdir/src/linux/', { + '32/syscallent.h', + '64/syscallent.h', + 'arm/syscallent.h', + 'i386/syscallent.h', + 'sparc/syscallent.h', + 'sparc64/syscallent.h', + 'generic/subcallent.h', + 'generic/syscallent-common.h', + 'x86_64/syscallent.h', +}} +build('awk', '$outdir/sen.h', {syscalls, '|', '$dir/sen.awk'}, { + expr='-f $dir/sen.awk', +}) + +local srcs = paths[[src/( + access.c + affinity.c + aio.c + alpha.c + basic_filters.c + bind.c + bjm.c + block.c + bpf.c + bpf_filter.c + bpf_seccomp_filter.c + bpf_sock_filter.c + btrfs.c + cacheflush.c + capability.c + chdir.c + chmod.c + clone.c + close_range.c + copy_file_range.c + count.c + counter_ioctl.c + delay.c + desc.c + dirent.c + dirent64.c + dirent_types.c + dm.c + dup.c + dyxlat.c + epoll.c + error_prints.c + evdev.c + evdev_mpers.c + eventfd.c + execve.c + fadvise.c + fallocate.c + fanotify.c + fchownat.c + fcntl.c + fetch_bpf_fprog.c + fetch_indirect_syscall_args.c + fetch_struct_flock.c + fetch_struct_iovec.c + fetch_struct_keyctl_kdf_params.c + fetch_struct_mmsghdr.c + fetch_struct_msghdr.c + fetch_struct_stat.c + fetch_struct_stat64.c + fetch_struct_statfs.c + fetch_struct_xfs_quotastat.c + file_handle.c + filter_qualify.c + filter_seccomp.c + flock.c + fs_0x94_ioctl.c + fs_f_ioctl.c + fs_x_ioctl.c + fsconfig.c + fsmount.c + fsopen.c + fspick.c + fstatfs.c + fstatfs64.c + futex.c + futex_waitv.c + gen/gen_hdio.c + get_personality.c + get_robust_list.c + getcpu.c + getcwd.c + getpagesize.c + getpid.c + getrandom.c + gpio_ioctl.c + hdio.c + hostname.c + inotify.c + inotify_ioctl.c + io.c + io_uring.c + ioctl.c + ioperm.c + ioprio.c + ipc.c + ipc_msg.c + ipc_msgctl.c + ipc_sem.c + ipc_semctl.c + ipc_shm.c + ipc_shmctl.c + kcmp.c + kd_ioctl.c + kd_mpers_ioctl.c + kexec.c + keyctl.c + kvm.c + landlock.c + ldt.c + link.c + lirc_ioctl.c + listen.c + lookup_dcookie.c + loop.c + lseek.c + mem.c + membarrier.c + memfd_create.c + memfd_secret.c + mknod.c + mmap_cache.c + mmap_notify.c + mmsghdr.c + mount.c + mount_setattr.c + move_mount.c + mq.c + msghdr.c + mtd.c + nbd_ioctl.c + net.c + netlink.c + netlink_crypto.c + netlink_inet_diag.c + netlink_kobject_uevent.c + netlink_netfilter.c + netlink_netlink_diag.c + netlink_packet_diag.c + netlink_route.c + netlink_selinux.c + netlink_smc_diag.c + netlink_sock_diag.c + netlink_unix_diag.c + nlattr.c + nsfs.c + numa.c + number_set.c + oldstat.c + open.c + open_tree.c + or1k_atomic.c + pathtrace.c + perf.c + perf_ioctl.c + personality.c + pidfd_getfd.c + pidfd_open.c + pidns.c + pkeys.c + poke.c + poll.c + prctl.c + print_dev_t.c + print_group_req.c + print_ifindex.c + print_instruction_pointer.c + print_kernel_sigset.c + print_kernel_version.c + print_mac.c + print_mq_attr.c + print_msgbuf.c + print_sg_req_info.c + print_sigevent.c + print_statfs.c + print_struct_stat.c + print_syscall_number.c + print_time.c + print_timespec32.c + print_timespec64.c + print_timeval.c + print_timeval64.c + print_timex.c + printmode.c + printrusage.c + printsiginfo.c + process_vm.c + ptp.c + ptrace.c + ptrace_syscall_info.c + quota.c + random_ioctl.c + readahead.c + readlink.c + reboot.c + regset.c + renameat.c + resource.c + retval.c + riscv.c + rt_sigframe.c + rt_sigreturn.c + rtc.c + rtnl_addr.c + rtnl_addrlabel.c + rtnl_cachereport.c + rtnl_dcb.c + rtnl_link.c + rtnl_mdb.c + rtnl_neigh.c + rtnl_neightbl.c + rtnl_netconf.c + rtnl_nh.c + rtnl_nsid.c + rtnl_route.c + rtnl_rule.c + rtnl_stats.c + rtnl_tc.c + rtnl_tc_action.c + s390.c + sched.c + scsi.c + seccomp.c + seccomp_ioctl.c + sendfile.c + sg_io_v3.c + sg_io_v4.c + shutdown.c + sigaltstack.c + signal.c + signalfd.c + sigreturn.c + sock.c + sockaddr.c + socketcall.c + socketutils.c + sparc.c + sram_alloc.c + stage_output.c + stat.c + stat64.c + statfs.c + statfs64.c + statx.c + strauss.c + string_to_uint.c + swapon.c + sync_file_range.c + sync_file_range2.c + syscall.c + syscall_name.c + sysctl.c + sysinfo.c + syslog.c + sysmips.c + tee.c + term.c + time.c + times.c + trie.c + truncate.c + ubi.c + ucopy.c + uid.c + uid16.c + umask.c + umount.c + uname.c + upeek.c + upoke.c + userfaultfd.c + ustat.c + util.c + utime.c + utimes.c + v4l2.c + wait.c + watchdog_ioctl.c + xattr.c + xgetdents.c + xlat.c + xmalloc.c +)]] + +build('sed', '$outdir/sys_func.h', expand{'$srcdir/', srcs}, { + expr=[[-n 's/^SYS_FUNC(.*/extern &;/p']], +}) + +pkg.deps = { + '$outdir/config.h', + '$outdir/ioctlent0.h', + '$outdir/ioctlent1.h', + '$outdir/ioctlent2.h', + '$outdir/native_printer_decls.h', + '$outdir/native_printer_defs.h', + '$outdir/printers.h', + '$outdir/scno.h', + '$outdir/sen.h', + '$outdir/sys_func.h', + 'pkg/devel/linux-headers/headers', +} + +lib('libstrace.a', srcs) +exe('strace', {'src/strace.c', 'libstrace.a'}) +file('bin/strace', '755', '$outdir/strace') + +build('sed', '$outdir/strace.1', '$srcdir/doc/strace.1.in', { + expr={ + [[-e 's,@STRACE_MANPAGE_DATE@,2023-06-11,']], + [[-e 's,@VERSION@,6.4,']], + [[-e 's,@ENABLE_STACKTRACE_TRUE@,#,']], + [[-e 's,@ENABLE_STACKTRACE_FALSE@,,']], + [[-e 's,@ENABLE_SECONTEXT_TRUE@,#,']], + [[-e 's,@ENABLE_SECONTEXT_FALSE@,,']], + }, +}) +man({'$outdir/strace.1'}) + +fetch('curl') diff --git a/pkg/devel/strace/mpers.txt b/pkg/devel/strace/mpers.txt @@ -0,0 +1,45 @@ +# 2,<awk '/^mpers_source_files =/ {for (i=3; i<=NF; ++i) print $i}' src/src/mpers.am +block.c +btrfs.c +dirent.c +evdev_mpers.c +fetch_bpf_fprog.c +fetch_struct_flock.c +fetch_struct_iovec.c +fetch_struct_keyctl_kdf_params.c +fetch_struct_mmsghdr.c +fetch_struct_msghdr.c +fetch_struct_stat.c +fetch_struct_stat64.c +fetch_struct_statfs.c +fetch_struct_xfs_quotastat.c +hdio.c +ipc_msgctl.c +ipc_semctl.c +ipc_shmctl.c +kd_mpers_ioctl.c +loop.c +mtd.c +perf_ioctl.c +print_group_req.c +print_kernel_sigset.c +print_mq_attr.c +print_msgbuf.c +print_sg_req_info.c +print_sigevent.c +print_time.c +print_timeval.c +printrusage.c +printsiginfo.c +regset.c +rt_sigreturn.c +rtc.c +sg_io_v3.c +sigaltstack.c +sock.c +sysctl.c +sysinfo.c +times.c +ustat.c +utime.c +v4l2.c diff --git a/pkg/devel/strace/patch/0001-Don-t-return-expression-in-void-function.patch b/pkg/devel/strace/patch/0001-Don-t-return-expression-in-void-function.patch @@ -0,0 +1,25 @@ +From 14b52959359f69bc5806bbd8d8c44f72d912aa1a Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Fri, 5 Jul 2019 20:52:24 -0700 +Subject: [PATCH] Don't return expression in void function + +--- + src/defs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/defs.h b/src/defs.h +index 846a7ae5a..d6b54a633 100644 +--- a/src/defs.h ++++ b/src/defs.h +@@ -807,7 +807,7 @@ extern bool pathtrace_match_set(struct tcb *, struct path_set *, + static inline void + pathtrace_select(const char *path) + { +- return pathtrace_select_set(path, &global_path_set); ++ pathtrace_select_set(path, &global_path_set); + } + + static inline bool +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0002-Use-__typeof__-spelling-of-typeof.patch b/pkg/devel/strace/patch/0002-Use-__typeof__-spelling-of-typeof.patch @@ -0,0 +1,355 @@ +From cdecbf8aee12f837e878a568814bb81550412b6b Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 6 Jul 2019 01:33:01 -0700 +Subject: [PATCH] Use __typeof__ spelling of typeof + +--- + src/bpf.c | 10 +++++----- + src/btrfs.c | 12 ++++++------ + src/defs.h | 6 +++--- + src/fs_0x94_ioctl.c | 2 +- + src/fs_f_ioctl.c | 2 +- + src/landlock.c | 4 ++-- + src/list.h | 10 +++++----- + src/macros.h | 2 +- + src/print_fields.h | 2 +- + src/s390.c | 6 +++--- + src/tee.c | 2 +- + src/ubi.c | 2 +- + tests/btrfs.c | 2 +- + tests/fcntl-common.c | 2 +- + 14 files changed, 32 insertions(+), 32 deletions(-) + +diff --git a/src/bpf.c b/src/bpf.c +index 7bdeb4f65..1e72f3e30 100644 +--- a/src/bpf.c ++++ b/src/bpf.c +@@ -1432,7 +1432,7 @@ BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE) + tprint_struct_next(); + PRINT_FIELD_U(attr, target_btf_id); + } +- attr_size = offsetofend(typeof(attr), target_btf_id); ++ attr_size = offsetofend(__typeof__(attr), target_btf_id); + break; + + /* TODO: prog type == BPF_PROG_TYPE_TRACING */ +@@ -1448,7 +1448,7 @@ BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE) + print_iter_info_array_member, 0); + tprint_struct_next(); + PRINT_FIELD_U(attr, iter_info_len); +- attr_size = offsetofend(typeof(attr), iter_info_len); ++ attr_size = offsetofend(__typeof__(attr), iter_info_len); + break; + } + +@@ -1460,7 +1460,7 @@ BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE) + tprint_struct_begin(); + PRINT_FIELD_X(attr.perf_event, bpf_cookie); + tprint_struct_end(); +- attr_size = offsetofend(typeof(attr), perf_event.bpf_cookie); ++ attr_size = offsetofend(__typeof__(attr), perf_event.bpf_cookie); + break; + + /* TODO: prog type == BPF_PROG_TYPE_KPROBE */ +@@ -1500,7 +1500,7 @@ BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE) + &buf.cookie, sizeof(buf.cookie), + tfetch_mem, print_xint_array_member, 0); + tprint_struct_end(); +- attr_size = offsetofend(typeof(attr), kprobe_multi.cookies); ++ attr_size = offsetofend(__typeof__(attr), kprobe_multi.cookies); + break; + } + +@@ -1510,7 +1510,7 @@ BEGIN_BPF_CMD_DECODER(BPF_LINK_CREATE) + * can pick up non-zero values in the union at the end + * of the link_create struct. + */ +- attr_size = offsetofend(typeof(attr), flags); ++ attr_size = offsetofend(__typeof__(attr), flags); + } + + print_bpf_link_create_end: +diff --git a/src/btrfs.c b/src/btrfs.c +index 31ee871b3..76d7a2bec 100644 +--- a/src/btrfs.c ++++ b/src/btrfs.c +@@ -216,7 +216,7 @@ btrfs_print_logical_ino_container(struct tcb *tcp, + tprint_more_data_follows(); + } else { + const uint64_t val_addr = +- inodes_addr + offsetof(typeof(container), val); ++ inodes_addr + offsetof(__typeof__(container), val); + uint64_t record[3]; + tprint_struct_next(); + tprints_field_name("val"); +@@ -257,7 +257,7 @@ btrfs_print_ino_path_container(struct tcb *tcp, + tprint_more_data_follows(); + } else { + uint64_t val_addr = +- fspath_addr + offsetof(typeof(container), val); ++ fspath_addr + offsetof(__typeof__(container), val); + uint64_t offset; + tprint_struct_next(); + tprints_field_name("val"); +@@ -298,7 +298,7 @@ btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr) + uint64_t record; + tprint_struct_next(); + tprints_field_name("qgroups"); +- print_array(tcp, qgi_addr + offsetof(typeof(inherit), qgroups), ++ print_array(tcp, qgi_addr + offsetof(__typeof__(inherit), qgroups), + inherit.num_qgroups, &record, sizeof(record), + tfetch_mem, print_uint_array_member, 0); + } +@@ -1170,7 +1170,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, + PRINT_FIELD_OBJ_PTR(args, key, + print_btrfs_ioctl_search_key, + entering(tcp), !abbrev(tcp)); +- decode_search_arg_buf(tcp, arg + offsetof(typeof(args), buf), ++ decode_search_arg_buf(tcp, arg + offsetof(__typeof__(args), buf), + sizeof(args.buf), args.key.nr_items); + tprint_struct_end(); + if (entering(tcp)) +@@ -1206,7 +1206,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, + entering(tcp), !abbrev(tcp)); + tprint_struct_next(); + PRINT_FIELD_U(args, buf_size); +- decode_search_arg_buf(tcp, arg + offsetof(typeof(args), buf), ++ decode_search_arg_buf(tcp, arg + offsetof(__typeof__(args), buf), + args.buf_size, args.key.nr_items); + tprint_struct_end(); + if (entering(tcp)) +@@ -1284,7 +1284,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, + struct btrfs_ioctl_space_info info; + tprint_struct_next(); + tprints_field_name("spaces"); +- print_array(tcp, arg + offsetof(typeof(args), spaces), ++ print_array(tcp, arg + offsetof(__typeof__(args), spaces), + args.total_spaces, + &info, sizeof(info), tfetch_mem, + print_btrfs_ioctl_space_info, 0); +diff --git a/src/defs.h b/src/defs.h +index d6b54a633..d24b11884 100644 +--- a/src/defs.h ++++ b/src/defs.h +@@ -1145,7 +1145,7 @@ print_local_array_ex(struct tcb *tcp, + # define print_local_array_upto(tcp_, start_addr_, upto_, print_func_) \ + print_local_array_ex((tcp_), (start_addr_), \ + CLAMP((upto_), 0, \ +- (typeof(upto_)) ARRAY_SIZE(start_addr_)), \ ++ (__typeof__(upto_)) ARRAY_SIZE(start_addr_)), \ + sizeof((start_addr_)[0]), (print_func_), \ + NULL, 0, NULL, NULL) + +@@ -2027,8 +2027,8 @@ scno_pers_is_valid(kernel_ulong_t scno, unsigned int pers) + + # define ILOG2_ITER_(val_, ret_, bit_) \ + do { \ +- typeof(ret_) shift_ = \ +- ((val_) > ((((typeof(val_)) 1) \ ++ __typeof__(ret_) shift_ = \ ++ ((val_) > ((((__typeof__(val_)) 1) \ + << (1 << (bit_))) - 1)) << (bit_); \ + (val_) >>= shift_; \ + (ret_) |= shift_; \ +diff --git a/src/fs_0x94_ioctl.c b/src/fs_0x94_ioctl.c +index 7aa170af0..b908ea1fb 100644 +--- a/src/fs_0x94_ioctl.c ++++ b/src/fs_0x94_ioctl.c +@@ -94,7 +94,7 @@ decode_file_dedupe_range(struct tcb *const tcp, const kernel_ulong_t arg) + if (abbrev(tcp) && range.dest_count > count) + limit = &count; + +- rc = print_array(tcp, arg + offsetof(typeof(range), info), ++ rc = print_array(tcp, arg + offsetof(__typeof__(range), info), + range.dest_count, &info, sizeof(info), + tfetch_mem, + print_file_dedupe_range_info, limit); +diff --git a/src/fs_f_ioctl.c b/src/fs_f_ioctl.c +index 7b51bc9f9..ee9a42754 100644 +--- a/src/fs_f_ioctl.c ++++ b/src/fs_f_ioctl.c +@@ -72,7 +72,7 @@ decode_fiemap(struct tcb *const tcp, const kernel_ulong_t arg) + struct fiemap_extent fe; + tprint_struct_next(); + tprints_field_name("fm_extents"); +- print_array(tcp, arg + offsetof(typeof(args), fm_extents), ++ print_array(tcp, arg + offsetof(__typeof__(args), fm_extents), + args.fm_mapped_extents, &fe, sizeof(fe), + tfetch_mem, print_fiemap_extent, 0); + } +diff --git a/src/landlock.c b/src/landlock.c +index d3ddb4edb..151bea7af 100644 +--- a/src/landlock.c ++++ b/src/landlock.c +@@ -19,7 +19,7 @@ print_landlock_ruleset_attr(struct tcb *tcp, const kernel_ulong_t addr, + { + struct landlock_ruleset_attr attr; + +- if (size < offsetofend(typeof(attr), handled_access_fs)) { ++ if (size < offsetofend(__typeof__(attr), handled_access_fs)) { + printaddr(addr); + return; + } +@@ -31,7 +31,7 @@ print_landlock_ruleset_attr(struct tcb *tcp, const kernel_ulong_t addr, + PRINT_FIELD_FLAGS(attr, handled_access_fs, landlock_ruleset_access_fs, + "LANDLOCK_ACCESS_FS_???"); + +- if (size > offsetofend(typeof(attr), handled_access_fs)) { ++ if (size > offsetofend(__typeof__(attr), handled_access_fs)) { + tprint_arg_next(); + tprint_more_data_follows(); + } +diff --git a/src/list.h b/src/list.h +index 4de4cb3be..f4ec11f0e 100644 +--- a/src/list.h ++++ b/src/list.h +@@ -158,7 +158,7 @@ list_is_empty(const struct list_item *l) + * @param field Name of the field that holds the respective struct list_item. + */ + # define list_next(var, field) \ +- list_elem((var)->field.next, typeof(*(var)), field) ++ list_elem((var)->field.next, __typeof__(*(var)), field) + /** + * Get the previous element in a list. + * +@@ -166,7 +166,7 @@ list_is_empty(const struct list_item *l) + * @param field Name of the field that holds the respective struct list_item. + */ + # define list_prev(var, field) \ +- list_elem((var)->field.prev, typeof(*(var)), field) ++ list_elem((var)->field.prev, __typeof__(*(var)), field) + + /** + * Insert an item into a list. The item is placed as the next list item +@@ -280,7 +280,7 @@ list_replace(struct list_item *old, struct list_item *new) + * inside list items. + */ + # define list_foreach(var_, head_, field_) \ +- for (var_ = list_elem((head_)->next, typeof(*var_), field_); \ ++ for (var_ = list_elem((head_)->next, __typeof__(*var_), field_); \ + &(var_->field_) != (head_); var_ = list_next(var_, field_)) + + /** +@@ -293,8 +293,8 @@ list_replace(struct list_item *old, struct list_item *new) + * @param _tmp Temporary variable for storing pointer to the next item. + */ + # define list_foreach_safe(var_, head_, field_, _tmp) \ +- for (var_ = list_elem((head_)->next, typeof(*var_), field_), \ +- _tmp = list_elem((var_)->field_.next, typeof(*var_), field_); \ ++ for (var_ = list_elem((head_)->next, __typeof__(*var_), field_), \ ++ _tmp = list_elem((var_)->field_.next, __typeof__(*var_), field_); \ + &var_->field_ != head_; var_ = _tmp, _tmp = list_next(_tmp, field_)) + + #endif /* !STRACE_LIST_H */ +diff --git a/src/macros.h b/src/macros.h +index f22be23c5..184f016b0 100644 +--- a/src/macros.h ++++ b/src/macros.h +@@ -62,7 +62,7 @@ + + # define sizeof_field(type_, member_) (sizeof(((type_ *)0)->member_)) + +-# define typeof_field(type_, member_) typeof(((type_ *)0)->member_) ++# define typeof_field(type_, member_) __typeof__(((type_ *)0)->member_) + + # ifndef offsetofend + # define offsetofend(type_, member_) \ +diff --git a/src/print_fields.h b/src/print_fields.h +index eca389e7e..b97e86377 100644 +--- a/src/print_fields.h ++++ b/src/print_fields.h +@@ -774,7 +774,7 @@ tprint_sysret_end(void) + # define MAYBE_PRINT_FIELD_LEN(print_prefix_, where_, field_, \ + len_, print_func_, ...) \ + do { \ +- unsigned int start = offsetof(typeof(where_), field_); \ ++ unsigned int start = offsetof(__typeof__(where_), field_); \ + unsigned int end = start + sizeof((where_).field_); \ + if (len_ > start) { \ + print_prefix_; \ +diff --git a/src/s390.c b/src/s390.c +index ca71730c4..455144fe7 100644 +--- a/src/s390.c ++++ b/src/s390.c +@@ -505,7 +505,7 @@ static void + print_sthyi_machine(struct tcb *tcp, struct sthyi_machine *hdr, uint16_t size, + bool *dummy) + { +- size_t last_decoded = offsetofend(typeof(*hdr), infmpman); ++ size_t last_decoded = offsetofend(__typeof__(*hdr), infmpman); + int cnt_val, name_val, id_val; + + CHECK_SIZE_EX(hdr, last_decoded, size, "machine structure"); +@@ -611,7 +611,7 @@ static void + print_sthyi_partition(struct tcb *tcp, struct sthyi_partition *hdr, + uint16_t size, bool *mt) + { +- size_t last_decoded = offsetofend(typeof(*hdr), infpabif); ++ size_t last_decoded = offsetofend(__typeof__(*hdr), infpabif); + int cnt_val, wcap_val, acap_val, id_val, lpar_val; + + *mt = false; +@@ -802,7 +802,7 @@ static void + print_sthyi_hypervisor(struct tcb *tcp, struct sthyi_hypervisor *hdr, + uint16_t size, int num, bool mt) + { +- size_t last_decoded = offsetofend(typeof(*hdr), infydifl); ++ size_t last_decoded = offsetofend(__typeof__(*hdr), infydifl); + + CHECK_SIZE_EX(hdr, last_decoded, size, "hypervisor %d structure", num); + +diff --git a/src/tee.c b/src/tee.c +index 25f6e76c5..c62566800 100644 +--- a/src/tee.c ++++ b/src/tee.c +@@ -33,7 +33,7 @@ struct tee_ioctl_shm_register_fd_data { + + #define TEE_FETCH_BUF_DATA(buf_, arg_, params_) \ + tee_fetch_buf_data(tcp, arg, &buf_, sizeof(arg_), \ +- &arg_, offsetof(typeof(arg_), num_params), \ ++ &arg_, offsetof(__typeof__(arg_), num_params), \ + params_) + + /* session id is printed as 0x%x in libteec */ +diff --git a/src/ubi.c b/src/ubi.c +index bd2d2811e..ff9f88cd0 100644 +--- a/src/ubi.c ++++ b/src/ubi.c +@@ -76,7 +76,7 @@ static bool + print_ubi_rnvol_req_ent_array_member(struct tcb *tcp, void *elem_buf, + size_t elem_size, void *data) + { +- typeof(&((struct ubi_rnvol_req *) NULL)->ents[0]) p = elem_buf; ++ __typeof__(&((struct ubi_rnvol_req *) NULL)->ents[0]) p = elem_buf; + + tprint_struct_begin(); + PRINT_FIELD_D(*p, vol_id); +diff --git a/tests/btrfs.c b/tests/btrfs.c +index d8ef87a96..321d3a25c 100644 +--- a/tests/btrfs.c ++++ b/tests/btrfs.c +@@ -876,7 +876,7 @@ btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, + printf("buf=["); + for (uint64_t i = 0; i < key->nr_items; ++i) { + struct btrfs_ioctl_search_header *sh; +- sh = (typeof(sh))(buf + off); ++ sh = (__typeof__(sh))(buf + off); + if (i) + printf(", "); + printf("{transid=%" PRI__u64 ", objectid=", +diff --git a/tests/fcntl-common.c b/tests/fcntl-common.c +index 20f92dd1d..aa6ecc8f5 100644 +--- a/tests/fcntl-common.c ++++ b/tests/fcntl-common.c +@@ -28,7 +28,7 @@ + #endif + + #ifdef HAVE_TYPEOF +-# define TYPEOF_FLOCK_OFF_T typeof(((struct flock *) NULL)->l_len) ++# define TYPEOF_FLOCK_OFF_T __typeof__(((struct flock *) NULL)->l_len) + #else + # define TYPEOF_FLOCK_OFF_T off_t + #endif +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0003-Make-tcp_sysent-a-static-inline-function.patch b/pkg/devel/strace/patch/0003-Make-tcp_sysent-a-static-inline-function.patch @@ -0,0 +1,33 @@ +From 0355d08676cdc94354bd35f8d885984938645fb3 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 6 Jul 2019 01:40:36 -0700 +Subject: [PATCH] Make tcp_sysent a static inline function + +This way we can include the second operand to the conditional +operator without evaluating the macro argument multiple times. +--- + src/defs.h | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/defs.h b/src/defs.h +index d24b11884..60b9e3322 100644 +--- a/src/defs.h ++++ b/src/defs.h +@@ -398,8 +398,12 @@ struct tcb { + # define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL) + # define has_seccomp_filter(tcp) ((tcp)->flags & TCB_SECCOMP_FILTER) + +-extern const struct_sysent stub_sysent; +-# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent) ++static inline const struct_sysent * ++tcp_sysent(struct tcb *tcp) ++{ ++ extern const struct_sysent stub_sysent; ++ return tcp->s_ent ? tcp->s_ent : &stub_sysent; ++} + # define n_args(tcp) (tcp_sysent(tcp)->nargs) + + # include "xlat.h" +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0004-Avoid-empty-initializer-lists.patch b/pkg/devel/strace/patch/0004-Avoid-empty-initializer-lists.patch @@ -0,0 +1,229 @@ +From 463e94867f84bcb4dc85e18cb4304edea90d8659 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 6 Jul 2019 01:54:05 -0700 +Subject: [PATCH] Avoid empty initializer lists + +--- + src/bpf.c | 4 ++-- + src/futex_waitv.c | 2 +- + src/sched.c | 2 +- + src/signal.c | 2 +- + src/strace.c | 2 +- + tests/btrfs.c | 8 ++++---- + tests/clock_nanosleep.c | 2 +- + tests/nanosleep.c | 2 +- + tests/restart_syscall.c | 2 +- + tests/setrlimit.c | 2 +- + tests/timer_create.c | 2 +- + tests/wait4.c | 2 +- + tests/waitid.c | 2 +- + 13 files changed, 17 insertions(+), 17 deletions(-) + +diff --git a/src/bpf.c b/src/bpf.c +index 1e72f3e30..7a6406687 100644 +--- a/src/bpf.c ++++ b/src/bpf.c +@@ -48,7 +48,7 @@ bpf_cmd_decoder(struct tcb *const tcp, \ + #define BEGIN_BPF_CMD_DECODER(bpf_cmd) \ + static DECL_BPF_CMD_DECODER(decode_ ## bpf_cmd) \ + { \ +- struct bpf_cmd ## _struct attr = {}; \ ++ struct bpf_cmd ## _struct attr = {0}; \ + size_t attr_size = bpf_cmd ## _struct_size; \ + const unsigned int len = MIN(size, attr_size); \ + memcpy(&attr, data, len); \ +@@ -159,7 +159,7 @@ print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len) + if (abbrev(tcp)) { + printaddr(addr); + } else { +- struct ebpf_insns_data eid = {}; ++ struct ebpf_insns_data eid = {0}; + struct ebpf_insn insn; + + print_array(tcp, addr, len, &insn, sizeof(insn), +diff --git a/src/futex_waitv.c b/src/futex_waitv.c +index 512ee715d..340201aa3 100644 +--- a/src/futex_waitv.c ++++ b/src/futex_waitv.c +@@ -49,7 +49,7 @@ print_waiter_array(struct tcb * const tcp, const kernel_ulong_t waiters, + const unsigned int nr_futexes) + { + struct futex_waitv buf; +- struct print_waiter_data data = {}; ++ struct print_waiter_data data = {0}; + + print_array(tcp, waiters, nr_futexes, &buf, sizeof(buf), + tfetch_mem, print_waiter, &data); +diff --git a/src/sched.c b/src/sched.c +index 010366871..2dda5b872 100644 +--- a/src/sched.c ++++ b/src/sched.c +@@ -111,7 +111,7 @@ static void + print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int usize) + { +- struct sched_attr attr = {}; ++ struct sched_attr attr = {0}; + unsigned int size; + bool is_set = false; + +diff --git a/src/signal.c b/src/signal.c +index 98f84d500..8680b10fb 100644 +--- a/src/signal.c ++++ b/src/signal.c +@@ -257,7 +257,7 @@ print_sigset_addr_len_limit(struct tcb *const tcp, const kernel_ulong_t addr, + printaddr(addr); + return; + } +- int mask[NSIG_BYTES / sizeof(int)] = {}; ++ int mask[NSIG_BYTES / sizeof(int)] = {0}; + if (umoven_or_printaddr(tcp, addr, len, mask)) + return; + tprints_string(sprintsigmask_n("", mask, len)); +diff --git a/src/strace.c b/src/strace.c +index 5752177b7..9cd4ff461 100644 +--- a/src/strace.c ++++ b/src/strace.c +@@ -3693,7 +3693,7 @@ trace_syscall(struct tcb *tcp, unsigned int *sig) + syscall_entering_finish(tcp, res); + return res; + } else { +- struct timespec ts = {}; ++ struct timespec ts = {0}; + int res = syscall_exiting_decode(tcp, &ts); + if (res != 0) { + res = syscall_exiting_trace(tcp, &ts, res); +diff --git a/tests/btrfs.c b/tests/btrfs.c +index 321d3a25c..442377130 100644 +--- a/tests/btrfs.c ++++ b/tests/btrfs.c +@@ -313,7 +313,7 @@ btrfs_test_subvol_ioctls(void) + char *long_subvol_name; + void *bad_pointer = (void *) (unsigned long) 0xdeadbeeffffffeedULL; + uint64_t u64val = 0xdeadbeefbadc0dedULL; +- struct btrfs_ioctl_vol_args vol_args = {}; ++ struct btrfs_ioctl_vol_args vol_args = {0}; + struct btrfs_ioctl_vol_args_v2 vol_args_v2 = { + .fd = 2, + .flags = max_flags_plus_one(2), +@@ -554,7 +554,7 @@ btrfs_test_balance_ioctls(void) + .devid = 1, + }, + }; +- struct btrfs_ioctl_vol_args vol_args = {}; ++ struct btrfs_ioctl_vol_args vol_args = {0}; + + ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); + printf("ioctl(-1, %s, %sBTRFS_BALANCE_CTL_PAUSE%s) = -1 EBADF (%m)\n", +@@ -764,7 +764,7 @@ btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args, + static void + btrfs_test_defrag_ioctls(void) + { +- struct btrfs_ioctl_vol_args vol_args = {}; ++ struct btrfs_ioctl_vol_args vol_args = {0}; + struct btrfs_ioctl_defrag_range_args args = { + .start = 0, + .len = -1ULL, +@@ -1092,7 +1092,7 @@ btrfs_test_ino_lookup_ioctl(void) + static void + btrfs_test_space_info_ioctl(void) + { +- struct btrfs_ioctl_space_args args = {}; ++ struct btrfs_ioctl_space_args args = {0}; + + ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", +diff --git a/tests/clock_nanosleep.c b/tests/clock_nanosleep.c +index 51bd0d7f7..a1053fd1e 100644 +--- a/tests/clock_nanosleep.c ++++ b/tests/clock_nanosleep.c +@@ -39,7 +39,7 @@ main(void) + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; +- const sigset_t set = {}; ++ const sigset_t set = {0}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { + .it_interval.tv_usec = 222222, +diff --git a/tests/nanosleep.c b/tests/nanosleep.c +index 8ff6a86b8..6377f38ee 100644 +--- a/tests/nanosleep.c ++++ b/tests/nanosleep.c +@@ -53,7 +53,7 @@ main(void) + .ts = { .tv_sec = 0xc0de2, .tv_nsec = 0xc0de3 }, + .pad = { 0xdeadbeef, 0xbadc0ded } + }; +- const sigset_t set = {}; ++ const sigset_t set = {0}; + const struct sigaction act = { .sa_handler = handler }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + +diff --git a/tests/restart_syscall.c b/tests/restart_syscall.c +index e4e83dc09..da83d1dc7 100644 +--- a/tests/restart_syscall.c ++++ b/tests/restart_syscall.c +@@ -26,7 +26,7 @@ main(void) + */ + error_msg_and_skip("x32 is broken"); + #else +- const sigset_t set = {}; ++ const sigset_t set = {0}; + const struct sigaction act = { .sa_handler = SIG_IGN }; + const struct itimerval itv = { .it_value.tv_usec = 111111 }; + const struct timespec req = { .tv_nsec = 222222222 }; +diff --git a/tests/setrlimit.c b/tests/setrlimit.c +index d4953f6f8..60d54fbd8 100644 +--- a/tests/setrlimit.c ++++ b/tests/setrlimit.c +@@ -39,7 +39,7 @@ main(void) + printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); + # endif + +- struct rlimit libc_rlim = {}; ++ struct rlimit libc_rlim = {0}; + if (getrlimit((int) res, &libc_rlim)) + continue; + rlimit[0] = libc_rlim.rlim_cur; +diff --git a/tests/timer_create.c b/tests/timer_create.c +index af91da0d3..a0a79f1ad 100644 +--- a/tests/timer_create.c ++++ b/tests/timer_create.c +@@ -24,7 +24,7 @@ main(void) + printf("timer_create(CLOCK_REALTIME, NULL, NULL) = -1 %s (%m)\n", + errno2name()); + +- int tid[4] = {}; ++ int tid[4] = {0}; + struct_sigevent sev = { + .sigev_notify = 0xdefaced, + .sigev_signo = 0xfacefeed, +diff --git a/tests/wait4.c b/tests/wait4.c +index faf9423f8..eacee2366 100644 +--- a/tests/wait4.c ++++ b/tests/wait4.c +@@ -89,7 +89,7 @@ k_wait4(const unsigned int pid, void const *wstatus, + static pid_t + do_wait4(pid_t pid, int *wstatus, int options, kernel_rusage_t *ru) + { +- sigset_t mask = {}; ++ sigset_t mask = {0}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); +diff --git a/tests/waitid.c b/tests/waitid.c +index 1ed763840..fef941874 100644 +--- a/tests/waitid.c ++++ b/tests/waitid.c +@@ -146,7 +146,7 @@ do_waitid(const unsigned int idtype, + const unsigned int options, + const kernel_rusage_t *const rusage) + { +- sigset_t mask = {}; ++ sigset_t mask = {0}; + sigaddset(&mask, SIGCHLD); + + assert(sigprocmask(SIG_BLOCK, &mask, NULL) == 0); +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0005-Avoid-pointer-arithmetic-on-void.patch b/pkg/devel/strace/patch/0005-Avoid-pointer-arithmetic-on-void.patch @@ -0,0 +1,152 @@ +From 989bfd76544b4f62ade9e35d2476332934d27d86 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 7 Jul 2019 21:25:13 -0700 +Subject: [PATCH] Avoid pointer arithmetic on `void *` + +--- + src/netlink_smc_diag.c | 4 ++-- + src/print_timespec.h | 6 ++++-- + src/sockaddr.c | 4 ++-- + src/tee.c | 2 +- + src/ucopy.c | 12 ++++++------ + 5 files changed, 15 insertions(+), 13 deletions(-) + +diff --git a/src/netlink_smc_diag.c b/src/netlink_smc_diag.c +index f7ff06b6b..dbf5be980 100644 +--- a/src/netlink_smc_diag.c ++++ b/src/netlink_smc_diag.c +@@ -42,7 +42,7 @@ DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req) + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, +- (void *) &req + offset)) { ++ (char *) &req + offset)) { + PRINT_FIELD_FLAGS(req, diag_ext, + smc_diag_extended_flags, + "1<<SMC_DIAG_\?\?\?-1"); +@@ -250,7 +250,7 @@ DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg) + if (len >= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, +- (void *) &msg + offset)) { ++ (char *) &msg + offset)) { + PRINT_FIELD_XVAL(msg, diag_state, + smc_states, "SMC_???"); + tprint_struct_next(); +diff --git a/src/print_timespec.h b/src/print_timespec.h +index 9603a6bb6..f5f747c42 100644 +--- a/src/print_timespec.h ++++ b/src/print_timespec.h +@@ -66,6 +66,8 @@ bool + PRINT_TIMESPEC_ARRAY_DATA_SIZE(const void *arg, const unsigned int nmemb, + const size_t size) + { ++ const char *ts = arg; ++ + if (nmemb > size / sizeof(TIMESPEC_T)) { + tprint_unavailable(); + return false; +@@ -73,10 +75,10 @@ PRINT_TIMESPEC_ARRAY_DATA_SIZE(const void *arg, const unsigned int nmemb, + + tprint_array_begin(); + +- for (unsigned int i = 0; i < nmemb; i++, arg += sizeof(TIMESPEC_T)) { ++ for (unsigned int i = 0; i < nmemb; i++, ts += sizeof(TIMESPEC_T)) { + if (i) + tprint_array_next(); +- print_unaligned_timespec_t(arg); ++ print_unaligned_timespec_t(ts); + } + + tprint_array_end(); +diff --git a/src/sockaddr.c b/src/sockaddr.c +index 9139da1cd..7126ad2fc 100644 +--- a/src/sockaddr.c ++++ b/src/sockaddr.c +@@ -583,7 +583,7 @@ print_sockaddr_data_ll(struct tcb *tcp, const void *const buf, + static void + print_sockaddr_data_raw(const void *const buf, const int addrlen) + { +- const char *const data = buf + SIZEOF_SA_FAMILY; ++ const char *const data = (const char *)buf + SIZEOF_SA_FAMILY; + const int datalen = addrlen - SIZEOF_SA_FAMILY; + + tprints_field_name("sa_data"); +@@ -780,7 +780,7 @@ print_sockaddr_data_rxrpc(struct tcb *tcp, const void *const buf, + tprints_field_name("transport"); + tprint_struct_begin(); + +- const void *const transport_buf = (void *) &sa->transport ++ const void *const transport_buf = (char *) &sa->transport + + sizeof(sa->transport.family); + const int transport_len = MIN(sa->transport_len, + len - offsetof(struct sockaddr_rxrpc, +diff --git a/src/tee.c b/src/tee.c +index fc735e0da..f705a7a94 100644 +--- a/src/tee.c ++++ b/src/tee.c +@@ -69,7 +69,7 @@ tee_fetch_buf_data(struct tcb *const tcp, + tee_print_buf(buf); + return RVAL_IOCTL_DECODED; + } +- uint32_t *num_params = (uint32_t *) (arg_struct + num_params_offs); ++ uint32_t *num_params = (uint32_t *) ((char *)arg_struct + num_params_offs); + if (entering(tcp) && + (arg_size + TEE_IOCTL_PARAM_SIZE(*num_params) != buf->buf_len)) { + /* +diff --git a/src/ucopy.c b/src/ucopy.c +index c769a1916..ed401ae74 100644 +--- a/src/ucopy.c ++++ b/src/ucopy.c +@@ -186,7 +186,7 @@ vm_read_mem(const pid_t pid, void *laddr, + break; + + len = next_len; +- laddr += copy_len; ++ laddr = (char *)laddr + copy_len; + page_start += page_size; + taddr = page_start; + } +@@ -282,7 +282,7 @@ umoven_peekdata(const int pid, kernel_ulong_t addr, unsigned int len, + memcpy(laddr, &u.data[residue], m); + residue = 0; + addr += sizeof(long); +- laddr += m; ++ laddr = (char *)laddr + m; + nread += m; + len -= m; + } +@@ -378,10 +378,10 @@ umovestr_peekdata(const int pid, kernel_ulong_t addr, unsigned int len, + memcpy(laddr, &u.data[residue], m); + while (residue < sizeof(long)) + if (u.data[residue++] == '\0') +- return (laddr - orig_addr) + residue; ++ return nread + residue; + residue = 0; + addr += sizeof(long); +- laddr += m; ++ laddr = (char *)laddr + m; + nread += m; + len -= m; + } +@@ -502,7 +502,7 @@ upoken_pokedata(const int pid, kernel_ulong_t addr, unsigned int len, + + addr += sizeof(long); + nwritten += npoke; +- our_addr += npoke; ++ our_addr = (char *)our_addr + npoke; + len -= npoke; + } + +@@ -515,7 +515,7 @@ upoken_pokedata(const int pid, kernel_ulong_t addr, unsigned int len, + + addr += sizeof(long); + nwritten += sizeof(long); +- our_addr += sizeof(long); ++ our_addr = (char *)our_addr + sizeof(long); + len -= sizeof(long); + } + +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0006-Avoid-empty-struct-definition.patch b/pkg/devel/strace/patch/0006-Avoid-empty-struct-definition.patch @@ -0,0 +1,38 @@ +From f94d470d85911142bff6cb3821079f3ff321edfc Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 7 Jul 2019 21:50:31 -0700 +Subject: [PATCH] Avoid empty struct definition + +--- + src/fetch_struct_stat64.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/src/fetch_struct_stat64.c b/src/fetch_struct_stat64.c +index b5125d420..b45a48da5 100644 +--- a/src/fetch_struct_stat64.c ++++ b/src/fetch_struct_stat64.c +@@ -32,12 +32,6 @@ + # endif /* HAVE_MX32_STRUCT_STAT64 */ + #endif /* MPERS_IS_m32 || MPERS_IS_mx32 */ + +-#ifndef HAVE_STRUCT_STAT64 +-struct stat64 {}; +-#endif +- +-typedef struct stat64 struct_stat64; +- + #include MPERS_DEFS + + #include "stat.h" +@@ -55,7 +49,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_stat64, + struct strace_stat *const dst) + { + #ifdef HAVE_STRUCT_STAT64 +- struct_stat64 buf; ++ struct stat64 buf; + if (umove_or_printaddr(tcp, addr, &buf)) + return false; + +-- +2.34.1 + diff --git a/pkg/devel/strace/patch/0007-Don-t-omit-second-operand-to-operator.patch b/pkg/devel/strace/patch/0007-Don-t-omit-second-operand-to-operator.patch @@ -0,0 +1,100 @@ +From 3b3898e2a370be0489226da973e18176530e267a Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 7 Jul 2019 21:53:16 -0700 +Subject: [PATCH] Don't omit second operand to '?' operator + +--- + src/kd_ioctl.c | 2 +- + src/open.c | 5 +++-- + src/prctl.c | 8 ++++---- + src/strace.c | 6 +++--- + 4 files changed, 11 insertions(+), 10 deletions(-) + +diff --git a/src/kd_ioctl.c b/src/kd_ioctl.c +index ada23d536..fddbd38fb 100644 +--- a/src/kd_ioctl.c ++++ b/src/kd_ioctl.c +@@ -457,7 +457,7 @@ kd_kbd_str_entry(struct tcb *const tcp, const kernel_ulong_t arg, + + if (print_quoted_string((char *) val.kb_string, + MIN(max_strlen, +- (unsigned int) ret ?: sizeof(val.kb_string)), ++ ret ? (unsigned int) ret : sizeof(val.kb_string)), + QUOTE_OMIT_TRAILING_0)) + tprint_more_data_follows(); + +diff --git a/src/open.c b/src/open.c +index 6356c5831..df59ea999 100644 +--- a/src/open.c ++++ b/src/open.c +@@ -88,8 +88,9 @@ sprint_open_modes64(uint64_t flags) + } + *p = '\0'; + +- return sprintflags_ex(outstr, open_mode_flags, flags, sep, +- XLAT_STYLE_ABBREV) ?: outstr; ++ str = sprintflags_ex(outstr, open_mode_flags, flags, sep, ++ XLAT_STYLE_ABBREV); ++ return str ? str : outstr; + } + + const char * +diff --git a/src/prctl.c b/src/prctl.c +index f6b4dd741..951133a83 100644 +--- a/src/prctl.c ++++ b/src/prctl.c +@@ -92,10 +92,10 @@ sprint_sve_val(kernel_ulong_t arg, bool aux) + if (!aux && flags && xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + { + xsprintf(out, "%#" PRI_klx " /* %s%s%#" PRI_klx " */", +- arg, flags_str ?: "", flags_str ? "|" : "", vl); ++ arg, flags_str ? flags_str : "", flags_str ? "|" : "", vl); + } else { + xsprintf(out, "%s%s%#" PRI_klx, +- flags_str ?: "", flags_str ? "|" : "", vl); ++ flags_str ? flags_str : "", flags_str ? "|" : "", vl); + } + + return out; +@@ -128,10 +128,10 @@ sprint_sme_val(kernel_ulong_t arg, bool aux) + if (!aux && flags && xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + { + xsprintf(out, "%#" PRI_klx " /* %s%s%#" PRI_klx " */", +- arg, flags_str ?: "", flags_str ? "|" : "", vl); ++ arg, flags_str ? flags_str : "", flags_str ? "|" : "", vl); + } else { + xsprintf(out, "%s%s%#" PRI_klx, +- flags_str ?: "", flags_str ? "|" : "", vl); ++ flags_str ? flags_str : "", flags_str ? "|" : "", vl); + } + + return out; +diff --git a/src/strace.c b/src/strace.c +index 9cd4ff461..4403bd27e 100644 +--- a/src/strace.c ++++ b/src/strace.c +@@ -2494,7 +2494,7 @@ init(int argc, char *argv[]) + break; + case GETOPT_TS: + tflag_long_set = true; +- if (parse_ts_arg(optarg ?: tflag_str)) ++ if (parse_ts_arg(optarg ? optarg : tflag_str)) + error_opt_arg(c, lopt, optarg); + break; + case 'T': +@@ -2614,10 +2614,10 @@ init(int argc, char *argv[]) + qualify_kvm(optarg); + break; + case GETOPT_QUAL_QUIET: +- qualify_quiet(optarg ?: qflag_qual); ++ qualify_quiet(optarg ? optarg : qflag_qual); + break; + case GETOPT_QUAL_DECODE_FD: +- qualify_decode_fd(optarg ?: yflag_qual); ++ qualify_decode_fd(optarg ? optarg : yflag_qual); + break; + case GETOPT_QUAL_DECODE_PID: + qualify_decode_pid(optarg); +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0008-Avoid-unnecessary-VLAs.patch b/pkg/devel/strace/patch/0008-Avoid-unnecessary-VLAs.patch @@ -0,0 +1,100 @@ +From a98e58cc36d6df5935dbedd9e1c2947262b8b67c Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 7 Jul 2019 21:58:46 -0700 +Subject: [PATCH] Avoid unnecessary VLAs + +--- + src/count.c | 2 +- + src/nlattr.c | 2 +- + src/socketutils.c | 4 ++-- + src/syscall.c | 2 +- + src/util.c | 5 ++--- + 5 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/src/count.c b/src/count.c +index e4f362787..ad203748b 100644 +--- a/src/count.c ++++ b/src/count.c +@@ -414,7 +414,7 @@ call_summary_pers(FILE *outf) + fprintf(outf, column_fmts[i], (val_), cwidths[c]); \ + break + +- const char *column_fmts[last_column + 1]; ++ const char *column_fmts[ARRAY_SIZE(columns)]; + for (size_t i = 0; i <= last_column; ++i) { + const size_t c = columns[i]; + +diff --git a/src/nlattr.c b/src/nlattr.c +index 1fb394d7c..6f2d54979 100644 +--- a/src/nlattr.c ++++ b/src/nlattr.c +@@ -357,7 +357,7 @@ decode_nla_hwaddr(struct tcb *const tcp, + if (len > MAX_ADDR_LEN) + return false; + +- uint8_t buf[len]; ++ uint8_t buf[MAX_ADDR_LEN]; + const uintptr_t arphrd = (uintptr_t) opaque_data; + + if (!umoven_or_printaddr(tcp, addr, len, buf)) { +diff --git a/src/socketutils.c b/src/socketutils.c +index d3a3b9283..e0079456f 100644 +--- a/src/socketutils.c ++++ b/src/socketutils.c +@@ -133,7 +133,7 @@ inet_parse_response(const void *const data, const int data_len, + return -1; + } + +- char src_buf[text_size]; ++ char src_buf[INET6_ADDRSTRLEN]; + char *details; + + /* open/closing brackets for IPv6 addresses */ +@@ -146,7 +146,7 @@ inet_parse_response(const void *const data, const int data_len, + + if (diag_msg->id.idiag_dport || + memcmp(zero_addr, diag_msg->id.idiag_dst, addr_size)) { +- char dst_buf[text_size]; ++ char dst_buf[INET6_ADDRSTRLEN]; + + if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_dst, + dst_buf, text_size)) +diff --git a/src/syscall.c b/src/syscall.c +index c636ba37c..687d08bc0 100644 +--- a/src/syscall.c ++++ b/src/syscall.c +@@ -287,7 +287,7 @@ decode_socket_subcall(struct tcb *tcp) + + const kernel_ulong_t scno = SYS_socket_subcall + call; + const unsigned int nargs = sysent[scno].nargs; +- uint64_t buf[nargs]; ++ uint64_t buf[MAX_ARGS]; + + if (umoven(tcp, tcp->u_arg[1], nargs * current_wordsize, buf) < 0) + return; +diff --git a/src/util.c b/src/util.c +index a63d80678..a3bea5b76 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -556,8 +556,7 @@ enum sock_proto + getfdproto(struct tcb *tcp, int fd) + { + #ifdef HAVE_SYS_XATTR_H +- size_t bufsize = 256; +- char buf[bufsize]; ++ char buf[256]; + ssize_t r; + char path[sizeof("/proc/%u/fd/%u") + 2 * sizeof(int)*3]; + +@@ -565,7 +564,7 @@ getfdproto(struct tcb *tcp, int fd) + return SOCK_PROTO_UNKNOWN; + + xsprintf(path, "/proc/%u/fd/%u", get_proc_pid(tcp->pid), fd); +- r = getxattr(path, "system.sockprotoname", buf, bufsize - 1); ++ r = getxattr(path, "system.sockprotoname", buf, sizeof(buf) - 1); + if (r <= 0) + return SOCK_PROTO_UNKNOWN; + else { +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0009-Avoid-index-ranges-and-empty-initializer-lists-in-sy.patch b/pkg/devel/strace/patch/0009-Avoid-index-ranges-and-empty-initializer-lists-in-sy.patch @@ -0,0 +1,1048 @@ +From 261761aff67c7169b758c4747b3fe7826161ee6d Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 7 Jul 2019 22:29:34 -0700 +Subject: [PATCH] Avoid index ranges and empty initializer lists in syscallent + arrays + +--- + src/linux/alpha/syscallent.h | 34 ++++++------- + src/linux/arm/syscallent.h | 2 +- + src/linux/avr32/syscallent.h | 4 +- + src/linux/bfin/syscallent.h | 2 +- + src/linux/i386/syscallent.h | 6 +-- + src/linux/m68k/syscallent.h | 2 +- + src/linux/microblaze/syscallent.h | 6 +-- + src/linux/mips/syscallent-compat.h | 46 +++++++++--------- + src/linux/s390/syscallent.h | 42 ++++++++-------- + src/linux/s390x/syscallent.h | 78 +++++++++++++++--------------- + src/linux/sh/syscallent.h | 12 ++--- + src/linux/sh64/syscallent.h | 18 +++---- + src/linux/xtensa/syscallent.h | 32 ++++++------ + 13 files changed, 142 insertions(+), 142 deletions(-) + +diff --git a/src/linux/alpha/syscallent.h b/src/linux/alpha/syscallent.h +index 87cbe59bd..88bc0a5a4 100644 +--- a/src/linux/alpha/syscallent.h ++++ b/src/linux/alpha/syscallent.h +@@ -60,7 +60,7 @@ + [ 50] = { 5, 0, SEN(printargs), "osf_setlogin" }, /* not implemented */ + [ 51] = { 1, TF, SEN(acct), "acct" }, + [ 52] = { 1, TS, SEN(sigpending), "sigpending" }, +-[ 53] = { }, ++/* [ 53] - unused */ + [ 54] = { 3, TD, SEN(ioctl), "ioctl" }, + [ 55] = { 5, 0, SEN(printargs), "osf_reboot" }, /* not implemented */ + [ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /* not implemented */ +@@ -126,7 +126,7 @@ + [116] = { 2, TCL, SEN(osf_gettimeofday), "osf_gettimeofday" }, + [117] = { 2, 0, SEN(osf_getrusage), "osf_getrusage" }, + [118] = { 5, TN, SEN(getsockopt), "getsockopt" }, +-[119] = { }, ++/* [119] - unused */ + [120] = { 3, TD, SEN(readv), "readv" }, + [121] = { 3, TD, SEN(writev), "writev" }, + [122] = { 2, TCL, SEN(osf_settimeofday), "osf_settimeofday" }, +@@ -158,31 +158,31 @@ + [148] = { 4, TF, SEN(quotactl), "quotactl" }, + [149] = { 5, 0, SEN(printargs), "osf_oldquota" }, /* not implemented */ + [150] = { 3, TN, SEN(getsockname), "getsockname" }, +-[151 ... 152] = { }, ++/* [151 ... 152] - unused */ + [153] = { 5, 0, SEN(printargs), "osf_pid_block" }, /* not implemented */ + [154] = { 5, 0, SEN(printargs), "osf_pid_unblock" }, /* not implemented */ +-[155] = { }, ++/* [155] - unused */ + [156] = { 3, TS, SEN(sigaction), "sigaction" }, + [157] = { 5, 0, SEN(printargs), "osf_sigwaitprim" }, /* not implemented */ + [158] = { 5, 0, SEN(printargs), "osf_nfssvc" }, /* not implemented */ + [159] = { 4, 0, SEN(printargs), "osf_getdirentries" }, + [160] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs" }, + [161] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs" }, +-[162] = { }, ++/* [162] - unused */ + [163] = { 5, 0, SEN(printargs), "osf_asynch_daemon" }, /* not implemented */ + [164] = { 5, 0, SEN(printargs), "osf_getfh" }, /* not implemented */ + [165] = { 2, 0, SEN(printargs), "osf_getdomainname" }, + [166] = { 2, 0, SEN(setdomainname), "setdomainname" }, +-[167 ... 168] = { }, ++/* [167 ... 168] - unused */ + [169] = { 5, 0, SEN(printargs), "osf_exportfs" }, /* not implemented */ +-[170 ... 180] = { }, ++/* [170 ... 180] - unused */ + [181] = { 5, 0, SEN(printargs), "osf_alt_plock" }, /* not implemented */ +-[182 ... 183] = { }, ++/* [182 ... 183] - unused */ + [184] = { 5, 0, SEN(printargs), "osf_getmnt" }, /* not implemented */ +-[185 ... 186] = { }, ++/* [185 ... 186] - unused */ + [187] = { 5, 0, SEN(printargs), "osf_alt_sigpending" }, /* not implemented */ + [188] = { 5, 0, SEN(printargs), "osf_alt_setsid" }, /* not implemented */ +-[189 ... 198] = { }, ++/* [189 ... 198] - unused */ + [199] = { 4, 0, SEN(printargs), "osf_swapon" }, + [200] = { 3, TI, SEN(msgctl), "msgctl" }, + [201] = { 2, TI, SEN(msgget), "msgget" }, +@@ -205,7 +205,7 @@ + [218] = { 5, 0, SEN(printargs), "osf_signal" }, /* not implemented */ + [219] = { 5, 0, SEN(printargs), "osf_utc_gettime" }, /* not implemented */ + [220] = { 5, TCL, SEN(printargs), "osf_utc_adjtime" }, /* not implemented */ +-[221] = { }, ++/* [221] - unused */ + [222] = { 5, 0, SEN(printargs), "osf_security" }, /* not implemented */ + [223] = { 5, 0, SEN(printargs), "osf_kloadcall" }, /* not implemented */ + [224] = { 2, TF|TST|TSTA, SEN(printargs), "osf_stat" }, +@@ -213,7 +213,7 @@ + [226] = { 2, TD|TFST|TSTA, SEN(printargs), "osf_fstat" }, + [227] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs64" }, + [228] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs64" }, +-[229 ... 232] = { }, ++/* [229 ... 232] - unused */ + [233] = { 1, 0, SEN(getpgid), "getpgid" }, + [234] = { 1, 0, SEN(getsid), "getsid" }, + [235] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +@@ -230,7 +230,7 @@ + [246] = { 5, 0, SEN(printargs), "osf_ntp_gettime" }, /* not implemented */ + [247] = { 5, 0, SEN(printargs), "osf_pathconf" }, /* not implemented */ + [248] = { 5, 0, SEN(printargs), "osf_fpathconf" }, /* not implemented */ +-[249] = { }, ++/* [249] - unused */ + [250] = { 5, 0, SEN(printargs), "osf_uswitch" }, /* not implemented */ + [251] = { 2, 0, SEN(printargs), "osf_usleep_thread" }, + [252] = { 5, 0, SEN(printargs), "osf_audcntl" }, /* not implemented */ +@@ -243,7 +243,7 @@ + [259] = { 5, 0, SEN(printargs), "osf_swapctl" }, /* not implemented */ + [260] = { 5, 0, SEN(printargs), "osf_memcntl" }, /* not implemented */ + [261] = { 5, 0, SEN(printargs), "osf_fdatasync" }, /* not implemented */ +-[262 ... 299] = { }, ++/* [262 ... 299] - unused */ + [300] = { 2, 0, SEN(bdflush), "bdflush" }, + [301] = { 1, 0, SEN(printargs), "sethae" }, + [302] = { 5, TF, SEN(mount), "mount" }, +@@ -264,7 +264,7 @@ + [317] = { 0, TM, SEN(munlockall), "munlockall" }, + [318] = { 1, 0, SEN(sysinfo), "sysinfo" }, + [319] = { 1, 0, SEN(sysctl), "_sysctl" }, +-[320] = { }, ++/* [320] - unused */ + [321] = { 1, TF, SEN(umount), "oldumount" }, + [322] = { 2, TF, SEN(swapon), "swapon" }, + [323] = { 1, 0, SEN(times), "times" }, +@@ -324,7 +324,7 @@ + [377] = { 3, TD, SEN(getdents64), "getdents64" }, + [378] = { 0, PU|NF, SEN(gettid), "gettid" }, + [379] = { 3, TD, SEN(readahead), "readahead" }, +-[380] = { }, ++/* [380] - unused */ + [381] = { 2, TS|TP, SEN(tkill), "tkill" }, + [382] = { 5, TF, SEN(setxattr), "setxattr" }, + [383] = { 5, TF, SEN(setxattr), "lsetxattr" }, +@@ -347,7 +347,7 @@ + [400] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, + [401] = { 3, 0, SEN(io_submit), "io_submit" }, + [402] = { 3, 0, SEN(io_cancel), "io_cancel" }, +-[403 ... 404] = { }, ++/* [403 ... 404] - unused */ + [405] = { 1, TP|SE, SEN(exit), "exit_group" }, + [406] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [407] = { 1, TD, SEN(epoll_create), "epoll_create" }, +diff --git a/src/linux/arm/syscallent.h b/src/linux/arm/syscallent.h +index 2086308a2..f4d808f2d 100644 +--- a/src/linux/arm/syscallent.h ++++ b/src/linux/arm/syscallent.h +@@ -433,7 +433,7 @@ + * ARM specific syscalls. Encoded with scno 0x000f00xx. + * Remapped by shuffle_scno() to be directly after __ARM_NR_cmpxchg. + */ +-[ARM_FIRST_SHUFFLED_SYSCALL+1+0] = { }, ++/* [ARM_FIRST_SHUFFLED_SYSCALL+1+0] - unused */ + [ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 0, 0, SEN(printargs), "breakpoint" }, + [ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 3, TM, SEN(printargs), "cacheflush" }, + [ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 0, 0, SEN(printargs), "usr26" }, +diff --git a/src/linux/avr32/syscallent.h b/src/linux/avr32/syscallent.h +index 104044e5f..1b3f3c64e 100644 +--- a/src/linux/avr32/syscallent.h ++++ b/src/linux/avr32/syscallent.h +@@ -228,7 +228,7 @@ + [219] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, + [220] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, + [221] = { 3, TS|TP, SEN(tgkill), "tgkill" }, +-[222] = { }, ++/* [222] - unused */ + [223] = { 2, TF, SEN(utimes), "utimes" }, + [224] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, + [225] = { 3, 0, SEN(printargs), "cacheflush" }, +@@ -288,7 +288,7 @@ + [279] = { 3, TD|TS, SEN(signalfd), "signalfd" }, + [280] = { 4, TD, SEN(timerfd), "timerfd" }, + [281] = { 1, TD, SEN(eventfd), "eventfd" }, +-[282] = { }, ++/* [282] - unused */ + [283] = { 2, TD, SEN(setns), "setns" }, + [284] = { 5, TD, SEN(pread), "pread64" }, + [285] = { 5, TD, SEN(pwrite), "pwrite64" }, +diff --git a/src/linux/bfin/syscallent.h b/src/linux/bfin/syscallent.h +index 05720b4f9..abef9f5c6 100644 +--- a/src/linux/bfin/syscallent.h ++++ b/src/linux/bfin/syscallent.h +@@ -229,7 +229,7 @@ + [219] = { 3, TM, SEN(madvise), "madvise" }, + [220] = { 3, TD, SEN(getdents64), "getdents64" }, + [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +-[222 ... 223] = { }, ++/* [222 ... 223] - unused */ + [224] = { 0, PU|NF, SEN(gettid), "gettid" }, + [225] = { 4, TD, SEN(readahead), "readahead" }, + [226] = { 5, TF, SEN(setxattr), "setxattr" }, +diff --git a/src/linux/i386/syscallent.h b/src/linux/i386/syscallent.h +index 3553a0575..4ae813d43 100644 +--- a/src/linux/i386/syscallent.h ++++ b/src/linux/i386/syscallent.h +@@ -229,7 +229,7 @@ + [219] = { 3, TM, SEN(madvise), "madvise" }, + [220] = { 3, TD, SEN(getdents64), "getdents64" }, + [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +-[222 ... 223] = { }, ++/* [222 ... 223] - unused */ + [224] = { 0, PU|NF, SEN(gettid), "gettid" }, + [225] = { 4, TD, SEN(readahead), "readahead" }, + [226] = { 5, TF, SEN(setxattr), "setxattr" }, +@@ -257,7 +257,7 @@ + [248] = { 3, 0, SEN(io_submit), "io_submit" }, + [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, + [250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +-[251] = { }, /* sys_set_zone_reclaim */ ++/* [251] - sys_set_zone_reclaim */ + [252] = { 1, TP|SE, SEN(exit), "exit_group" }, + [253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +@@ -291,7 +291,7 @@ + [282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, + [283] = { 4, 0, SEN(kexec_load), "kexec_load" }, + [284] = { 5, TP, SEN(waitid), "waitid" }, +-[285] = { }, /* sys_setaltroot */ ++/* [285] - sys_setaltroot */ + [286] = { 5, 0, SEN(add_key), "add_key" }, + [287] = { 4, 0, SEN(request_key), "request_key" }, + [288] = { 5, 0, SEN(keyctl), "keyctl" }, +diff --git a/src/linux/m68k/syscallent.h b/src/linux/m68k/syscallent.h +index 3abd77b0c..d861832e2 100644 +--- a/src/linux/m68k/syscallent.h ++++ b/src/linux/m68k/syscallent.h +@@ -225,7 +225,7 @@ + [215] = { 1, TC|NF, SEN(setfsuid), "setfsuid32" }, + [216] = { 1, TC|NF, SEN(setfsgid), "setfsgid32" }, + [217] = { 2, TF, SEN(pivotroot), "pivot_root" }, +-[218 ... 219] = { }, ++/* [218 ... 219] - unused */ + [220] = { 3, TD, SEN(getdents64), "getdents64" }, + [221] = { 0, PU|NF, SEN(gettid), "gettid" }, + [222] = { 2, TS|TP, SEN(tkill), "tkill" }, +diff --git a/src/linux/microblaze/syscallent.h b/src/linux/microblaze/syscallent.h +index 15ca048ca..7c86c2d07 100644 +--- a/src/linux/microblaze/syscallent.h ++++ b/src/linux/microblaze/syscallent.h +@@ -229,7 +229,7 @@ + [219] = { 3, TM, SEN(madvise), "madvise" }, + [220] = { 3, TD, SEN(getdents64), "getdents64" }, + [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +-[222 ... 223] = { }, ++/* [222 ... 223] - unused */ + [224] = { 0, PU|NF, SEN(gettid), "gettid" }, + [225] = { 4, TD, SEN(readahead), "readahead" }, + [226] = { 5, TF, SEN(setxattr), "setxattr" }, +@@ -257,7 +257,7 @@ + [248] = { 3, 0, SEN(io_submit), "io_submit" }, + [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, + [250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +-[251] = { }, ++/* [251] - unused */ + [252] = { 1, TP|SE, SEN(exit), "exit_group" }, + [253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +@@ -291,7 +291,7 @@ + [282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, + [283] = { 4, 0, SEN(kexec_load), "kexec_load" }, + [284] = { 5, TP, SEN(waitid), "waitid" }, +-[285] = { }, ++/* [285] - unused */ + [286] = { 5, 0, SEN(add_key), "add_key" }, + [287] = { 4, 0, SEN(request_key), "request_key" }, + [288] = { 5, 0, SEN(keyctl), "keyctl" }, +diff --git a/src/linux/mips/syscallent-compat.h b/src/linux/mips/syscallent-compat.h +index 29cc42632..b1274f890 100644 +--- a/src/linux/mips/syscallent-compat.h ++++ b/src/linux/mips/syscallent-compat.h +@@ -69,13 +69,13 @@ + [ 61] = { 0, 0, SEN(printargs), "svr4_chroot" }, + [ 62] = { 0, 0, SEN(printargs), "svr4_fcntl" }, + [ 63] = { 0, 0, SEN(printargs), "svr4_ulimit" }, +-[64 ... 69] = { }, ++/* [64 ... 69] - unused */ + [ 70] = { 0, 0, SEN(printargs), "svr4_advfs" }, + [ 71] = { 0, 0, SEN(printargs), "svr4_unadvfs" }, +-[ 72] = { }, +-[ 73] = { }, ++/* [ 72] - unused */ ++/* [ 73] - unused */ + [ 74] = { 0, 0, SEN(printargs), "svr4_rfstart" }, +-[ 75] = { }, ++/* [ 75] - unused */ + [ 76] = { 0, 0, SEN(printargs), "svr4_rdebug" }, + [ 77] = { 0, 0, SEN(printargs), "svr4_rfstop" }, + [ 78] = { 0, 0, SEN(printargs), "svr4_rfsys" }, +@@ -105,7 +105,7 @@ + [ 102] = { 0, 0, SEN(printargs), "svr4_evtrapret" }, + [ 103] = { 0, TF|TSF|TSFA,SEN(printargs), "svr4_statvfs" }, + [ 104] = { 0, TD|TFSF|TSFA,SEN(printargs), "svr4_fstatvfs" }, +-[ 105] = { }, ++/* [ 105] - unused */ + [ 106] = { 0, 0, SEN(printargs), "svr4_nfssys" }, + [ 107] = { 0, 0, SEN(printargs), "svr4_waitid" }, + [ 108] = { 0, 0, SEN(printargs), "svr4_sigsendset" }, +@@ -140,13 +140,13 @@ + [ 137] = { 0, 0, SEN(printargs), "svr4_sysconf" }, + [ 138] = { 0, TCL, SEN(printargs), "svr4_adjtime" }, + [ 139] = { 0, 0, SEN(printargs), "svr4_sysinfo" }, +-[ 140] = { }, ++/* [ 140] - unused */ + [ 141] = { 0, TC, SEN(printargs), "svr4_seteuid" }, + [ 142] = { 0, 0, SEN(printargs), "svr4_PYRAMID_statis" }, + [ 143] = { 0, 0, SEN(printargs), "svr4_PYRAMID_tuning" }, + [ 144] = { 0, 0, SEN(printargs), "svr4_PYRAMID_forcerr" }, + [ 145] = { 0, 0, SEN(printargs), "svr4_PYRAMID_mpcntl" }, +-[146 ... 200] = { }, ++/* [146 ... 200] - unused */ + [ 201] = { 0, 0, SEN(printargs), "svr4_aread" }, + [ 202] = { 0, 0, SEN(printargs), "svr4_awrite" }, + [ 203] = { 0, 0, SEN(printargs), "svr4_listio" }, +@@ -214,13 +214,13 @@ + [1055] = { 0, 0, SEN(printargs), "sysv_uadmin" }, + [1056] = { 0, 0, SEN(printargs), "sysv_sysmp" }, + [1057] = { 0, 0, SEN(printargs), "sysv_utssys" }, +-[1058] = { }, ++/* [1058] - unused */ + [1059] = { 0, 0, SEN(printargs), "sysv_execve" }, + [1060] = { 0, 0, SEN(printargs), "sysv_umask" }, + [1061] = { 0, 0, SEN(printargs), "sysv_chroot" }, + [1062] = { 0, 0, SEN(printargs), "sysv_fcntl" }, + [1063] = { 0, 0, SEN(printargs), "sysv_ulimit" }, +-[1064 ... 1069] = { }, ++/* [1064 ... 1069] - unused */ + [1070] = { 0, 0, SEN(printargs), "sysv_advfs" }, + [1071] = { 0, 0, SEN(printargs), "sysv_unadvfs" }, + [1072] = { 0, 0, SEN(printargs), "sysv_rmount" }, +@@ -390,8 +390,8 @@ + [2046] = { 0, TC, SEN(printargs), "bsd43_setgid" }, + [2047] = { 0, TC, SEN(printargs), "bsd43_getgid" }, + [2048] = { 0, 0, SEN(printargs), "bsd43_ssig" }, +-[2049] = { }, +-[2050] = { }, ++/* [2049] - unused */ ++/* [2050] - unused */ + [2051] = { 0, 0, SEN(printargs), "bsd43_sysacct" }, + [2052] = { 0, 0, SEN(printargs), "bsd43_phys" }, + [2053] = { 0, 0, SEN(printargs), "bsd43_lock" }, +@@ -404,7 +404,7 @@ + [2060] = { 0, 0, SEN(printargs), "bsd43_umask" }, + [2061] = { 0, 0, SEN(printargs), "bsd43_chroot" }, + [2062] = { 0, TD|TFST|TSTA,SEN(printargs), "bsd43_fstat" }, +-[2063] = { }, ++/* [2063] - unused */ + [2064] = { 0, 0, SEN(printargs), "bsd43_getpagesize" }, + [2065] = { 0, TM|SI, SEN(printargs), "bsd43_mremap" }, + [2066] = { 0, 0, SEN(printargs), "bsd43_vfork" }, +@@ -460,7 +460,7 @@ + [2116] = { 0, TCL, SEN(printargs), "bsd43_gettimeofday" }, + [2117] = { 0, 0, SEN(printargs), "bsd43_getrusage" }, + [2118] = { 0, 0, SEN(printargs), "bsd43_getsockopt" }, +-[2119] = { }, ++/* [2119] - unused */ + [2120] = { 0, 0, SEN(printargs), "bsd43_readv" }, + [2121] = { 0, 0, SEN(printargs), "bsd43_writev" }, + [2122] = { 0, TCL, SEN(printargs), "bsd43_settimeofday" }, +@@ -496,8 +496,8 @@ + [2152] = { 0, 0, SEN(printargs), "bsd43_cacheflush" }, + [2153] = { 0, 0, SEN(printargs), "bsd43_cachectl" }, + [2154] = { 0, 0, SEN(printargs), "bsd43_debug" }, +-[2155] = { }, +-[2156] = { }, ++/* [2155] - unused */ ++/* [2156] - unused */ + [2157] = { 0, 0, SEN(printargs), "bsd43_nfs_mount" }, + [2158] = { 0, 0, SEN(printargs), "bsd43_nfs_svc" }, + [2159] = { 0, 0, SEN(printargs), "bsd43_getdirentries" }, +@@ -518,8 +518,8 @@ + [2174] = { 0, 0, SEN(printargs), "bsd43_libattach" }, + [2175] = { 0, 0, SEN(printargs), "bsd43_libdetach" }, + [2176] = { 0, 0, SEN(printargs), "bsd43_accept" }, +-[2177] = { }, +-[2178] = { }, ++/* [2177] - unused */ ++/* [2178] - unused */ + [2179] = { 0, 0, SEN(printargs), "bsd43_recvmsg" }, + [2180] = { 0, 0, SEN(printargs), "bsd43_recvfrom" }, + [2181] = { 0, 0, SEN(printargs), "bsd43_sendmsg" }, +@@ -592,19 +592,19 @@ + [3055] = { 0, 0, SEN(printargs), "posix_uadmin" }, + [3056] = { 0, 0, SEN(printargs), "posix_exch" }, + [3057] = { 0, 0, SEN(printargs), "posix_utssys" }, +-[3058] = { }, ++/* [3058] - unused */ + [3059] = { 0, 0, SEN(printargs), "posix_exece" }, + [3060] = { 0, 0, SEN(printargs), "posix_umask" }, + [3061] = { 0, 0, SEN(printargs), "posix_chroot" }, + [3062] = { 0, 0, SEN(printargs), "posix_fcntl" }, + [3063] = { 0, 0, SEN(printargs), "posix_ulimit" }, +-[3064 ... 3069] = { }, ++/* [3064 ... 3069] - unused */ + [3070] = { 0, 0, SEN(printargs), "posix_advfs" }, + [3071] = { 0, 0, SEN(printargs), "posix_unadvfs" }, + [3072] = { 0, 0, SEN(printargs), "posix_rmount" }, + [3073] = { 0, 0, SEN(printargs), "posix_rumount" }, + [3074] = { 0, 0, SEN(printargs), "posix_rfstart" }, +-[3075] = { }, ++/* [3075] - unused */ + [3076] = { 0, 0, SEN(printargs), "posix_rdebug" }, + [3077] = { 0, 0, SEN(printargs), "posix_rfstop" }, + [3078] = { 0, 0, SEN(printargs), "posix_rfsys" }, +@@ -661,7 +661,7 @@ + [3129] = { 0, 0, SEN(printargs), "posix_SGI_sproc" }, + [3130] = { 0, 0, SEN(printargs), "posix_SGI_prctl" }, + [3131] = { 0, 0, SEN(printargs), "posix_SGI_blkproc" }, +-[3132] = { }, ++/* [3132] - unused */ + [3133] = { 0, 0, SEN(printargs), "posix_SGI_sgigsc" }, + [3134] = { 0, TD|TM|SI, SEN(printargs), "posix_SGI_mmap" }, + [3135] = { 0, TM|SI, SEN(printargs), "posix_SGI_munmap" }, +@@ -674,7 +674,7 @@ + [3142] = { 0, 0, SEN(printargs), "posix_SGI_libdetach" }, + [3143] = { 0, 0, SEN(printargs), "posix_SGI_getpgrp" }, + [3144] = { 0, 0, SEN(printargs), "posix_SGI_setpgrp" }, +-[3145 ... 3149] = { }, ++/* [3145 ... 3149] - unused */ + [3150] = { 0, 0, SEN(printargs), "posix_cacheflush" }, + [3151] = { 0, 0, SEN(printargs), "posix_cachectl" }, + [3152] = { 0, 0, SEN(printargs), "posix_fchown" }, +@@ -695,7 +695,7 @@ + [3167] = { 0, 0, SEN(printargs), "posix_setrlimit" }, + [3168] = { 0, 0, SEN(printargs), "posix_waitpid" }, + [3169] = { 0, 0, SEN(printargs), "posix_dup2" }, +-[3170 ... 3259] = { }, ++/* [3170 ... 3259] - unused */ + [3260] = { 0, 0, SEN(printargs), "posix_netboot" }, + [3261] = { 0, 0, SEN(printargs), "posix_netunboot" }, + [3262] = { 0, 0, SEN(printargs), "posix_rdump" }, +diff --git a/src/linux/s390/syscallent.h b/src/linux/s390/syscallent.h +index a808c7b5b..8f7a0aca0 100644 +--- a/src/linux/s390/syscallent.h ++++ b/src/linux/s390/syscallent.h +@@ -26,8 +26,8 @@ + [ 14] = { 3, TF, SEN(mknod), "mknod" }, + [ 15] = { 2, TF, SEN(chmod), "chmod" }, + [ 16] = { 3, TF, SEN(chown16), "lchown" }, +-[ 17] = { }, +-[ 18] = { }, ++/* [ 17] - unused */ ++/* [ 18] - unused */ + [ 19] = { 3, TD, SEN(lseek), "lseek" }, + [ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, + [ 21] = { 5, TF, SEN(mount), "mount" }, +@@ -37,14 +37,14 @@ + [ 25] = { 1, 0, SEN(stime), "stime" }, + [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, + [ 27] = { 1, 0, SEN(alarm), "alarm" }, +-[ 28] = { }, ++/* [ 28] - unused */ + [ 29] = { 0, TS, SEN(pause), "pause" }, + [ 30] = { 2, TF, SEN(utime), "utime" }, +-[ 31] = { }, +-[ 32] = { }, ++/* [ 31] - unused */ ++/* [ 32] - unused */ + [ 33] = { 2, TF, SEN(access), "access" }, + [ 34] = { 1, 0, SEN(nice), "nice" }, +-[ 35] = { }, ++/* [ 35] - unused */ + [ 36] = { 0, 0, SEN(sync), "sync" }, + [ 37] = { 2, TS|TP, SEN(kill), "kill" }, + [ 38] = { 2, TF, SEN(rename), "rename" }, +@@ -53,7 +53,7 @@ + [ 41] = { 1, TD, SEN(dup), "dup" }, + [ 42] = { 1, TD, SEN(pipe), "pipe" }, + [ 43] = { 1, 0, SEN(times), "times" }, +-[ 44] = { }, ++/* [ 44] - unused */ + [ 45] = { 1, TM|SI, SEN(brk), "brk" }, + [ 46] = { 1, TC, SEN(setgid16), "setgid" }, + [ 47] = { 0, TC|PU|NF, SEN(getgid16), "getgid" }, +@@ -62,13 +62,13 @@ + [ 50] = { 0, TC|PU|NF, SEN(getegid16), "getegid" }, + [ 51] = { 1, TF, SEN(acct), "acct" }, + [ 52] = { 2, TF, SEN(umount2), "umount2" }, +-[ 53] = { }, ++/* [ 53] - unused */ + [ 54] = { 3, TD, SEN(ioctl), "ioctl" }, + [ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +-[ 56] = { }, ++/* [ 56] - unused */ + [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +-[ 58] = { }, +-[ 59] = { }, ++/* [ 58] - unused */ ++/* [ 59] - unused */ + [ 60] = { 1, NF, SEN(umask), "umask" }, + [ 61] = { 1, TF, SEN(chroot), "chroot" }, + [ 62] = { 2, TSFA, SEN(ustat), "ustat" }, +@@ -77,8 +77,8 @@ + [ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, + [ 66] = { 0, 0, SEN(setsid), "setsid" }, + [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +-[ 68] = { }, +-[ 69] = { }, ++/* [ 68] - unused */ ++/* [ 69] - unused */ + [ 70] = { 2, TC, SEN(setreuid16), "setreuid" }, + [ 71] = { 2, TC, SEN(setregid16), "setregid" }, + [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +@@ -91,9 +91,9 @@ + [ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" }, + [ 80] = { 2, TC, SEN(getgroups16), "getgroups" }, + [ 81] = { 2, TC, SEN(setgroups16), "setgroups" }, +-[ 82] = { }, ++/* [ 82] - unused */ + [ 83] = { 2, TF, SEN(symlink), "symlink" }, +-[ 84] = { }, ++/* [ 84] - unused */ + [ 85] = { 3, TF, SEN(readlink), "readlink" }, + [ 86] = { 1, TF, SEN(uselib), "uselib" }, + [ 87] = { 2, TF, SEN(swapon), "swapon" }, +@@ -107,7 +107,7 @@ + [ 95] = { 3, TD, SEN(fchown16), "fchown" }, + [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, + [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +-[ 98] = { }, ++/* [ 98] - unused */ + [ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, + [100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, + [101] = { 3, 0, SEN(ioperm), "ioperm" }, +@@ -118,11 +118,11 @@ + [106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, + [107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, + [108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +-[109] = { }, ++/* [109] - unused */ + [110] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [111] = { 0, 0, SEN(vhangup), "vhangup" }, + [112] = { 0, 0, SEN(idle), "idle" }, +-[113] = { }, ++/* [113] - unused */ + [114] = { 4, TP, SEN(wait4), "wait4" }, + [115] = { 1, TF, SEN(swapoff), "swapoff" }, + [116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +@@ -132,7 +132,7 @@ + [120] = { 5, TP, SEN(clone), "clone" }, + [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, + [122] = { 1, 0, SEN(uname), "uname" }, +-[123] = { }, ++/* [123] - unused */ + [124] = { 1, TCL, SEN(adjtimex32), "adjtimex" }, + [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, + [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +@@ -175,7 +175,7 @@ + [163] = { 5, TM|SI, SEN(mremap), "mremap" }, + [164] = { 3, TC, SEN(setresuid16), "setresuid" }, + [165] = { 3, TC, SEN(getresuid16), "getresuid" }, +-[166] = { }, ++/* [166] - unused */ + [167] = { 5, 0, SEN(query_module), "query_module" }, + [168] = { 3, TD, SEN(poll_time32), "poll" }, + [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +@@ -251,7 +251,7 @@ + [239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, + [240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, + [241] = { 3, TS|TP, SEN(tgkill), "tgkill" }, +-[242] = { }, ++/* [242] - unused */ + [243] = { 2, TM, SEN(io_setup), "io_setup" }, + [244] = { 1, TM, SEN(io_destroy), "io_destroy" }, + [245] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, +diff --git a/src/linux/s390x/syscallent.h b/src/linux/s390x/syscallent.h +index 90bf993b7..8c03af9d9 100644 +--- a/src/linux/s390x/syscallent.h ++++ b/src/linux/s390x/syscallent.h +@@ -21,29 +21,29 @@ + [ 10] = { 1, TF, SEN(unlink), "unlink" }, + [ 11] = { 3, CC|TF|TP|TSD|SE|SI, SEN(execve), "execve" }, + [ 12] = { 1, TF, SEN(chdir), "chdir" }, +-[ 13] = { }, ++/* [ 13] - unused */ + [ 14] = { 3, TF, SEN(mknod), "mknod" }, + [ 15] = { 2, TF, SEN(chmod), "chmod" }, +-[ 16] = { }, +-[ 17] = { }, +-[ 18] = { }, ++/* [ 16] - unused */ ++/* [ 17] - unused */ ++/* [ 18] - unused */ + [ 19] = { 3, TD, SEN(lseek), "lseek" }, + [ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, + [ 21] = { 5, TF, SEN(mount), "mount" }, + [ 22] = { 1, TF, SEN(umount), "umount" }, +-[ 23] = { }, +-[ 24] = { }, +-[ 25] = { }, ++/* [ 23] - unused */ ++/* [ 24] - unused */ ++/* [ 25] - unused */ + [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, + [ 27] = { 1, 0, SEN(alarm), "alarm" }, +-[ 28] = { }, ++/* [ 28] - unused */ + [ 29] = { 0, TS, SEN(pause), "pause" }, + [ 30] = { 2, TF, SEN(utime), "utime" }, +-[ 31] = { }, +-[ 32] = { }, ++/* [ 31] - unused */ ++/* [ 32] - unused */ + [ 33] = { 2, TF, SEN(access), "access" }, + [ 34] = { 1, 0, SEN(nice), "nice" }, +-[ 35] = { }, ++/* [ 35] - unused */ + [ 36] = { 0, 0, SEN(sync), "sync" }, + [ 37] = { 2, TS|TP, SEN(kill), "kill" }, + [ 38] = { 2, TF, SEN(rename), "rename" }, +@@ -52,22 +52,22 @@ + [ 41] = { 1, TD, SEN(dup), "dup" }, + [ 42] = { 1, TD, SEN(pipe), "pipe" }, + [ 43] = { 1, 0, SEN(times), "times" }, +-[ 44] = { }, ++/* [ 44] - unused */ + [ 45] = { 1, TM|SI, SEN(brk), "brk" }, +-[ 46] = { }, +-[ 47] = { }, ++/* [ 46] - unused */ ++/* [ 47] - unused */ + [ 48] = { 2, TS, SEN(signal), "signal" }, +-[ 49] = { }, +-[ 50] = { }, ++/* [ 49] - unused */ ++/* [ 50] - unused */ + [ 51] = { 1, TF, SEN(acct), "acct" }, + [ 52] = { 2, TF, SEN(umount2), "umount2" }, +-[ 53] = { }, ++/* [ 53] - unused */ + [ 54] = { 3, TD, SEN(ioctl), "ioctl" }, + [ 55] = { 3, TD, SEN(fcntl), "fcntl" }, +-[ 56] = { }, ++/* [ 56] - unused */ + [ 57] = { 2, 0, SEN(setpgid), "setpgid" }, +-[ 58] = { }, +-[ 59] = { }, ++/* [ 58] - unused */ ++/* [ 59] - unused */ + [ 60] = { 1, NF, SEN(umask), "umask" }, + [ 61] = { 1, TF, SEN(chroot), "chroot" }, + [ 62] = { 2, TSFA, SEN(ustat), "ustat" }, +@@ -76,18 +76,18 @@ + [ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, + [ 66] = { 0, 0, SEN(setsid), "setsid" }, + [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, +-[ 68 ... 71] = { }, ++/* [ 68 ... 71] - unused */ + [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, + [ 73] = { 1, TS, SEN(sigpending), "sigpending" }, + [ 74] = { 2, 0, SEN(sethostname), "sethostname" }, + [ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, +-[ 76] = { }, ++/* [ 76] - unused */ + [ 77] = { 2, 0, SEN(getrusage), "getrusage" }, + [ 78] = { 2, TCL, SEN(gettimeofday), "gettimeofday" }, + [ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" }, +-[ 80 ... 82] = { }, ++/* [ 80 ... 82] - unused */ + [ 83] = { 2, TF, SEN(symlink), "symlink" }, +-[ 84] = { }, ++/* [ 84] - unused */ + [ 85] = { 3, TF, SEN(readlink), "readlink" }, + [ 86] = { 1, TF, SEN(uselib), "uselib" }, + [ 87] = { 2, TF, SEN(swapon), "swapon" }, +@@ -98,13 +98,13 @@ + [ 92] = { 2, TF, SEN(truncate), "truncate" }, + [ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, + [ 94] = { 2, TD, SEN(fchmod), "fchmod" }, +-[ 95] = { }, ++/* [ 95] - unused */ + [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, + [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, +-[ 98] = { }, ++/* [ 98] - unused */ + [ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, + [100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, +-[101] = { }, ++/* [101] - unused */ + [102] = { 2, TD|TSD, SEN(socketcall), "socketcall" }, + [103] = { 3, 0, SEN(syslog), "syslog" }, + [104] = { 3, 0, SEN(setitimer), "setitimer" }, +@@ -112,11 +112,11 @@ + [106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, + [107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, + [108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +-[109] = { }, ++/* [109] - unused */ + [110] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [111] = { 0, 0, SEN(vhangup), "vhangup" }, + [112] = { 0, 0, SEN(idle), "idle" }, +-[113] = { }, ++/* [113] - unused */ + [114] = { 4, TP, SEN(wait4), "wait4" }, + [115] = { 1, TF, SEN(swapoff), "swapoff" }, + [116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +@@ -126,7 +126,7 @@ + [120] = { 5, TP, SEN(clone), "clone" }, + [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, + [122] = { 1, 0, SEN(uname), "uname" }, +-[123] = { }, ++/* [123] - unused */ + [124] = { 1, TCL, SEN(adjtimex64), "adjtimex" }, + [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, + [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, +@@ -141,7 +141,7 @@ + [135] = { 3, 0, SEN(sysfs), "sysfs" }, + [136] = { 1, NF, SEN(personality), "personality" }, + [137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +-[138 ... 140] = { }, ++/* [138 ... 140] - unused */ + [141] = { 3, TD, SEN(getdents), "getdents" }, + [142] = { 5, TD, SEN(select), "select" }, + [143] = { 2, TD, SEN(flock), "flock" }, +@@ -165,11 +165,11 @@ + [161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, + [162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, + [163] = { 5, TM|SI, SEN(mremap), "mremap" }, +-[164 ... 166] = { }, ++/* [164 ... 166] - unused */ + [167] = { 5, 0, SEN(query_module), "query_module" }, + [168] = { 3, TD, SEN(poll_time64), "poll" }, + [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +-[170 ... 171] = { }, ++/* [170 ... 171] - unused */ + [172] = { 5, CC|TC, SEN(prctl), "prctl" }, + [173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, + [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +@@ -180,7 +180,7 @@ + [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, + [180] = { 4, TD, SEN(pread), "pread64" }, + [181] = { 4, TD, SEN(pwrite), "pwrite64" }, +-[182] = { }, ++/* [182] - unused */ + [183] = { 2, TF, SEN(getcwd), "getcwd" }, + [184] = { 2, TC, SEN(capget), "capget" }, + [185] = { 2, TC, SEN(capset), "capset" }, +@@ -190,7 +190,7 @@ + [189] = { 5, TN, SEN(putpmsg), "putpmsg" }, + [190] = { 0, TP, SEN(vfork), "vfork" }, + [191] = { 2, 0, SEN(getrlimit), "getrlimit" }, +-[196 ... 197] = { }, ++/* [196 ... 197] - unused */ + [198] = { 3, TF, SEN(chown), "lchown" }, + [199] = { 0, TC|PU|NF, SEN(getuid), "getuid" }, + [200] = { 0, TC|PU|NF, SEN(getgid), "getgid" }, +@@ -214,9 +214,9 @@ + [218] = { 3, TM, SEN(mincore), "mincore" }, + [219] = { 3, TM, SEN(madvise), "madvise" }, + [220] = { 3, TD, SEN(getdents64), "getdents64" }, +-[221] = { }, ++/* [221] - unused */ + [222] = { 3, TD, SEN(readahead), "readahead" }, +-[223] = { }, ++/* [223] - unused */ + [224] = { 5, TF, SEN(setxattr), "setxattr" }, + [225] = { 5, TF, SEN(setxattr), "lsetxattr" }, + [226] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +@@ -235,7 +235,7 @@ + [239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, + [240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, + [241] = { 3, TS|TP, SEN(tgkill), "tgkill" }, +-[242] = { }, ++/* [242] - unused */ + [243] = { 2, TM, SEN(io_setup), "io_setup" }, + [244] = { 1, TM, SEN(io_destroy), "io_destroy" }, + [245] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, +@@ -257,7 +257,7 @@ + [261] = { 2, TCL, SEN(clock_getres_time64), "clock_getres" }, + [262] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, + [263] = { 5, 0, SEN(vserver), "vserver" }, +-[264] = { }, ++/* [264] - unused */ + [265] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, + [266] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, + [267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +diff --git a/src/linux/sh/syscallent.h b/src/linux/sh/syscallent.h +index c238f0400..a95f0db99 100644 +--- a/src/linux/sh/syscallent.h ++++ b/src/linux/sh/syscallent.h +@@ -197,7 +197,7 @@ + [185] = { 2, TC, SEN(capset), "capset" }, + [186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, + [187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +-[188 ... 189] = { }, ++/* [188 ... 189] - unused */ + [190] = { 0, TP, SEN(vfork), "vfork" }, + [191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, + [192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +@@ -230,7 +230,7 @@ + [219] = { 3, TM, SEN(madvise), "madvise" }, + [220] = { 3, TD, SEN(getdents64), "getdents64" }, + [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, +-[222 ... 223] = { }, ++/* [222 ... 223] - unused */ + [224] = { 0, PU|NF, SEN(gettid), "gettid" }, + [225] = { 4, TD, SEN(readahead), "readahead" }, + [226] = { 5, TF, SEN(setxattr), "setxattr" }, +@@ -250,14 +250,14 @@ + [240] = { 6, 0, SEN(futex_time32), "futex" }, + [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, + [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +-[243 ... 244] = { }, ++/* [243 ... 244] - unused */ + [245] = { 2, TM, SEN(io_setup), "io_setup" }, + [246] = { 1, TM, SEN(io_destroy), "io_destroy" }, + [247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, + [248] = { 3, 0, SEN(io_submit), "io_submit" }, + [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, + [250] = { 5, TD, SEN(fadvise64), "fadvise64" }, +-[251] = { }, ++/* [251] - unused */ + [252] = { 1, TP|SE, SEN(exit), "exit_group" }, + [253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [254] = { 1, TD, SEN(epoll_create), "epoll_create" }, +@@ -279,7 +279,7 @@ + [270] = { 3, TS|TP, SEN(tgkill), "tgkill" }, + [271] = { 2, TF, SEN(utimes), "utimes" }, + [272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, +-[273] = { }, ++/* [273] - unused */ + [274] = { 6, TM, SEN(mbind), "mbind" }, + [275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, + [276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +@@ -299,7 +299,7 @@ + [290] = { 0, TD, SEN(inotify_init), "inotify_init" }, + [291] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, + [292] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +-[293] = { }, ++/* [293] - unused */ + [294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, + [295] = { 4, TD|TF, SEN(openat), "openat" }, + [296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +diff --git a/src/linux/sh64/syscallent.h b/src/linux/sh64/syscallent.h +index f33504235..646eb6f4a 100644 +--- a/src/linux/sh64/syscallent.h ++++ b/src/linux/sh64/syscallent.h +@@ -89,7 +89,7 @@ + [ 79] = { 2, TCL, SEN(settimeofday), "settimeofday" }, + [ 80] = { 2, TC, SEN(getgroups16), "getgroups" }, + [ 81] = { 2, TC, SEN(setgroups16), "setgroups" }, +-[ 82] = { }, ++/* [ 82] - unused */ + [ 83] = { 2, TF, SEN(symlink), "symlink" }, + [ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, + [ 85] = { 3, TF, SEN(readlink), "readlink" }, +@@ -120,7 +120,7 @@ + [110] = { 1, 0, SEN(iopl), "iopl" }, + [111] = { 0, 0, SEN(vhangup), "vhangup" }, + [112] = { 0, 0, SEN(idle), "idle" }, +-[113] = { }, ++/* [113] - unused */ + [114] = { 4, TP, SEN(wait4), "wait4" }, + [115] = { 1, TF, SEN(swapoff), "swapoff" }, + [116] = { 1, 0, SEN(sysinfo), "sysinfo" }, +@@ -173,7 +173,7 @@ + [163] = { 5, TM|SI, SEN(mremap), "mremap" }, + [164] = { 3, TC, SEN(setresuid16), "setresuid" }, + [165] = { 3, TC, SEN(getresuid16), "getresuid" }, +-[166] = { }, ++/* [166] - unused */ + [167] = { 5, 0, SEN(query_module), "query_module" }, + [168] = { 3, TD, SEN(poll_time64), "poll" }, + [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +@@ -195,7 +195,7 @@ + [185] = { 2, TC, SEN(capset), "capset" }, + [186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, + [187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +-[188 ... 189] = { }, ++/* [188 ... 189] - unused */ + [190] = { 0, TP, SEN(vfork), "vfork" }, + [191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, + [192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, +@@ -256,7 +256,7 @@ + [247] = { 3, TI, SEN(shmctl), "shmctl" }, + [248] = { 3, TD, SEN(getdents64), "getdents64" }, + [249] = { 3, TD, SEN(fcntl64), "fcntl64" }, +-[250 ... 251] = { }, ++/* [250 ... 251] - unused */ + [252] = { 0, PU|NF, SEN(gettid), "gettid" }, + [253] = { 3, TD, SEN(readahead), "readahead" }, + [254] = { 5, TF, SEN(setxattr), "setxattr" }, +@@ -276,14 +276,14 @@ + [268] = { 6, 0, SEN(futex_time64), "futex" }, + [269] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, + [270] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +-[271 ... 272] = { }, ++/* [271 ... 272] - unused */ + [273] = { 2, TM, SEN(io_setup), "io_setup" }, + [274] = { 1, TM, SEN(io_destroy), "io_destroy" }, + [275] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, + [276] = { 3, 0, SEN(io_submit), "io_submit" }, + [277] = { 3, 0, SEN(io_cancel), "io_cancel" }, + [278] = { 4, TD, SEN(fadvise64), "fadvise64" }, +-[279] = { }, ++/* [279] - unused */ + [280] = { 1, TP|SE, SEN(exit), "exit_group" }, + [281] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, + [282] = { 1, TD, SEN(epoll_create), "epoll_create" }, +@@ -305,7 +305,7 @@ + [298] = { 3, TS|TP, SEN(tgkill), "tgkill" }, + [299] = { 2, TF, SEN(utimes), "utimes" }, + [300] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" }, +-[301] = { }, ++/* [301] - unused */ + [302] = { 6, TM, SEN(mbind), "mbind" }, + [303] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, + [304] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +@@ -325,7 +325,7 @@ + [318] = { 0, TD, SEN(inotify_init), "inotify_init" }, + [319] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, + [320] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +-[321] = { }, ++/* [321] - unused */ + [322] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, + [323] = { 4, TD|TF, SEN(openat), "openat" }, + [324] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +diff --git a/src/linux/xtensa/syscallent.h b/src/linux/xtensa/syscallent.h +index 09fed329c..69d58ec6d 100644 +--- a/src/linux/xtensa/syscallent.h ++++ b/src/linux/xtensa/syscallent.h +@@ -7,7 +7,7 @@ + + [ 0] = { 0, 0, SEN(printargs), "spill" }, + [ 1] = { 0, 0, SEN(printargs), "xtensa" }, +-[ 2 ... 7] = { }, ++/* [ 2 ... 7] - unused */ + [ 8] = { 3, TD|TF, SEN(open), "open" }, + [ 9] = { 1, TD, SEN(close), "close" }, + [ 10] = { 1, TD, SEN(dup), "dup" }, +@@ -51,7 +51,7 @@ + [ 48] = { 3, TF, SEN(chown), "lchown" }, + [ 49] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, + [ 50] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +-[ 51] = { }, ++/* [ 51] - unused */ + [ 52] = { 2, TD, SEN(fchmod), "fchmod" }, + [ 53] = { 3, TD, SEN(fchown), "fchown" }, + [ 54] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +@@ -152,7 +152,7 @@ + [149] = { 1, 0, SEN(getpgid), "getpgid" }, + [150] = { 0, PU|NF, SEN(getppid), "getppid" }, + [151] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, +-[152 ... 153] = { }, ++/* [152 ... 153] - unused */ + [154] = { 1, 0, SEN(times), "times" }, + [155] = { 1, TF, SEN(acct), "acct" }, + [156] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +@@ -164,12 +164,12 @@ + [162] = { 3, TI, SEN(semget), "semget" }, + [163] = { 3, TI, SEN(semop), "semop" }, + [164] = { 4, TI, SEN(semctl), "semctl" }, +-[165] = { }, ++/* [165] - unused */ + [166] = { 2, TI, SEN(msgget), "msgget" }, + [167] = { 4, TI, SEN(msgsnd), "msgsnd" }, + [168] = { 5, TI, SEN(msgrcv), "msgrcv" }, + [169] = { 3, TI, SEN(msgctl), "msgctl" }, +-[170] = { }, ++/* [170] - unused */ + [171] = { 2, TF, SEN(umount2), "umount2" }, + [172] = { 5, TF, SEN(mount), "mount" }, + [173] = { 2, TF, SEN(swapon), "swapon" }, +@@ -219,7 +219,7 @@ + [217] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, + [218] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, + [219] = { 0, 0, SEN(sched_yield), "sched_yield" }, +-[220 ... 222] = { }, ++/* [220 ... 222] - unused */ + [223] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, + [224] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, + [225] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +@@ -235,7 +235,7 @@ + [235] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, + [236] = { 2, TD, SEN(mq_notify), "mq_notify" }, + [237] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, +-[238] = { }, ++/* [238] - unused */ + [239] = { 2, TM, SEN(io_setup), "io_setup" }, + [240] = { 1, TM, SEN(io_destroy), "io_destroy" }, + [241] = { 3, 0, SEN(io_submit), "io_submit" }, +@@ -250,13 +250,13 @@ + [250] = { 4, 0, SEN(timer_settime32), "timer_settime" }, + [251] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, + [252] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +-[253] = { }, ++/* [253] - unused */ + [254] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +-[255] = { }, ++/* [255] - unused */ + [256] = { 5, 0, SEN(add_key), "add_key" }, + [257] = { 4, 0, SEN(request_key), "request_key" }, + [258] = { 5, 0, SEN(keyctl), "keyctl" }, +-[259] = { }, ++/* [259] - unused */ + [260] = { 5, TD, SEN(readahead), "readahead" }, + [261] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, + [262] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +@@ -268,7 +268,7 @@ + [268] = { 6, TD, SEN(splice), "splice" }, + [269] = { 4, TD, SEN(tee), "tee" }, + [270] = { 4, TD, SEN(vmsplice), "vmsplice" }, +-[271] = { }, ++/* [271] - unused */ + [272] = { 6, TD, SEN(pselect6_time32), "pselect6" }, + [273] = { 5, TD, SEN(ppoll_time32), "ppoll" }, + [274] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +@@ -283,7 +283,7 @@ + [283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, + [284] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, + [285] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +-[286 ... 287] = { }, ++/* [286 ... 287] - unused */ + [288] = { 4, TD|TF, SEN(openat), "openat" }, + [289] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, + [290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +@@ -298,9 +298,9 @@ + [299] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, + [300] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, + [301] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +-[302 ... 303] = { }, ++/* [302 ... 303] - unused */ + [304] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +-[305] = { }, ++/* [305] - unused */ + [306] = { 1, TD, SEN(eventfd), "eventfd" }, + [307] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, + [308] = { 2, TD, SEN(setns), "setns" }, +@@ -310,11 +310,11 @@ + [312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, + [313] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, + [314] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, +-[315] = { }, ++/* [315] - unused */ + [316] = { 2, TD, SEN(eventfd2), "eventfd2" }, + [317] = { 5, TD, SEN(preadv), "preadv" }, + [318] = { 5, TD, SEN(pwritev), "pwritev" }, +-[319] = { }, ++/* [319] - unused */ + [320] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, + [321] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, + [322] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/0010-Use-alloca-when-VLAs-aren-t-available.patch b/pkg/devel/strace/patch/0010-Use-alloca-when-VLAs-aren-t-available.patch @@ -0,0 +1,31 @@ +From 4673bf0d6a0eba5d363266a40cfb087e08a66e7f Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 30 Jan 2020 21:57:34 -0800 +Subject: [PATCH] Use alloca when VLAs aren't available + +--- + src/evdev.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/evdev.c b/src/evdev.c +index 81dd951cb..74a765469 100644 +--- a/src/evdev.c ++++ b/src/evdev.c +@@ -164,9 +164,13 @@ decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg, + return RVAL_IOCTL_DECODED; + } + ++#ifndef __STDC_NO_VLA__ + char decoded_arg[size]; ++#else ++ char *decoded_arg = alloca(size); ++#endif + +- if (umove_or_printaddr(tcp, arg, &decoded_arg)) ++ if (umoven_or_printaddr(tcp, arg, size, decoded_arg)) + return RVAL_IOCTL_DECODED; + + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_RAW) { +-- +2.34.1 + diff --git a/pkg/devel/strace/patch/0011-Avoid-index-ranges.patch b/pkg/devel/strace/patch/0011-Avoid-index-ranges.patch @@ -0,0 +1,62 @@ +From d1c93514cb65877134e8f53b189adbcd5a0e1b43 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 30 Jan 2020 22:32:50 -0800 +Subject: [PATCH] Avoid index ranges + +The change in print_mac.c is not functionally the same, but we +ignore this for now. +--- + src/print_mac.c | 4 +--- + src/util.c | 8 ++++---- + 2 files changed, 5 insertions(+), 7 deletions(-) + +diff --git a/src/print_mac.c b/src/print_mac.c +index cad1013a8..73d7bbe28 100644 +--- a/src/print_mac.c ++++ b/src/print_mac.c +@@ -17,8 +17,6 @@ + DIAG_PUSH_IGNORE_OVERRIDE_INIT + + static uint8_t hwaddr_sizes[] = { +- [0 ... ARPHRD_VSOCKMON] = 255, +- + [ARPHRD_NETROM] = 7 /* AX25_ADDR_LEN */, + [ARPHRD_ETHER] = 6 /* ETH_ALEN */, + /* ARPHRD_EETHER - no actual devices in Linux */ +@@ -129,7 +127,7 @@ print_mac_addr(const char *prefix, const uint8_t addr[], size_t size) + static const char * + sprint_hwaddr(const uint8_t hwaddr[], size_t size, uint32_t devtype) + { +- uint8_t sz = (devtype < ARRAY_SIZE(hwaddr_sizes)) ++ uint8_t sz = (devtype < ARRAY_SIZE(hwaddr_sizes) && hwaddr_sizes[devtype]) + ? hwaddr_sizes[devtype] : 255; + + return sprint_mac_addr(hwaddr, MIN(size, sz)); +diff --git a/src/util.c b/src/util.c +index a3bea5b76..21fb9560f 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -1477,16 +1477,16 @@ dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, + ? 1 + ilog2_klong(len - 1) / HEX_BIT : DUMPSTR_OFFS_MIN_CHARS; + kernel_ulong_t i = 0; + const unsigned char *src; ++ char outbuf[DUMPSTR_WIDTH_CHARS + 1]; ++ ++ memset(outbuf, ' ', DUMPSTR_WIDTH_CHARS); ++ outbuf[DUMPSTR_WIDTH_CHARS] = '\0'; + + while (i < len) { + /* + * It is important to overwrite all the byte values, as we + * re-use the buffer in order to avoid its re-initialisation. + */ +- static char outbuf[] = { +- [0 ... DUMPSTR_WIDTH_CHARS - 1] = ' ', +- '\0' +- }; + char *dst = outbuf; + + /* Fetching data from tracee. */ +-- +2.37.3 + diff --git a/pkg/devel/strace/patch/1001-Prevent-zero-sized-arrays.patch b/pkg/devel/strace/patch/1001-Prevent-zero-sized-arrays.patch @@ -0,0 +1,72 @@ +From a9a8b003bc97952fcc47d84b2ba9c490d90985e3 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Fri, 18 Feb 2022 01:40:22 -0800 +Subject: [PATCH] Prevent zero-sized arrays + +--- + src/xlat/btrfs_features_compat.h | 3 ++- + src/xlat/compat_ptrace_cmds.h | 3 ++- + src/xlat/sigprof_codes.h | 3 ++- + 3 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/src/xlat/btrfs_features_compat.h b/src/xlat/btrfs_features_compat.h +index 12136c495..cc5804a1b 100644 +--- a/src/xlat/btrfs_features_compat.h ++++ b/src/xlat/btrfs_features_compat.h +@@ -15,13 +15,14 @@ extern const struct xlat btrfs_features_compat[]; + + DIAG_PUSH_IGNORE_TAUTOLOGICAL_CONSTANT_COMPARE + static const struct xlat_data btrfs_features_compat_xdata[] = { ++ {0} + }; + # if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) + static + # endif + const struct xlat btrfs_features_compat[1] = { { + .data = btrfs_features_compat_xdata, +- .size = ARRAY_SIZE(btrfs_features_compat_xdata), ++ .size = ARRAY_SIZE(btrfs_features_compat_xdata) - 1, + .type = XT_NORMAL, + .flags_mask = 0 + , +diff --git a/src/xlat/compat_ptrace_cmds.h b/src/xlat/compat_ptrace_cmds.h +index 9a7fc96b1..a29567689 100644 +--- a/src/xlat/compat_ptrace_cmds.h ++++ b/src/xlat/compat_ptrace_cmds.h +@@ -225,11 +225,12 @@ static const struct xlat_data compat_ptrace_cmds_xdata[] = { + #define XLAT_VAL_9 ((unsigned) (COMPAT_PTRACE_SETHBPREGS)) + #define XLAT_STR_9 STRINGIFY(COMPAT_PTRACE_SETHBPREGS) + #endif ++ {0} + }; + static + const struct xlat compat_ptrace_cmds[1] = { { + .data = compat_ptrace_cmds_xdata, +- .size = ARRAY_SIZE(compat_ptrace_cmds_xdata), ++ .size = ARRAY_SIZE(compat_ptrace_cmds_xdata) - 1, + .type = XT_SORTED, + .flags_mask = 0 + # ifdef XLAT_VAL_0 +diff --git a/src/xlat/sigprof_codes.h b/src/xlat/sigprof_codes.h +index bc61fdc8f..88f043ab9 100644 +--- a/src/xlat/sigprof_codes.h ++++ b/src/xlat/sigprof_codes.h +@@ -20,13 +20,14 @@ static const struct xlat_data sigprof_codes_xdata[] = { + #define XLAT_VAL_0 ((unsigned) (PROF_SIG)) + #define XLAT_STR_0 STRINGIFY(PROF_SIG) + #endif ++ {0} + }; + # if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) + static + # endif + const struct xlat sigprof_codes[1] = { { + .data = sigprof_codes_xdata, +- .size = ARRAY_SIZE(sigprof_codes_xdata), ++ .size = ARRAY_SIZE(sigprof_codes_xdata) - 1, + .type = XT_NORMAL, + .flags_mask = 0 + # ifdef XLAT_VAL_0 +-- +2.34.1 + diff --git a/pkg/devel/strace/printerdecls.awk b/pkg/devel/strace/printerdecls.awk @@ -0,0 +1,11 @@ +BEGIN { + FS = "\\(|\\)|, " + OFS = ", " +} + +$1 == "MPERS_PRINTER_DECL" { + printf "extern %s %s(%s", $2, $3, $4 + for (i = 5; i < NF; ++i) + printf ", %s", $i + print ");" +} diff --git a/pkg/devel/strace/printerdefs.awk b/pkg/devel/strace/printerdefs.awk @@ -0,0 +1,8 @@ +BEGIN { + FS = "\\(|\\)|, " + OFS = ", " +} + +$1 == "MPERS_PRINTER_DECL" { + print "." $3 " = " $3 "," +} diff --git a/pkg/devel/strace/printers.awk b/pkg/devel/strace/printers.awk @@ -0,0 +1,19 @@ +BEGIN { + FS = "\\(|\\)|, " + OFS = ", " + print "typedef struct {" +} + +$1 == "MPERS_PRINTER_DECL" { + printf " %s (*%s)(%s", $2, $3, $4 + for (i = 5; i < NF; ++i) + printf ", %s", $i + print ");" + print "#define " $3 " MPERS_PRINTER_NAME(" $3 ")\n" +} + +END { + print "} struct_printers;" + print "extern const struct_printers *printers;" + print "#define MPERS_PRINTER_NAME(printer_name) printers->printer_name" +} diff --git a/pkg/devel/strace/scno.awk b/pkg/devel/strace/scno.awk @@ -0,0 +1,11 @@ +BEGIN { + FS = "[][\"]" +} + +{ + name = $4 + number = int($2) + print "#ifndef __NR_" name + print "# define __NR_" name " (SYSCALL_BIT | " number ")" + print "#endif" +} diff --git a/pkg/devel/strace/sen.awk b/pkg/devel/strace/sen.awk @@ -0,0 +1,16 @@ +BEGIN { + print "enum {" + print "SEN_printargs = 0," +} + +match($0, /SEN\([^)]+\)/) { + name = substr($0, RSTART + 4, RLENGTH - 5) + if (name != "printargs") + print "SEN_" name "," | "sort -u" +} + +END { + if (close("sort -u")) + exit 1 + print "};" +} diff --git a/pkg/devel/strace/sha256 b/pkg/devel/strace/sha256 @@ -0,0 +1 @@ +27987dbac57fdfd260c6db4dc8328df35c95c6867c8a3d4371d59cdcf4eb9238 strace-6.4.tar.xz diff --git a/pkg/devel/strace/url b/pkg/devel/strace/url @@ -0,0 +1 @@ +url = "https://github.com/strace/strace/releases/download/v6.4/strace-6.4.tar.xz" diff --git a/pkg/devel/strace/ver b/pkg/devel/strace/ver @@ -0,0 +1 @@ +6.4 r0 diff --git a/pkg/editors/gen.lua b/pkg/editors/gen.lua @@ -0,0 +1 @@ +subgen('vis') +\ No newline at end of file diff --git a/pkg/editors/vis/gen.lua b/pkg/editors/vis/gen.lua @@ -0,0 +1,85 @@ +set('version', '7111608') +cflags({ + '-std=c99', + '-D CONFIG_HELP=1', + '-D CONFIG_CURSES=1', + '-D CONFIG_LUA=1', + '-D CONFIG_LPEG=1', + '-D CONFIG_TRE=0', + '-D CONFIG_SELINUX=0', + '-D CONFIG_ACL=0', + '-D HAVE_MEMRCHR=1', + '-D _XOPEN_SOURCE=700', + [[-D 'VERSION="$version"']], + string.format([[-D 'VIS_PATH="%s/share/vis"']], config.prefix), + '-D NDEBUG', + '-I $outdir', + '-isystem $builddir/pkg/lang/lua/include', + '-isystem $builddir/pkg/libs/libtermkey/include', + '-isystem $builddir/pkg/libs/netbsd-curses/include', +}) + +build('copy', '$outdir/config.h', '$srcdir/config.def.h') + +pkg.deps = { + '$outdir/config.h', + 'pkg/lang/lua/headers', + 'pkg/libs/libtermkey/headers', + 'pkg/libs/netbsd-curses/headers', +} + +exe('vis', [[ + array.c + buffer.c + libutf.c + main.c + map.c + sam.c + text.c + text-common.c + text-io.c + text-iterator.c + text-motions.c + text-objects.c + text-util.c + ui-terminal.c + view.c + vis.c + vis-lua.c + vis-marks.c + vis-modes.c + vis-motions.c + vis-operators.c + vis-prompt.c + vis-registers.c + vis-subprocess.c + vis-text-objects.c + text-regex.c + $builddir/pkg/lang/lua/liblua.a + $builddir/pkg/libs/libtermkey/libtermkey.a.d + $builddir/pkg/libs/lpeg/liblpeg.a + $builddir/pkg/libs/netbsd-curses/libcurses.a.d +]]) +file('bin/vis', '755', '$outdir/vis') + +exe('vis-digraph', {'vis-digraph.c'}) +file('bin/vis-digraph', '755', '$outdir/vis-digraph') + +exe('vis-menu', {'vis-menu.c'}) +file('bin/vis-menu', '755', '$outdir/vis-menu') + +file('bin/vis-open', '755', '$srcdir/vis-open') + +for _, f in ipairs{'vis.1', 'vis-digraph.1', 'vis-menu.1', 'vis-open.1'} do + build('sed', '$outdir/'..f, '$srcdir/man/'..f, {expr='s,VERSION,$version,'}) + man({'$outdir/'..f}) +end + +for f in iterlines('lua.txt') do + file('share/vis/'..f, '644', '$srcdir/lua/'..f) +end +sym('share/vis/lexer.lua', 'lexers/lexer.lua') +sym('share/vis/themes/default-16.lua', 'dark-16.lua') +sym('share/vis/themes/default-256.lua', 'dark-16.lua') + +fetch('git') diff --git a/pkg/editors/vis/lua.txt b/pkg/editors/vis/lua.txt @@ -0,0 +1,164 @@ +# 2,<cd src/lua && find * -type f -name '*.lua' | LC_COLLATE=C sort +lexers/actionscript.lua +lexers/ada.lua +lexers/ansi_c.lua +lexers/antlr.lua +lexers/apdl.lua +lexers/apl.lua +lexers/applescript.lua +lexers/asm.lua +lexers/asp.lua +lexers/autoit.lua +lexers/awk.lua +lexers/bash.lua +lexers/batch.lua +lexers/bibtex.lua +lexers/boo.lua +lexers/caml.lua +lexers/chuck.lua +lexers/clojure.lua +lexers/cmake.lua +lexers/coffeescript.lua +lexers/container.lua +lexers/context.lua +lexers/cpp.lua +lexers/crystal.lua +lexers/csharp.lua +lexers/css.lua +lexers/cuda.lua +lexers/dart.lua +lexers/desktop.lua +lexers/diff.lua +lexers/django.lua +lexers/dmd.lua +lexers/dockerfile.lua +lexers/dot.lua +lexers/dsv.lua +lexers/eiffel.lua +lexers/elixir.lua +lexers/elm.lua +lexers/erlang.lua +lexers/fantom.lua +lexers/faust.lua +lexers/fennel.lua +lexers/fish.lua +lexers/forth.lua +lexers/fortran.lua +lexers/fsharp.lua +lexers/fstab.lua +lexers/gap.lua +lexers/gemini.lua +lexers/gettext.lua +lexers/gherkin.lua +lexers/git-rebase.lua +lexers/gleam.lua +lexers/glsl.lua +lexers/gnuplot.lua +lexers/go.lua +lexers/groovy.lua +lexers/gtkrc.lua +lexers/hare.lua +lexers/haskell.lua +lexers/html.lua +lexers/icon.lua +lexers/idl.lua +lexers/inform.lua +lexers/ini.lua +lexers/io_lang.lua +lexers/java.lua +lexers/javascript.lua +lexers/jq.lua +lexers/json.lua +lexers/jsp.lua +lexers/julia.lua +lexers/latex.lua +lexers/ledger.lua +lexers/less.lua +lexers/lexer.lua +lexers/lilypond.lua +lexers/lisp.lua +lexers/litcoffee.lua +lexers/logtalk.lua +lexers/lua.lua +lexers/makefile.lua +lexers/man.lua +lexers/markdown.lua +lexers/matlab.lua +lexers/mediawiki.lua +lexers/meson.lua +lexers/moonscript.lua +lexers/myrddin.lua +lexers/nemerle.lua +lexers/networkd.lua +lexers/nim.lua +lexers/nsis.lua +lexers/null.lua +lexers/objective_c.lua +lexers/pascal.lua +lexers/perl.lua +lexers/php.lua +lexers/pico8.lua +lexers/pike.lua +lexers/pkgbuild.lua +lexers/pony.lua +lexers/powershell.lua +lexers/prolog.lua +lexers/props.lua +lexers/protobuf.lua +lexers/ps.lua +lexers/pure.lua +lexers/python.lua +lexers/rails.lua +lexers/rc.lua +lexers/reason.lua +lexers/rebol.lua +lexers/rest.lua +lexers/rexx.lua +lexers/rhtml.lua +lexers/routeros.lua +lexers/rstats.lua +lexers/ruby.lua +lexers/rust.lua +lexers/sass.lua +lexers/scala.lua +lexers/scheme.lua +lexers/smalltalk.lua +lexers/sml.lua +lexers/snobol4.lua +lexers/spin.lua +lexers/sql.lua +lexers/strace.lua +lexers/systemd.lua +lexers/taskpaper.lua +lexers/tcl.lua +lexers/tex.lua +lexers/texinfo.lua +lexers/text.lua +lexers/toml.lua +lexers/txt2tags.lua +lexers/typescript.lua +lexers/vala.lua +lexers/vb.lua +lexers/vbscript.lua +lexers/vcard.lua +lexers/verilog.lua +lexers/vhdl.lua +lexers/wsf.lua +lexers/xml.lua +lexers/xs.lua +lexers/xtend.lua +lexers/yaml.lua +lexers/zig.lua +plugins/complete-filename.lua +plugins/complete-word.lua +plugins/digraph.lua +plugins/filetype.lua +plugins/number-inc-dec.lua +plugins/textobject-lexer.lua +themes/dark-16.lua +themes/light-16.lua +themes/solarized.lua +themes/zenburn.lua +vis-std.lua +vis.lua +visrc.lua diff --git a/pkg/editors/vis/patch/0001-HACK-Avoid-wide-string-literals-for-now.patch b/pkg/editors/vis/patch/0001-HACK-Avoid-wide-string-literals-for-now.patch @@ -0,0 +1,27 @@ +From 358e4526a4ed8c5780d4fa43403c5c6e3d92f8bb Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Fri, 31 Jan 2020 23:34:52 -0800 +Subject: [PATCH] [HACK] Avoid wide string literals for now + +--- + vis-digraph.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/vis-digraph.c b/vis-digraph.c +index 35a5a17..0c23387 100644 +--- a/vis-digraph.c ++++ b/vis-digraph.c +@@ -1962,8 +1962,9 @@ int main(int argc, char *argv[]) { + setlocale(LC_ALL, ""); + + if (argc == 1) { ++ static const wchar_t fmt[] = {'%', 's', ' ', '%', 'l', 'c', ' ', '%', 's', '\n', '\0'}; + for (const Digraph *d = digraphs; d->name[0]; d++) +- wprintf(L"%s %lc %s\n", d->name, d->rune, d->description); ++ wprintf(fmt, d->name, d->rune, d->description); + return 0; + } + +-- +2.25.0 + diff --git a/pkg/editors/vis/src b/pkg/editors/vis/src @@ -0,0 +1 @@ +Subproject commit 7111608444c9fc00743e9dbd8c4dead3b4001eeb diff --git a/pkg/editors/vis/ver b/pkg/editors/vis/ver @@ -0,0 +1 @@ +7111608 r0 diff --git a/pkg/gen.lua b/pkg/gen.lua @@ -0,0 +1,6 @@ +subgen('admin') +subgen('crypt') +subgen('devel') +subgen('editors') +subgen('lang') +subgen('libs') diff --git a/pkg/lang/awk/.gitignore b/pkg/lang/awk/.gitignore @@ -0,0 +1 @@ +/tools.ninja diff --git a/pkg/lang/awk/gen.lua b/pkg/lang/awk/gen.lua @@ -0,0 +1,28 @@ +cflags({ + '-std=c99', + '-D _XOPEN_SOURCE=700', + '-I $outdir', + '-I $srcdir', +}) + +yacc('awkgram', 'awkgram.y') + +pkg.deps = {'$outdir/awkgram.tab.h'} + +sub('tools.ninja', function() + toolchain(config.host) + cflags{'-I $outdir'} + exe('maketab', {'maketab.c'}) +end) + +rule('maketab', '$outdir/maketab $in >$out') +build('maketab', '$outdir/proctab.c', {'$outdir/awkgram.tab.h', '|', '$outdir/maketab'}) + +exe('awk', [[ + b.c main.c parse.c tran.c lib.c run.c lex.c + $outdir/(awkgram.tab.c proctab.c) +]]) +file('bin/awk', '755', '$outdir/awk') +man({'awk.1'}) + +fetch('git') diff --git a/pkg/lang/awk/src b/pkg/lang/awk/src @@ -0,0 +1 @@ +Subproject commit 30791e0f686010b39c1ab2121df85da180960d53 diff --git a/pkg/lang/awk/ver b/pkg/lang/awk/ver @@ -0,0 +1 @@ +20220830 r0 diff --git a/pkg/lang/gen.lua b/pkg/lang/gen.lua @@ -0,0 +1,2 @@ +subgen('awk') +subgen('lua') diff --git a/pkg/lang/lua/.gitignore b/pkg/lang/lua/.gitignore @@ -0,0 +1,2 @@ +/lua-5.2.4.tar.gz +/src diff --git a/pkg/lang/lua/gen.lua b/pkg/lang/lua/gen.lua @@ -0,0 +1,26 @@ +cflags({ + '-std=c99', '-Wall', '-Wextra', '-Wpedantic', '-Wno-implicit-fallthrough', + '-D _DEFAULT_SOURCE', + '-D LUA_USE_POSIX', +}) + +pkg.hdrs = { + copy('$outdir/include', '$srcdir/src', {'lua.h', 'luaconf.h', 'lualib.h', 'lauxlib.h'}), + install=true, +} + +lib('liblua.a', [[src/( + lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c + lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c + ltm.c lundump.c lvm.c lzio.c + lauxlib.c lbaselib.c lbitlib.c lcorolib.c ldblib.c liolib.c + lmathlib.c loslib.c lstrlib.c ltablib.c loadlib.c linit.c +)]]) +file('lib/liblua.a', '644', '$outdir/liblua.a') + +exe('lua', {'src/lua.c', 'liblua.a'}) +file('bin/lua5.2', '755', '$outdir/lua') +sym('bin/lua', 'lua5.2') +man({'doc/lua.1'}) + +fetch('curl') diff --git a/pkg/lang/lua/sha256 b/pkg/lang/lua/sha256 @@ -0,0 +1 @@ +b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b lua-5.2.4.tar.gz diff --git a/pkg/lang/lua/url b/pkg/lang/lua/url @@ -0,0 +1 @@ +url = "http://www.lua.org/ftp/lua-5.2.4.tar.gz" diff --git a/pkg/lang/lua/ver b/pkg/lang/lua/ver @@ -0,0 +1 @@ +5.2.4 r0 diff --git a/pkg/libs/gen.lua b/pkg/libs/gen.lua @@ -0,0 +1,3 @@ +subgen('libtermkey') +subgen('lpeg') +subgen('netbsd-curses') diff --git a/pkg/libs/libtermkey/.gitignore b/pkg/libs/libtermkey/.gitignore @@ -0,0 +1,2 @@ +/libtermkey-0.22.tar.gz +/src diff --git a/pkg/libs/libtermkey/gen.lua b/pkg/libs/libtermkey/gen.lua @@ -0,0 +1,16 @@ +cflags({ + '-std=c99', '-Wall', + '-isystem $builddir/pkg/libs/netbsd-curses/include', +}) + +pkg.hdrs = copy('$outdir/include', '$srcdir', {'termkey.h'}) +pkg.deps = {'pkg/libs/netbsd-curses/headers'} + +lib('libtermkey.a', { + 'termkey.c', + 'driver-csi.c', + 'driver-ti.c', + '$builddir/pkg/libs/netbsd-curses/libcurses.a.d', +}) + +fetch('curl') diff --git a/pkg/libs/libtermkey/sha256 b/pkg/libs/libtermkey/sha256 @@ -0,0 +1 @@ +6945bd3c4aaa83da83d80a045c5563da4edd7d0374c62c0d35aec09eb3014600 libtermkey-0.22.tar.gz diff --git a/pkg/libs/libtermkey/url b/pkg/libs/libtermkey/url @@ -0,0 +1 @@ +url = "http://www.leonerd.org.uk/code/libtermkey/libtermkey-0.22.tar.gz" diff --git a/pkg/libs/libtermkey/ver b/pkg/libs/libtermkey/ver @@ -0,0 +1 @@ +0.22 r0 diff --git a/pkg/libs/lpeg/.gitignore b/pkg/libs/lpeg/.gitignore @@ -0,0 +1,2 @@ +/lpeg-1.0.2.tar.gz +/src diff --git a/pkg/libs/lpeg/gen.lua b/pkg/libs/lpeg/gen.lua @@ -0,0 +1,17 @@ +cflags({ + '-std=c99', + '-D NDEBUG', + '-isystem $builddir/pkg/lang/lua/include', +}) + +pkg.deps = {'pkg/lang/lua/headers'} + +lib('liblpeg.a', { + 'lpvm.c', + 'lpcap.c', + 'lptree.c', + 'lpcode.c', + 'lpprint.c', +}) + +fetch('curl') diff --git a/pkg/libs/lpeg/sha256 b/pkg/libs/lpeg/sha256 @@ -0,0 +1 @@ +48d66576051b6c78388faad09b70493093264588fcd0f258ddaab1cdd4a15ffe lpeg-1.0.2.tar.gz diff --git a/pkg/libs/lpeg/url b/pkg/libs/lpeg/url @@ -0,0 +1 @@ +url = "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.2.tar.gz" diff --git a/pkg/libs/lpeg/ver b/pkg/libs/lpeg/ver @@ -0,0 +1 @@ +1.0.2 r0 diff --git a/pkg/libs/netbsd-curses/.gitignore b/pkg/libs/netbsd-curses/.gitignore @@ -0,0 +1 @@ +/tools.ninja diff --git a/pkg/libs/netbsd-curses/gen.lua b/pkg/libs/netbsd-curses/gen.lua @@ -0,0 +1,143 @@ +cflags({ + '-Wall', '-Wpedantic', + '-D _XOPEN_SOURCE=700', + '-D TERMINFO_DB', + ([[-D '_PATH_TERMINFO="%s/share/misc/terminfo"']]):format(config.prefix), + '-I $srcdir/compat', + '-I $srcdir/lib/libcurses', + '-I $srcdir/lib/libterminfo', + '-I $srcdir/lib/libform', + '-I $srcdir/lib/libmenu', + '-I $srcdir/lib/libpanel', + '-I $outdir', +}) + +sub('tools.ninja', function() + toolchain(config.host) + cflags{ + '-I $srcdir/compat', + '-I $srcdir/lib/libterminfo', + } + set('outdir', '$outdir/host') + + cc('compat/mi_vector_hash.c') + build('cc', '$outdir/hash.c.o', '$outdir/../hash.c') + + exe('nbperf', [[ + usr.bin/nbperf/( + nbperf.c + nbperf-bdz.c nbperf-chm.c nbperf-chm3.c + graph2.c graph3.c + ) + compat/mi_vector_hash.c.o + ]]) + + exe('tic', [[ + usr.bin/tic/tic.c + lib/libterminfo/compile.c + compat/cdbw.c + compat/mi_vector_hash.c.o + hash.c.o + ]]) +end) + +pkg.hdrs = { + copy('$outdir/include', '$srcdir/lib/libcurses', {'curses.h', 'unctrl.h'}), + copy('$outdir/include', '$srcdir/lib/libterminfo', {'term.h', 'termcap.h'}), + copy('$outdir/include', '$srcdir/lib/libpanel', {'panel.h'}), + install=true, +} +pkg.deps = { + '$outdir/compiled_terms.c', + '$outdir/termcap_hash.c', + '$outdir/hash.c', +} + +rule('tic', '$outdir/host/tic $ticflags -o $out $in $terms') +build('tic', '$outdir/compiled_terms.c', {'$srcdir/share/terminfo/terminfo', '|', '$outdir/host/tic'}, { + ticflags='-Sx', + terms='dumb', +}) +build('tic', '$outdir/terminfo.cdb', {'$srcdir/share/terminfo/terminfo', '|', '$outdir/host/tic'}, { + ticflags='-x', +}) +file('share/misc/terminfo.cdb', '644', '$outdir/terminfo.cdb') + +rule('genhash', 'TOOL_NBPERF=$outdir/host/nbperf $srcdir/lib/libterminfo/genhash $in >$out') +build('genhash', '$outdir/hash.c', { + '$srcdir/lib/libterminfo/term.h', + '|', '$srcdir/lib/libterminfo/genhash', '$outdir/host/nbperf', +}) + +rule('genthash', 'TOOL_NBPERF=$outdir/host/nbperf $srcdir/lib/libterminfo/genthash $in >$out') +build('genthash', '$outdir/termcap_hash.c', { + '$srcdir/lib/libterminfo/termcap_map.c', + '|', '$srcdir/lib/libterminfo/genthash', '$outdir/host/nbperf', +}) + +lib('libcurses.a', [[ + lib/libcurses/( + acs.c addbytes.c addch.c addchnstr.c addnstr.c attributes.c + background.c bell.c border.c box.c chgat.c clear.c clearok.c + clrtobot.c clrtoeol.c color.c copywin.c cr_put.c + ctrace.c cur_hash.c curs_set.c + curses.c delch.c deleteln.c delwin.c echochar.c erase.c fileio.c + flushok.c fullname.c getch.c getstr.c getyx.c id_subwins.c idlok.c + idcok.c immedok.c inch.c inchstr.c initscr.c insch.c insdelln.c + insertln.c insstr.c instr.c keypad.c keyname.c leaveok.c line.c + meta.c mouse.c move.c + mvwin.c newwin.c nodelay.c notimeout.c overlay.c overwrite.c pause.c + printw.c putchar.c refresh.c resize.c ripoffline.c scanw.c screen.c + scroll.c scrollok.c setterm.c slk.c standout.c syncok.c timeout.c + toucholap.c touchwin.c tstp.c tty.c unctrl.c underscore.c version.c + + cchar.c add_wch.c add_wchstr.c addwstr.c echo_wchar.c ins_wch.c + ins_wstr.c get_wch.c get_wstr.c in_wch.c in_wchstr.c + inwstr.c + ) + libterminfo.a +]]) +file('lib/libcurses.a', '644', '$outdir/libcurses.a') + +lib('libterminfo.a', [[ + lib/libterminfo/( + term.c ti.c setupterm.c curterm.c tparm.c tputs.c + compile.c + termcap.c + ) + compat/cdbr.c + compat/mi_vector_hash.c + $outdir/hash.c +]]) +file('lib/libterminfo.a', '644', '$outdir/libterminfo.a') + +lib('libpanel.a', [[ + lib/libpanel/( + _deck.c above.c below.c bottom.c del.c getuser.c hidden.c hide.c move.c + new.c replace.c setuser.c show.c top.c update.c window.c + ) + libcurses.a.d +]]) +file('lib/libpanel.a', '644', '$outdir/libpanel.a') + +exe('infocmp', [[usr.bin/infocmp/infocmp.c libterminfo.a]]) +file('bin/infocmp', '755', '$outdir/infocmp') +exe('tabs', [[usr.bin/tabs/tabs.c libterminfo.a]]) +file('bin/tabs', '755', '$outdir/tabs') +exe('tic', [[usr.bin/tic/tic.c compat/cdbw.c libterminfo.a]]) +file('bin/tic', '755', '$outdir/tic') +exe('tput', [[usr.bin/tput/tput.c libterminfo.a]]) +file('bin/tput', '755', '$outdir/tput') +exe('tset', [[usr.bin/tset/(map.c misc.c set.c term.c tset.c) libterminfo.a]]) +file('bin/tset', '755', '$outdir/tset') +sym('bin/reset', 'tset') + +man({ + 'usr.bin/infocmp/infocmp.1', + 'usr.bin/tabs/tabs.1', + 'usr.bin/tic/tic.1', + 'usr.bin/tput/tput.1', + 'usr.bin/tset/tset.1', +}) + +fetch('git') diff --git a/pkg/libs/netbsd-curses/patch/0001-Use-__fpurge-from-stdio_ext.h.patch b/pkg/libs/netbsd-curses/patch/0001-Use-__fpurge-from-stdio_ext.h.patch @@ -0,0 +1,33 @@ +From 9c2c3bd4d21bf5f55c2e8a41c8253d152f7ba2f5 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 29 May 2021 21:45:58 -0700 +Subject: [PATCH] Use __fpurge from stdio_ext.h + +--- + lib/libcurses/tty.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/lib/libcurses/tty.c b/lib/libcurses/tty.c +index b022ba6..b5e4506 100644 +--- a/lib/libcurses/tty.c ++++ b/lib/libcurses/tty.c +@@ -34,6 +34,7 @@ + #include <sys/types.h> + + #include <fcntl.h> ++#include <stdio_ext.h> + #include <stdlib.h> + #include <termios.h> + #include <unistd.h> +@@ -597,7 +598,7 @@ int + flushinp(void) + { + +- (void)fpurge(_cursesi_screen->infd); ++ (void)__fpurge(_cursesi_screen->infd); + return OK; + } + +-- +2.31.1 + diff --git a/pkg/libs/netbsd-curses/patch/0002-Remove-duplicate-keymap-sequences-from-st-terminfo.patch b/pkg/libs/netbsd-curses/patch/0002-Remove-duplicate-keymap-sequences-from-st-terminfo.patch @@ -0,0 +1,50 @@ +From a6d5710b0fa7d79da7addc1ba2f58b28d6823396 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 1 Jun 2021 00:24:45 -0700 +Subject: [PATCH] Remove duplicate keymap sequences from st terminfo + +Otherwise, curses has to make an arbitrary decision about which key +to use when that sequence is detected. +--- + share/terminfo/terminfo | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/share/terminfo/terminfo b/share/terminfo/terminfo +index b70fa1c..6e1f3bb 100644 +--- a/share/terminfo/terminfo ++++ b/share/terminfo/terminfo +@@ -1398,7 +1398,7 @@ qansi-g|QNX ANSI, + ind=\E[S, invis=\E[9m, + is2=\E>\E[?1l\E[?7h\E[0;10;39;49m, is3=\E(B\E)0, + kBEG=\ENn, kCAN=\E[s, kCMD=\E[t, kCPY=\ENs, kCRT=\ENt, +- kDL=\ENv, kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kHOM=\E[h, ++ kEXT=\ENw, kFND=\ENx, kHLP=\ENy, kHOM=\E[h, + kLFT=\E[d, kNXT=\E[u, kOPT=\ENz, kPRV=\E[v, kRIT=\E[c, + kbs=^H, kcan=\E[S, kcbt=\E[Z, kclo=\ENc, kclr=\ENa, + kcmd=\E[G, kcpy=\E[g, kctab=\E[z, kcub1=\E[D, kcud1=\E[B, +@@ -6701,10 +6701,10 @@ st-0.6|simpleterm 0.6, + il=\E[%p1%dL, il1=\E[L, ind=\n, invis=\E[8m, + is2=\E[4l\E>\E[?1034l, kDC=\E[3;2~, kEND=\E[1;2F, + kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, kNXT=\E[6;2~, +- kPRV=\E[5;2~, kRIT=\E[1;2C, ka1=\E[1~, ka3=\E[5~, kb2=\EOu, +- kbs=^?, kc1=\E[4~, kc3=\E[6~, kcbt=\E[Z, kclr=\E[3;5~, ++ kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOu, ++ kbs=^?, kcbt=\E[Z, kclr=\E[3;5~, + kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, +- kdch1=\E[3~, kdl1=\E[3;2~, ked=\E[1;5F, kel=\E[1;2F, ++ kdch1=\E[3~, kdl1=\E[3;2~, ked=\E[1;5F, + kend=\E[4~, kent=\EOM, kf1=\EOP, kf10=\E[21~, kf11=\E[23~, + kf12=\E[24~, kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R, + kf16=\E[1;2S, kf17=\E[15;2~, kf18=\E[17;2~, +@@ -6724,7 +6724,7 @@ st-0.6|simpleterm 0.6, + kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kich1=\E[2~, + kil1=\E[2;5~, kind=\E[1;2B, kmous=\E[M, knp=\E[6~, +- kpp=\E[5~, kri=\E[1;2A, krmir=\E[2;2~, mc0=\E[i, mc4=\E[4i, ++ kpp=\E[5~, kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, + mc5=\E[5i, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM, + rmacs=\E(B, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[27m, + rmul=\E[24m, rs1=\Ec, rs2=\E[4l\E>\E[?1034l, sc=\E7, +-- +2.31.1 + diff --git a/pkg/libs/netbsd-curses/patch/0003-Revert-Fix-for-PR-lib-56224.patch b/pkg/libs/netbsd-curses/patch/0003-Revert-Fix-for-PR-lib-56224.patch @@ -0,0 +1,80 @@ +From 6e3a7ba743db0e7e22ef50d038690b3f1e46bba3 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Tue, 8 Jun 2021 20:00:53 -0700 +Subject: [PATCH] Revert "Fix for PR lib/56224" + +This reverts commit deeb100e95f3d981cbe4ece4744fe6c34a5a2f05. +--- + lib/libcurses/addbytes.c | 38 +------------------------------------- + 1 file changed, 1 insertion(+), 37 deletions(-) + +diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c +index a678939f..9fd917ca 100644 +--- a/lib/libcurses/addbytes.c ++++ b/lib/libcurses/addbytes.c +@@ -1,4 +1,4 @@ +-/* $NetBSD: addbytes.c,v 1.55 2021/06/06 05:06:44 blymn Exp $ */ ++/* $NetBSD: addbytes.c,v 1.54 2021/02/13 14:30:37 rillig Exp $ */ + + /* + * Copyright (c) 1987, 1993, 1994 +@@ -161,15 +161,6 @@ _cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr, + } else if (wc == 0) { + break; + } +- +- /* if scrollok is false and we are at the bottom of +- * screen and this character would take us past the +- * end of the line then we are done. +- */ +- if ((win->curx + n >= win->maxx) && +- (!(win->flags & __SCROLLOK)) && +- (win->cury == win->scr_b)) +- break; + #ifdef DEBUG + __CTRACE(__CTRACE_INPUT, + "ADDBYTES WIDE(0x%x [%s], %x) at (%d, %d), ate %d bytes\n", +@@ -214,19 +205,6 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c, + case '\t': + tabsize = win->screen->TABSIZE; + newx = tabsize - (*x % tabsize); +- /* if at the bottom of the window and +- not allowed to scroll then just do +- what we can */ +- if ((*y == win->scr_b) && +- !(win->flags & __SCROLLOK)) { +- if ((*lp)->flags & __ISPASTEOL) { +- return OK; +- } +- +- if (*x + newx > win->maxx - 1) +- newx = win->maxx - *x - 1; +- } +- + for (i = 0; i < newx; i++) { + if (waddbytes(win, blank, 1) == ERR) + return ERR; +@@ -379,20 +357,6 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + cc.attributes = win->wattr; + tabsize = win->screen->TABSIZE; + newx = tabsize - (*x % tabsize); +- +- /* if at the bottom of the window and +- not allowed to scroll then just do +- what we can */ +- if ((*y == win->scr_b) && +- !(win->flags & __SCROLLOK)) { +- if ((*lnp)->flags & __ISPASTEOL) { +- return OK; +- } +- +- if (*x + newx > win->maxx - 1) +- newx = win->maxx - *x - 1; +- } +- + for (i = 0; i < newx; i++) { + if (wadd_wch(win, &cc) == ERR) + return ERR; +-- +2.31.1 + diff --git a/pkg/libs/netbsd-curses/patch/0004-Don-t-wrap-when-adding-past-last-line-in-non-scrolli.patch b/pkg/libs/netbsd-curses/patch/0004-Don-t-wrap-when-adding-past-last-line-in-non-scrolli.patch @@ -0,0 +1,119 @@ +From de7a1acf3168a35c19a569cc7f6f572c39e96c82 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 3 Jun 2021 00:32:57 -0700 +Subject: [PATCH] Don't wrap when adding past last line in non-scrolling window + +X/Open curses says + +> If scrolling is disabled, any characters that would extend beyond +> the last column of the last line are truncated. + +However, currently libcurses wraps the cursor back to the beginning +of the last line. + +To fix this, when we try to add a character that would go past the +end of the last line, leave the cursor where it is. If the character +goes exactly to the end of the last line, add the character but set +the cursor to the last column (to match ncurses behavior). + +[0] https://pubs.opengroup.org/onlinepubs/7908799/xcurses/intov.html#tag_001_004_002_002 +--- + lib/libcurses/addbytes.c | 20 +++++++++++--------- + 1 file changed, 11 insertions(+), 9 deletions(-) + +diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c +index 9fd917ca..e52dc310 100644 +--- a/lib/libcurses/addbytes.c ++++ b/lib/libcurses/addbytes.c +@@ -232,8 +232,6 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c, + #endif + + if (char_interp && ((*lp)->flags & __ISPASTEOL)) { +- *x = 0; +- (*lp)->flags &= ~__ISPASTEOL; + if (*y == win->scr_b) { + #ifdef DEBUG + __CTRACE(__CTRACE_INPUT, +@@ -246,6 +244,8 @@ _cursesi_addbyte(WINDOW *win, __LINE **lp, int *y, int *x, int c, + } else { + (*y)++; + } ++ *x = 0; ++ (*lp)->flags &= ~__ISPASTEOL; + *lp = win->alines[*y]; + if (c == '\n') + return OK; +@@ -341,8 +341,6 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + return OK; + case L'\n': + wclrtoeol(win); +- *x = 0; +- (*lnp)->flags &= ~__ISPASTEOL; + if (*y == win->scr_b) { + if (!(win->flags & __SCROLLOK)) + return ERR; +@@ -350,6 +348,8 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + } else { + (*y)++; + } ++ *x = 0; ++ (*lnp)->flags &= ~__ISPASTEOL; + return OK; + case L'\t': + cc.vals[0] = L' '; +@@ -395,8 +395,6 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + } + /* check for new line first */ + if (char_interp && ((*lnp)->flags & __ISPASTEOL)) { +- *x = 0; +- (*lnp)->flags &= ~__ISPASTEOL; + if (*y == win->scr_b) { + if (!(win->flags & __SCROLLOK)) + return ERR; +@@ -404,6 +402,8 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + } else { + (*y)++; + } ++ *x = 0; ++ (*lnp)->flags &= ~__ISPASTEOL; + (*lnp) = win->alines[*y]; + lp = &win->alines[*y]->line[*x]; + } +@@ -459,7 +459,6 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + if (newx > *(*lnp)->lastchp) + *(*lnp)->lastchp = newx; + __touchline(win, *y, sx, (int) win->maxx - 1); +- sx = *x = 0; + if (*y == win->scr_b) { + if (!(win->flags & __SCROLLOK)) + return ERR; +@@ -467,6 +466,7 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + } else { + (*y)++; + } ++ sx = *x = 0; + lp = &win->alines[*y]->line[0]; + (*lnp) = win->alines[*y]; + } +@@ -547,14 +547,16 @@ _cursesi_addwchar(WINDOW *win, __LINE **lnp, int *y, int *x, + if (newx > *(*lnp)->lastchp) + *(*lnp)->lastchp = newx; + __touchline(win, *y, sx, (int) win->maxx - 1); +- *x = sx = 0; + if (*y == win->scr_b) { +- if (!(win->flags & __SCROLLOK)) ++ if (!(win->flags & __SCROLLOK)) { ++ *x = win->maxx - 1; + return ERR; ++ } + scroll(win); + } else { + (*y)++; + } ++ *x = sx = 0; + lp = &win->alines[*y]->line[0]; + (*lnp) = win->alines[*y]; + } else { +-- +2.31.1 + diff --git a/pkg/libs/netbsd-curses/patch/0005-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch b/pkg/libs/netbsd-curses/patch/0005-Return-early-from-_cursesi_waddbytes-if-_cursesi_add.patch @@ -0,0 +1,28 @@ +From c977aac84ce6c6e2737a8a072cb4116b8ee4278e Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Thu, 3 Jun 2021 00:42:45 -0700 +Subject: [PATCH] Return early from _cursesi_waddbytes if _cursesi_addwchar + fails + +This error may indicate that scrolling was required in a non-scrolling +window, in which case the rest of the string should be truncated. +--- + lib/libcurses/addbytes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/libcurses/addbytes.c b/lib/libcurses/addbytes.c +index e52dc310..5d783df8 100644 +--- a/lib/libcurses/addbytes.c ++++ b/lib/libcurses/addbytes.c +@@ -132,7 +132,7 @@ _cursesi_waddbytes(WINDOW *win, const char *bytes, int count, attr_t attr, + #ifdef HAVE_WCHAR + (void)memset(&st, 0, sizeof(st)); + #endif +- while (count > 0) { ++ while (count > 0 && err == OK) { + #ifndef HAVE_WCHAR + c = *bytes++; + #ifdef DEBUG +-- +2.31.1 + diff --git a/pkg/libs/netbsd-curses/src b/pkg/libs/netbsd-curses/src @@ -0,0 +1 @@ +Subproject commit 5b78297a1276a7d64c3be78d1e54251a1203a44a diff --git a/pkg/libs/netbsd-curses/ver b/pkg/libs/netbsd-curses/ver @@ -0,0 +1 @@ +5b78297a12 r0 diff --git a/probe/HAVE_EMMINTRIN_H b/probe/HAVE_EMMINTRIN_H @@ -0,0 +1,4 @@ +#include <emmintrin.h> +int main(void) { + return 0; +} diff --git a/probe/HAVE_IMMINTRIN_H b/probe/HAVE_IMMINTRIN_H @@ -0,0 +1,4 @@ +#include <immintrin.h> +int main(void) { + return 0; +} diff --git a/probe/HAVE_INLINE_ASM b/probe/HAVE_INLINE_ASM @@ -0,0 +1,4 @@ +int main(void) { + __asm__(""); + return 0; +} diff --git a/probe/HAVE_MMINTRIN_H b/probe/HAVE_MMINTRIN_H @@ -0,0 +1,4 @@ +#include <mmintrin.h> +int main(void) { + return 0; +} diff --git a/probe/HAVE__MM_MOVEMASK_EPI8 b/probe/HAVE__MM_MOVEMASK_EPI8 @@ -0,0 +1,6 @@ +#include <immintrin.h> +static __m128i x; +int main(void) { + _mm_movemask_epi8(x); + return 0; +} diff --git a/probe/HAVE__THREAD_LOCAL b/probe/HAVE__THREAD_LOCAL @@ -0,0 +1,4 @@ +_Thread_local int x; +int main(void) { + return x; +} diff --git a/probe/HAVE___BUILTIN_ASSUME_ALIGNED b/probe/HAVE___BUILTIN_ASSUME_ALIGNED @@ -0,0 +1,4 @@ +void *x; +int main(void) { + return __builtin_assume_aligned(x, 8) == x; +} diff --git a/probe/HAVE___BUILTIN_CHOOSE_EXPR b/probe/HAVE___BUILTIN_CHOOSE_EXPR @@ -0,0 +1,3 @@ +int main(void) { + return __builtin_choose_expr(123, 1, 0); +} diff --git a/probe/HAVE___BUILTIN_CLZ b/probe/HAVE___BUILTIN_CLZ @@ -0,0 +1,4 @@ +unsigned x = -1; +int main(void) { + return __builtin_clz(x); +} diff --git a/probe/HAVE___BUILTIN_CTZL b/probe/HAVE___BUILTIN_CTZL @@ -0,0 +1,4 @@ +unsigned long x = -1; +int main(void) { + return __builtin_ctzl(x); +} diff --git a/probe/HAVE___BUILTIN_POPCOUNT b/probe/HAVE___BUILTIN_POPCOUNT @@ -0,0 +1,4 @@ +unsigned x = 0; +int main(void) { + return __builtin_popcount(x); +} diff --git a/probe/PIC b/probe/PIC @@ -0,0 +1,3 @@ +int main(void) { + return __PIC__ == 0; +} diff --git a/probe/SIZEOF_LONG b/probe/SIZEOF_LONG @@ -0,0 +1 @@ +_Static_assert(SIZEOF_LONG == sizeof(long), "incorrect size"); diff --git a/probe/SIZEOF_SIZE_T b/probe/SIZEOF_SIZE_T @@ -0,0 +1,2 @@ +#include <stddef.h> +_Static_assert(SIZEOF_SIZE_T == sizeof(size_t), "incorrect size"); diff --git a/probe/SIZEOF_TIME_T b/probe/SIZEOF_TIME_T @@ -0,0 +1,2 @@ +#include <sys/types.h> +_Static_assert(SIZEOF_TIME_T == sizeof(time_t), "incorrect size"); diff --git a/probe/gen.lua b/probe/gen.lua @@ -0,0 +1,24 @@ +local function probe(var) + build('probe', '$outdir/'..var, {'$dir/'..var, '|', '$basedir/scripts/probe.sh'}, {var=var}) +end + +probe('HAVE_EMMINTRIN_H') +probe('HAVE_IMMINTRIN_H') +probe('HAVE_INLINE_ASM') +probe('HAVE_MMINTRIN_H') +probe('HAVE__MM_MOVEMASK_EPI8') +probe('HAVE__THREAD_LOCAL') +probe('HAVE___BUILTIN_ASSUME_ALIGNED') +probe('HAVE___BUILTIN_CHOOSE_EXPR') +probe('HAVE___BUILTIN_CLZ') +probe('HAVE___BUILTIN_CTZL') +probe('HAVE___BUILTIN_POPCOUNT') +probe('PIC') + +local function probesize(var) + build('probe-size', '$outdir/'..var, {'$dir/'..var, '|', '$basedir/scripts/probe-size.sh'}, {var=var}) +end + +probesize('SIZEOF_LONG') +probesize('SIZEOF_SIZE_T') +probesize('SIZEOF_TIME_T') diff --git a/rules.ninja b/rules.ninja @@ -0,0 +1,132 @@ +rule gen + command = lua $basedir/setup.lua $gendir + generator = 1 + +# toolchain +rule cc + command = $cc -MD -MF $out.d $cflags -c -o $out $in + depfile = $out.d + deps = gcc + description = CC $out + +rule cpp + command = $cc -MD -MF $out.d $cflags -E -P -o $out $in + depfile = $out.d + deps = gcc + description = CPP $out + +rule as + command = $as $asflags -o $out $in + description = AS $out + +rule link + command = $cc $ldflags -o $out $in $ldlibs + description = LINK $out + +rule ar + command = rm -f $out && $ar crs $out $in + description = AR $out + +rule ld + command = $ld -o $out $in + description = LD $out + +rule objcopy + command = $objcopy $objcopyflags $in $out + +rule rsp + command = ln -f $rspfile $out + description = RSP $out + rspfile = $out.tmp + rspfile_content = $in_newline + +# TODO: Enable dependency-tracking for nasm when +# https://bugzilla.nasm.us/show_bug.cgi?id=3392280#c6 is fixed. +rule nasm + command = nasm $nasmflags -o $out $in + +rule mc + command = $mc $mcflags -o $out $in + +rule muse + command = muse $museflags -o $out $in + +rule probe + command = sh $basedir/scripts/probe.sh $var $out $cc $cflags $ldflags -o /dev/null -x c $in + +rule probe-size + command = sh $basedir/scripts/probe-size.sh $var $out $cc $cflags -c -o /dev/null -x c $in + +# misc tools +rule touch + command = touch $out + +rule empty + command = >$out + description = EMPTY $out + +rule copy + command = ln -f $in $out + description = COPY $out + +rule cat + command = cat $in >$out + +rule gzip + command = gzip -c -9 -n <$in >$out + description = GZIP $out + +rule yacc + command = yacc $yaccflags $in + description = YACC $out + +rule sed + command = sed $expr $in >$out + description = SED $out + +rule awk + command = awk $expr $in >$out + description = AWK $out + +rule grep + command = grep $expr $in >$out + +rule printf + command = printf $args >$out + +rule tic + command = tic $ticflags $in + +rule wayland-proto + command = wayland-scanner $type <$in >$out + +rule git-hash + command = sh $basedir/scripts/hash.sh $repo $args $in >$out + description = HASH $args + +rule git-tree + command = sh $basedir/scripts/tree.sh $repo $repo_tag $in $out + description = TREE $out + restat = 1 + +rule git-commit + command = sh $basedir/scripts/commit.sh $repo $repo_branch $repo_tag $out + +rule git-init + command = git init $repo_flags $repo && touch $out + +rule fspec-hash + command = $builddir/pkg/devel/fspec-sync/host/fspec-hash <$in >$out + +rule fspec-sort + command = $builddir/pkg/devel/fspec-sync/host/fspec-sort -p <$in >$out + +rule fspec-tar + command = $builddir/pkg/devel/fspec-sync/host/fspec-tar <$in | zstd >$out + +rule fetch + command = cd $basedir && sh $$OLDPWD/$script $gendir && touch $$OLDPWD/$out + description = FETCH $gendir + restat = 1 + generator = 1 + pool = console diff --git a/scripts/checksum.sh b/scripts/checksum.sh @@ -0,0 +1,10 @@ +if command -v sha256sum >/dev/null; then + exec sha256sum "$@" +elif command -v sha256 >/dev/null; then + exec sha256 "$@" +elif command -v shasum >/dev/null; then + exec shasum -a 256 "$@" +else + printf '%s: sha256sum, sha256, or shasum required\n' "$0" >&2 + exit 1 +fi diff --git a/scripts/commit.sh b/scripts/commit.sh @@ -0,0 +1,29 @@ +set -e + +if [ "$#" != 4 ] ; then + echo 'usage: commit.sh repo branch tag out' >&2 + exit 2 +fi + +repo=$1 +branch=$2 +tag=$3 +out=$4 + +if commit=$(git -C "$repo" show-ref -s --verify "refs/heads/$branch" 2>/dev/null) ; then + oldtree=$(git -C "$repo" rev-parse --verify "$branch^{tree}") + newtree=$(git -C "$repo" rev-parse --verify "$tag^{tree}") + if [ "$oldtree" != "$newtree" ] ; then + set -- -p "$branch" + unset commit + fi +else + set -- + unset commit +fi + +if [ -z "${commit+set}" ] ; then + commit=$(git -C "$repo" commit-tree -m "oasis $(git rev-parse --short=10 HEAD)" "$@" "$tag") + git -C "$repo" update-ref "refs/heads/$branch" "$commit" +fi +echo "$commit" >"$out" diff --git a/scripts/extract.sh b/scripts/extract.sh @@ -0,0 +1,18 @@ +file=$1 +shift + +case $file in +*.tar.gz|*.tgz) tool=gzip ;; +*.tar.bz2) tool=bzip2 ;; +*.tar.xz) tool=xz ;; +*) exit 0 +esac + +if command -v bsdtar >/dev/null; then + exec bsdtar -xf "$file" "$@" +elif command -v pax >/dev/null; then + "$tool" -d -c "$file" | pax -r "$@" +else + printf '%s: bsdtar or pax is required' "$0" >&2 + exit 1 +fi diff --git a/scripts/fetch-curl.sh b/scripts/fetch-curl.sh @@ -0,0 +1,28 @@ +set -e + +if [ "$#" != 1 ] ; then + echo 'usage: fetch-curl.sh dir' >&2 + exit 2 +fi + +dir=$1 +shift + +cd "$dir" + +if [ -e src ] ; then + rm -rf src +fi + +if ! sh "$OLDPWD/scripts/checksum.sh" -c sha256 2>/dev/null ; then + curl -L -K url -O + sh "$OLDPWD/scripts/checksum.sh" -c sha256 +fi + +while read -r _ archive ; do + sh "$OLDPWD/scripts/extract.sh" "$archive" -s ',^[^/]*,src,' '*/*' +done <sha256 + +if [ -d patch ] ; then + git apply -v --whitespace=nowarn --directory "$dir/src" patch/*.patch +fi diff --git a/scripts/fetch-git.sh b/scripts/fetch-git.sh @@ -0,0 +1,13 @@ +set -e + +if [ "$#" != 1 ] ; then + echo 'usage: fetch-git.sh dir' >&2 + exit 2 +fi + +cd "$1" + +git submodule update --init --checkout src +if [ -d patch ] ; then + git -C src am --keep-non-patch --whitespace=nowarn "$PWD"/patch/*.patch +fi diff --git a/scripts/hash.sh b/scripts/hash.sh @@ -0,0 +1,23 @@ +set -e + +if [ "$#" != 4 ] ; then + echo 'usage: hash.sh repo mode name file' >&2 + exit 2 +fi + +repo=$1 +mode=$2 +name=$3 +shift 3 + +case "$mode" in +12????) + hash=$(printf %s "$1" | git -C "$repo" hash-object -w --stdin) ;; +10????) + hash=$(git -C "$repo" hash-object -w --stdin <"$1") ;; +*) + echo "invalid mode: $mode" + exit 1 +esac + +printf '%s %s\t%s\n' "$mode" "$hash" "$name" diff --git a/scripts/outdated.py b/scripts/outdated.py @@ -0,0 +1,60 @@ +import collections +import json +import os +import subprocess +import sys +import urllib.request + +names = { + 'awk': 'nawk', + 'lpeg': 'lua:lpeg', + 'sshfs': 'fusefs:sshfs', + 'st': 'st-term', + 'terminus-font': 'fonts:terminus', + 'the_silver_searcher': 'the-silver-searcher', + 'tz': 'tzdata', + 'wpa_supplicant': 'wpa-supplicant', +} +skip = set([ + 'adobe-source-fonts', + 'cproc', + 'libutp', + 'mc', + 'openbsd', + 'qbe', + 'sbase', + 'sdhcp', + 'skeleton', + 'st', + 'swc', + 'ubase', + 'velox', + 'wld', +]) + +p = subprocess.Popen(['git', '-C', 'pkg', 'ls-tree', 'HEAD'], stdout=subprocess.PIPE) +for line in p.stdout: + fields = line.decode().split() + if fields[1] != 'tree' or fields[3] in skip: + continue + name = fields[3] + try: + with open('pkg/{}/ver'.format(name), 'r') as f: + oldver = f.read().rsplit(maxsplit=1)[0] + except FileNotFoundError: + continue + proj = names.get(name, name) + with urllib.request.urlopen('https://repology.org/api/v1/project/{}'.format(proj)) as response: + pkgs = json.loads(response.read()) + newest = collections.Counter() + for pkg in pkgs: + if pkg['status'] in ('newest', 'unique'): + newest[pkg['version']] += 1 + if not newest: + print('could not find newest version of {}'.format(proj), file=sys.stderr) + continue + newver = newest.most_common(1)[0][0] + if oldver != newver: + print('{:20} {:16} => {:16}'.format(name, oldver, newver)) +if p.wait(): + raise CalledProcessError(p.retcode, p.args) diff --git a/scripts/perms.awk b/scripts/perms.awk @@ -0,0 +1,23 @@ +BEGIN { + RS = "" + sort = "sort -k 2" +} + +function mode() { + for (i = 2; i <= NF; ++i) { + if ($i ~ /^mode=/) + return substr($i, 6) + } + printf "file '%s' is missing mode attribute\n", $1 >"/proc/self/fd/2" + exit(1) +} + +/type=dir/ { + printf "04%s %s\n", mode(), substr($1, 2) |sort +} + +/type=reg/ { + m = mode() + if (m != "0644" && m != "0755") + printf "10%s %s\n", m, substr($1, 2) |sort +} diff --git a/scripts/probe-size.sh b/scripts/probe-size.sh @@ -0,0 +1,22 @@ +set -e + +if [ "$#" -lt 3 ] ; then + printf 'usage: %s var out command...\n' "$0" >&2 + exit 2 +fi + +var=$1 +out=$2 +shift 2 +for size in 8 4 2 1 ; do + echo "==> trying $var=$size..." >&2 + if "$@" -D "$var=$size" ; then + echo '==> success' >&2 + echo "#define $var $size" >"$out" + exit 0 + fi +done 2>"$out.log" + +cat "$out.log" +printf "%s: could not determine %s\n" "$0" "$var" >&2 +exit 1 diff --git a/scripts/probe.sh b/scripts/probe.sh @@ -0,0 +1,13 @@ +set -e + +if [ "$#" -lt 3 ] ; then + printf 'usage: %s var out command...\n' "$0" >&2 + exit 2 +fi + +var=$1 +out=$2 +shift 2 +if "$@" 2>"$out.log" ; then + echo "#define $var 1" +fi >"$out" diff --git a/scripts/prune-config.sed b/scripts/prune-config.sed @@ -0,0 +1,9 @@ +#n + +:next +/\\$/ { + N + b next +} + +/#/p diff --git a/scripts/rsp.awk b/scripts/rsp.awk @@ -0,0 +1,34 @@ +function line() { + if (match($0, /\.d$/)) + read($0) + else + libs[++n] = $0 +} + +function read(name) { + for (;;) { + ret = getline < name + if (ret < 0) { + print "failed to read line from " name > "/proc/self/fd/2" + exit(1) + } + if (ret == 0) + break + line() + } + close(name) +} + +{line()} + +END { + for (i = n; i > 0; --i) { + lib = libs[i] + if (lib in seen) + continue + seen[lib] = 1 + uniq[++m] = lib + } + for (i = m; i > 0; --i) + print uniq[i] +} diff --git a/scripts/tree.sh b/scripts/tree.sh @@ -0,0 +1,24 @@ +set -e + +if [ "$#" != 4 ] ; then + echo 'usage: commit.sh repo tag index out' >&2 + exit 2 +fi + +repo=$1 +tag=$2 +index=$3 +out=$4 + +export GIT_INDEX_FILE="$PWD/$out.index" +git -C "$repo" read-tree --empty +git -C "$repo" update-index --index-info <"$index" +tree=$(git -C "$repo" write-tree) +git -C "$repo" update-ref "refs/tags/$tag" "$tree" + +printf '%s\n' "$tree" >"$out.tmp" +if cmp -s "$out" "$out.tmp" ; then + rm "$out.tmp" +else + mv "$out.tmp" "$out" +fi diff --git a/sets.lua b/sets.lua @@ -0,0 +1,15 @@ +local S = {} + +S.bin = { + 'awk', + 'pwgen', + 'samurai', + 'strace', + 'vis', +} + +S.lib = { + 'netbsd-curses', +} + +return S diff --git a/setup.lua b/setup.lua @@ -0,0 +1,145 @@ +#!/bin/lua + +-- Lua 5.1 compatibility +do + local os_execute = os.execute + os.execute = function(cmd) + local ret = os_execute(cmd) + return ret == true or ret == 0 + end +end + +basedir = arg[0]:match('(.*)/') or '.' + +if not os.execute('exec test -f config.lua') then + os.execute('exec cp '..basedir..'/config.def.lua config.lua') +end + +dofile(basedir..'/ninja.lua') +config = dofile 'config.lua' +if not config.prefix then + config.prefix = '' +end + +local recurse = not arg[1] + +local function gen(gendir) + local dir = basedir..'/'..gendir + local outdir = config.builddir..'/'..gendir + pkg={ + name=gendir:match('[^/]*$'), + dir=dir, + gendir=gendir, + srcdir=dir..'/src', + outdir=outdir, + inputs={ + index={}, + fspec={}, + gen={ + '$basedir/ninja.lua', + '$basedir/sets.lua', + '$basedir/setup.lua', + 'config.lua', + }, + ninja={'$gendir/local.ninja'}, + fetch={}, + }, + fspec={}, + } + assert(os.execute(('exec mkdir -p %s %s'):format(gendir, outdir))) + io.output(gendir..'/local.ninja.tmp') + set('gendir', gendir) + if gendir ~= '.' then + set('dir', '$basedir/$gendir') + set('outdir', '$builddir/$gendir') + set('srcdir', '$dir/src') + end + load('gen.lua') + + build('gen', '$gendir/local.ninja', {'|', pkg.inputs.gen}) + phony('ninja', pkg.inputs.ninja) + + if pkg.hdrs then + phony('headers', pkg.hdrs) + if pkg.hdrs.install then + for hdr in iterstrings(pkg.hdrs) do + if not hdr:hasprefix('$outdir/include/') then + error('header is not in $outdir/include: '..hdr) + end + file(hdr:sub(9), '644', hdr) + end + end + end + if pkg.deps then + phony('deps', pkg.deps) + end + + if next(pkg.fspec) then + local out = outdir..'/local.fspec' + local tmp = out..'.tmp' + local f = assert(io.open(tmp, 'w')) + local srcs = {} + for _, path, fspec in sortedpairs(pkg.fspec) do + f:write(('/%s\n'):format(path)) + for _, k in ipairs{'type', 'mode', 'source', 'target'} do + local v = fspec[k] + if v then + f:write(('%s=%s\n'):format(k, v)) + end + end + f:write('\n') + local src = fspec.source + if src then + srcs[#srcs + 1] = src + end + end + f:close() + if os.execute(('exec cmp -s %s %s'):format(tmp, out)) then + os.remove(tmp) + else + os.rename(tmp, out) + end + build('fspec-hash', '$outdir/local-hashed.fspec', {'$outdir/local.fspec', '|', '$builddir/pkg/devel/fspec-sync/host/fspec-hash', srcs}) + table.insert(pkg.inputs.fspec, '$outdir/local-hashed.fspec') + end + if next(pkg.inputs.index) then + build('cat', '$outdir/root.index', pkg.inputs.index, { + description=' INDEX $outdir/root.index', + }) + else + build('empty', '$outdir/root.index') + end + if next(pkg.inputs.fspec) then + build('cat', '$outdir/tree.fspec', pkg.inputs.fspec, { + description = ' FSPEC $outdir/tree.fspec', + }) + else + build('empty', '$outdir/tree.fspec') + end + build('phony', '$dir/root', pkg.inputs.root) + io.close() + os.rename(gendir..'/local.ninja.tmp', gendir..'/local.ninja') + if gendir == '.' then + os.execute('exec ln -sf local.ninja build.ninja') + end +end + +function subgen(dir) + local file = '$gendir/'..dir..'/local.ninja' + subninja(file) + table.insert(pkg.inputs.ninja, '$gendir/'..dir..'/ninja') + table.insert(pkg.inputs.index, '$outdir/'..dir..'/root.index') + table.insert(pkg.inputs.fspec, '$outdir/'..dir..'/tree.fspec') + local cmd = ('exec test -f %s/%s/local.ninja'):format(pkg.gendir, dir) + if recurse or not os.execute(cmd) then + local oldpkg, oldout = pkg, io.output() + if pkg.gendir ~= '.' then + dir = pkg.gendir..'/'..dir + end + gen(dir) + pkg = oldpkg + io.output(oldout) + end +end + +gen(arg[1] or '.') diff --git a/template/config b/template/config @@ -0,0 +1,8 @@ +[core] + sharedRepository = 0664 + sparseCheckout = true +[oasis] + root = . +[merge "perms"] + name = .perms merge driver + driver = ./libexec/mergeperms %O %A %B diff --git a/template/hooks/post-checkout b/template/hooks/post-checkout @@ -0,0 +1,15 @@ +#!/bin/sh + +old=$1 +new=$2 +flag=$3 + +# If HEAD didn't change or if this is just a file checkout, do a complete +# permissions fix. +if [ "$old" = 0000000000000000000000000000000000000000 ] || [ "$old" = "$new" ] || [ "$flag" = 0 ] ; then + set "$new" +else + set "$old" "$new" +fi + +exec "$(git config oasis.root)"/libexec/applyperms "$@" diff --git a/template/hooks/post-merge b/template/hooks/post-merge @@ -0,0 +1,3 @@ +#!/bin/sh + +exec "$(git config oasis.root)"/libexec/applyperms ORIG_HEAD HEAD diff --git a/template/info/attributes b/template/info/attributes @@ -0,0 +1,2 @@ +* merge=binary +/.perms merge=perms diff --git a/template/info/exclude b/template/info/exclude @@ -0,0 +1 @@ +/lost+found diff --git a/template/info/sparse-checkout b/template/info/sparse-checkout @@ -0,0 +1,4 @@ +* +!/.gitattributes +!/.perms +!/LICENSE