From d98631a65ca45be52ba01f650cf8666b5d9c9b68 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 19 Apr 2022 14:57:07 +0100 Subject: [PATCH] Import libaio_0.3.113-2.debian.tar.xz [dgit import tarball libaio 0.3.113-2 libaio_0.3.113-2.debian.tar.xz] --- changelog | 539 ++++++++++++++++++ control | 55 ++ copyright | 25 + libaio-dev.install | 3 + libaio-dev.manpages | 13 + libaio1-udeb.install | 2 + libaio1.install | 2 + libaio1.symbols | 18 + ...0001-harness-Disable-failing-test-23.patch | 32 ++ patches/0001-man-Fix-typos.patch | 36 ++ ...TDIR-and-pathname-variables-handling.patch | 77 +++ .../0003-build-Honor-user-build-flags.patch | 104 ++++ ...n-to-SYMVER-and-DEFSYMVER-call-sites.patch | 67 +++ ...unction-attribute-to-support-LTO-bui.patch | 94 +++ ...definitions-to-match-exactly-the-ker.patch | 34 ++ ...-definitions-to-match-exactly-the-ke.patch | 32 ++ ...EL_RW_POINTER-for-various-32-bit-arc.patch | 35 ++ .../0009-Fix-and-improve-MIPS-support.patch | 137 +++++ patches/0010-Add-PARISC-support.patch | 66 +++ patches/0011-Add-m68k-support.patch | 53 ++ patches/0012-Add-SH-support.patch | 76 +++ patches/0013-Add-x32-support.patch | 64 +++ ...s-syscall-wrapper-on-32-bit-userland.patch | 107 ++++ patches/series | 17 + rules | 48 ++ source/format | 1 + tests/control | 7 + tests/test-unit | 14 + tests/test-unit-root | 14 + upstream/metadata | 2 + watch | 3 + 31 files changed, 1777 insertions(+) create mode 100644 changelog create mode 100644 control create mode 100644 copyright create mode 100644 libaio-dev.install create mode 100644 libaio-dev.manpages create mode 100644 libaio1-udeb.install create mode 100644 libaio1.install create mode 100644 libaio1.symbols create mode 100644 patches/0001-harness-Disable-failing-test-23.patch create mode 100644 patches/0001-man-Fix-typos.patch create mode 100644 patches/0002-build-Fix-DESTDIR-and-pathname-variables-handling.patch create mode 100644 patches/0003-build-Honor-user-build-flags.patch create mode 100644 patches/0004-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch create mode 100644 patches/0005-Use-new-symver-function-attribute-to-support-LTO-bui.patch create mode 100644 patches/0006-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch create mode 100644 patches/0007-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch create mode 100644 patches/0008-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch create mode 100644 patches/0009-Fix-and-improve-MIPS-support.patch create mode 100644 patches/0010-Add-PARISC-support.patch create mode 100644 patches/0011-Add-m68k-support.patch create mode 100644 patches/0012-Add-SH-support.patch create mode 100644 patches/0013-Add-x32-support.patch create mode 100644 patches/0014-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch create mode 100644 patches/series create mode 100755 rules create mode 100644 source/format create mode 100644 tests/control create mode 100755 tests/test-unit create mode 100755 tests/test-unit-root create mode 100644 upstream/metadata create mode 100644 watch diff --git a/changelog b/changelog new file mode 100644 index 0000000..5327ff3 --- /dev/null +++ b/changelog @@ -0,0 +1,539 @@ +libaio (0.3.113-2) unstable; urgency=medium + + * Skip new test case 23, which was added upstream for a kernel regression, + so we are not worse off than before. Its failure was known and being + looked at upstream. + + -- Guillem Jover Tue, 19 Apr 2022 15:57:07 +0200 + +libaio (0.3.113-1) unstable; urgency=medium + + * New upstream release. + - Remove patches taken from upstream, now unneeded. + - Remove -Werror removal patch, as we override CFLAGS. + - Refresh patches. + - Update copyright years. + * Add support for the noudeb build profile. + + -- Guillem Jover Tue, 19 Apr 2022 03:22:49 +0200 + +libaio (0.3.112-13) unstable; urgency=medium + + * Pass CPPFLAGS to linker command, which as a side effect makes the + build reproducible on differing build pathnames. + + -- Guillem Jover Thu, 11 Nov 2021 04:56:01 +0100 + +libaio (0.3.112-12) unstable; urgency=medium + + * Add patch from upstream to fix test suite warning with gcc-11. + * Fix LTO build by using symver function attribute instead of .symver + __asm__ statement. (Closes: #998309) + + -- Guillem Jover Wed, 03 Nov 2021 00:56:45 +0100 + +libaio (0.3.112-11) unstable; urgency=medium + + * Use CC as a shell variable instead of a make one in autopkgtests. + * Fix typos in io(3) man page. + + -- Guillem Jover Sun, 10 Oct 2021 06:34:12 +0200 + +libaio (0.3.112-10) unstable; urgency=medium + + * Add autopkgtests. + * Switch to Standards-Version 4.6.0 (no changes needed). + * Ship all man pages again, now that the redundant ones are no longer + present, and the ones that describe the interfaces in the library live + in section 3 which do not conflict with the ones in manpages-dev. + (Closes: #995110) + * Stop shipping upstream TODO file in libaio-dev. + * List pathnames explicitly in debhelper .install fragment files, instead + of using over matching globs. + + -- Guillem Jover Sat, 09 Oct 2021 17:31:09 +0200 + +libaio (0.3.112-9) unstable; urgency=medium + + * Remove Build-Depends on dpkg-dev, satisfied in stable. + * Switch to debhelper compatibility level 13. + * Do not pass ChangeLog to dh_installchangelogs, now handled by default. + * Switch to Standards-Version 4.5.1 (no changes needed). + * Switch to the dh sequencer. + * Add debian/upstream/metadata file. + + -- Guillem Jover Thu, 24 Dec 2020 15:41:17 +0100 + +libaio (0.3.112-8) unstable; urgency=medium + + * Add a comment with the reason for each architecture being in the flaky + test suite mode. + * Remove temporary forced flaky test suite run on architectures built under + an emulator, and move them to the permanent flaky list. + * Add x32 to the flaky test suite mode list, it's still failing on the build + daemons, even though it worked locally. + * Remove no longer needed TESTS_RUN logic, and inline the nocheck condition. + + -- Guillem Jover Mon, 13 Apr 2020 02:58:47 +0200 + +libaio (0.3.112-7) unstable; urgency=medium + + * Cleanup patches: + - Move upstream patches under debian/patches/upstream/. + - Fix syscall definitions for ARM and ia64 to match the kernel exactly. + Otherwise the preprocessor emits warnings about redefinitions. + - Split the architecture support patches into one per arch support. + - Fix syscall definitions for hppa to match the kernel exactly. + - Make __X32_SYSCALL_BIT an unsigned long constant to match the kernel. + - Fix x32 structures padding. + - Rework build system patches to ready them for upstream submission, + and drop libdevdir support which we do not use anymore. + * Fix logic inversion in test suite flaky handling. + * Remove trailing closing parenthesis from TESTS_RUN conditional. + * Print a message when we run the test suite in flaky mode. + * Remove armhf from the test suite flaky mode. + + -- Guillem Jover Sun, 12 Apr 2020 04:49:39 +0200 + +libaio (0.3.112-6) unstable; urgency=medium + + * Sync with upstream commits: + - Rebase against latest upstream git master. + - Skip the test if io_pgetevents() is not implemented. + * Switch to Standards-Version 4.5.0 (no changes needed). + * Do not pass --add-udeb to dh_makeshlibs anymore, it's autodetected since + debhelper 12.3, for which we add an explicit versioned Build-Depends. + * Use correct syscall numbers for x32 port. + * Make the testsuite fatal on architectures known to pass it, to avoid + future regressions. + * Temporarily force a flaky test suite run on architectures built under + and emulator, to get test results. + + -- Guillem Jover Sat, 11 Apr 2020 19:06:49 +0200 + +libaio (0.3.112-5) unstable; urgency=medium + + * Sync with upstream commits: + - Make test suite failures fatal, so we ignore errors for now, until it + passes at least in all release architectures. + - Add support for SKIPable tests. + - Allow running tests against the installed library, which will make + possible to add autopkgtests. + - Fix test case 5.t, by using a write() instead of a read() to force the + kernel to read from the unreadable buffer. + * Add a workaround to io_pgetevents() for 32-bit userland running on + 64-bit kernels to cope with the broken compat kernel syscall, which uses + a 64-bit pointer instead of a 32-bit one, and eats the sigset_t size + member which makes it then fail a consistency check and return -EINVAL. + This fixes test case 22.t. The kernel fix is being prepared as well. + * Add more detailed error messages to test case 22.t. + + -- Guillem Jover Fri, 16 Aug 2019 05:11:10 +0200 + +libaio (0.3.112-4) unstable; urgency=medium + + * Switch to Standards-Version 4.4.0 (no changes needed). + * Switch to debhelper compatibility level 12. + * Switch from debian/compat to debhelper-compat in Build-Depends. + * Test suite fixes: + - Fix the attempt_rw READ call to be arch-dependent instead of making + it the WRITE call. Thanks to Jeff Moyer . + + -- Guillem Jover Fri, 02 Aug 2019 05:33:44 +0200 + +libaio (0.3.112-3) unstable; urgency=medium + + * Test suite fixes: + - Fix logic inversion in EINVAL check. + - Revert making the test suite fatal on failures, as the Debian buildd + setup is peculiar enough to make at least two tests fail. This will + need further work. + + -- Guillem Jover Tue, 26 Feb 2019 05:26:21 +0100 + +libaio (0.3.112-2) unstable; urgency=medium + + * Test suite fixes: + - Make RISC-V use SYS_eventfd2 instead of unavailable SYS_eventfd. + - Add fallback code for filesystems not supporting O_DIRECT. + - Handle -ENOTSUP in addition to -EINVAL from io_submit() with RWF_NOWAIT. + - The WRITE call does not change across different arches anymore. + - Make the test exit with a code matching the pass/fail state. + This will turn test suite errors into fatal build problems. + + -- Guillem Jover Tue, 26 Feb 2019 03:14:38 +0100 + +libaio (0.3.112-1) unstable; urgency=medium + + * New upstream release. + - Refresh patches. + - Remove patches merged upstream. + - Add new patch to fix error due to -Werror=sizeof-pointer-memaccess. + - Split man page cleanup into logic changes, and further improve the + formatting, markup, typo fixes, etc. + * Use expanded symbol file instead of matching on symver. Even though + upstream manages versioned symbols correctly, being explicit makes it + safer against accidental changes. + * Add a Build-Depends-Package field to the symbols file. + * Only install upstream TODO into libaio-dev. + * Remove support for old debug symbol package migration. + * Add comment for dpkg-dev versioned Build-Depends. + * Perform a proper and correct /usr-merge transition by moving the package + contents from / to /usr. + * Now using Standards-Version 4.3.0 (no changes needed). + * Remove unused make variables from debian/rules. + + -- Guillem Jover Mon, 25 Feb 2019 02:56:55 +0100 + +libaio (0.3.111-1) unstable; urgency=medium + + * New upstream release. + - Refresh patches. + - Fix x32 support. (Closes: #883904) + - Add riscv64 support. (Closes: #893003) + * Fix cross-building by not invoking getconf for PAGESIZE, and instead + getting the value at run-time. + * Do not pass -fomit-frame-pointer as part of the required compiler flags. + * Remove now always unused lintian override, as upstream requires linking + against libc everywhere for its syscall(3) usage. + * Mark libaio-dev as Multi-Arch same. + * Now using Standards-Version 4.1.3 (no changes needed). + * Switch to debhelper compatibility level 11. + + -- Guillem Jover Sun, 18 Mar 2018 02:58:44 +0100 + +libaio (0.3.110-5) unstable; urgency=medium + + * Line-wrap and sort debian/control fields. + * Now using Standards-Version 4.1.1 (no changes needed). + * Use dpkg buildtools.mk fragment to set a correct CC. + * Set Rules-Requires-Root to no. + * Switch to debian/watch format version 4. + * Fix regex in debian/watch file to not include extension in the version. + + -- Guillem Jover Sun, 05 Nov 2017 16:26:47 +0100 + +libaio (0.3.110-4) unstable; urgency=medium + + * Update upstream URLs to point to pagure.io instead of obsolete + fedorahosted.org site. + * Switch to debhelper compatibility level 10. + * Now using Standards-Version 4.0.1 (no changes needed). + * Move location of LGPL in Debian systems into a Comment field in + debian/copyright. + * Use -a instead of deprecated -s in debhelper commands. + + -- Guillem Jover Tue, 08 Aug 2017 00:29:32 +0200 + +libaio (0.3.110-3) unstable; urgency=medium + + * Use https for hadrons.org and debian.org URLs. + * Switch debug package to a ddeb. + * Switch to the dpkg makefile fragments in debian/rules. + * Enable hardening bindnow feature. + * Update URL in debian/watch. + * Fix typos in man pages, reported by lintian. + * Now using Standards-Version 3.9.8 (no changes needed). + + -- Guillem Jover Tue, 31 May 2016 20:38:08 +0200 + +libaio (0.3.110-2) unstable; urgency=medium + + * Use https for the debian/copyright Format URL. + * Switch Vcs-Browser to a cgit URL. + * Update Homepage URL to new release site. + Prompted by Sedat Dilek . + * Use https in debian/watch URL. + * Add a small note on each long package description explaining what is + contained on each package. + * Document each patch. + + -- Guillem Jover Tue, 29 Sep 2015 16:48:30 +0200 + +libaio (0.3.110-1) unstable; urgency=low + + * New upstream release. + - Refresh patches. + * Link against -lc and -Wl,--as-needed so that we pull the required + fortified functions from the internal libc_nonshared.a, but do not link + against the shared library because we do not use any of its symbols. + (Closes: #764509) + * Switch debian/copyright to machine-readable format 1.0. + * Now using Standards-Version 3.9.6 (no changes needed). + * Switch to debhelper compatibility level 9. + * Fix mips/mipsel syscall wrappers to return correct error values. + Thanks to Jurica Stanojkovic . + * Add mips64 support. Reported by Jeremy Fitzhardinge . + + -- Guillem Jover Thu, 09 Oct 2014 05:44:48 +0200 + +libaio (0.3.109-4) unstable; urgency=low + + * Now using Standards-Version 3.9.4 (no changes needed). + * Remove package creation information from debian/copyright. + * Update upstream git URL in debian/copyright. + * Add support for x32 (from the Yocto project). (Closes: #702183) + Thanks to Daniel Schepler . + * Add support for arm64 (stolen from upstream). (Closes: #702409) + Thanks to Ian Campbell . + * Add cross-compilation support. + Based on a patch by Ian Campbell . + * Update debian/watch file to a working URL. + + -- Guillem Jover Mon, 06 May 2013 18:56:19 +0200 + +libaio (0.3.109-3) unstable; urgency=low + + * Escape backslash in man pages. (Closes: #651833) + Thanks to Stephan Springl . + * Do not install man pages now provided by manpages-dev. (Closes: #650108) + * Use dpkg-buildflags to set CPPFLAGS, CFLAGS and LDFLAGS. + * Now using Standards-Version 3.9.3 (no changes needed). + + -- Guillem Jover Thu, 21 Jun 2012 09:21:59 +0200 + +libaio (0.3.109-2) unstable; urgency=low + + * Add a symbols file for libaio1. + * Remove heading ‘./’ from lintian-override tag. + * Fix FTBFS with newer gcc 4.6: (Closes: #638848) + - Do not build the test-suite with -Werror. + - Use unused waitpid() return code variables to assert valid values. + * Make shared library packages multiarch: + - Build-Depend on debhelper 8.1.3. + - Add misc:Pre-Depends substvar to Pre-Depends field in libaio1. + - Add “Multi-Arch: same” field to libaio1 and libaio1-dbg. + - Change paths from lib/ to lib/* in install and lintian-override files. + - Define DEB_HOST_MULTIARCH and use it to set libdir and libdevdir. + * Install all libaio io*.3 man pages. (Closes: #418048) + * Do not install man pages for functions coming from libc, the aio* + and lio_listio* man pages are already shipped by manpages-dev. + * Merge adapted changes from Ubuntu. (Closes: #588112) + - Change Priority from extra to optional. + - Add support for sparc64 and hppa 64-bit architectures. + * Set libaio1-dbg Priority back to extra. + * Now using Standards-Version 3.9.2 (no changes needed). + + -- Guillem Jover Tue, 30 Aug 2011 16:54:22 +0200 + +libaio (0.3.109-1) unstable; urgency=low + + * New upstream release. + - Refresh patches. + * Switch to source format “3.0 (quilt)”: + - Remove quilt from Build-Depends. + - Remove quilt.make include from debian/rules. + - Remove patch and unpatch targets from debian/rules. + - Remove now unneeded debian/README.source. + * Update watch file to point to the new upstream URL at kernel.org. + * Now using Standards-Version 3.9.1 (no changes needed). + * Add missing ${misc:Depends} to eveyr package Depends fields. + * Switch Architecture field list to just linux-any, and although the + code will not automatically support new Linux architectures, as it + will miss the syscall-.h header support among others, it just + needs to be ported, and this way it's easier to spot. This implicitly + adds amrhf support. (Closes: #596996) + * Add a Homepage field. (Closes: #566338) + + -- Guillem Jover Sun, 27 Feb 2011 05:22:27 +0100 + +libaio (0.3.107-7) unstable; urgency=low + + * Add support for sh3 and sh4. (Closes: #535288) + Thanks to Nobuhiro Iwamatsu . + * Now using Standards-Version 3.8.3 (no changes needed). + + -- Guillem Jover Thu, 10 Sep 2009 13:02:34 +0200 + +libaio (0.3.107-6) unstable; urgency=low + + * Workaround debhelper compat v7 bug (#534565) in dh_install which makes + files end up under /debian/tmp/ in the binary package, by not passing + --sourcedir to dh_install. (Closes: #533359, #532644) + * Pass -s to arch dependent debhelper commands. + * Now using Standards-Version 3.8.2 (no changes needed). + + -- Guillem Jover Thu, 25 Jun 2009 14:11:25 +0200 + +libaio (0.3.107-5) unstable; urgency=low + + * Change libaio1-dbg section to debug. + * Fix build failure in test suite on non-i386 32 bit architectures. + * Fix man pages errors and warnings. + + -- Guillem Jover Wed, 10 Jun 2009 06:09:52 +0200 + +libaio (0.3.107-4) unstable; urgency=low + + * Switch to debhelper compatibility level 7. + * Use dh_prep instead of “dh_clean -k”. + * Remove libaio1.dirs, unneeded due to dh_lintian taking care of it. + * Run the test suite on all architectures and not only on i386. + * Now using Standards-Version 3.8.1 (no changes needed). + * Switch the upstream repository reference from CVS to git. + + -- Guillem Jover Mon, 08 Jun 2009 19:40:54 +0200 + +libaio (0.3.107-3) unstable; urgency=low + + * Fix the Vcs-Git URL. + * Remove XB- from the Package-Type field. + * Fix watch file URL. (Closes: #502884) + Thanks to Jiří Paleček . + + -- Guillem Jover Mon, 20 Oct 2008 20:36:43 +0300 + +libaio (0.3.107-2) unstable; urgency=low + + * Only run the test suite on i386 as it has not been ported for other + architectures. (Closes: #488812) + * Use $(filter ...) instead of $(findstring ...) to extract space separated + options from DEB_BUILD_OPTIONS in debian/rules. + * Do not check for the existence of the Makefile on clean, it's always + there. + * Switch to use dh_lintian instead of manually installing the overrides. + - Bump the versioned debhelper Build-Depends to 6.0.7. + + -- Guillem Jover Wed, 09 Jul 2008 05:32:30 +0300 + +libaio (0.3.107-1) unstable; urgency=low + + * New upstream release. + * Run the test suite on install, and support nocheck DEB_BUILD_OPTIONS + to disable it. + + -- Guillem Jover Tue, 24 Jun 2008 09:03:54 +0300 + +libaio (0.3.106-9) unstable; urgency=low + + * Fix misspelled words (linux -> Linux and aio -> AIO). + * Update packaging Vcs fields to the new URL. + * Improve debian/copyright: + - Change 'Copyright Holder' to 'Copyright Holders'. + - Use UTF-8 copyright sign. + - Update upstream download url. + - Refer to LGPL-2.1 from common-licenses instead of just LGPL. + * Add a debian/README.source file. + * Now using Standards-Version 3.8.0. + * Refresh patches with -pab. (Closes: #484962) + * Update watch file URL. (Closes: #450017) + + -- Guillem Jover Sun, 22 Jun 2008 07:42:52 +0300 + +libaio (0.3.106-8) unstable; urgency=low + + * Install shared library under /lib, needed by multipath binaries which + reside under /sbin. (Closes: #441244) + - debian/patches/02_libdevdir.patch: New file. + * Add a debugging symbols library package. + * Add Vcs-Browser and Vcs-Git fields. + + -- Guillem Jover Tue, 11 Sep 2007 04:29:22 +0300 + +libaio (0.3.106-7) unstable; urgency=low + + * Add a new library udeb needed for multipath support. (Closes: #440320) + + -- Guillem Jover Thu, 06 Sep 2007 03:11:08 +0300 + +libaio (0.3.106-6) unstable; urgency=low + + * Link against libgcc to avoid unresolved symbols on at least hppa. + - debian/01_link_libgcc.patch: New file. + Thanks to Steve Langasek for the analysis. + * Add shlibs:Depends substvar back into libaio1 Depends, since we link + against an external library now (although it might not be used on any + architecture). + + -- Guillem Jover Mon, 06 Aug 2007 04:50:18 +0300 + +libaio (0.3.106-5) unstable; urgency=low + + * Do not ignore 'make clean' errors on clean. + * Support build-arch and build-indep in debian/rules: + - Rename install to install-arch. + - Rename build to build-arch. + - Add an empty build target that depends on build-arch and build-indep. + * Switch directory variables to simply expanded ones in debian/rules. + * Use binary:Version instead of the deprecated Source-Version substvar. + * Remove Tag field as it does not seem to make much sense to include it + in the packages. + + -- Guillem Jover Tue, 17 Jul 2007 09:19:26 +0300 + +libaio (0.3.106-4) unstable; urgency=low + + * Add armeb and armel to the Architecture fields. + + -- Guillem Jover Fri, 19 Jan 2007 06:48:26 +0200 + +libaio (0.3.106-3) unstable; urgency=low + + * Fix a typo in the arm io_syscall5 macro, making the library end up + with unresolvable symbols. (Closes: #393156) + Thanks to Marcin Juszkiewicz . + + -- Guillem Jover Mon, 16 Oct 2006 10:44:02 +0300 + +libaio (0.3.106-2) unstable; urgency=low + + * Use quilt for patching: + - Add new debian/patches/series file. + - Add Build-Depends on 'quilt (>= 0.40)'. + - Include quilt.make from debian/rules. + * Add support for arm, hppa, m68k, mips, mipsel and sparc. Those have yet + to be tested with the harness test suite and pass it. + * Add a Tag: field to all binary packages. + + -- Guillem Jover Tue, 19 Sep 2006 00:48:10 +0300 + +libaio (0.3.106-1) unstable; urgency=low + + * New Upstream Release. (Closes: #384268) + - Fix .endp being outside of procedure on ia64 with new binutils. + (Closes: #385373) + + -- Guillem Jover Fri, 1 Sep 2006 05:51:36 +0300 + +libaio (0.3.104-2) unstable; urgency=low + + * New Maintainer. + * Provide a new binary package libaio-dev, with the static library + the .so symlink and the manpages. (Closes: #318795) + * Add debian/libaio-dev.install. + * Add debian/libaio-dev.manpages. + * Rename the binary package libaio to libaio1 to match the soname, no + transition package as no one depends on it. + * Rename debian/lintian.override to debian/libaio1.lintian. + * Remove shlib-missing-in-control-file lintian override as we provide + now the shlibs file. + * Only put "usr/share/lintian/override" in libaio1.dirs. + * Remove temporal debhelper leftover files: + - debian/libaio-0.3.104.postinst.debhelper + - debian/libaio-0.3.104.postrm.debhelper + * Add amd64 to the Architecture fields. (Closes: #335352) + * Switch to debhelper compat level 5. + * Now using Standards-Version 3.7.2. + * Change Priority from optional to extra. + * Specify in the package description that this library is for Linux. + * Remove unneeded debian/dirs file. + * Remove debian/debianize.patch, we actually want the .so symlink + and the .a library when doing "make install". + * Clean up debian/rules: + - Do not use stamp files. + - Remove unused comments. + - Remove unused configure target. + - Do not pass DESTDIR to make as it is not using it. + * Complete debian/copyright: + - Add copyright holder information. + - Add the LGPL license snippet. + - Specify a download url which actually works. + * Add a watch file. + + -- Guillem Jover Thu, 24 Aug 2006 05:45:36 +0300 + +libaio (0.3.104-1) unstable; urgency=low + + * Initial Release. + + -- William Lee Irwin III Fri, 22 Apr 2005 14:49:28 -0700 diff --git a/control b/control new file mode 100644 index 0000000..44c9eda --- /dev/null +++ b/control @@ -0,0 +1,55 @@ +Source: libaio +Maintainer: Guillem Jover +Priority: optional +Section: libs +Vcs-Browser: https://git.hadrons.org/cgit/debian/pkgs/libaio.git +Vcs-Git: https://git.hadrons.org/git/debian/pkgs/libaio.git +Homepage: https://pagure.io/libaio +Standards-Version: 4.6.0 +Rules-Requires-Root: no +Build-Depends: + debhelper-compat (= 13), + +Package: libaio1 +Architecture: linux-any +Multi-Arch: same +Pre-Depends: + ${misc:Pre-Depends}, +Depends: + ${misc:Depends}, + ${shlibs:Depends}, +Description: Linux kernel AIO access library - shared library + This library enables userspace to use Linux kernel asynchronous I/O + system calls, important for the performance of databases and other + advanced applications. + . + This package contains the shared library. + +Package: libaio1-udeb +Package-Type: udeb +Section: debian-installer +Architecture: linux-any +Build-Profiles: +Depends: + ${misc:Depends}, + ${shlibs:Depends}, +Description: Linux kernel AIO access library - shared library + This library enables userspace to use Linux kernel asynchronous I/O + system calls, important for the performance of databases and other + advanced applications. + . + This package contains the udeb shared library. + +Package: libaio-dev +Section: libdevel +Architecture: linux-any +Multi-Arch: same +Depends: + ${misc:Depends}, + libaio1 (= ${binary:Version}), +Description: Linux kernel AIO access library - development files + This library enables userspace to use Linux kernel asynchronous I/O + system calls, important for the performance of databases and other + advanced applications. + . + This package contains the static library and the header files. diff --git a/copyright b/copyright new file mode 100644 index 0000000..2e27538 --- /dev/null +++ b/copyright @@ -0,0 +1,25 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libaio +Upstream-Contact: Jeff Moyer +Source: https://pagure.io/libaio.git + +Files: * +Copyright: + Copyright © 2002-2003 Benjamin LaHaise + Copyright © 2003-2022 Jeff Moyer +License: LGPL-2.1+ + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + . + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + . + You should have received a copy of the GNU Lesser General Public License + along with this library. If not, see . +Comment: + On Debian systems, the complete text of the GNU Lesser General + Public License can be found in '/usr/share/common-licenses/LGPL-2.1'. diff --git a/libaio-dev.install b/libaio-dev.install new file mode 100644 index 0000000..dd27ae3 --- /dev/null +++ b/libaio-dev.install @@ -0,0 +1,3 @@ +usr/include +usr/lib/*/libaio.so +usr/lib/*/libaio.a diff --git a/libaio-dev.manpages b/libaio-dev.manpages new file mode 100644 index 0000000..fecc25c --- /dev/null +++ b/libaio-dev.manpages @@ -0,0 +1,13 @@ +man/io.3 +man/io_cancel.3 +man/io_fsync.3 +man/io_getevents.3 +man/io_prep_fsync.3 +man/io_prep_pread.3 +man/io_prep_pwrite.3 +man/io_queue_init.3 +man/io_queue_release.3 +man/io_queue_run.3 +man/io_queue_wait.3 +man/io_set_callback.3 +man/io_submit.3 diff --git a/libaio1-udeb.install b/libaio1-udeb.install new file mode 100644 index 0000000..cb2dadb --- /dev/null +++ b/libaio1-udeb.install @@ -0,0 +1,2 @@ +usr/lib/*/libaio.so.1 +usr/lib/*/libaio.so.1.* diff --git a/libaio1.install b/libaio1.install new file mode 100644 index 0000000..cb2dadb --- /dev/null +++ b/libaio1.install @@ -0,0 +1,2 @@ +usr/lib/*/libaio.so.1 +usr/lib/*/libaio.so.1.* diff --git a/libaio1.symbols b/libaio1.symbols new file mode 100644 index 0000000..5e6747c --- /dev/null +++ b/libaio1.symbols @@ -0,0 +1,18 @@ +libaio.so.1 libaio1 #MINVER# +* Build-Depends-Package: libaio-dev + LIBAIO_0.1@LIBAIO_0.1 0.3.9 + LIBAIO_0.4@LIBAIO_0.4 0.3.93 + LIBAIO_0.5@LIBAIO_0.5 0.3.112 + io_cancel@LIBAIO_0.1 0.3.9 + io_cancel@LIBAIO_0.4 0.3.93 + io_destroy@LIBAIO_0.4 0.3.93 + io_getevents@LIBAIO_0.1 0.3.9 + io_getevents@LIBAIO_0.4 0.3.93 + io_pgetevents@LIBAIO_0.5 0.3.112 + io_queue_init@LIBAIO_0.1 0.3.9 + io_queue_release@LIBAIO_0.1 0.3.9 + io_queue_run@LIBAIO_0.1 0.3.9 + io_queue_wait@LIBAIO_0.1 0.3.9 + io_queue_wait@LIBAIO_0.4 0.3.93 + io_setup@LIBAIO_0.4 0.3.93 + io_submit@LIBAIO_0.1 0.3.9 diff --git a/patches/0001-harness-Disable-failing-test-23.patch b/patches/0001-harness-Disable-failing-test-23.patch new file mode 100644 index 0000000..9a494d4 --- /dev/null +++ b/patches/0001-harness-Disable-failing-test-23.patch @@ -0,0 +1,32 @@ +From 90fde4fb458fbf1d497c427c3f945f3d7ee11684 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 19 Apr 2022 15:45:39 +0200 +Subject: [PATCH libaio] harness: Disable failing test 23 + +This new test fails on several architectures. But it is a new test +intended to check for a Linux kernel regression, so we are not worse +off than were before. Add it to the EXTRACASES variables, which has +currently the side effect of disabling it, as it is not handled +explicitly in the make target responsible for that variable. + +Sent-Upstream: not-relevant +Signed-off-by: Guillem Jover +--- + harness/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/harness/Makefile b/harness/Makefile +index 8cb27fa..01613e7 100644 +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -1,6 +1,6 @@ + # foo. + TEST_SRCS:=$(shell find cases/ -name \*.t | sort -n -t/ -k2) +-EXTRAPROGS:=cases/8.p cases/10.p ++EXTRAPROGS:=cases/8.p cases/10.p cases/23.p + PARTPROGS:=$(filter-out $(EXTRAPROGS), $(patsubst %.t,%.p,$(TEST_SRCS))) + PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c +-- +2.35.2 + diff --git a/patches/0001-man-Fix-typos.patch b/patches/0001-man-Fix-typos.patch new file mode 100644 index 0000000..f69f384 --- /dev/null +++ b/patches/0001-man-Fix-typos.patch @@ -0,0 +1,36 @@ +From f95e1898b6efd3eaf50273bd1c5a8a40816b5160 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 10 Oct 2021 06:14:51 +0200 +Subject: [PATCH libaio 01/14] man: Fix typos + +Warned-by: lintian +Signed-off-by: Guillem Jover +--- + man/io.3 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/man/io.3 b/man/io.3 +index bfa9836..c4554a5 100644 +--- a/man/io.3 ++++ b/man/io.3 +@@ -147,7 +147,7 @@ This is experimental. + * 3. When write completes decrement counter and free resources + * + * +- * Usage: aiocp file(s) desination ++ * Usage: aiocp file(s) destination + */ + + #include +@@ -271,7 +271,7 @@ int main(int argc, char *const *argv) + + while (tocopy > 0) { + int i, rc; +- /* Submit as many reads as once as possible upto AIO_MAXIO */ ++ /* Submit as many reads as once as possible up to AIO_MAXIO */ + int n = MIN(MIN(AIO_MAXIO - busy, AIO_MAXIO / 2), + howmany(length - offset, AIO_BLKSIZE)); + if (n > 0) { +-- +2.35.2 + diff --git a/patches/0002-build-Fix-DESTDIR-and-pathname-variables-handling.patch b/patches/0002-build-Fix-DESTDIR-and-pathname-variables-handling.patch new file mode 100644 index 0000000..dda684f --- /dev/null +++ b/patches/0002-build-Fix-DESTDIR-and-pathname-variables-handling.patch @@ -0,0 +1,77 @@ +From 67a28d3c066465668ebffb9ebfb71e89f0e5c19c Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:58:12 +0200 +Subject: [PATCH libaio 02/14] build: Fix DESTDIR and pathname variables + handling + +The convention for DESTDIR is that it is only prefixed during the +install target. In this case we postpone that to the inner Makefile +so that it can be invoked directly while preserving the expected +semantics. We should also prefer the user specified pathname variables +if already set in any way, and do not need to pass them explicitly +to the sub-make. + +Signed-off-by: Guillem Jover +--- + Makefile | 6 +----- + src/Makefile | 16 ++++++++-------- + 2 files changed, 9 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index c1fb831..c194d9e 100644 +--- a/Makefile ++++ b/Makefile +@@ -4,17 +4,13 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(SPECFILE)) + TAG = $(NAME)-$(VERSION) + RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm") + +-prefix=/usr +-includedir=$(prefix)/include +-libdir=$(prefix)/lib +- + default: all + + all: + @$(MAKE) -C src + + install: +- @$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir) ++ @$(MAKE) -C src install + + check: + @$(MAKE) -C harness check +diff --git a/src/Makefile b/src/Makefile +index d080a1b..9a36d0d 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,6 +1,6 @@ +-prefix=/usr +-includedir=$(prefix)/include +-libdir=$(prefix)/lib ++prefix ?= /usr ++includedir ?= $(prefix)/include ++libdir ?= $(prefix)/lib + + CFLAGS ?= -g -fomit-frame-pointer -O2 + CFLAGS += -Wall -I. -fPIC +@@ -59,12 +59,12 @@ $(libname): $(libaio_sobjs) libaio.map + $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS) + + install: $(all_targets) +- install -D -m 644 libaio.h $(includedir)/libaio.h +- install -D -m 644 libaio.a $(libdir)/libaio.a ++ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h ++ install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a + ifeq ($(ENABLE_SHARED),1) +- install -D -m 755 $(libname) $(libdir)/$(libname) +- ln -sf $(libname) $(libdir)/$(soname) +- ln -sf $(libname) $(libdir)/libaio.so ++ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname) ++ ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname) ++ ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so + endif + + $(libaio_objs): libaio.h +-- +2.35.2 + diff --git a/patches/0003-build-Honor-user-build-flags.patch b/patches/0003-build-Honor-user-build-flags.patch new file mode 100644 index 0000000..2527c81 --- /dev/null +++ b/patches/0003-build-Honor-user-build-flags.patch @@ -0,0 +1,104 @@ +From dd2a4c0d176b82781040c08a39fa4c75ccca63f5 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 04:01:27 +0200 +Subject: [PATCH libaio 03/14] build: Honor user build flags +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +CPPFLAGS, CFLAGS and LDFLAGS are user flags, which we need to preserve, +regardless of the user passing them over the environment or the +command-line. Any required flag that the build system needs, has to be +set in some other flag (which we will namespace with «MK_») so that the +build will use even if the user flags are passed, even though the user +should be able to override by appending after them. We pass CPPFLAGS to +any compilation command that missed them. + +Signed-off-by: Guillem Jover +--- + harness/Makefile | 9 ++++++--- + src/Makefile | 20 ++++++++++---------- + 2 files changed, 16 insertions(+), 13 deletions(-) + +diff --git a/harness/Makefile b/harness/Makefile +index 4f225d3..8cb27fa 100644 +--- a/harness/Makefile ++++ b/harness/Makefile +@@ -6,13 +6,16 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS) + HARNESS_SRCS:=main.c + # io_queue.c + +-CFLAGS+=-Wall -Werror -I../src -g -O2 ++MK_CPPFLAGS = -I../src $(CPPFLAGS) ++CFLAGS ?= -Wall -Werror -g -O2 ++MK_CFLAGS = $(CFLAGS) + #-lpthread -lrt ++MK_LDFLAGS = main.c $(LIBAIO) -lpthread $(LDFLAGS) + + # gcc-11 does not like the test case in 3.t that + # passes an invalid pointer (-1) to the kernel, so + # tell the compiler we do not need a warning here +-cases/3.p: CFLAGS+=-Wno-stringop-overflow ++cases/3.p: MK_CFLAGS+=-Wno-stringop-overflow + + # Change this on the build line to run tests against the installed libraries: + # make LIBAIO=-laio partcheck +@@ -21,7 +24,7 @@ LIBAIO?=../src/libaio.a + all: $(PROGS) + + $(PROGS): %.p: %.t $(HARNESS_SRCS) +- $(CC) $(CFLAGS) -DTEST_NAME=\"$<\" -o $@ main.c $(LIBAIO) -lpthread ++ $(CC) $(MK_CPPFLAGS) $(MK_CFLAGS) -DTEST_NAME=\"$<\" -o $@ $(MK_LDFLAGS) + + clean: + rm -f $(PROGS) *.o runtests.out rofile wofile rwfile +diff --git a/src/Makefile b/src/Makefile +index 9a36d0d..9a1ba51 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -2,12 +2,12 @@ prefix ?= /usr + includedir ?= $(prefix)/include + libdir ?= $(prefix)/lib + +-CFLAGS ?= -g -fomit-frame-pointer -O2 +-CFLAGS += -Wall -I. -fPIC +-SO_CFLAGS=-shared $(CFLAGS) +-L_CFLAGS=$(CFLAGS) +-LINK_FLAGS= +-LINK_FLAGS+=$(LDFLAGS) ++MK_CPPFLAGS = -I. $(CPPFLAGS) ++CFLAGS ?= -Wall -g -fomit-frame-pointer -O2 ++MK_CFLAGS = -fPIC $(CFLAGS) ++SO_CFLAGS = -shared $(MK_CFLAGS) ++L_CFLAGS = $(MK_CFLAGS) ++MK_LDFLAGS = $(LDFLAGS) + ENABLE_SHARED ?= 1 + + soname=libaio.so.1 +@@ -42,10 +42,10 @@ libaio_sobjs := $(patsubst %.c,%.os,$(libaio_srcs)) + $(libaio_objs) $(libaio_sobjs): libaio.h vsys_def.h + + %.os: %.c +- $(CC) $(SO_CFLAGS) -c -o $@ $< ++ $(CC) $(MK_CPPFLAGS) $(SO_CFLAGS) -c -o $@ $< + + %.ol: %.c +- $(CC) $(L_CFLAGS) -c -o $@ $< ++ $(CC) $(MK_CPPFLAGS) $(L_CFLAGS) -c -o $@ $< + + AR ?= ar + RANLIB ?= ranlib +@@ -55,8 +55,8 @@ libaio.a: $(libaio_objs) + $(RANLIB) libaio.a + + $(libname): $(libaio_sobjs) libaio.map +- $(CC) $(CFLAGS) -c struct_offsets.c +- $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS) ++ $(CC) $(MK_CPPFLAGS) $(MK_CFLAGS) -c struct_offsets.c ++ $(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(MK_LDFLAGS) + + install: $(all_targets) + install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h +-- +2.35.2 + diff --git a/patches/0004-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch b/patches/0004-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch new file mode 100644 index 0000000..e5e1313 --- /dev/null +++ b/patches/0004-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch @@ -0,0 +1,67 @@ +From fa00b019422170118b5b4086b84e2dfd1a50811e Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 3 Nov 2021 00:20:50 +0100 +Subject: [PATCH libaio 04/14] Move semicolon to SYMVER and DEFSYMVER call + sites + +These look like function macros, so let's unify their call sites to use +function syntax with a final semicolon. + +Signed-off-by: Guillem Jover +--- + src/io_cancel.c | 2 +- + src/io_getevents.c | 2 +- + src/io_queue_wait.c | 2 +- + src/syscall.h | 4 ++-- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/io_cancel.c b/src/io_cancel.c +index 2f0f5f4..441806d 100644 +--- a/src/io_cancel.c ++++ b/src/io_cancel.c +@@ -20,4 +20,4 @@ + #include "syscall.h" + + io_syscall3(int, io_cancel_0_4, io_cancel, io_context_t, ctx, struct iocb *, iocb, struct io_event *, event) +-DEFSYMVER(io_cancel_0_4, io_cancel, 0.4) ++DEFSYMVER(io_cancel_0_4, io_cancel, 0.4); +diff --git a/src/io_getevents.c b/src/io_getevents.c +index 90d6081..88d285a 100644 +--- a/src/io_getevents.c ++++ b/src/io_getevents.c +@@ -32,4 +32,4 @@ int io_getevents_0_4(io_context_t ctx, long min_nr, long nr, struct io_event * e + return __io_getevents_0_4(ctx, min_nr, nr, events, timeout); + } + +-DEFSYMVER(io_getevents_0_4, io_getevents, 0.4) ++DEFSYMVER(io_getevents_0_4, io_getevents, 0.4); +diff --git a/src/io_queue_wait.c b/src/io_queue_wait.c +index 538d2f3..6f69a51 100644 +--- a/src/io_queue_wait.c ++++ b/src/io_queue_wait.c +@@ -28,4 +28,4 @@ int io_queue_wait_0_4(io_context_t ctx, struct timespec *timeout) + { + return io_getevents(ctx, 0, 0, NULL, timeout); + } +-DEFSYMVER(io_queue_wait_0_4, io_queue_wait, 0.4) ++DEFSYMVER(io_queue_wait_0_4, io_queue_wait, 0.4); +diff --git a/src/syscall.h b/src/syscall.h +index d2a117b..f7ce979 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -6,10 +6,10 @@ + #define SYMSTR(str) _SYMSTR(str) + + #define SYMVER(compat_sym, orig_sym, ver_sym) \ +- __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)); ++ __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)) + + #define DEFSYMVER(compat_sym, orig_sym, ver_sym) \ +- __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)); ++ __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)) + + #if defined(__i386__) + #include "syscall-i386.h" +-- +2.35.2 + diff --git a/patches/0005-Use-new-symver-function-attribute-to-support-LTO-bui.patch b/patches/0005-Use-new-symver-function-attribute-to-support-LTO-bui.patch new file mode 100644 index 0000000..dd146b2 --- /dev/null +++ b/patches/0005-Use-new-symver-function-attribute-to-support-LTO-bui.patch @@ -0,0 +1,94 @@ +From 3ec8be29fc945238788f1fc7f0d998b145a761c7 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 2 Nov 2021 22:37:32 +0100 +Subject: [PATCH libaio 05/14] Use new symver function attribute to support LTO + builds + +The LTO support cannot work properly when there are versioned symbols +via asm statements, as those are not seen by the compiler. Use the new +function attributes if supported instead of the asm statements. + +We need to move the SYMVER calls after the function definitions +otherwise it will reference symbols not yet seen. + +Signed-off-by: Guillem Jover +--- + src/compat-0_1.c | 7 +++---- + src/syscall.h | 13 +++++++++++++ + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/src/compat-0_1.c b/src/compat-0_1.c +index 722e107..ac40fcc 100644 +--- a/src/compat-0_1.c ++++ b/src/compat-0_1.c +@@ -28,7 +28,6 @@ + + + /* ABI change. Provide partial compatibility on this one for now. */ +-SYMVER(compat0_1_io_cancel, io_cancel, 0.1); + int compat0_1_io_cancel(io_context_t ctx, struct iocb *iocb) + { + struct io_event event; +@@ -36,8 +35,8 @@ int compat0_1_io_cancel(io_context_t ctx, struct iocb *iocb) + /* FIXME: the old ABI would return the event on the completion queue */ + return io_cancel(ctx, iocb, &event); + } ++SYMVER(compat0_1_io_cancel, io_cancel, 0.1); + +-SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1); + int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) + { + struct timespec timeout; +@@ -45,10 +44,10 @@ int compat0_1_io_queue_wait(io_context_t ctx, struct timespec *when) + timeout = *when; + return io_getevents(ctx, 0, 0, NULL, when ? &timeout : NULL); + } ++SYMVER(compat0_1_io_queue_wait, io_queue_wait, 0.1); + + + /* ABI change. Provide backwards compatibility for this one. */ +-SYMVER(compat0_1_io_getevents, io_getevents, 0.1); + int compat0_1_io_getevents(io_context_t ctx, long nr, + struct io_event *events, + const struct timespec *const_timeout) +@@ -59,4 +58,4 @@ int compat0_1_io_getevents(io_context_t ctx, long nr, + return io_getevents(ctx, 1, nr, events, + const_timeout ? &timeout : NULL); + } +- ++SYMVER(compat0_1_io_getevents, io_getevents, 0.1); +diff --git a/src/syscall.h b/src/syscall.h +index f7ce979..59e0bb3 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -2,14 +2,27 @@ + #include + #include + ++#ifndef __has_attribute ++#define __has_attribute(x) 0 ++#endif ++ + #define _SYMSTR(str) #str + #define SYMSTR(str) _SYMSTR(str) + ++#if __has_attribute(__symver__) ++#define SYMVER(compat_sym, orig_sym, ver_sym) \ ++ extern __typeof(compat_sym) compat_sym \ ++ __attribute__((__symver__(SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)))) ++#define DEFSYMVER(compat_sym, orig_sym, ver_sym) \ ++ extern __typeof(compat_sym) compat_sym \ ++ __attribute__((__symver__(SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)))) ++#else + #define SYMVER(compat_sym, orig_sym, ver_sym) \ + __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@LIBAIO_" SYMSTR(ver_sym)) + + #define DEFSYMVER(compat_sym, orig_sym, ver_sym) \ + __asm__(".symver " SYMSTR(compat_sym) "," SYMSTR(orig_sym) "@@LIBAIO_" SYMSTR(ver_sym)) ++#endif + + #if defined(__i386__) + #include "syscall-i386.h" +-- +2.35.2 + diff --git a/patches/0006-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch b/patches/0006-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch new file mode 100644 index 0000000..1e64008 --- /dev/null +++ b/patches/0006-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch @@ -0,0 +1,34 @@ +From a045661b84fd5aa7177fa445d22cee3e5ab39ed9 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:39:47 +0200 +Subject: [PATCH libaio 06/14] syscall: Fix ARM definitions to match exactly + the kernel + +Otherwise we get preprocessor warnings due to the redefinitions. + +Signed-off-by: Guillem Jover +--- + src/syscall-arm.h | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/syscall-arm.h b/src/syscall-arm.h +index 556852b..315a37b 100644 +--- a/src/syscall-arm.h ++++ b/src/syscall-arm.h +@@ -19,8 +19,8 @@ + #define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE + #endif + +-#define __NR_io_setup (__NR_SYSCALL_BASE+243) +-#define __NR_io_destroy (__NR_SYSCALL_BASE+244) +-#define __NR_io_getevents (__NR_SYSCALL_BASE+245) +-#define __NR_io_submit (__NR_SYSCALL_BASE+246) +-#define __NR_io_cancel (__NR_SYSCALL_BASE+247) ++#define __NR_io_setup (__NR_SYSCALL_BASE + 243) ++#define __NR_io_destroy (__NR_SYSCALL_BASE + 244) ++#define __NR_io_getevents (__NR_SYSCALL_BASE + 245) ++#define __NR_io_submit (__NR_SYSCALL_BASE + 246) ++#define __NR_io_cancel (__NR_SYSCALL_BASE + 247) +-- +2.35.2 + diff --git a/patches/0007-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch b/patches/0007-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch new file mode 100644 index 0000000..a942525 --- /dev/null +++ b/patches/0007-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch @@ -0,0 +1,32 @@ +From 588df950b1867d224a6227b5d64a0186c8a5c5f5 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:44:43 +0200 +Subject: [PATCH libaio 07/14] syscall: Fix ia64 definitions to match exactly + the kernel + +Otherwise we get preprocessor warnings due to the redefinitions. + +Signed-off-by: Guillem Jover +--- + src/syscall-ia64.h | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/syscall-ia64.h b/src/syscall-ia64.h +index a21e93b..765c423 100644 +--- a/src/syscall-ia64.h ++++ b/src/syscall-ia64.h +@@ -1,5 +1,6 @@ +-#define __NR_io_setup 1238 +-#define __NR_io_destroy 1239 +-#define __NR_io_getevents 1240 +-#define __NR_io_submit 1241 +-#define __NR_io_cancel 1242 ++#define __NR_Linux 1024 ++#define __NR_io_setup (__NR_Linux + 214) ++#define __NR_io_destroy (__NR_Linux + 215) ++#define __NR_io_getevents (__NR_Linux + 216) ++#define __NR_io_submit (__NR_Linux + 217) ++#define __NR_io_cancel (__NR_Linux + 218) +-- +2.35.2 + diff --git a/patches/0008-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch b/patches/0008-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch new file mode 100644 index 0000000..1a5fac7 --- /dev/null +++ b/patches/0008-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch @@ -0,0 +1,35 @@ +From 046d978cd399324cb3bca3bb2e1b72fb0bd8d9c3 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:30:09 +0200 +Subject: [PATCH libaio 08/14] harness: Add KERNEL_RW_POINTER for various + 32-bit architectures + +Signed-off-by: Guillem Jover +--- + harness/main.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/harness/main.c b/harness/main.c +index 82e9c69..0eed7bd 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -12,7 +12,16 @@ + #include + + #if __LP64__ == 0 ++#if defined(__i386__) || defined(__powerpc__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) ++#elif defined(__arm__) || defined(__s390__) ++#define KERNEL_RW_POINTER ((void *)0x00010000) ++#elif defined(__sparc__) ++#define KERNEL_RW_POINTER ((void *)0xf0010000) ++#else ++#warning Not really sure where kernel memory is. Guessing. ++#define KERNEL_RW_POINTER ((void *)0xc0010000) ++#endif + #else + //#warning Not really sure where kernel memory is. Guessing. + #define KERNEL_RW_POINTER ((void *)0xffffffff81000000) +-- +2.35.2 + diff --git a/patches/0009-Fix-and-improve-MIPS-support.patch b/patches/0009-Fix-and-improve-MIPS-support.patch new file mode 100644 index 0000000..edc3232 --- /dev/null +++ b/patches/0009-Fix-and-improve-MIPS-support.patch @@ -0,0 +1,137 @@ +From cf9ef834c4e15c546808b6100a4d95343cf02e9b Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:18:50 +0200 +Subject: [PATCH libaio 09/14] Fix and improve MIPS support + +Fix structure padding for MIPS 64, add syscall definitions, and the +kernel R/W pointer. + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/libaio.h | 6 +++++- + src/syscall-mips.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++ + src/syscall.h | 2 ++ + 4 files changed, 62 insertions(+), 2 deletions(-) + create mode 100644 src/syscall-mips.h + +diff --git a/harness/main.c b/harness/main.c +index 0eed7bd..33d8e46 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -12,7 +12,7 @@ + #include + + #if __LP64__ == 0 +-#if defined(__i386__) || defined(__powerpc__) ++#if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) + #elif defined(__arm__) || defined(__s390__) + #define KERNEL_RW_POINTER ((void *)0x00010000) +diff --git a/src/libaio.h b/src/libaio.h +index 24b4b8a..570ef2b 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -52,7 +52,9 @@ typedef enum io_iocb_cmd { + + /* little endian, 32 bits */ + #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ +- defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \ ++ defined(__sh__) || \ ++ defined(__bfin__) || \ ++ (defined(__MIPSEL__) && !defined(__mips64)) || \ + defined(__cris__) || defined(__loongarch32) || \ + (defined(__riscv) && __riscv_xlen == 32) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ +@@ -63,6 +65,7 @@ typedef enum io_iocb_cmd { + + /* little endian, 64 bits */ + #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \ ++ (defined(__mips64) && defined(__MIPSEL__)) || \ + (defined(__aarch64__) && defined(__AARCH64EL__)) || \ + defined(__loongarch64) || \ + (defined(__riscv) && __riscv_xlen == 64) || \ +@@ -75,6 +78,7 @@ typedef enum io_iocb_cmd { + /* big endian, 64 bits */ + #elif defined(__powerpc64__) || defined(__s390x__) || \ + (defined(__sparc__) && defined(__arch64__)) || \ ++ (defined(__mips64) && defined(__MIPSEB__)) || \ + (defined(__aarch64__) && defined(__AARCH64EB__)) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ + __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8) +diff --git a/src/syscall-mips.h b/src/syscall-mips.h +new file mode 100644 +index 0000000..2c4245e +--- /dev/null ++++ b/src/syscall-mips.h +@@ -0,0 +1,54 @@ ++/* ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file "COPYING" in the main directory of this archive ++ * for more details. ++ * ++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle ++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc. ++ */ ++ ++#ifndef _MIPS_SIM_ABI32 ++#define _MIPS_SIM_ABI32 1 ++#define _MIPS_SIM_NABI32 2 ++#define _MIPS_SIM_ABI64 3 ++#endif ++ ++#if _MIPS_SIM == _MIPS_SIM_ABI32 ++ ++/* ++ * Linux o32 style syscalls are in the range from 4000 to 4999. ++ */ ++#define __NR_Linux 4000 ++#define __NR_io_setup (__NR_Linux + 241) ++#define __NR_io_destroy (__NR_Linux + 242) ++#define __NR_io_getevents (__NR_Linux + 243) ++#define __NR_io_submit (__NR_Linux + 244) ++#define __NR_io_cancel (__NR_Linux + 245) ++ ++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ ++ ++#if _MIPS_SIM == _MIPS_SIM_ABI64 ++ ++/* ++ * Linux 64-bit syscalls are in the range from 5000 to 5999. ++ */ ++#define __NR_Linux 5000 ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ ++ ++#if _MIPS_SIM == _MIPS_SIM_NABI32 ++ ++/* ++ * Linux N32 syscalls are in the range from 6000 to 6999. ++ */ ++#define __NR_Linux 6000 ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ +diff --git a/src/syscall.h b/src/syscall.h +index 59e0bb3..4e56894 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -40,6 +40,8 @@ + #include "syscall-arm.h" + #elif defined(__sparc__) + #include "syscall-sparc.h" ++#elif defined(__mips__) ++#include "syscall-mips.h" + #elif defined(__aarch64__) || defined(__loongarch__) || defined(__riscv) + #include "syscall-generic.h" + #else +-- +2.35.2 + diff --git a/patches/0010-Add-PARISC-support.patch b/patches/0010-Add-PARISC-support.patch new file mode 100644 index 0000000..6331b19 --- /dev/null +++ b/patches/0010-Add-PARISC-support.patch @@ -0,0 +1,66 @@ +From a7cb322acddb2ab595a51beffb74942e45bb54f2 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:22:10 +0200 +Subject: [PATCH libaio 10/14] Add PARISC support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 ++ + src/libaio.h | 1 + + src/syscall-parisc.h | 5 +++++ + src/syscall.h | 2 ++ + 4 files changed, 10 insertions(+) + create mode 100644 src/syscall-parisc.h + +diff --git a/harness/main.c b/harness/main.c +index 33d8e46..01c81aa 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -16,6 +16,8 @@ + #define KERNEL_RW_POINTER ((void *)0xc0010000) + #elif defined(__arm__) || defined(__s390__) + #define KERNEL_RW_POINTER ((void *)0x00010000) ++#elif defined(__hppa__) ++#define KERNEL_RW_POINTER ((void *)0x10100000) + #elif defined(__sparc__) + #define KERNEL_RW_POINTER ((void *)0xf0010000) + #else +diff --git a/src/libaio.h b/src/libaio.h +index 570ef2b..af02ec0 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -77,6 +77,7 @@ typedef enum io_iocb_cmd { + + /* big endian, 64 bits */ + #elif defined(__powerpc64__) || defined(__s390x__) || \ ++ (defined(__hppa__) && defined(__arch64__)) || \ + (defined(__sparc__) && defined(__arch64__)) || \ + (defined(__mips64) && defined(__MIPSEB__)) || \ + (defined(__aarch64__) && defined(__AARCH64EB__)) || \ +diff --git a/src/syscall-parisc.h b/src/syscall-parisc.h +new file mode 100644 +index 0000000..1738075 +--- /dev/null ++++ b/src/syscall-parisc.h +@@ -0,0 +1,5 @@ ++#define __NR_io_setup 215 ++#define __NR_io_destroy 216 ++#define __NR_io_getevents 217 ++#define __NR_io_submit 218 ++#define __NR_io_cancel 219 +diff --git a/src/syscall.h b/src/syscall.h +index 4e56894..3a6c85e 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -40,6 +40,8 @@ + #include "syscall-arm.h" + #elif defined(__sparc__) + #include "syscall-sparc.h" ++#elif defined(__hppa__) ++#include "syscall-parisc.h" + #elif defined(__mips__) + #include "syscall-mips.h" + #elif defined(__aarch64__) || defined(__loongarch__) || defined(__riscv) +-- +2.35.2 + diff --git a/patches/0011-Add-m68k-support.patch b/patches/0011-Add-m68k-support.patch new file mode 100644 index 0000000..c05830e --- /dev/null +++ b/patches/0011-Add-m68k-support.patch @@ -0,0 +1,53 @@ +From bfbe6653ef0a9bac41ea54f1f3a12c21d5ff0a57 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Wed, 14 Aug 2019 03:25:22 +0200 +Subject: [PATCH libaio 11/14] Add m68k support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/syscall-m68k.h | 5 +++++ + src/syscall.h | 2 ++ + 3 files changed, 8 insertions(+), 1 deletion(-) + create mode 100644 src/syscall-m68k.h + +diff --git a/harness/main.c b/harness/main.c +index 01c81aa..99d393f 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -14,7 +14,7 @@ + #if __LP64__ == 0 + #if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) +-#elif defined(__arm__) || defined(__s390__) ++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) + #define KERNEL_RW_POINTER ((void *)0x00010000) + #elif defined(__hppa__) + #define KERNEL_RW_POINTER ((void *)0x10100000) +diff --git a/src/syscall-m68k.h b/src/syscall-m68k.h +new file mode 100644 +index 0000000..2dd4a9b +--- /dev/null ++++ b/src/syscall-m68k.h +@@ -0,0 +1,5 @@ ++#define __NR_io_setup 241 ++#define __NR_io_destroy 242 ++#define __NR_io_getevents 243 ++#define __NR_io_submit 244 ++#define __NR_io_cancel 245 +diff --git a/src/syscall.h b/src/syscall.h +index 3a6c85e..e3825df 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -40,6 +40,8 @@ + #include "syscall-arm.h" + #elif defined(__sparc__) + #include "syscall-sparc.h" ++#elif defined(__m68k__) ++#include "syscall-m68k.h" + #elif defined(__hppa__) + #include "syscall-parisc.h" + #elif defined(__mips__) +-- +2.35.2 + diff --git a/patches/0012-Add-SH-support.patch b/patches/0012-Add-SH-support.patch new file mode 100644 index 0000000..c631be2 --- /dev/null +++ b/patches/0012-Add-SH-support.patch @@ -0,0 +1,76 @@ +From 76fb6fa924bda8c8ce669633ba89271e0c2e268d Mon Sep 17 00:00:00 2001 +From: Nobuhiro Iwamatsu +Date: Sun, 12 Apr 2020 03:30:41 +0200 +Subject: [PATCH libaio 12/14] Add SH support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/libaio.h | 3 ++- + src/syscall-sh.h | 6 ++++++ + src/syscall.h | 2 ++ + 4 files changed, 11 insertions(+), 2 deletions(-) + create mode 100644 src/syscall-sh.h + +diff --git a/harness/main.c b/harness/main.c +index 99d393f..ac0fba2 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -14,7 +14,7 @@ + #if __LP64__ == 0 + #if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) +-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) ++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) + #define KERNEL_RW_POINTER ((void *)0x00010000) + #elif defined(__hppa__) + #define KERNEL_RW_POINTER ((void *)0x10100000) +diff --git a/src/libaio.h b/src/libaio.h +index af02ec0..2dbb6bb 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -52,7 +52,7 @@ typedef enum io_iocb_cmd { + + /* little endian, 32 bits */ + #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ +- defined(__sh__) || \ ++ (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \ + defined(__bfin__) || \ + (defined(__MIPSEL__) && !defined(__mips64)) || \ + defined(__cris__) || defined(__loongarch32) || \ +@@ -90,6 +90,7 @@ typedef enum io_iocb_cmd { + /* big endian, 32 bits */ + #elif defined(__PPC__) || defined(__s390__) || \ + (defined(__arm__) && defined(__ARMEB__)) || \ ++ (defined(__sh__) && defined (__BIG_ENDIAN__)) || \ + defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \ + defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \ + (defined(__GNUC__) && defined(__BYTE_ORDER__) && \ +diff --git a/src/syscall-sh.h b/src/syscall-sh.h +new file mode 100644 +index 0000000..6c00573 +--- /dev/null ++++ b/src/syscall-sh.h +@@ -0,0 +1,6 @@ ++/* Copy from ./arch/sh/include/asm/unistd_32.h */ ++#define __NR_io_setup 245 ++#define __NR_io_destroy 246 ++#define __NR_io_getevents 247 ++#define __NR_io_submit 248 ++#define __NR_io_cancel 249 +diff --git a/src/syscall.h b/src/syscall.h +index e3825df..57dd1fa 100644 +--- a/src/syscall.h ++++ b/src/syscall.h +@@ -46,6 +46,8 @@ + #include "syscall-parisc.h" + #elif defined(__mips__) + #include "syscall-mips.h" ++#elif defined(__sh__) ++#include "syscall-sh.h" + #elif defined(__aarch64__) || defined(__loongarch__) || defined(__riscv) + #include "syscall-generic.h" + #else +-- +2.35.2 + diff --git a/patches/0013-Add-x32-support.patch b/patches/0013-Add-x32-support.patch new file mode 100644 index 0000000..f541b87 --- /dev/null +++ b/patches/0013-Add-x32-support.patch @@ -0,0 +1,64 @@ +From a70f29d317a02a7cf5c0c1cbacc8f020c52cdea9 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Sun, 12 Apr 2020 03:36:39 +0200 +Subject: [PATCH libaio 13/14] Add x32 support + +Signed-off-by: Guillem Jover +--- + harness/main.c | 2 +- + src/libaio.h | 4 +++- + src/syscall-x86_64.h | 10 ++++++++++ + 3 files changed, 14 insertions(+), 2 deletions(-) + +diff --git a/harness/main.c b/harness/main.c +index ac0fba2..db42a18 100644 +--- a/harness/main.c ++++ b/harness/main.c +@@ -14,7 +14,7 @@ + #if __LP64__ == 0 + #if defined(__i386__) || defined(__powerpc__) || defined(__mips__) + #define KERNEL_RW_POINTER ((void *)0xc0010000) +-#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) ++#elif defined(__arm__) || defined(__m68k__) || defined(__s390__) || defined(__sh__) || defined(__x86_64__) + #define KERNEL_RW_POINTER ((void *)0x00010000) + #elif defined(__hppa__) + #define KERNEL_RW_POINTER ((void *)0x10100000) +diff --git a/src/libaio.h b/src/libaio.h +index 2dbb6bb..c731298 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -51,7 +51,9 @@ typedef enum io_iocb_cmd { + } io_iocb_cmd_t; + + /* little endian, 32 bits */ +-#if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \ ++#if defined(__i386__) || \ ++ (defined(__x86_64__) && defined(__ILP32__)) || \ ++ (defined(__arm__) && !defined(__ARMEB__)) || \ + (defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \ + defined(__bfin__) || \ + (defined(__MIPSEL__) && !defined(__mips64)) || \ +diff --git a/src/syscall-x86_64.h b/src/syscall-x86_64.h +index 0eccef3..6a44d53 100644 +--- a/src/syscall-x86_64.h ++++ b/src/syscall-x86_64.h +@@ -1,6 +1,16 @@ ++#if __ILP32__ ++#define __X32_SYSCALL_BIT 0x40000000UL ++#define __NR_io_setup (__X32_SYSCALL_BIT + 543) ++#define __NR_io_destroy (__X32_SYSCALL_BIT + 207) ++#define __NR_io_submit (__X32_SYSCALL_BIT + 544) ++#define __NR_io_cancel (__X32_SYSCALL_BIT + 210) ++#define __NR_io_getevents (__X32_SYSCALL_BIT + 208) ++#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333) ++#else + #define __NR_io_setup 206 + #define __NR_io_destroy 207 + #define __NR_io_getevents 208 + #define __NR_io_submit 209 + #define __NR_io_cancel 210 + #define __NR_io_pgetevents 333 ++#endif +-- +2.35.2 + diff --git a/patches/0014-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch b/patches/0014-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch new file mode 100644 index 0000000..287000a --- /dev/null +++ b/patches/0014-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch @@ -0,0 +1,107 @@ +From 97daff5b92530896f9ea6e89ed2d1ec6df264944 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Fri, 16 Aug 2019 02:33:46 +0200 +Subject: [PATCH libaio 14/14] Fix io_pgetevents() syscall wrapper on 32-bit + userland on 64-bit kernels + +The kernel compat syscall in the kernel got introduced with a broken +layout, which requires a pointer to the actual sigset_t variable but +with the size of the running kernel, not the size of the compat code. + +This means that when the wrapper sends the expected compat (32-bit) +pointer, the kernel reads a 64-bit pointer, eating with it also the +sigset size member. And then proceeds to fail the comparison of the +sigset_t size and returns EINVAL. + +This really needs to be fixed in the kernel, as there's no apparent +user of the broken compat layout (from codesearch.debian.org, nor a +quick github.com search). But we have to workaround it in libaio so +that we can use kernels that have not yet been fixed. + +We do that, by trying the non-broken layout (that would be used with +a 32-bit userland on a 32-bit kernel), and if that fails with -EINVAL +we retry with a structure padded to what the kernel expects. + +Signed-off-by: Guillem Jover +--- + src/io_pgetevents.c | 38 +++++++++++++++++++++++++++++++------- + src/libaio.h | 10 ++++++++++ + 2 files changed, 41 insertions(+), 7 deletions(-) + +diff --git a/src/io_pgetevents.c b/src/io_pgetevents.c +index e6b0614..b2515f2 100644 +--- a/src/io_pgetevents.c ++++ b/src/io_pgetevents.c +@@ -33,17 +33,41 @@ int io_pgetevents(io_context_t ctx, long min_nr, long nr, + struct io_event *events, struct timespec *timeout, + sigset_t *sigmask) + { +- struct { +- unsigned long ss; +- unsigned long ss_len; +- } data; ++ struct io_sigset aio_sigset; ++#ifndef __LP64__ ++ struct io_sigset_compat aio_sigset_compat = { 0 }; ++#endif ++ int ret; + + if (aio_ring_is_empty(ctx, timeout)) + return 0; + +- data.ss = (unsigned long)sigmask; +- data.ss_len = _NSIG / 8; +- return __io_pgetevents(ctx, min_nr, nr, events, timeout, &data); ++ aio_sigset.ss = (unsigned long)sigmask; ++ aio_sigset.ss_len = _NSIG / 8; ++ ret = __io_pgetevents(ctx, min_nr, nr, events, timeout, &aio_sigset); ++ ++#ifndef __LP64__ ++ /* ++ * The compat kernel syscall got introduced with an broken layout for ++ * its sigset argument, expecting it to contain a pointer for the ++ * non-compat pointer size. ++ * ++ * To cope with this on unfixed kernels, in case we are built as a ++ * 32-bit library (which could run on a kernel with compat code) and ++ * when the syscall returns EINVAL due to the kernel not finding the ++ * sigset size member when unpacking the structure, we retry with ++ * the fixed up compat layout, which requires the padding to be ++ * zero-filled, otherwise the 64-bit pointer will contain garbage. ++ */ ++ if (ret != -EINVAL) ++ return ret; ++ ++ aio_sigset_compat.ss = (unsigned long)sigmask; ++ aio_sigset_compat.ss_len = _NSIG / 8; ++ ret = __io_pgetevents(ctx, min_nr, nr, events, timeout, &aio_sigset_compat); ++#endif ++ ++ return ret; + } + #else + int io_pgetevents(io_context_t ctx, long min_nr, long nr, +diff --git a/src/libaio.h b/src/libaio.h +index c731298..fc3118c 100644 +--- a/src/libaio.h ++++ b/src/libaio.h +@@ -154,6 +154,16 @@ struct io_event { + PADDEDul(res2, __pad4); + }; + ++struct io_sigset { ++ unsigned long ss; ++ unsigned long ss_len; ++}; ++ ++struct io_sigset_compat { ++ PADDEDptr(unsigned long ss, __ss_pad); ++ unsigned long ss_len; ++}; ++ + #undef PADDED + #undef PADDEDptr + #undef PADDEDul +-- +2.35.2 + diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..aef8e11 --- /dev/null +++ b/patches/series @@ -0,0 +1,17 @@ +# Local changes, pending submission +0001-man-Fix-typos.patch +0002-build-Fix-DESTDIR-and-pathname-variables-handling.patch +0003-build-Honor-user-build-flags.patch +0004-Move-semicolon-to-SYMVER-and-DEFSYMVER-call-sites.patch +0005-Use-new-symver-function-attribute-to-support-LTO-bui.patch +0006-syscall-Fix-ARM-definitions-to-match-exactly-the-ker.patch +0007-syscall-Fix-ia64-definitions-to-match-exactly-the-ke.patch +0008-harness-Add-KERNEL_RW_POINTER-for-various-32-bit-arc.patch +0009-Fix-and-improve-MIPS-support.patch +0010-Add-PARISC-support.patch +0011-Add-m68k-support.patch +0012-Add-SH-support.patch +0013-Add-x32-support.patch +# Local changes, not for upstream +0014-Fix-io_pgetevents-syscall-wrapper-on-32-bit-userland.patch +0001-harness-Disable-failing-test-23.patch diff --git a/rules b/rules new file mode 100755 index 0000000..9010218 --- /dev/null +++ b/rules @@ -0,0 +1,48 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +DEB_BUILD_MAINT_OPTIONS = hardening=+bindnow +DEB_CFLAGS_MAINT_PREPEND = -Wall + +include /usr/share/dpkg/default.mk +include /usr/share/dpkg/buildtools.mk + +# The following architectures still fail the test suite: +# m68k +# (emulated, no proper test results) +# sh4 +# (emulated, no proper test results) +# x32 +# (20: io_setup failed) +# riscv64 +# (5: 512 instead of EFAULT on write) +# sparc64 +# (5: 512 instead of EFAULT on write) +# (19: mremap EINVAL) +# hppa +# (5: 512 instead of EFAULT on write) +# (19: mremap EINVAL) +# (17: looping, timeout?) +ifneq (,$(filter $(DEB_HOST_ARCH),m68k sh4 x32 riscv64 sparc64 hppa)) + TESTS_FLAKY = yes +endif + +export CC + +%: + dh $@ + +override_dh_auto_test: +ifeq ($(TESTS_FLAKY),yes) + @echo "Notice: Running tests in flaky mode, errors will be ignored." +endif + $(if $(TESTS_FLAKY),-)$(MAKE) partcheck \ + CPPFLAGS="$(CPPFLAGS)" \ + CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" + +override_dh_auto_install: + dh_auto_install -- \ + libdir=/usr/lib/$(DEB_HOST_MULTIARCH) diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/tests/control b/tests/control new file mode 100644 index 0000000..a44d003 --- /dev/null +++ b/tests/control @@ -0,0 +1,7 @@ +Tests: test-unit +Restrictions: flaky rw-build-tree +Depends: build-essential, libaio-dev + +Tests: test-unit-root +Restrictions: flaky rw-build-tree needs-root +Depends: build-essential, libaio-dev diff --git a/tests/test-unit b/tests/test-unit new file mode 100755 index 0000000..dec4a6d --- /dev/null +++ b/tests/test-unit @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e +exec 2>&1 +set -u +set -x + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CC="$DEB_HOST_GNU_TYPE-gcc" +else + CC=gcc +fi + +make partcheck CC="$CC" LIBAIO=-laio diff --git a/tests/test-unit-root b/tests/test-unit-root new file mode 100755 index 0000000..ba1fc9d --- /dev/null +++ b/tests/test-unit-root @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e +exec 2>&1 +set -u +set -x + +if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then + CC="$DEB_HOST_GNU_TYPE-gcc" +else + CC=gcc +fi + +make check CC="$CC" LIBAIO=-laio diff --git a/upstream/metadata b/upstream/metadata new file mode 100644 index 0000000..1974a17 --- /dev/null +++ b/upstream/metadata @@ -0,0 +1,2 @@ +Repository: https://pagure.io/libaio.git +Repository-Browse: https://pagure.io/libaio diff --git a/watch b/watch new file mode 100644 index 0000000..3984695 --- /dev/null +++ b/watch @@ -0,0 +1,3 @@ +# Site Directory Pattern Version Script +version=4 +https://releases.pagure.org/libaio/libaio-([\d\.]+)\.tar\.(?:gz|xz) debian uupdate -- 2.30.2