commit:     0def201e473c328b78ea35c34bb1caa7b4585ce3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 30 23:01:28 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 30 23:01:28 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0def201e

app-misc/remind: don't force LTO

Users should enable LTO via *FLAGS, configure shouldn't force it.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-misc/remind/files/remind-06.02.01-no-lto.patch | 48 ++++++++++++++++++++++
 app-misc/remind/remind-06.02.01.ebuild             | 12 ++++++
 2 files changed, 60 insertions(+)

diff --git a/app-misc/remind/files/remind-06.02.01-no-lto.patch 
b/app-misc/remind/files/remind-06.02.01-no-lto.patch
new file mode 100644
index 000000000000..1761a3a9f120
--- /dev/null
+++ b/app-misc/remind/files/remind-06.02.01-no-lto.patch
@@ -0,0 +1,48 @@
+Don't automagically enable LTO. Users can enable that if they want via
+*FLAGS.
+--- a/configure.ac
++++ b/configure.ac
+@@ -46,43 +46,6 @@ dnl Checks for typedefs, structures, and compiler 
characteristics.
+ AC_STRUCT_TM
+ U="`uname -s`"
+ 
+-# LTO fails on Solaris for some reason
+-if test "$U" != "SunOS" -a "$GCC" = yes; then
+-      CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
+-        # Check for link-time optimization support
+-        OLDCFLAGS="$CFLAGS"
+-        CFLAGS="$CFLAGS -flto=auto"
+-        AC_MSG_CHECKING([whether $CC supports -flto=auto])
+-        AC_LINK_IFELSE(
+-            [AC_LANG_PROGRAM(
+-               [[int x = 1;]],
+-               [[]])],
+-               [lto=yes],
+-               [lto=no]
+-               )
+-        AC_MSG_RESULT([$lto])
+-        if test "x$lto" != "xyes" ; then
+-          CFLAGS="$OLDCFLAGS"
+-        else
+-            AC_MSG_CHECKING([whether $CC supports -ffat-lto-object])
+-            OLDCFLAGS="$CFLAGS"
+-            CFLAGS="$CFLAGS -Werror -ffat-lto-objects"
+-            AC_LINK_IFELSE(
+-                [AC_LANG_PROGRAM(
+-                    [[int x = 1;]],
+-                    [[]])],
+-                [lto=yes],
+-                [lto=no]
+-                )
+-            AC_MSG_RESULT([$lto])
+-            if test "x$lto" != "xyes" ; then
+-                CFLAGS="$OLDCFLAGS"
+-            else
+-                CFLAGS="$OLDCFLAGS -ffat-lto-objects"
+-            fi
+-        fi
+-fi
+-
+ dnl If sizeof(time_t) is 4, try to get 64-bit time_t
+ if test "$ac_cv_sizeof_time_t" = "4" ; then
+     AC_MSG_NOTICE([time_t is 32-bits on this system; attempting to use 64-bit 
time_t])

diff --git a/app-misc/remind/remind-06.02.01.ebuild 
b/app-misc/remind/remind-06.02.01.ebuild
index 8478935f7be7..96b057defe3e 100644
--- a/app-misc/remind/remind-06.02.01.ebuild
+++ b/app-misc/remind/remind-06.02.01.ebuild
@@ -3,6 +3,8 @@
 
 EAPI=8
 
+inherit autotools
+
 DESCRIPTION="Ridiculously functional reminder program"
 HOMEPAGE="https://dianne.skoll.ca/projects/remind/";
 SRC_URI="https://dianne.skoll.ca/projects/remind/download/${P}.tar.gz";
@@ -23,6 +25,16 @@ DEPEND="${RDEPEND}
 "
 DOCS="docs/* examples/defs.rem"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-06.02.01-no-lto.patch
+)
+
+src_prepare() {
+       default
+       # for LTO patch
+       eautoreconf
+}
+
 src_test() {
        if [[ ${EUID} -eq 0 ]] ; then
                ewarn "Testing fails if run as root. Skipping tests"

Reply via email to