commit:     763fa743d6d6c80130ef82a8153d814d1b620220
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  9 02:18:07 2025 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Thu Jan  9 02:18:07 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=763fa743

sys-auth/pam_ssh_agent_auth: fix -Wincompatible-pointer-types, unknown argument 
'-Wl,-O1'

Patches are taken from Debian and GH PR.
Debian Patch updated by Grant Taylor.

Closes: https://bugs.gentoo.org/920275
Closes: https://bugs.gentoo.org/741927
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 ...auth-0.10.4-0003-Fix-incompatible-pointer.patch | 46 ++++++++++++++++++++++
 ...agent_auth-0.10.4-0004-Always-call-linker.patch | 44 +++++++++++++++++++++
 .../pam_ssh_agent_auth-0.10.4-r1.ebuild            |  4 +-
 .../pam_ssh_agent_auth-9999.ebuild                 |  4 +-
 4 files changed, 96 insertions(+), 2 deletions(-)

diff --git 
a/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0003-Fix-incompatible-pointer.patch
 
b/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0003-Fix-incompatible-pointer.patch
new file mode 100644
index 000000000000..580e903c0c18
--- /dev/null
+++ 
b/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0003-Fix-incompatible-pointer.patch
@@ -0,0 +1,46 @@
+Description: Avoided incompatible pointer passing to fix GCC 14 build errors.
+ Add missing 'const', cast to expected pointer type (DSA_SIG) and avoid
+ pointer to pointer when pointer is required.
+ Updated for Gentoo.
+Author: Petter Reinholdtsen <[email protected]>
+Bug-Debian: https://bugs.debian.org/1075358
+Forwarded: no
+Last-Update: 2024-11-05
+---
+--- a/ssh-ecdsa.c
++++ b/ssh-ecdsa.c
+@@ -73,7 +73,7 @@ ssh_ecdsa_sign(const Key *key, u_char **
+     if (pamsshagentauth_buffer_get_bignum2_ret(&bb, sig->r) == -1 ||
+         pamsshagentauth_buffer_get_bignum2_ret(&bb, sig->s) == -1) {
+ #else
+-    DSA_SIG_get0(sig, &r, &s);
++    DSA_SIG_get0((const DSA_SIG*)sig, (const BIGNUM **)&r, (const BIGNUM 
**)&s);
+     if (pamsshagentauth_buffer_get_bignum2_ret(&bb, r) == -1 ||
+         pamsshagentauth_buffer_get_bignum2_ret(&bb, s) == -1) {
+ #endif
+--- a/ssh-rsa.c
++++ b/ssh-rsa.c
+@@ -56,9 +56,9 @@ ssh_rsa_sign(const Key *key, u_char **si
+               return -1;
+       }
+       md = EVP_MD_CTX_create();
+-      EVP_DigestInit(&md, evp_md);
+-      EVP_DigestUpdate(&md, data, datalen);
+-      EVP_DigestFinal(&md, digest, &dlen);
++      EVP_DigestInit(md, evp_md);
++      EVP_DigestUpdate(md, data, datalen);
++      EVP_DigestFinal(md, digest, &dlen);
+ 
+       slen = RSA_size(key->rsa);
+       sig = pamsshagentauth_xmalloc(slen);
+--- a/ssh-ecdsa.c
++++ b/ssh-ecdsa.c
+@@ -145,7 +145,7 @@
+     if ((pamsshagentauth_buffer_get_bignum2_ret(&b, sig->r) == -1) ||
+         (pamsshagentauth_buffer_get_bignum2_ret(&b, sig->s) == -1))
+ #else
+-    DSA_SIG_get0(sig, &r, &s);
++    DSA_SIG_get0((const DSA_SIG*)sig, (const BIGNUM **)&r, (const BIGNUM 
**)&s);
+     if ((pamsshagentauth_buffer_get_bignum2_ret(&b, r) == -1) ||
+         (pamsshagentauth_buffer_get_bignum2_ret(&b, s) == -1))
+ #endif

diff --git 
a/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0004-Always-call-linker.patch
 
b/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0004-Always-call-linker.patch
new file mode 100644
index 000000000000..81d857f4182d
--- /dev/null
+++ 
b/sys-auth/pam_ssh_agent_auth/files/pam_ssh_agent_auth-0.10.4-0004-Always-call-linker.patch
@@ -0,0 +1,44 @@
+From 465a30ec74c5053ac93ecd58d71427a3e2b4f393 Mon Sep 17 00:00:00 2001
+From: Peter Levine <[email protected]>
+Date: Sun, 18 Dec 2022 21:19:39 -0500
+Subject: [PATCH] Always use the compiler to call the linker
+
+Let the compiler call the linker to handle LDFLAGS correctly.
+---
+ configure    | 5 +----
+ configure.ac | 6 +-----
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/configure b/configure
+index 0090b34..ca8cd7f 100755
+--- a/configure
++++ b/configure
+@@ -7577,10 +7577,7 @@ _ACEOF
+ 
+ fi
+ 
+-if test -z "$LD" ; then
+-      LD=$CC
+-fi
+-
++LD=$CC
+ 
+ 
+ ac_fn_c_check_decl "$LINENO" "LLONG_MAX" "ac_cv_have_decl_LLONG_MAX" 
"#include <limits.h>
+diff --git a/configure.ac b/configure.ac
+index 6496679..7cfd8fc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -116,11 +116,7 @@ if test ! -z "$PATH_PASSWD_PROG" ; then
+               [Full path of your "passwd" program])
+ fi
+ 
+-if test -z "$LD" ; then
+-      LD=$CC
+-fi
+-AC_SUBST(LD)
+-
++AC_SUBST(LD, $CC)
+ 
+ AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include <limits.h>])
+ 

diff --git a/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-0.10.4-r1.ebuild 
b/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-0.10.4-r1.ebuild
index d09b0fea56c1..aa7b2e61f595 100644
--- a/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-0.10.4-r1.ebuild
+++ b/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-0.10.4-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -36,6 +36,8 @@ BDEPEND="dev-lang/perl"
 PATCHES=(
        
"${FILESDIR}"/${PN}-0.10.4-0001-Fix-function-prototypes-in-configure.patch
        
"${FILESDIR}"/${PN}-0.10.4-0002-Add-missing-includes-implicit-function-declarations.patch
+       "${FILESDIR}"/${PN}-0.10.4-0003-Fix-incompatible-pointer.patch
+       "${FILESDIR}"/${PN}-0.10.4-0004-Always-call-linker.patch
 )
 
 src_prepare() {

diff --git a/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-9999.ebuild 
b/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-9999.ebuild
index d633a44c02ec..501e1ff7f51a 100644
--- a/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-9999.ebuild
+++ b/sys-auth/pam_ssh_agent_auth/pam_ssh_agent_auth-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -36,6 +36,8 @@ BDEPEND="dev-lang/perl"
 PATCHES=(
        
"${FILESDIR}"/${PN}-0.10.4-0001-Fix-function-prototypes-in-configure.patch
        
"${FILESDIR}"/${PN}-0.10.4-0002-Add-missing-includes-implicit-function-declarations.patch
+       "${FILESDIR}"/${PN}-0.10.4-0003-Fix-incompatible-pointer.patch
+       "${FILESDIR}"/${PN}-0.10.4-0004-Always-call-linker.patch
 )
 
 src_prepare() {

Reply via email to