summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO10
-rw-r--r--0001-Add-autoconf-archive-to-src-external.patch49
-rw-r--r--0002-Import-of-code-from-autoconf-archive.patch500
-rw-r--r--0003-Use-autoconf-archive-m4-from-src-external.patch84
-rw-r--r--0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch140
-rw-r--r--0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch127
-rw-r--r--PKGBUILD27
7 files changed, 932 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index eaa5079f8c16..6234b10dba92 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = openafs-modules
pkgdesc = Kernel module for OpenAFS
pkgver = 1.8.8.1
- pkgrel = 1
+ pkgrel = 2
url = http://www.openafs.org
install = openafs-modules.install
arch = i686
@@ -15,6 +15,14 @@ pkgbase = openafs-modules
conflicts = openafs<1.6.6-2
options = !emptydirs
source = http://openafs.org/dl/openafs/1.8.8.1/openafs-1.8.8.1-src.tar.bz2
+ source = 0001-Add-autoconf-archive-to-src-external.patch
+ source = 0002-Import-of-code-from-autoconf-archive.patch
+ source = 0003-Use-autoconf-archive-m4-from-src-external.patch
+ source = 0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch
+ source = 0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch
sha256sums = e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44
+ sha256sums = a66ac857c28164e0af919b6cd259fe7249f9c2e0ca0952a36830555de00ae961
+ sha256sums = c36a859e94061272db153e32c3d3c862f0dc6a733328a042c94ea2e6fd73b50e
+ sha256sums = f15a2bb8c983534bc8660431d97971789256a63925cc5bcd21bc277f0fdc131b
pkgname = openafs-modules
diff --git a/0001-Add-autoconf-archive-to-src-external.patch b/0001-Add-autoconf-archive-to-src-external.patch
new file mode 100644
index 000000000000..18a3fa55aaec
--- /dev/null
+++ b/0001-Add-autoconf-archive-to-src-external.patch
@@ -0,0 +1,49 @@
+From 26434fb4376a5db1f38fca8807825fbabc81be7b Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Sat, 4 Apr 2020 22:28:21 -0500
+Subject: [PATCH 1/5] Add autoconf-archive to src/external
+
+Add autoconf-archive to the src/external mechanism, so we can more
+easily import and update the AX_* m4 macros we pull in from
+autoconf-archive. Commits are imported from
+<git://git.savannah.gnu.org/autoconf-archive.git>.
+
+We already have a copy of ax_gcc_func_attribute.m4 in the tree, so
+include that in the list of files. While we're here, also include a
+few more macros for checking compiler flags, which will be used in
+subsequent commits.
+
+Change-Id: I8c6288fc1d48a47837ca08f8b9207e0ada921af8
+Reviewed-on: https://gerrit.openafs.org/14133
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit a072c65bba86cbcd81157e354d3719ac41a2c97d)
+---
+ src/external/autoconf-archive-author | 1 +
+ src/external/autoconf-archive-files | 5 +++++
+ 2 files changed, 6 insertions(+)
+ create mode 100644 src/external/autoconf-archive-author
+ create mode 100644 src/external/autoconf-archive-files
+
+diff --git a/src/external/autoconf-archive-author b/src/external/autoconf-archive-author
+new file mode 100644
+index 000000000..1c668c50b
+--- /dev/null
++++ b/src/external/autoconf-archive-author
+@@ -0,0 +1 @@
++Autoconf Archive Maintainers <autoconf-archive-maintainers@gnu.org>
+diff --git a/src/external/autoconf-archive-files b/src/external/autoconf-archive-files
+new file mode 100644
+index 000000000..42c7c3852
+--- /dev/null
++++ b/src/external/autoconf-archive-files
+@@ -0,0 +1,5 @@
++m4/ax_append_compile_flags.m4 m4/ax_append_compile_flags.m4
++m4/ax_append_flag.m4 m4/ax_append_flag.m4
++m4/ax_check_compile_flag.m4 m4/ax_check_compile_flag.m4
++m4/ax_gcc_func_attribute.m4 m4/ax_gcc_func_attribute.m4
++m4/ax_require_defined.m4 m4/ax_require_defined.m4
+--
+2.35.1
+
diff --git a/0002-Import-of-code-from-autoconf-archive.patch b/0002-Import-of-code-from-autoconf-archive.patch
new file mode 100644
index 000000000000..731fd0a3c25d
--- /dev/null
+++ b/0002-Import-of-code-from-autoconf-archive.patch
@@ -0,0 +1,500 @@
+From 3dd58d1b0d417fcda3b7679aa0f0691f55740c93 Mon Sep 17 00:00:00 2001
+From: Autoconf Archive Maintainers <autoconf-archive-maintainers@gnu.org>
+Date: Tue, 7 Apr 2020 10:23:16 -0500
+Subject: [PATCH 2/5] Import of code from autoconf-archive
+
+This commit updates the code imported from autoconf-archive to
+24358c8c5ca679949ef522964d94e4d1cd1f941a (v2019.01.06)
+
+New files are:
+ m4/ax_append_compile_flags.m4
+ m4/ax_append_flag.m4
+ m4/ax_check_compile_flag.m4
+ m4/ax_gcc_func_attribute.m4
+ m4/ax_require_defined.m4
+
+Change-Id: I64e14d1b4d41ebfee82fa92da10239f73e28b4c9
+Reviewed-on: https://gerrit.openafs.org/14138
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit d8205bbb482554812fbe66afa3c337d991a247b6)
+---
+ src/external/autoconf-archive-last | 1 +
+ .../m4/ax_append_compile_flags.m4 | 46 ++++
+ .../autoconf-archive/m4/ax_append_flag.m4 | 50 ++++
+ .../m4/ax_check_compile_flag.m4 | 53 ++++
+ .../m4/ax_gcc_func_attribute.m4 | 238 ++++++++++++++++++
+ .../autoconf-archive/m4/ax_require_defined.m4 | 37 +++
+ 6 files changed, 425 insertions(+)
+ create mode 100644 src/external/autoconf-archive-last
+ create mode 100644 src/external/autoconf-archive/m4/ax_append_compile_flags.m4
+ create mode 100644 src/external/autoconf-archive/m4/ax_append_flag.m4
+ create mode 100644 src/external/autoconf-archive/m4/ax_check_compile_flag.m4
+ create mode 100644 src/external/autoconf-archive/m4/ax_gcc_func_attribute.m4
+ create mode 100644 src/external/autoconf-archive/m4/ax_require_defined.m4
+
+diff --git a/src/external/autoconf-archive-last b/src/external/autoconf-archive-last
+new file mode 100644
+index 000000000..8bf2750b1
+--- /dev/null
++++ b/src/external/autoconf-archive-last
+@@ -0,0 +1 @@
++24358c8c5ca679949ef522964d94e4d1cd1f941a
+diff --git a/src/external/autoconf-archive/m4/ax_append_compile_flags.m4 b/src/external/autoconf-archive/m4/ax_append_compile_flags.m4
+new file mode 100644
+index 000000000..9c856356c
+--- /dev/null
++++ b/src/external/autoconf-archive/m4/ax_append_compile_flags.m4
+@@ -0,0 +1,46 @@
++# ============================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
++# ============================================================================
++#
++# SYNOPSIS
++#
++# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++# For every FLAG1, FLAG2 it is checked whether the compiler works with the
++# flag. If it does, the flag is added FLAGS-VARIABLE
++#
++# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
++# CFLAGS) is used. During the check the flag is always added to the
++# current language's flags.
++#
++# If EXTRA-FLAGS is defined, it is added to the current language's default
++# flags (e.g. CFLAGS) when the check is done. The check is thus made with
++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
++# force the compiler to issue an error when a bad flag is given.
++#
++# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++# NOTE: This macro depends on the AX_APPEND_FLAG and
++# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
++# AX_APPEND_LINK_FLAGS.
++#
++# LICENSE
++#
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved. This file is offered as-is, without any
++# warranty.
++
++#serial 7
++
++AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
++[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
++AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
++for flag in $1; do
++ AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
++done
++])dnl AX_APPEND_COMPILE_FLAGS
+diff --git a/src/external/autoconf-archive/m4/ax_append_flag.m4 b/src/external/autoconf-archive/m4/ax_append_flag.m4
+new file mode 100644
+index 000000000..dd6d8b614
+--- /dev/null
++++ b/src/external/autoconf-archive/m4/ax_append_flag.m4
+@@ -0,0 +1,50 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
++#
++# DESCRIPTION
++#
++# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
++# added in between.
++#
++# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
++# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
++# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
++# FLAG.
++#
++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved. This file is offered as-is, without any
++# warranty.
++
++#serial 8
++
++AC_DEFUN([AX_APPEND_FLAG],
++[dnl
++AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
++AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
++AS_VAR_SET_IF(FLAGS,[
++ AS_CASE([" AS_VAR_GET(FLAGS) "],
++ [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
++ [
++ AS_VAR_APPEND(FLAGS,[" $1"])
++ AC_RUN_LOG([: FLAGS="$FLAGS"])
++ ])
++ ],
++ [
++ AS_VAR_SET(FLAGS,[$1])
++ AC_RUN_LOG([: FLAGS="$FLAGS"])
++ ])
++AS_VAR_POPDEF([FLAGS])dnl
++])dnl AX_APPEND_FLAG
+diff --git a/src/external/autoconf-archive/m4/ax_check_compile_flag.m4 b/src/external/autoconf-archive/m4/ax_check_compile_flag.m4
+new file mode 100644
+index 000000000..bd753b34d
+--- /dev/null
++++ b/src/external/autoconf-archive/m4/ax_check_compile_flag.m4
+@@ -0,0 +1,53 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
++#
++# DESCRIPTION
++#
++# Check whether the given FLAG works with the current language's compiler
++# or gives an error. (Warnings, however, are ignored)
++#
++# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
++# success/failure.
++#
++# If EXTRA-FLAGS is defined, it is added to the current language's default
++# flags (e.g. CFLAGS) when the check is done. The check is thus made with
++# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
++# force the compiler to issue an error when a bad flag is given.
++#
++# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
++#
++# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
++# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved. This file is offered as-is, without any
++# warranty.
++
++#serial 6
++
++AC_DEFUN([AX_CHECK_COMPILE_FLAG],
++[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
++AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
++AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
++ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
++ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
++ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
++ [AS_VAR_SET(CACHEVAR,[yes])],
++ [AS_VAR_SET(CACHEVAR,[no])])
++ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
++AS_VAR_IF(CACHEVAR,yes,
++ [m4_default([$2], :)],
++ [m4_default([$3], :)])
++AS_VAR_POPDEF([CACHEVAR])dnl
++])dnl AX_CHECK_COMPILE_FLAGS
+diff --git a/src/external/autoconf-archive/m4/ax_gcc_func_attribute.m4 b/src/external/autoconf-archive/m4/ax_gcc_func_attribute.m4
+new file mode 100644
+index 000000000..098c9aadf
+--- /dev/null
++++ b/src/external/autoconf-archive/m4/ax_gcc_func_attribute.m4
+@@ -0,0 +1,238 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)
++#
++# DESCRIPTION
++#
++# This macro checks if the compiler supports one of GCC's function
++# attributes; many other compilers also provide function attributes with
++# the same syntax. Compiler warnings are used to detect supported
++# attributes as unsupported ones are ignored by default so quieting
++# warnings when using this macro will yield false positives.
++#
++# The ATTRIBUTE parameter holds the name of the attribute to be checked.
++#
++# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.
++#
++# The macro caches its result in the ax_cv_have_func_attribute_<attribute>
++# variable.
++#
++# The macro currently supports the following function attributes:
++#
++# alias
++# aligned
++# alloc_size
++# always_inline
++# artificial
++# cold
++# const
++# constructor
++# constructor_priority for constructor attribute with priority
++# deprecated
++# destructor
++# dllexport
++# dllimport
++# error
++# externally_visible
++# fallthrough
++# flatten
++# format
++# format_arg
++# gnu_inline
++# hot
++# ifunc
++# leaf
++# malloc
++# noclone
++# noinline
++# nonnull
++# noreturn
++# nothrow
++# optimize
++# pure
++# sentinel
++# sentinel_position
++# unused
++# used
++# visibility
++# warning
++# warn_unused_result
++# weak
++# weakref
++#
++# Unsupported function attributes will be tested with a prototype
++# returning an int and not accepting any arguments and the result of the
++# check might be wrong or meaningless so use with care.
++#
++# LICENSE
++#
++# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved. This file is offered as-is, without any
++# warranty.
++
++#serial 9
++
++AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
++ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
++
++ AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([
++ m4_case([$1],
++ [alias], [
++ int foo( void ) { return 0; }
++ int bar( void ) __attribute__(($1("foo")));
++ ],
++ [aligned], [
++ int foo( void ) __attribute__(($1(32)));
++ ],
++ [alloc_size], [
++ void *foo(int a) __attribute__(($1(1)));
++ ],
++ [always_inline], [
++ inline __attribute__(($1)) int foo( void ) { return 0; }
++ ],
++ [artificial], [
++ inline __attribute__(($1)) int foo( void ) { return 0; }
++ ],
++ [cold], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [const], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [constructor_priority], [
++ int foo( void ) __attribute__((__constructor__(65535/2)));
++ ],
++ [constructor], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [deprecated], [
++ int foo( void ) __attribute__(($1("")));
++ ],
++ [destructor], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [dllexport], [
++ __attribute__(($1)) int foo( void ) { return 0; }
++ ],
++ [dllimport], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [error], [
++ int foo( void ) __attribute__(($1("")));
++ ],
++ [externally_visible], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [fallthrough], [
++ int foo( void ) {switch (0) { case 1: __attribute__(($1)); case 2: break ; }};
++ ],
++ [flatten], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [format], [
++ int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
++ ],
++ [format_arg], [
++ char *foo(const char *p) __attribute__(($1(1)));
++ ],
++ [gnu_inline], [
++ inline __attribute__(($1)) int foo( void ) { return 0; }
++ ],
++ [hot], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [ifunc], [
++ int my_foo( void ) { return 0; }
++ static int (*resolve_foo(void))(void) { return my_foo; }
++ int foo( void ) __attribute__(($1("resolve_foo")));
++ ],
++ [leaf], [
++ __attribute__(($1)) int foo( void ) { return 0; }
++ ],
++ [malloc], [
++ void *foo( void ) __attribute__(($1));
++ ],
++ [noclone], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [noinline], [
++ __attribute__(($1)) int foo( void ) { return 0; }
++ ],
++ [nonnull], [
++ int foo(char *p) __attribute__(($1(1)));
++ ],
++ [noreturn], [
++ void foo( void ) __attribute__(($1));
++ ],
++ [nothrow], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [optimize], [
++ __attribute__(($1(3))) int foo( void ) { return 0; }
++ ],
++ [pure], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [sentinel], [
++ int foo(void *p, ...) __attribute__(($1));
++ ],
++ [sentinel_position], [
++ int foo(void *p, ...) __attribute__(($1(1)));
++ ],
++ [returns_nonnull], [
++ void *foo( void ) __attribute__(($1));
++ ],
++ [unused], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [used], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [visibility], [
++ int foo_def( void ) __attribute__(($1("default")));
++ int foo_hid( void ) __attribute__(($1("hidden")));
++ int foo_int( void ) __attribute__(($1("internal")));
++ int foo_pro( void ) __attribute__(($1("protected")));
++ ],
++ [warning], [
++ int foo( void ) __attribute__(($1("")));
++ ],
++ [warn_unused_result], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [weak], [
++ int foo( void ) __attribute__(($1));
++ ],
++ [weakref], [
++ static int foo( void ) { return 0; }
++ static int bar( void ) __attribute__(($1("foo")));
++ ],
++ [
++ m4_warn([syntax], [Unsupported attribute $1, the test may fail])
++ int foo( void ) __attribute__(($1));
++ ]
++ )], [])
++ ],
++ dnl GCC doesn't exit with an error if an unknown attribute is
++ dnl provided but only outputs a warning, so accept the attribute
++ dnl only if no warning were issued.
++ [AS_IF([test -s conftest.err],
++ [AS_VAR_SET([ac_var], [no])],
++ [AS_VAR_SET([ac_var], [yes])])],
++ [AS_VAR_SET([ac_var], [no])])
++ ])
++
++ AS_IF([test yes = AS_VAR_GET([ac_var])],
++ [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1,
++ [Define to 1 if the system has the `$1' function attribute])], [])
++
++ AS_VAR_POPDEF([ac_var])
++])
+diff --git a/src/external/autoconf-archive/m4/ax_require_defined.m4 b/src/external/autoconf-archive/m4/ax_require_defined.m4
+new file mode 100644
+index 000000000..17c3eab7d
+--- /dev/null
++++ b/src/external/autoconf-archive/m4/ax_require_defined.m4
+@@ -0,0 +1,37 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_REQUIRE_DEFINED(MACRO)
++#
++# DESCRIPTION
++#
++# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
++# been defined and thus are available for use. This avoids random issues
++# where a macro isn't expanded. Instead the configure script emits a
++# non-fatal:
++#
++# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
++#
++# It's like AC_REQUIRE except it doesn't expand the required macro.
++#
++# Here's an example:
++#
++# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
++#
++# LICENSE
++#
++# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved. This file is offered as-is, without any
++# warranty.
++
++#serial 2
++
++AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
++ m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
++])dnl AX_REQUIRE_DEFINED
+--
+2.35.1
+
diff --git a/0003-Use-autoconf-archive-m4-from-src-external.patch b/0003-Use-autoconf-archive-m4-from-src-external.patch
new file mode 100644
index 000000000000..b37a2977cb23
--- /dev/null
+++ b/0003-Use-autoconf-archive-m4-from-src-external.patch
@@ -0,0 +1,84 @@
+From d82a2aa279ddf3ba36e753fe4f9d360ec3ee3206 Mon Sep 17 00:00:00 2001
+From: Andrew Deason <adeason@sinenomine.net>
+Date: Sat, 4 Apr 2020 22:35:07 -0500
+Subject: [PATCH 3/5] Use autoconf-archive m4 from src/external
+
+Switch to using the m4 macros from autoconf-archive in our
+src/external mechanism, instead of manually-copied versions in src/cf.
+The src/external copy of ax_gcc_func_attribute.m4 is identical to the
+existing copy in src/cf, so that should incur no changes. There are
+also a few new macros pulled in, but they are currently unused.
+
+Increase our AC_PREREQ in configure.ac to 2.64, to match the AC_PREREQ
+in some of the new files.
+
+Change-Id: I8acfe4df7b9a22d9b9e69004c3438034a2dacadb
+Reviewed-on: https://gerrit.openafs.org/14135
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit ca847ddf35e336a8bc3159ce4b26f0162417bbd5)
+---
+ LICENSE | 15 +++++++++++++++
+ configure.ac | 2 +-
+ regen.sh | 8 ++++++--
+ 3 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/LICENSE b/LICENSE
+index 92528897a..f200e2a02 100644
+--- a/LICENSE
++++ b/LICENSE
+@@ -415,3 +415,18 @@ src/cf/lib-pathname.m4 are covered by the following license:
+ THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
++
++====================================================
++
++The files under src/external/autoconf-archive/m4/ are covered by the following
++license:
++
++ Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
++ Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
++ Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com>
++ Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
++
++ Copying and distribution of this file, with or without modification, are
++ permitted in any medium without royalty provided the copyright notice
++ and this notice are preserved. This file is offered as-is, without any
++ warranty.
+diff --git a/configure.ac b/configure.ac
+index 8ca01268b..87ffd1a51 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,4 +1,4 @@
+-AC_PREREQ([2.60])
++AC_PREREQ([2.64])
+ AC_INIT([OpenAFS],[m4_esyscmd(build-tools/git-version .)],[openafs-bugs@openafs.org],[],[http://www.openafs.org/])
+ AC_CONFIG_AUX_DIR([build-tools])
+ AC_CONFIG_MACRO_DIR([src/cf])
+diff --git a/regen.sh b/regen.sh
+index 3ada36c6b..3ae1987f0 100755
+--- a/regen.sh
++++ b/regen.sh
+@@ -26,11 +26,15 @@ else
+ exit 1
+ fi
+
++M4_INCS="-I src/cf"
++M4_INCS="$M4_INCS -I src/external/rra-c-util/m4"
++M4_INCS="$M4_INCS -I src/external/autoconf-archive/m4"
++
+ echo "Running aclocal"
+ if which aclocal > /dev/null 2>&1; then
+- aclocal -I src/cf -I src/external/rra-c-util/m4
++ aclocal $M4_INCS
+ elif which aclocal-1.10 > /dev/null 2>&1; then
+- aclocal-1.10 -I src/cf -I src/external/rra-c-util/m4
++ aclocal-1.10 $M4_INCS
+ else
+ echo "No aclocal found on your system (looked for aclocal & aclocal-1.10)"
+ exit 1
+--
+2.35.1
+
diff --git a/0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch b/0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch
new file mode 100644
index 000000000000..4c616e73cfd0
--- /dev/null
+++ b/0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch
@@ -0,0 +1,140 @@
+From 1f504c13f7203f7a2122f789ea1d70d8c3182e71 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Thu, 27 Jan 2022 20:19:17 -0700
+Subject: [PATCH 4/5] Linux-5.17: kernel func complete_and_exit renamed
+
+Handle the Linux kernel function rename made in commit
+ "exit: Rename complete_and_exit to kthread_complete_and_exit"
+ (cead1855)
+
+Add a new autoconf test for the linux function kthread_complete_and_exit
+and if not found use a define to map kthread_complete_and_exit to
+complete_and_exit.
+
+Replace calls to complete_and_exit with kthread_complete_and_exit.
+
+Change-Id: If8db2d0abb1de8b08f511e9ff67612ef605cd603
+Reviewed-on: https://gerrit.openafs.org/14882
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+(cherry picked from commit a651d4db7f86a24ea6784f6f27d5c8482667267b)
+---
+ src/afs/LINUX/osi_compat.h | 4 ++++
+ src/afs/afs_call.c | 18 ++++++++++--------
+ src/cf/linux-kernel-func.m4 | 6 ++++++
+ 3 files changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h
+index 726b6559c..53a079b67 100644
+--- a/src/afs/LINUX/osi_compat.h
++++ b/src/afs/LINUX/osi_compat.h
+@@ -27,6 +27,10 @@
+ # endif
+ #endif
+
++#if !defined(HAVE_LINUX_KTHREAD_COMPLETE_AND_EXIT)
++# define kthread_complete_and_exit complete_and_exit
++#endif
++
+ #if defined(STRUCT_DENTRY_OPERATIONS_HAS_D_AUTOMOUNT) && !defined(DCACHE_NEED_AUTOMOUNT)
+ # define DCACHE_NEED_AUTOMOUNT DMANAGED_AUTOMOUNT
+ #endif
+diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c
+index 32ad210c4..fab4c01ed 100644
+--- a/src/afs/afs_call.c
++++ b/src/afs/afs_call.c
+@@ -19,7 +19,9 @@
+ #include "afs/afs_stats.h"
+ #include "rx/rx_globals.h"
+ #if !defined(UKERNEL)
+-# if !defined(AFS_LINUX20_ENV)
++# if defined(AFS_LINUX20_ENV)
++# include "osi_compat.h"
++# else
+ # include "net/if.h"
+ # ifdef AFS_SGI62_ENV
+ # include "h/hashing.h"
+@@ -328,7 +330,7 @@ afsd_thread(void *rock)
+ sprintf(current->comm, "afs_callback");
+ afs_RXCallBackServer();
+ AFS_GUNLOCK();
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ case AFSOP_START_AFS:
+ sprintf(current->comm, "afs_afsstart");
+@@ -342,7 +344,7 @@ afsd_thread(void *rock)
+ sprintf(current->comm, "afsd");
+ afs_Daemon();
+ AFS_GUNLOCK();
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ case AFSOP_START_BKG:
+ #ifdef AFS_NEW_BKG
+@@ -361,7 +363,7 @@ afsd_thread(void *rock)
+ afs_BackgroundDaemon();
+ AFS_GUNLOCK();
+ #endif
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ case AFSOP_START_TRUNCDAEMON:
+ sprintf(current->comm, "afs_trimstart");
+@@ -372,7 +374,7 @@ afsd_thread(void *rock)
+ sprintf(current->comm, "afs_cachetrim");
+ afs_CacheTruncateDaemon();
+ AFS_GUNLOCK();
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ case AFSOP_START_CS:
+ sprintf(current->comm, "afs_checkserver");
+@@ -380,7 +382,7 @@ afsd_thread(void *rock)
+ complete(arg->complete);
+ afs_CheckServerDaemon();
+ AFS_GUNLOCK();
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ case AFSOP_RXEVENT_DAEMON:
+ sprintf(current->comm, "afs_evtstart");
+@@ -398,7 +400,7 @@ afsd_thread(void *rock)
+ sprintf(current->comm, "afs_rxevent");
+ afs_rxevent_daemon();
+ AFS_GUNLOCK();
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ #ifdef RXK_LISTENER_ENV
+ case AFSOP_RXLISTENER_DAEMON:
+@@ -420,7 +422,7 @@ afsd_thread(void *rock)
+ sprintf(current->comm, "afs_rxlistener");
+ rxk_Listener();
+ AFS_GUNLOCK();
+- complete_and_exit(0, 0);
++ kthread_complete_and_exit(0, 0);
+ break;
+ #endif
+ default:
+diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4
+index 0ca3e4463..cd4afe914 100644
+--- a/src/cf/linux-kernel-func.m4
++++ b/src/cf/linux-kernel-func.m4
+@@ -178,6 +178,12 @@ AC_CHECK_LINUX_FUNC([ip_sock_set],
+ [#include <net/ip.h>],
+ [ip_sock_set_mtu_discover(NULL, 0);])
+
++dnl Linux 5.17 renamed complete_and_exit to kthread_complete_and_exit
++AC_CHECK_LINUX_FUNC([kthread_complete_and_exit],
++ [#include <linux/kernel.h>
++ #include <linux/kthread.h>],
++ [kthread_complete_and_exit(0, 0);])
++
+ dnl Consequences - things which get set as a result of the
+ dnl above tests
+ AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],
+--
+2.35.1
+
diff --git a/0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch b/0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch
new file mode 100644
index 000000000000..5565973657ca
--- /dev/null
+++ b/0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch
@@ -0,0 +1,127 @@
+From e71816dc640462aab0870fc46cf1d56b63575f45 Mon Sep 17 00:00:00 2001
+From: Cheyenne Wills <cwills@sinenomine.net>
+Date: Fri, 28 Jan 2022 14:10:46 -0700
+Subject: [PATCH 5/5] Linux-5.17: Kernel build uses -Wcast-function-type
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The linux 5.17 commit:
+ "Makefile: Enable -Wcast-function-type" (552a23a0)
+added the -Wcast-function-type compiler flag for kernel module builds.
+
+This change catches a type mismatch in the external files obtained from
+heimdal: hcrypto/evp.c and hcrypto/evp-algs.c and produces the following
+type of compile time error messages.
+
+ src/libafs/MODLOAD-.../evp.c: In function ‘hc_EVP_md_null’:
+ src/libafs/MODLOAD-.../evp.c:501:2: error: cast between incompatible
+ function types from ‘void (*)(void *)’ to ‘int (*)(EVP_MD_CTX *)’
+ {aka ‘int (*)(struct hc_EVP_MD_CTX *)’}
+ [-Werror=cast-function-type]
+ 501 | (hc_evp_md_init)null_Init,
+ | ^
+
+Use AX_APPEND_COMPILE_FLAGS to create a CFLAGS_NOCAST_FUNCTION_TYPE
+macro to disable this warning and update the CFLAGS for these 2 files
+for the Linux libafs build.
+
+Update the CODING documentation to add the new exceptions. In addition
+add a brief description on how to set up autoconf to add a new build
+macro to suppress compiler warnings.
+
+Note: upstream heimdal has committed a fix for this in:
+
+ hcrypto: Fix return type for null_Init, null_Update and null_Final
+ (fc4b3ce49b)
+
+Change-Id: I05b716867016a33ca02a791ed6bc5a7d846de608
+Reviewed-on: https://gerrit.openafs.org/14881
+Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Andrew Deason <adeason@sinenomine.net>
+(cherry picked from commit 6bdfa976731ce07f3236893ecf12abb9e169b882)
+---
+ CODING | 12 +++++++++++-
+ src/cf/osconf.m4 | 4 ++++
+ src/libafs/MakefileProto.LINUX.in | 5 +++--
+ 3 files changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/CODING b/CODING
+index 5d62dbb0b..c26697934 100644
+--- a/CODING
++++ b/CODING
+@@ -265,7 +265,13 @@ the fix is to mark that warning as ignored, but only for clang. For example:
+ # endif
+ #endif
+
+-If a pragma isn't available for your particular warning, you will need to
++If the source cannot be changed to add a pragma, you might be abe to use the
++autoconf function AX_APPEND_COMPILE_FLAGS to create a new macro that disables
++the warning and then use macro for the build options for that file. For an
++example, see how the autoconf macro CFLAGS_NOIMPLICIT_FALLTHROUGH is defined and
++used.
++
++Finally if there isn't a way to disable the specific warning, you will need to
+ disable all warnings for the file in question. You can do this by supplying
+ the autoconf macro @CFLAGS_NOERROR@ in the build options for the file. For
+ example:
+@@ -288,6 +294,10 @@ bucoord/commands.c : all : Ubik_Call
+ : signed vs unsigned for dates
+ butc/tcudbprocs.c : all : ubik_Call
+ external/heimdal/hcrypto/validate.c: all: statement with empty body
++external/heimdal/hcrypto/evp.c: cast-function-type
++ : Linux kernel build uses -Wcast-function-type
++external/heimdal/hcrypto/evp-algs.c: cast-function-type
++ : Linux kernel build uses -Wcast-function-type
+ kauth/admin_tools.c : strict-proto : ubik_Call
+ kauth/authclient.c : strict-proto : ubik_Call nonsense
+ libadmin/kas/afs_kasAdmin.c: strict-proto : ubik_Call nonsense
+diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4
+index 1e1b08057..11f3eeae5 100644
+--- a/src/cf/osconf.m4
++++ b/src/cf/osconf.m4
+@@ -665,6 +665,7 @@ CFLAGS_NOERROR=
+ CFLAGS_NOSTRICT=-fno-strict-aliasing
+ CFLAGS_NOUNUSED=
+ CFLAGS_NOOLDSTYLE=
++CFLAGS_NOCAST_FUNCTION_TYPE=
+ XCFLAGS_NOCHECKING="$XCFLAGS"
+
+ if test "x$GCC" = "xyes"; then
+@@ -677,6 +678,8 @@ if test "x$GCC" = "xyes"; then
+ CFLAGS_NOERROR="-Wno-error"
+ CFLAGS_NOUNUSED="-Wno-unused"
+ CFLAGS_NOOLDSTYLE="-Wno-old-style-definition"
++ AX_APPEND_COMPILE_FLAGS([-Wno-cast-function-type],
++ [CFLAGS_NOCAST_FUNCTION_TYPE])
+ AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode])
+ else
+ CFLAGS_NOSTRICT=
+@@ -753,6 +756,7 @@ AC_SUBST(CFLAGS_NOERROR)
+ AC_SUBST(CFLAGS_NOSTRICT)
+ AC_SUBST(CFLAGS_NOUNUSED)
+ AC_SUBST(CFLAGS_NOOLDSTYLE)
++AC_SUBST(CFLAGS_NOCAST_FUNCTION_TYPE)
+ AC_SUBST(XCFLAGS64)
+ AC_SUBST(XLDFLAGS)
+ AC_SUBST(XLDFLAGS64)
+diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in
+index d98fa05ad..8e98afd56 100644
+--- a/src/libafs/MakefileProto.LINUX.in
++++ b/src/libafs/MakefileProto.LINUX.in
+@@ -79,8 +79,9 @@ CFLAGS_rxkad_common.o = -I${TOP_SRCDIR}/rxkad -I$(TOP_OBJDIR)/src/rxkad
+ CFLAGS_opr_rbtree.o = -I${TOP_SRCDIR}/opr
+
+ CFLAGS_evp.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto \
+- -DHAVE_CONFIG_H
+-CFLAGS_evp-algs.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
++ -DHAVE_CONFIG_H @CFLAGS_NOCAST_FUNCTION_TYPE@
++CFLAGS_evp-algs.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto \
++ @CFLAGS_NOCAST_FUNCTION_TYPE@
+ CFLAGS_evp-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
+ CFLAGS_rand-timer-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
+ CFLAGS_rand-kernel.o = -I$(TOP_SRCDIR)/external/heimdal/hcrypto
+--
+2.35.1
+
diff --git a/PKGBUILD b/PKGBUILD
index 755c34de2ff9..44695dc843fd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
pkgname=openafs-modules
_srcname=openafs
pkgver=1.8.8.1
-pkgrel=1
+pkgrel=2
pkgdesc="Kernel module for OpenAFS"
arch=('i686' 'x86_64' 'armv7h')
url="http://www.openafs.org"
@@ -15,9 +15,19 @@ depends=('openafs')
makedepends=('libelf' 'linux-headers')
conflicts=('openafs-features-libafs' 'openafs<1.6.6-2')
options=(!emptydirs)
-source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2")
+source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2"
+ 0001-Add-autoconf-archive-to-src-external.patch
+ 0002-Import-of-code-from-autoconf-archive.patch
+ 0003-Use-autoconf-archive-m4-from-src-external.patch
+ 0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch
+ 0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch)
install=openafs-modules.install
-sha256sums=('e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44')
+sha256sums=('e7c4bed7075bcd6402e3f0c2d5b9dbe76ad2ee3c5fd5ddc3973a3356ca23ef44'
+ '67bad31f8a401f1fa4e851a1f8d2d772f6649573f81045cafae94c105bbff173'
+ '16ced06d3d4ffffa251e20aecd1ccb3fedb4585617b004b8ade0b4eab603b17d'
+ '3b2aa3343fe4b9401b272fcf0252f4c3f108f1a1e5039718de38b803690c9d74'
+ 'c9623eac1e8faf2be133d69c6146eb68be800de0c3226acd99848348b5bfd2f4'
+ '17c71196bf5f1fc1c62bab8f03a102d7ca75fec56de94390851b10bd27efa3e9')
# Heuristic to determine version of installed kernel
# You can modify this if the heuristic fails
@@ -32,8 +42,17 @@ _extramodules="/usr/lib/modules/${_kernelver}/extramodules"
prepare() {
cd "${srcdir}/${_srcname}-${pkgver}"
+ # Updates to autoconf required for following patches
+ patch -p1 < "${srcdir}/0001-Add-autoconf-archive-to-src-external.patch"
+ patch -p1 < "${srcdir}/0002-Import-of-code-from-autoconf-archive.patch"
+ patch -p1 < "${srcdir}/0003-Use-autoconf-archive-m4-from-src-external.patch"
+
+ # Compatibility with Linux 5.17
+ patch -p1 < "${srcdir}/0004-Linux-5.17-kernel-func-complete_and_exit-renamed.patch"
+ patch -p1 < "${srcdir}/0005-Linux-5.17-Kernel-build-uses-Wcast-function-type.patch"
+
# Only needed when changes to configure were made
- # ./regen.sh -q
+ ./regen.sh -q
}
build() {