public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Lars Wendler" <polynomial-c@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
Date: Sat, 10 Jul 2021 21:31:47 +0000 (UTC)	[thread overview]
Message-ID: <1625952701.f97eb250b55904388c542a546ec048f239f89b5c.polynomial-c@gentoo> (raw)

commit:     f97eb250b55904388c542a546ec048f239f89b5c
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 10 21:24:33 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Jul 10 21:31:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f97eb250

sys-apps/util-linux: Attempt fix build with sys-libs/libxcrypt[-abi_x86_32]

Bug: https://bugs.gentoo.org/801403
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../files/util-linux-2.37-avoid_autoreconf.patch   | 136 +++++++++++++++++++++
 .../files/util-linux-2.37-lcrypt_link_fix.patch    |  50 ++++++++
 .../files/util-linux-2.37-lcrypt_use_LIBS.patch    |  91 ++++++++++++++
 sys-apps/util-linux/util-linux-2.37.ebuild         |   4 +
 4 files changed, 281 insertions(+)

diff --git a/sys-apps/util-linux/files/util-linux-2.37-avoid_autoreconf.patch b/sys-apps/util-linux/files/util-linux-2.37-avoid_autoreconf.patch
new file mode 100644
index 00000000000..44ea6e5c2be
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.37-avoid_autoreconf.patch
@@ -0,0 +1,136 @@
+--- util-linux-2.37/config.h.in
++++ util-linux-2.37/config.h.in
+@@ -216,9 +216,6 @@
+ /* Define to 1 if you have the `cap-ng' library (-lcap-ng). */
+ #undef HAVE_LIBCAP_NG
+ 
+-/* Do we need -lcrypt? */
+-#undef HAVE_LIBCRYPT
+-
+ /* Define if libeconf is available */
+ #undef HAVE_LIBECONF
+ 
+--- util-linux-2.37/configure
++++ util-linux-2.37/configure
+@@ -4965,12 +4965,7 @@
+ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+ 
+ if test x"${MISSING+set}" != xset; then
+-  case $am_aux_dir in
+-  *\ * | *\	*)
+-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+-  *)
+-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+-  esac
++  MISSING="\${SHELL} '$am_aux_dir/missing'"
+ fi
+ # Use eval to expand $SHELL
+ if eval "$MISSING --is-lightweight"; then
+@@ -25591,7 +25586,10 @@
+ 
+ else
+ 
++
++  old_LIBS="$LIBS"
+   LIBS="$LIBS -lcrypt"
++
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+@@ -25612,10 +25610,7 @@
+   return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_compile "$LINENO"; then :
+-
+-
+-$as_echo "#define HAVE_LIBCRYPT 1" >>confdefs.h
++if ac_fn_c_try_link "$LINENO"; then :
+ 
+   have_libcrypt=yes
+   have_crypt=yes
+@@ -25626,7 +25621,11 @@
+ $as_echo "$as_me: WARNING: crypt() is not available" >&2;}
+ 
+ fi
+-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++rm -f core conftest.err conftest.$ac_objext \
++    conftest$ac_exeext conftest.$ac_ext
++
++  LIBS="$old_LIBS"
++
+ 
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+@@ -25768,12 +25767,8 @@
+ 
+ 
+ 
+-  old_CFLAGS="$CFLAGS"
+-  old_CPPFLAGS="$CPPFLAGS"
+-  old_LDFLAGS="$LDFLAGS"
+-  CFLAGS="$CFLAGS "
+-  CPPFLAGS="$CPPFLAGS "
+-  LDFLAGS="$LDFLAGS $SELINUX_LIBS"
++  old_LIBS="$LIBS"
++  LIBS="$LIBS $SELINUX_LIBS"
+ 
+     # This function is missing in old libselinux 1.xx versions
+     for ac_func in security_get_initial_context
+@@ -25788,9 +25783,7 @@
+ done
+ 
+ 
+-  CFLAGS="$old_CFLAGS"
+-  CPPFLAGS="$old_CPPFLAGS"
+-  LDFLAGS="$old_LDFLAGS"
++  LIBS="$old_LIBS"
+ 
+ 
+ fi
+--- util-linux-2.37/Makefile.in
++++ util-linux-2.37/Makefile.in
+@@ -1,4 +1,4 @@
+-# Makefile.in generated by automake 1.16.2 from Makefile.am.
++# Makefile.in generated by automake 1.16.3 from Makefile.am.
+ # @configure_input@
+ 
+ # Copyright (C) 1994-2020 Free Software Foundation, Inc.
+@@ -4649,6 +4649,8 @@
+ GZIP_ENV = --best
+ DIST_ARCHIVES = $(distdir).tar.xz
+ DIST_TARGETS = dist-xz
++# Exists only to be overridden by the user if desired.
++AM_DISTCHECK_DVI_TARGET = dvi
+ distuninstallcheck_listfiles = find . -type f -print
+ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+@@ -14854,7 +14856,7 @@
+ 	    $(DISTCHECK_CONFIGURE_FLAGS) \
+ 	    --srcdir=../.. --prefix="$$dc_install_base" \
+ 	  && $(MAKE) $(AM_MAKEFLAGS) \
+-	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
++	  && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
+ 	  && $(MAKE) $(AM_MAKEFLAGS) check \
+ 	  && $(MAKE) $(AM_MAKEFLAGS) install \
+ 	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+@@ -14920,7 +14922,8 @@
+ 	done
+ install: $(BUILT_SOURCES)
+ 	$(MAKE) $(AM_MAKEFLAGS) install-recursive
+-install-exec: install-exec-recursive
++install-exec: $(BUILT_SOURCES)
++	$(MAKE) $(AM_MAKEFLAGS) install-exec-recursive
+ install-data: install-data-recursive
+ uninstall: uninstall-recursive
+ 
+@@ -16157,7 +16160,8 @@
+ 	uninstall-man8
+ 
+ .MAKE: $(am__recursive_targets) all check check-am install install-am \
+-	install-data-am install-exec-am install-strip uninstall-am
++	install-data-am install-exec install-exec-am install-strip \
++	uninstall-am
+ 
+ .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ 	am--depfiles am--refresh check check-am check-local clean \

diff --git a/sys-apps/util-linux/files/util-linux-2.37-lcrypt_link_fix.patch b/sys-apps/util-linux/files/util-linux-2.37-lcrypt_link_fix.patch
new file mode 100644
index 00000000000..2da99b2841d
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.37-lcrypt_link_fix.patch
@@ -0,0 +1,50 @@
+From 637cc045ee464909c261d6fa16c71ed15cd455e3 Mon Sep 17 00:00:00 2001
+From: Alex Xu <351006+Hello71@users.noreply.github.com>
+Date: Wed, 16 Jun 2021 13:58:25 +0000
+Subject: [PATCH] build-sys: Update configure.ac
+
+1. the test incorrectly used AC_COMPILE_IFELSE instead of
+   AC_LINK_IFELSE, defeating the purpose of checking -lcrypt.
+2. the test did not properly restore LIBS, causing later checks to all
+   fail if libcrypt wasn't found.
+3. HAVE_LIBCRYPT only controls whether to use -lcrypt, it is not
+   needed or used in any source files.
+
+[kzak@redhat.com: - improve commit message
+                  - use UL_{SET,RESTORE}_FLAGS() rather than directly
+		    modify $LIBS]
+
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5181d524c..939c6d2d3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -845,8 +845,8 @@ char *c = crypt("abc","pw");
+   have_libcrypt=no
+   have_crypt=yes
+ ],[
+-  LIBS="$LIBS -lcrypt"
+-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
++  UL_SET_FLAGS([], [], [-lcrypt])
++  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+   #ifdef HAVE_CRYPT_H
+   #include <crypt.h>
+   #else
+@@ -856,12 +856,12 @@ char *c = crypt("abc","pw");
+   ]], [[
+   char *c = crypt("abc","pw");
+   ]])],[
+-  AC_DEFINE([HAVE_LIBCRYPT], [1], [Do we need -lcrypt?])
+   have_libcrypt=yes
+   have_crypt=yes
+   ],[
+   AC_MSG_WARN([crypt() is not available])
+   ])
++  UL_RESTORE_FLAGS
+ ])
+ AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
+ 

diff --git a/sys-apps/util-linux/files/util-linux-2.37-lcrypt_use_LIBS.patch b/sys-apps/util-linux/files/util-linux-2.37-lcrypt_use_LIBS.patch
new file mode 100644
index 00000000000..2173195be61
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.37-lcrypt_use_LIBS.patch
@@ -0,0 +1,91 @@
+From 75cba8d5cdb2a0e84c23de26007feac977837a6f Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Fri, 18 Jun 2021 17:21:13 +0200
+Subject: [PATCH] build-sys: use $LIBS rather than LDFLAGS
+
+Fixes: https://github.com/karelzak/util-linux/pull/1349
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ configure.ac |  8 ++++----
+ m4/ul.m4     | 29 +++++++++++------------------
+ 2 files changed, 15 insertions(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 939c6d2d3..234cebc68 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -845,7 +845,7 @@ char *c = crypt("abc","pw");
+   have_libcrypt=no
+   have_crypt=yes
+ ],[
+-  UL_SET_FLAGS([], [], [-lcrypt])
++  UL_SET_LIBS([-lcrypt])
+   AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+   #ifdef HAVE_CRYPT_H
+   #include <crypt.h>
+@@ -861,7 +861,7 @@ char *c = crypt("abc","pw");
+   ],[
+   AC_MSG_WARN([crypt() is not available])
+   ])
+-  UL_RESTORE_FLAGS
++  UL_RESTORE_LIBS
+ ])
+ AM_CONDITIONAL([HAVE_LIBCRYPT], [test "x$have_libcrypt" = xyes])
+ 
+@@ -883,10 +883,10 @@ AS_IF([test "x$with_selinux" = xno], [
+     UL_PKG_STATIC([SELINUX_LIBS_STATIC], [libselinux])
+     AM_CONDITIONAL([HAVE_SELINUX], [true])
+ 
+-    UL_SET_FLAGS([], [], [$SELINUX_LIBS])
++    UL_SET_LIBS([$SELINUX_LIBS])
+     # This function is missing in old libselinux 1.xx versions
+     AC_CHECK_FUNCS([security_get_initial_context])
+-    UL_RESTORE_FLAGS
++    UL_RESTORE_LIBS
+   ])
+ ])
+ AC_SUBST([SELINUX_LIBS])
+diff --git a/m4/ul.m4 b/m4/ul.m4
+index 951db7371..724579462 100644
+--- a/m4/ul.m4
++++ b/m4/ul.m4
+@@ -67,28 +67,21 @@ AC_DEFUN([UL_SET_ARCH], [
+ ])
+ 
+ 
+-dnl UL_SET_FLAGS(CFLAGS, CPPFLAGS, LDFLAGS)
+-dnl
+-dnl Sets new global CFLAGS, CPPFLAGS and LDFLAG, the original
+-dnl setting could be restored by UL_RESTORE_FLAGS()
+-dnl
+-AC_DEFUN([UL_SET_FLAGS], [
+-  old_CFLAGS="$CFLAGS"
+-  old_CPPFLAGS="$CPPFLAGS"
+-  old_LDFLAGS="$LDFLAGS"
+-  CFLAGS="$CFLAGS $1"
+-  CPPFLAGS="$CPPFLAGS $2"
+-  LDFLAGS="$LDFLAGS $3"
++dnl UL_SET_LIBS(LIBS)
++dnl
++dnl Sets new global LIBS, the original setting could be restored by UL_RESTORE_LIBS()
++dnl
++AC_DEFUN([UL_SET_LIBS], [
++  old_LIBS="$LIBS"
++  LIBS="$LIBS $1"
+ ])
+ 
+-dnl UL_RESTORE_FLAGS()
++dnl UL_RESTORE_LIBS()
+ dnl
+-dnl Restores CFLAGS, CPPFLAGS and LDFLAG previously saved by UL_SET_FLAGS()
++dnl Restores LIBS previously saved by UL_SET_LIBS()
+ dnl
+-AC_DEFUN([UL_RESTORE_FLAGS], [
+-  CFLAGS="$old_CFLAGS"
+-  CPPFLAGS="$old_CPPFLAGS"
+-  LDFLAGS="$old_LDFLAGS"
++AC_DEFUN([UL_RESTORE_LIBS], [
++  LIBS="$old_LIBS"
+ ])
+ 
+ 

diff --git a/sys-apps/util-linux/util-linux-2.37.ebuild b/sys-apps/util-linux/util-linux-2.37.ebuild
index 2b3ff76f988..e12e9483062 100644
--- a/sys-apps/util-linux/util-linux-2.37.ebuild
+++ b/sys-apps/util-linux/util-linux-2.37.ebuild
@@ -90,6 +90,10 @@ S="${WORKDIR}/${MY_P}"
 PATCHES=(
 	# https://github.com/karelzak/util-linux/pull/1329
 	"${FILESDIR}/${P}-ppc-nortas.patch"
+
+	"${FILESDIR}/${P}-lcrypt_link_fix.patch" # 801403
+	"${FILESDIR}/${P}-lcrypt_use_LIBS.patch" # 801403
+	"${FILESDIR}/${P}-avoid_autoreconf.patch" # 801403
 )
 
 rm_man() {


             reply	other threads:[~2021-07-10 21:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 21:31 Lars Wendler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-08  6:59 [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/, sys-apps/util-linux/files/ Sam James
2024-05-20 15:06 Mike Gilbert
2024-05-11 17:19 Mike Gilbert
2024-04-04  1:17 Sam James
2024-03-28  4:55 Sam James
2024-03-22  0:12 Matt Turner
2023-12-28  2:57 Sam James
2023-05-26  7:24 Sam James
2023-05-23  4:20 Sam James
2023-05-23  3:14 Sam James
2023-03-19  6:07 Sam James
2023-02-09  3:54 Sam James
2022-01-24 16:02 Sam James
2021-10-03 11:28 David Seifert
2021-08-16 14:02 Lars Wendler
2021-08-11 12:30 Lars Wendler
2021-07-30 12:21 Marek Szuba
2021-06-02 21:14 Georgy Yakovlev
2021-05-23 12:14 David Seifert
2020-12-22 14:43 Andreas K. Hüttel
2020-11-16 17:36 Lars Wendler
2020-03-25 14:14 Thomas Deutschmann
2019-05-31  0:58 Lars Wendler
2018-12-29 17:45 Mikle Kolyada
2018-07-13 16:41 Patrick McLean
2018-04-10 19:29 Thomas Deutschmann
2017-12-17 15:48 Lars Wendler
2017-06-09  1:19 Lars Wendler
2017-01-21  0:36 Lars Wendler
2015-09-07 20:02 Lars Wendler
2015-09-07 18:30 Michał Górny
2015-09-07 14:37 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1625952701.f97eb250b55904388c542a546ec048f239f89b5c.polynomial-c@gentoo \
    --to=polynomial-c@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox