On Tue, Feb 07, 2023 at 03:21:39PM +0100, Sven Püschel wrote:
> GCC removed the SunRPC implementation, therefore we're now using
> libtirpc. Also added a patch to include the correct header for
> socklen_t, so that autotools cannot fail to detect the type presence 
> correctly.
> 
> Signed-off-by: Sven Püschel <[email protected]>
> ---
>  .../lmbench-3.0-a9-add-libtirpc.diff          | 50 +++++++++++++++++++
>  .../lmbench-3.0-a9-fix_socklen_t.diff         | 19 +++++++
>  patches/lmbench-3.0-a9/series                 |  2 +
>  rules/lmbench.in                              |  9 ++--
>  4 files changed, 74 insertions(+), 6 deletions(-)
>  create mode 100644 patches/lmbench-3.0-a9/lmbench-3.0-a9-add-libtirpc.diff
>  create mode 100644 patches/lmbench-3.0-a9/lmbench-3.0-a9-fix_socklen_t.diff
> 
> diff --git a/patches/lmbench-3.0-a9/lmbench-3.0-a9-add-libtirpc.diff 
> b/patches/lmbench-3.0-a9/lmbench-3.0-a9-add-libtirpc.diff
> new file mode 100644
> index 000000000..cebe67f73
> --- /dev/null
> +++ b/patches/lmbench-3.0-a9/lmbench-3.0-a9-add-libtirpc.diff
> @@ -0,0 +1,50 @@
> +commit 3cabac2f5b1688fc35a3e6af890d1b0193b8c840
> +Author: Sven Püschel <[email protected]>
> +Date:   Wed Feb 1 08:17:38 2023 +0000
> +
> +    added libtirpc
> +
> +diff --git a/configure.ac b/configure.ac
> +index 0d935e8..415203b 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -27,8 +27,39 @@ AC_SUBST(LT_AGE)
> + #
> + # Checks for programs.
> + #
> ++
> ++# Function copied and modified from 
> http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=blob;f=aclocal/libtirpc.m4;h=bddae022693100c810edff042d51b145c8f411a6;hb=HEAD
> ++dnl Checks for TI-RPC library and headers
> ++dnl
> ++AC_DEFUN([AC_LIBTIRPC], [
> ++
> ++  PKG_PROG_PKG_CONFIG([0.9.0])
> ++  PKG_CHECK_MODULES([TIRPC], [libtirpc],
> ++                    [LIBS="${LIBS} ${TIRPC_LIBS}"
> ++                       AM_CFLAGS="${AM_CFLAGS} ${TIRPC_CFLAGS}"
> ++                       AC_DEFINE([HAVE_LIBTIRPC], [1],
> ++                                 [Define to 1 if you have and wish to use 
> libtirpc.])])
> ++
> ++     AS_IF([test -n "${LIBTIRPC}"],
> ++           [AC_CHECK_LIB([tirpc], [authgss_free_private_data],
> ++                         [AC_DEFINE([HAVE_AUTHGSS_FREE_PRIVATE_DATA], [1],
> ++                                    [Define to 1 if your rpcsec library 
> provides authgss_free_private_data])],,
> ++                         [${LIBS}])])
> ++
> ++     AS_IF([test -n "${LIBTIRPC}"],
> ++           [AC_CHECK_LIB([tirpc], [libtirpc_set_debug],
> ++                         [AC_DEFINE([HAVE_LIBTIRPC_SET_DEBUG], [1],
> ++                                    [Define to 1 if your tirpc library 
> provides libtirpc_set_debug])],,
> ++                         [${LIBS}])])
> ++
> ++  AC_SUBST([AM_CFLAGS])
> ++  AC_SUBST([LIBS])
> ++
> ++])dnl
> ++
> + AC_PROG_CC
> + AC_PROG_LIBTOOL
> ++AC_LIBTIRPC
> + 
> + AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
> + 
> diff --git a/patches/lmbench-3.0-a9/lmbench-3.0-a9-fix_socklen_t.diff 
> b/patches/lmbench-3.0-a9/lmbench-3.0-a9-fix_socklen_t.diff
> new file mode 100644
> index 000000000..e1cba8373
> --- /dev/null
> +++ b/patches/lmbench-3.0-a9/lmbench-3.0-a9-fix_socklen_t.diff
> @@ -0,0 +1,19 @@
> +commit eacfb4af1ecfafa1a0486643c81f313eb183eaa8
> +Author: Sven Püschel <[email protected]>
> +Date:   Wed Feb 1 08:54:07 2023 +0000
> +
> +    Added missing include for socklen_t check
> +
> +diff --git a/configure.ac b/configure.ac
> +index 415203b..c29e794 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -100,7 +100,7 @@ AC_CHECK_TYPE([uint64],[CFLAGS="${CFLAGS} 
> -DHAVE_uint64"])
> + AC_CHECK_TYPE([uint64_t],[CFLAGS="${CFLAGS} -DHAVE_uint64_t"])
> + AC_CHECK_TYPE([int64],[CFLAGS="${CFLAGS} -DHAVE_int64"])
> + AC_CHECK_TYPE([int64_t],[CFLAGS="${CFLAGS} -DHAVE_int64_t"])
> +-AC_CHECK_TYPE([socklen_t],[CFLAGS="${CFLAGS} -DHAVE_socklen_t"])
> ++AC_CHECK_TYPE([socklen_t],[CFLAGS="${CFLAGS} -DHAVE_socklen_t"], [], 
> [[#include <sys/socket.h>]])
> + AC_CHECK_TYPE([off64_t],[CFLAGS="${CFLAGS} -DHAVE_off64_t"])
> + 
> + AC_COMPILE_IFELSE(
> diff --git a/patches/lmbench-3.0-a9/series b/patches/lmbench-3.0-a9/series
> index 0c4ffef30..b2a777897 100644
> --- a/patches/lmbench-3.0-a9/series
> +++ b/patches/lmbench-3.0-a9/series
> @@ -1,3 +1,5 @@
>  lmbench-3.0-a9-remove-old-buildsystem.diff
>  lmbench-3.0-a9-autotoolize.diff
>  lmbench-3.0-a9-rpcheaders.diff
> +lmbench-3.0-a9-add-libtirpc.diff
> +lmbench-3.0-a9-fix_socklen_t.diff

Please regenerate the patches with 'git ptx-patches'.

> diff --git a/rules/lmbench.in b/rules/lmbench.in
> index f3d78e8e6..2e6d5fbcb 100644
> --- a/rules/lmbench.in
> +++ b/rules/lmbench.in
> @@ -1,14 +1,11 @@
> -## SECTION=staging
> -## old section:
> -### SECTION=test_suites
> +## SECTION=test_suites
>  
>  config LMBENCH
>       tristate
>       select LIBC_M
>       select GCCLIBS_GCC_S
> +     # glibc has removed the SunRPC implementation, see 
> https://fedoraproject.org/wiki/Changes/SunRPCRemoval, therefore we use 
> libtirpc

I don't think wee need that comment here. None of the other users have it.
Add this to the patch description instead.

Michael

> +     select LIBTIRPC
>       prompt "lmbench"
>       help
>         Various tools for performance analysis
> -
> -       STAGING: remove in PTXdist 2022.01.0
> -       Upstream dead and fails to build with gcc 10.
> -- 
> 2.30.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Reply via email to