app-shells/smrsh: fix compilation for musl, c23/gcc-15

The value ```-DXDEBUG=0``` was fixed in the ```site.config.m4``` file, and now
it's in the ebuild file. In order to support musl, we need to add a new value
to the ```confENVDEF``` define.

Closes: https://bugs.gentoo.org/715280
Closes: https://bugs.gentoo.org/944460
Signed-off-by: Cristian Othón Martínez Vera <cfuga@cfuga.mx>
Part-of: https://github.com/gentoo/gentoo/pull/41538
Closes: https://github.com/gentoo/gentoo/pull/41538
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Cristian Othón Martínez Vera
2025-04-11 11:48:21 -06:00
committed by Sam James
parent 37d3847717
commit ed7c31f894
5 changed files with 61 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
define(`confCCOPTS', `@@confCCOPTS@@')
define(`confSTDIO_TYPE', `portable')
define(`confENVDEF', `-DXDEBUG=0')
define(`confENVDEF', `@@confENVDEF@@')
define(`confLDOPTS', `@@confLDOPTS@@')
define(`confMANOWN', `root')
define(`confMANGRP', `root')

View File

@@ -0,0 +1,29 @@
Bug: https://bugs.gentoo.org/944460
--- a/libsm/vfscanf.c
+++ b/libsm/vfscanf.c
@@ -240,13 +240,13 @@
/* FALLTHROUGH */
case 'd':
c = CT_INT;
- ccfn = (ULONGLONG_T (*)())sm_strtoll;
+ ccfn = (ULONGLONG_T (*)(const char *, char **, int))sm_strtoll;
base = 10;
break;
case 'i':
c = CT_INT;
- ccfn = (ULONGLONG_T (*)())sm_strtoll;
+ ccfn = (ULONGLONG_T (*)(const char *, char **, int))sm_strtoll;
base = 0;
break;
@@ -324,7 +324,7 @@
if (isupper(c))
flags |= LONG;
c = CT_INT;
- ccfn = (ULONGLONG_T (*)()) sm_strtoll;
+ ccfn = (ULONGLONG_T (*)(const char *, char **, int)) sm_strtoll;
base = 10;
break;
}

View File

@@ -0,0 +1,11 @@
--- a/include/sm/os/sm_os_linux.h 2020-06-09 11:57:46.789786561 +0200
+++ b/include/sm/os/sm_os_linux.h 2020-06-09 11:57:49.174781812 +0200
@@ -33,7 +33,7 @@
# endif /* LINUX_VERSION_CODE */
#endif /* SM_CONF_SHM */
-#define SM_CONF_SYS_CDEFS_H 1
+#define SM_CONF_SYS_CDEFS_H 0
#ifndef SM_CONF_SEM
# define SM_CONF_SEM 2
#endif /* SM_CONF_SEM */

View File

@@ -26,6 +26,15 @@ DEPEND="${RDEPEND}
sys-devel/m4"
src_prepare() {
local confENVDEF="-DXDEBUG=0"
eapply "${FILESDIR}"/${PN}-8.18.1-c23-sm_strtoll.patch
if use elibc_musl; then
eapply "${FILESDIR}"/${PN}-musl-disable-cdefs.patch
confENVDEF+=" -DHASSTRERROR"
fi
cd "${S}/${PN}" || die
default
@@ -36,6 +45,7 @@ src_prepare() {
sed -e "s|@@confCCOPTS@@|${CFLAGS}|" \
-e "s|@@confLDOPTS@@|${LDFLAGS}|" \
-e "s|@@confENVDEF@@|${confENVDEF}|" \
-e "s:@@confCC@@:$(tc-getCC):" "${FILESDIR}/site.config.m4" \
> "${S}/devtools/Site/site.config.m4" || die "sed failed"
}

View File

@@ -26,6 +26,15 @@ DEPEND="${RDEPEND}
sys-devel/m4"
src_prepare() {
local confENVDEF="-DXDEBUG=0"
eapply "${FILESDIR}"/${PN}-8.18.1-c23-sm_strtoll.patch
if use elibc_musl; then
eapply "${FILESDIR}"/${PN}-musl-disable-cdefs.patch
confENVDEF+=" -DHASSTRERROR"
fi
cd "${S}/${PN}" || die
default
@@ -36,6 +45,7 @@ src_prepare() {
sed -e "s|@@confCCOPTS@@|${CFLAGS}|" \
-e "s|@@confLDOPTS@@|${LDFLAGS}|" \
-e "s|@@confENVDEF@@|${confENVDEF}|" \
-e "s:@@confCC@@:$(tc-getCC):" "${FILESDIR}/site.config.m4" \
> "${S}/devtools/Site/site.config.m4" || die "sed failed"
}