summaryrefslogtreecommitdiff
path: root/repo/system/libaio
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-18 23:40:38 +0100
committerdavidovski <david@davidovski.xyz>2022-05-18 23:40:38 +0100
commit0b977787374349328a21af0deade30d534cf3978 (patch)
tree3c2be28ef9a6f74a36f21cd48a34cb06b3080960 /repo/system/libaio
parentdccab9b94dcfc5e040647210ba22b9cc4bddc742 (diff)
fixed gcc loader/linker errors
Diffstat (limited to 'repo/system/libaio')
-rw-r--r--repo/system/libaio/gnudesignator.patch24
-rw-r--r--repo/system/libaio/libaio-cppflags.patch17
-rw-r--r--repo/system/libaio/libaio-errno.patch11
-rw-r--r--repo/system/libaio/libaio-optional-werror.patch31
-rw-r--r--repo/system/libaio/libaio.xibuild30
-rw-r--r--repo/system/libaio/test-poll.patch12
-rw-r--r--repo/system/libaio/test.patch55
7 files changed, 180 insertions, 0 deletions
diff --git a/repo/system/libaio/gnudesignator.patch b/repo/system/libaio/gnudesignator.patch
new file mode 100644
index 0000000..f62c407
--- /dev/null
+++ b/repo/system/libaio/gnudesignator.patch
@@ -0,0 +1,24 @@
+--- /dev/null 2022-05-16 19:50:41.952900736 +0100
++++ build/gnudesignator.patch 2022-05-16 19:52:21.655900238 +0100
+@@ -0,0 +1,11 @@
++--- build-old/harness/cases/13.t 2022-05-16 19:50:41.952900736 +0100
+++++ build/harness/cases/13.t 2022-05-16 19:49:43.896896077 +0100
++@@ -35,7 +35,7 @@
++ status |= attempt_io_submit(io_ctx, IOS, iocb_list, IOS);
++
++ for (i=0; i<IOS; i++) {
++- struct timespec ts = { tv_sec: 30, tv_nsec: 0 };
+++ struct timespec ts = { tv_sec = 30, tv_nsec = 0 };
++ struct io_event event;
++ struct iocb *iocb;
++
+--- build-old/harness/cases/13.t 2022-05-16 19:50:41.952900736 +0100
++++ build/harness/cases/13.t 2022-05-16 19:52:21.655900238 +0100
+@@ -38 +38 @@
+- struct timespec ts = { tv_sec: 30, tv_nsec: 0 };
++ struct timespec ts = { .tv_sec = 30, .tv_nsec = 0 };
+--- build-old/libaio.xibuild 2022-05-16 19:50:41.952900736 +0100
++++ build/libaio.xibuild 2022-05-16 19:52:21.655900238 +0100
+@@ -11 +11 @@
+-ADDITIONAL="test.patch test-poll.patch libaio-optional-werror.patch libaio-errno.patch libaio-cppflags.patch "
++ADDITIONAL="test.patch test-poll.patch libaio-optional-werror.patch libaio-errno.patch libaio-cppflags.patch gnudesignator.patch"
diff --git a/repo/system/libaio/libaio-cppflags.patch b/repo/system/libaio/libaio-cppflags.patch
new file mode 100644
index 0000000..5f62b7c
--- /dev/null
+++ b/repo/system/libaio/libaio-cppflags.patch
@@ -0,0 +1,17 @@
+respect env CPPFLAGS
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -2,8 +2,9 @@ prefix=/usr
+ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
+
+-CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -Wall -I. -fPIC
++CFLAGS ?= -fomit-frame-pointer -O2
++CFLAGS += -I. -fPIC
++CFLAGS += $(CPPFLAGS)
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
+ LINK_FLAGS=
+
diff --git a/repo/system/libaio/libaio-errno.patch b/repo/system/libaio/libaio-errno.patch
new file mode 100644
index 0000000..0d2ca77
--- /dev/null
+++ b/repo/system/libaio/libaio-errno.patch
@@ -0,0 +1,11 @@
+--- libaio-0.3.112.orig/src/compat-0_1.c
++++ libaio-0.3.112/src/compat-0_1.c
+@@ -19,7 +19,7 @@
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+ #include <stdlib.h>
+-#include <asm/errno.h>
++#include <errno.h>
+
+ #include "libaio.h"
+ #include "vsys_def.h"
diff --git a/repo/system/libaio/libaio-optional-werror.patch b/repo/system/libaio/libaio-optional-werror.patch
new file mode 100644
index 0000000..a5bd404
--- /dev/null
+++ b/repo/system/libaio/libaio-optional-werror.patch
@@ -0,0 +1,31 @@
+From ebe62b178f3e5fcde8a311e64aaffe62099204a5 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 21 Apr 2019 12:44:26 +0200
+Subject: [PATCH] make -Werror into an optional flag
+
+This lets distros disable the flag as random errors might come up with
+different compiler flags and older/newer toolchain versions.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ harness/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/harness/Makefile b/harness/Makefile
+index f477737..a155c4b 100644
+--- a/harness/Makefile
++++ b/harness/Makefile
+@@ -6,7 +6,8 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS)
+ HARNESS_SRCS:=main.c
+ # io_queue.c
+
+-CFLAGS+=-Wall -Werror -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
++CFLAGS_WERROR?=-Werror
++CFLAGS+=-Wall $(CFLAGS_WERROR) -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
+ #-lpthread -lrt
+
+ all: $(PROGS)
+--
+2.21.0
+
+
diff --git a/repo/system/libaio/libaio.xibuild b/repo/system/libaio/libaio.xibuild
new file mode 100644
index 0000000..6c9b45f
--- /dev/null
+++ b/repo/system/libaio/libaio.xibuild
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+NAME="libaio"
+DESC="Asynchronous input/output library"
+
+MAKEDEPS="make "
+DEPS="musl "
+
+PKG_VER=0.3.112
+SOURCE="https://releases.pagure.org/libaio/libaio-$PKG_VER.tar.gz"
+ADDITIONAL="test.patch test-poll.patch libaio-optional-werror.patch libaio-errno.patch libaio-cppflags.patch gnudesignator.patch"
+
+prepare () {
+ apply_patches
+}
+
+build () {
+ CFLAGS="-Wgnu-designator" make PREFIX=/usr
+}
+
+check() {
+ make partcheck
+}
+
+package () {
+ make PREFIX=/usr DESTDIR=$PKG_DEST install
+ cd man
+ find ./ -name "*.3" -exec install -Dm 644 {} "$PKG_DEST"/usr/share/man/man3/{} \;
+
+}
diff --git a/repo/system/libaio/test-poll.patch b/repo/system/libaio/test-poll.patch
new file mode 100644
index 0000000..1183a4b
--- /dev/null
+++ b/repo/system/libaio/test-poll.patch
@@ -0,0 +1,12 @@
+diff -Nurp a/harness/cases/22.t b/harness/cases/22.t
+--- a/harness/cases/22.t 2018-10-22 20:59:34.000000000 +0100
++++ b/harness/cases/22.t 2022-02-26 09:48:59.421311473 +0000
+@@ -11,7 +11,7 @@
+ #include <signal.h>
+ #include <stdio.h>
+ #include <unistd.h>
+-#include <sys/poll.h>
++#include <poll.h>
+ #include <sys/wait.h>
+ #include <stdlib.h>
+
diff --git a/repo/system/libaio/test.patch b/repo/system/libaio/test.patch
new file mode 100644
index 0000000..0822723
--- /dev/null
+++ b/repo/system/libaio/test.patch
@@ -0,0 +1,55 @@
+From: Lee Duncan <lduncan@suse.com>
+Date: Thu, 11 Feb 2021 11:34:42 -0800
+Subject: [PATCH] Fix test issue with gcc-11
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Test 3.t exercises io_submit() with invalid addresses,
+and one test attempted to pass in "-1" as an invalid
+pointer. But gcc-11 realizes you cannot take an offset
+from an invalid pointer, making it impossible to
+compile or run this test:
+
+> sh# make CC=gcc-11 partcheck
+> make[1]: Entering directory '/alt/public_software/libaio/src'
+> make[1]: Nothing to be done for 'all'.
+> make[1]: Leaving directory '/alt/public_software/libaio/src'
+> make[1]: Entering directory '/alt/public_software/libaio/harness'
+> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/2.t\" -o cases/2.p main.c ../src/libaio.a -lpthread
+> gcc-11 -Wall -Werror -I../src -g -O2 -DTEST_NAME=\"cases/3.t\" -o cases/3.p main.c ../src/libaio.a -lpthread
+> In file included from main.c:24:
+> cases/3.t: In function ‘test_main’:
+> cases/3.t:18:19: error: ‘attempt_io_submit’ accessing 8 bytes in a region of size 0 [-Werror=stringop-overflow=]
+> 18 | status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT);
+> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+> cases/3.t:18:19: note: referencing argument 3 of type ‘struct iocb **’
+> In file included from cases/3.t:5,
+> from main.c:24:
+> cases/aio_setup.h:15:5: note: in a call to function ‘attempt_io_submit’
+> 15 | int attempt_io_submit(io_context_t ctx, long nr, struct iocb *ios[], int expect)
+> | ^~~~~~~~~~~~~~~~~
+> cc1: all warnings being treated as errors
+> make[1]: *** [Makefile:19: cases/3.p] Error 1
+> make[1]: Leaving directory '/alt/public_software/libaio/harness'
+> make: *** [Makefile:23: partcheck] Error 2
+
+The fix is to remove this one test case, since the compiler now
+ensures the running code will never see this case.
+
+Signed-off-by: Lee Duncan <leeman.duncan@gmail.com>
+---
+ harness/cases/3.t | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff -Nurp a/harness/cases/3.t b/harness/cases/3.t
+--- a/harness/cases/3.t 2018-10-22 20:59:34.000000000 +0100
++++ b/harness/cases/3.t 2022-02-26 09:46:51.969845084 +0000
+@@ -15,7 +15,6 @@ int test_main(void)
+ status |= attempt_io_submit(BAD_CTX, 1, good_ios, -EINVAL);
+ status |= attempt_io_submit( io_ctx, 0, good_ios, 0);
+ status |= attempt_io_submit( io_ctx, 1, NULL, -EFAULT);
+- status |= attempt_io_submit( io_ctx, 1, (void *)-1, -EFAULT);
+ status |= attempt_io_submit( io_ctx, 2, bad1_ios, -EFAULT);
+ status |= attempt_io_submit( io_ctx, 2, bad2_ios, -EFAULT);
+ status |= attempt_io_submit( io_ctx, -1, good_ios, -EINVAL);