commit: 86259c9ba2a9e4eab2c5c61ad1c85d8e2004e567 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> AuthorDate: Thu Mar 21 20:36:52 2019 +0000 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> CommitDate: Thu Mar 21 20:36:52 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=86259c9b
Add libaio-0.3.110 Required for newer LVM2. Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> defaults/software.sh | 5 ++ gen_compile.sh | 37 +++++++++++++ gen_determineargs.sh | 1 + .../libaio/0.3.110/libaio-0.3.109-install.patch | 45 ++++++++++++++++ .../libaio/0.3.110/libaio-0.3.109-testcase-8.patch | 19 +++++++ patches/libaio/0.3.110/libaio-0.3.109-x32.patch | 63 ++++++++++++++++++++++ .../libaio/0.3.110/libaio-0.3.110-cppflags.patch | 25 +++++++++ .../0.3.110/libaio-0.3.110-link-stdlib.patch | 21 ++++++++ .../0.3.110/libaio-0.3.110-optional-werror.patch | 30 +++++++++++ 9 files changed, 246 insertions(+) diff --git a/defaults/software.sh b/defaults/software.sh index ae63197..e304bee 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -14,6 +14,11 @@ BUSYBOX_SRCTAR="${BUSYBOX_SRCTAR:-${DISTDIR}/busybox-${BUSYBOX_VER}.tar.bz2}" BUSYBOX_DIR="${BUSYBOX_DIR:-busybox-${BUSYBOX_VER}}" BUSYBOX_BINCACHE="${BUSYBOX_BINCACHE:-%%CACHE%%/busybox-${BUSYBOX_VER}-%%ARCH%%.tar.bz2}" +LIBAIO_VER="${LIBAIO_VER:-VERSION_LIBAIO}" +LIBAIO_DIR="${LIBAIO_DIR:-libaio-${LIBAIO_VER}}" +LIBAIO_SRCTAR="${LIBAIO_SRCTAR:-${DISTDIR}/libaio-${LIBAIO_VER}.tar.gz}" +LIBAIO_BINCACHE="${LIBAIO_BINCACHE:-%%CACHE%%/libaio-${LIBAIO_VER}-%%ARCH%%.tar.bz2}" + LVM_VER="${LVM_VER:-VERSION_LVM}" LVM_DIR="${LVM_DIR:-LVM2.${LVM_VER}}" LVM_SRCTAR="${LVM_SRCTAR:-${DISTDIR}/LVM2.${LVM_VER}.tgz}" diff --git a/gen_compile.sh b/gen_compile.sh index 74319bd..0689e10 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -492,6 +492,43 @@ compile_busybox() { fi } +compile_libaio() { + if [ -f "${LIBAIO_BINCACHE}" ] + then + print_info 1 "$(getIndent 3)libaio: >> Using cache" + else + [ -f "${LIBAIO_SRCTAR}" ] || + gen_die "Could not find libaio source tarball: ${LIBAIO_SRCTAR}! Please place it there, or place another version, changing /etc/genkernel.conf as necessary!" + cd "${TEMP}" + rm -rf ${LIBAIO_DIR} > /dev/null + /bin/tar -xpf ${LIBAIO_SRCTAR} || + gen_die 'Could not extract libaio source tarball!' + [ -d "${LIBAIO_DIR}" ] || + gen_die "libaio directory ${LIBAIO_DIR} is invalid!" + + print_info 1 "$(getIndent 3)libaio: >> Patching ..." + cd "${LIBAIO_DIR}" || gen_die "cannot chdir into '${LIBAIO_DIR}'" + apply_patches libaio ${LIBAIO_VER} + + print_info 1 "$(getIndent 3)libaio: >> Compiling..." + CFLAGS="-fPIC" \ + LDFLAGS='-Wl,--no-as-needed' \ + compile_generic '' utils || gen_die "failed to build libaio" + + print_info 1 "$(getIndent 3)libaio: >> Installing to DESTDIR..." + compile_generic "prefix=${TEMP}/libaio install" utils || gen_die "failed to install libaio" + + print_info 1 "$(getIndent 3)libaio: >> Copying to bincache..." + cd "${TEMP}/libaio" || gen_die "cannot chdir into '${TEMP}/libaio'" + /bin/tar -cjf "${LIBAIO_BINCACHE}" . || + gen_die 'Could not create libaio binary cache' + + cd "${TEMP}" + isTrue "${CMD_DEBUGCLEANUP}" && rm -rf "${LIBAIO_DIR}" libaio + return 0 + fi +} + compile_lvm() { if [ -f "${LVM_BINCACHE}" ] then diff --git a/gen_determineargs.sh b/gen_determineargs.sh index fee7f75..2879287 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -161,6 +161,7 @@ determine_real_args() { FUSE_BINCACHE GPG_BINCACHE ISCSI_BINCACHE + LIBAIO_BINCACHE LVM_BINCACHE MDADM_BINCACHE UNIONFS_FUSE_BINCACHE diff --git a/patches/libaio/0.3.110/libaio-0.3.109-install.patch b/patches/libaio/0.3.110/libaio-0.3.109-install.patch new file mode 100644 index 0000000..9c049fc --- /dev/null +++ b/patches/libaio/0.3.110/libaio-0.3.109-install.patch @@ -0,0 +1,45 @@ +From 2e34caef82a2367a85de4f06daf5e5a92f61e845 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vap...@gentoo.org> +Date: Sun, 17 Jan 2010 17:10:14 -0500 +Subject: [PATCH] fix up install paths + +This is similar to the Fedora patch, but this uses more common conventions +like "DESTDIR" instead of "destdir". + +Signed-off-by: Mike Frysinger <vap...@gentoo.org> +--- + src/Makefile | 11 ++++++----- + 1 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/src/Makefile b/src/Makefile +index 687c7be..ee431a1 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,6 +1,7 @@ + prefix=/usr + includedir=$(prefix)/include + libdir=$(prefix)/lib ++usrlibdir=$(libdir) + + CFLAGS ?= -g -fomit-frame-pointer -O2 + CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC +@@ -53,11 +54,11 @@ $(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 755 $(libname) $(libdir)/$(libname) +- ln -sf $(libname) $(libdir)/$(soname) +- ln -sf $(libname) $(libdir)/libaio.so ++ install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h ++ install -D -m 644 libaio.a $(DESTDIR)$(usrlibdir)/libaio.a ++ install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname) ++ ln -sf $(libname) $(DESTDIR)$(usrlibdir)/$(soname) ++ ln -sf $(libname) $(DESTDIR)$(usrlibdir)/libaio.so + + $(libaio_objs): libaio.h + +-- +1.7.3.1 + diff --git a/patches/libaio/0.3.110/libaio-0.3.109-testcase-8.patch b/patches/libaio/0.3.110/libaio-0.3.109-testcase-8.patch new file mode 100644 index 0000000..de66f21 --- /dev/null +++ b/patches/libaio/0.3.110/libaio-0.3.109-testcase-8.patch @@ -0,0 +1,19 @@ +Do not ignore return value of ftruncate(): testcases are compiled with -Werror, +and ftruncate is declared with attribute warn_unused_result. +--- harness/cases/8.t.orig 2012-03-09 16:40:04.074168070 +0100 ++++ harness/cases/8.t 2012-03-09 16:40:57.777278646 +0100 +@@ -9,12 +9,13 @@ + { + long long min = 0, max = 9223372036854775807LL; + char c = 0; ++ int ret; + + while (max - min > 1) { + if (pwrite64(fd, &c, 1, (min + max) / 2) == -1) + max = (min + max) / 2; + else { +- ftruncate(fd, 0); ++ ret = ftruncate(fd, 0); assert(ret == 0); + min = (min + max) / 2; + } + } diff --git a/patches/libaio/0.3.110/libaio-0.3.109-x32.patch b/patches/libaio/0.3.110/libaio-0.3.109-x32.patch new file mode 100644 index 0000000..1d2c2a9 --- /dev/null +++ b/patches/libaio/0.3.110/libaio-0.3.109-x32.patch @@ -0,0 +1,63 @@ +http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f5c071d93c9e6f57930bce56b1e4f009c160a826 + +Upstream-Status: Pending + +Properly load arguments 5 an 6 for x86-64 syscall +Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64 +syscall so that it works with both x32 and x86-64. + +Received this patch from H.J. Lu <hjl.to...@gmail.com> + +Signed-Off-By: Nitin A Kamble <nitin.a.kam...@intel.com> +2011/12/02 + +--- libaio-0.3.109/src/syscall-x86_64.h.x32 2009-10-09 11:17:02.000000000 -0700 ++++ libaio-0.3.109/src/syscall-x86_64.h 2011-12-02 09:09:07.537603224 -0800 +@@ -1,8 +1,18 @@ ++#ifndef __NR_io_setup + #define __NR_io_setup 206 ++#endif ++#ifndef __NR_io_destroy + #define __NR_io_destroy 207 ++#endif ++#ifndef __NR_io_getevents + #define __NR_io_getevents 208 ++#endif ++#ifndef __NR_io_submit + #define __NR_io_submit 209 ++#endif ++#ifndef __NR_io_cancel + #define __NR_io_cancel 210 ++#endif + + #define __syscall_clobber "r11","rcx","memory" + #define __syscall "syscall" +@@ -42,10 +52,11 @@ return __res; \ + type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ + { \ + long __res; \ +-__asm__ volatile ("movq %5,%%r10 ;" __syscall \ ++register long __a4 asm ("r10") = (long) arg4; \ ++__asm__ volatile (__syscall \ + : "=a" (__res) \ + : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ +- "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \ ++ "d" ((long)(arg3)),"r" (__a4)); \ + return __res; \ + } + +@@ -54,10 +65,11 @@ return __res; \ + type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ + { \ + long __res; \ +-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall \ ++register long __a4 asm ("r10") = (long) arg4; \ ++register long __a5 asm ("r8") = (long) arg5; \ ++__asm__ volatile ( __syscall \ + : "=a" (__res) \ + : "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)), \ +- "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) : \ +- __syscall_clobber,"r8","r10" ); \ ++ "d" ((long)(arg3)),"r" (__a4),"r" (__a5)); \ + return __res; \ + } diff --git a/patches/libaio/0.3.110/libaio-0.3.110-cppflags.patch b/patches/libaio/0.3.110/libaio-0.3.110-cppflags.patch new file mode 100644 index 0000000..4567ac9 --- /dev/null +++ b/patches/libaio/0.3.110/libaio-0.3.110-cppflags.patch @@ -0,0 +1,25 @@ +From 3bf96bb62370035dba18d4b25459406b32365cfc Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vap...@gentoo.org> +Date: Wed, 26 Mar 2014 23:10:18 -0400 +Subject: [PATCH] respect env CPPFLAGS + +Signed-off-by: Mike Frysinger <vap...@gentoo.org> +--- + src/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/Makefile b/src/Makefile +index 49f448f..b918c8b 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -5,6 +5,7 @@ usrlibdir=$(libdir) + + CFLAGS ?= -g -fomit-frame-pointer -O2 + CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC ++CFLAGS += $(CPPFLAGS) + SO_CFLAGS=-shared $(CFLAGS) + L_CFLAGS=$(CFLAGS) + LINK_FLAGS= +-- +1.9.1 + diff --git a/patches/libaio/0.3.110/libaio-0.3.110-link-stdlib.patch b/patches/libaio/0.3.110/libaio-0.3.110-link-stdlib.patch new file mode 100644 index 0000000..696a928 --- /dev/null +++ b/patches/libaio/0.3.110/libaio-0.3.110-link-stdlib.patch @@ -0,0 +1,21 @@ +From: Gokturk Yuksek <gokt...@binghamton.edu> +Subject: [PATCH] Link against stdlib to resolve fortified functions + +When '-fstack-protector-strong' is included in CFLAGS, the function +'__stack_chk_fail_local' needs to be pulled from libc. However, upstream +uses '-nostdlib' to avoid linking against any C library or gcc libs. Remove +'-nostdlib' and '-nostartfiles' to pull the required symbols from libc. + +Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=558406 + +--- a/src/Makefile ++++ b/src/Makefile +@@ -4,7 +4,7 @@ + usrlibdir=$(libdir) + + CFLAGS ?= -g -fomit-frame-pointer -O2 +-CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC ++CFLAGS += -Wall -I. -fPIC + CFLAGS += $(CPPFLAGS) + SO_CFLAGS=-shared $(CFLAGS) + L_CFLAGS=$(CFLAGS) diff --git a/patches/libaio/0.3.110/libaio-0.3.110-optional-werror.patch b/patches/libaio/0.3.110/libaio-0.3.110-optional-werror.patch new file mode 100644 index 0000000..2933cf5 --- /dev/null +++ b/patches/libaio/0.3.110/libaio-0.3.110-optional-werror.patch @@ -0,0 +1,30 @@ +From 0cc7dc108d0b2288b40d82bb2fd1fd8bdc08f764 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger <vap...@gentoo.org> +Date: Wed, 26 Mar 2014 23:07:58 -0400 +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 <vap...@gentoo.org> +--- + harness/Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/harness/Makefile b/harness/Makefile +index 2a88e71..cf8c90d 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 -O ++CFLAGS_WERROR?=-Werror ++CFLAGS+=-Wall $(CFLAGS_WERROR) -I../src -g -O + #-lpthread -lrt + + all: $(PROGS) +-- +1.9.1 +