From nobody Fri Dec 08 23:30:59 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sn6pC2n3Dz53c1h; Fri, 8 Dec 2023 23:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sn6pC2LPWz3DTn; Fri, 8 Dec 2023 23:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702078259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=26RUj2s2z56OTMPxTgBV9u2009DuRfi/yABZgTq92ss=; b=foJaQN8CaxTj9ELtNo6lwBAU7qpiZWY9wvgxJwWvnzi66aOLK2WnL9p+/yPeMfVlprpmIk b7+zWtFzO91iCVxvaE6u0rsCQ3i5scOK7Rq+RIW3oH0SVFdzEgE8wJuqW8XVOrp45RtmYt 5un4rIVqE+VZtj85wp0cjzD4DyRbIvXgvnWQ9wMXd27qX/i+/TMEoZlPFXznBp3ugJU04D 9cogq/k6hFkYvVxquXpqAUnPtOJW6YCG9HaKpK93huiDyUygO5m3wdbyAoeX8W/yI0Qrei oslKx7q9mY1EFRS0hbPD5XpX/j3sqHtOMeqPMDAo1d/VWHO7/OC+q16o3qwo/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702078259; a=rsa-sha256; cv=none; b=fxX8HYE1B+73I0Ahz7CzWBXpaOSPTsTAwwc/o58Td1x7dWnCOT9lwK9NZYgnTfSrT5DgT0 hMGfTbLzd2gHWGb0yIsBMoHKKFtcUVc9jQoLtA03mh3bBDqHDFeaaAwwEivIP9iISx8OcR kG+jKi5wCygCBvqqtSqF6lf/1H+J5DH6tjXMPf8QyUgt1fGMi2CLXMUc2n87qPwaG/7EN3 ntYweuvkNOqH1f1eo+MIe2VbLZybv/yumtybrQVehk1v0h4Q0wb4VJT769FnqO8Bz8haSO glF/sxQIxwv9X3YUFV6q+JA8fBX191aqnDHN7AOPhzGYrmF996meNWMmKVBXOw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702078259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=26RUj2s2z56OTMPxTgBV9u2009DuRfi/yABZgTq92ss=; b=fFFpQ3mO0qeVC9/1CX/OVB/rRlsXvWQmXuZn2Ka/Pe4rGDn9ohSPFRvG4y4naSzHEL7QpL 1BX5BHRJvA2CBwM/CXRPlTQmlOiejj5ZlA7gvRcD+dViiwaxK0zWrKSTf+Qiomgny/74XO 3FQfjGyVY4IUvZXJMV0XkpX1CPtnO40WT8JO5bdvDvngHG8HmxQkkB3k2pqEvLHkqGW137 S07en2IocGGuJp5cmk2XnMEpSxE3iZDTxvc3lIOviV44PVKwy7tFgOPywyn/0LfzfVQDkj QW6w6nOdGfqQcozaMNbXv/xj7pWppE2iOm6MTpB3agB5aYRg0A+W5xtYwO7RkQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sn6pC1SZjzgqb; Fri, 8 Dec 2023 23:30:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3B8NUxxr067289; Fri, 8 Dec 2023 23:30:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3B8NUxqO067286; Fri, 8 Dec 2023 23:30:59 GMT (envelope-from git) Date: Fri, 8 Dec 2023 23:30:59 GMT Message-Id: <202312082330.3B8NUxqO067286@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Brooks Davis Subject: git: 7723e73e5ee5 - main - irc/irc: remove unneeded sbrk use List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7723e73e5ee58e3afbb05cb4423729914d04491d Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/ports/commit/?id=7723e73e5ee58e3afbb05cb4423729914d04491d commit 7723e73e5ee58e3afbb05cb4423729914d04491d Author: Brooks Davis AuthorDate: 2023-12-06 19:41:25 +0000 Commit: Brooks Davis CommitDate: 2023-12-08 23:24:17 +0000 irc/irc: remove unneeded sbrk use It's use to print heap use, but it's often not correct for modern allocators. This should permit builds on aarch64 and riscv. --- irc/irc/Makefile | 4 +--- irc/irc/files/patch-ircd_ircd.c | 42 ++++++++++++++++++++++++++++++++++++ irc/irc/files/patch-ircd_ircd__ext.h | 10 +++++++++ irc/irc/files/patch-ircd_s__debug.c | 14 ++++++++++++ 4 files changed, 67 insertions(+), 3 deletions(-) diff --git a/irc/irc/Makefile b/irc/irc/Makefile index 3aaea6194111..a7963f4d4b9a 100644 --- a/irc/irc/Makefile +++ b/irc/irc/Makefile @@ -1,5 +1,6 @@ PORTNAME= irc PORTVERSION= 2.11.2p3 +PORTREVISION= 1 CATEGORIES= irc MASTER_SITES= http://ftp.irc.org/ftp/irc/server/ \ ftp://ftp.archive.de.uu.net/pub/mirrors/ftp.irc.org/server/ \ @@ -9,9 +10,6 @@ DISTNAME= ${PORTNAME}${PORTVERSION} MAINTAINER= ports@FreeBSD.org COMMENT= The "Internet Relay Chat" Server -BROKEN_aarch64= Fails to link: missing sbrk -BROKEN_riscv64= Fails to link: missing sbrk - CONFLICTS_INSTALL= charybdis ircd-hybrid Nefarious \ ru-ircd-hybrid ircd-ru diff --git a/irc/irc/files/patch-ircd_ircd.c b/irc/irc/files/patch-ircd_ircd.c new file mode 100644 index 000000000000..659cd6f62620 --- /dev/null +++ b/irc/irc/files/patch-ircd_ircd.c @@ -0,0 +1,42 @@ +--- ircd/ircd.c.orig 2023-12-06 19:33:28 UTC ++++ ircd/ircd.c +@@ -49,7 +49,6 @@ char *debugmode = ""; /* -"- -"- -"- -"- */ + int firstrejoindone = 0; /* Server rejoined the network after + start */ + char *debugmode = ""; /* -"- -"- -"- -"- */ +-char *sbrk0; /* initial sbrk(0) */ + char *tunefile = IRCDTUNE_PATH; + volatile static int dorehash = 0, + dorestart = 0, +@@ -140,11 +139,9 @@ void restart(char *mesg) + void restart(char *mesg) + { + #ifdef USE_SYSLOG +- (void)syslog(LOG_WARNING, "Restarting Server because: %s (%u)", mesg, +- (u_int)((char *)sbrk((size_t)0)-sbrk0)); ++ (void)syslog(LOG_WARNING, "Restarting Server because: %s", mesg); + #endif +- sendto_flag(SCH_NOTICE, "Restarting server because: %s (%u)", mesg, +- (u_int)((char *)sbrk((size_t)0)-sbrk0)); ++ sendto_flag(SCH_NOTICE, "Restarting server because: %s (%u)"); + server_reboot(); + } + +@@ -175,8 +172,7 @@ void server_reboot(void) + { + Reg int i; + +- sendto_flag(SCH_NOTICE, "Aieeeee!!! Restarting server... (%u)", +- (u_int)((char *)sbrk((size_t)0)-sbrk0)); ++ sendto_flag(SCH_NOTICE, "Aieeeee!!! Restarting server..."); + + Debug((DEBUG_NOTICE,"Restarting server...")); + flush_connections(me.fd); +@@ -768,7 +764,6 @@ int main(int argc, char *argv[]) + { + uid_t uid, euid; + +- sbrk0 = (char *)sbrk((size_t)0); + uid = getuid(); + euid = geteuid(); + diff --git a/irc/irc/files/patch-ircd_ircd__ext.h b/irc/irc/files/patch-ircd_ircd__ext.h new file mode 100644 index 000000000000..8ac5180f60aa --- /dev/null +++ b/irc/irc/files/patch-ircd_ircd__ext.h @@ -0,0 +1,10 @@ +--- ircd/ircd_ext.h.orig 2023-12-06 19:35:50 UTC ++++ ircd/ircd_ext.h +@@ -37,7 +37,6 @@ extern char *debugmode; + extern int debuglevel; + extern int bootopt; + extern char *debugmode; +-extern char *sbrk0; + extern char *tunefile; + #ifdef DELAY_CLOSE + extern time_t nextdelayclose; diff --git a/irc/irc/files/patch-ircd_s__debug.c b/irc/irc/files/patch-ircd_s__debug.c new file mode 100644 index 000000000000..a25e1cd64749 --- /dev/null +++ b/irc/irc/files/patch-ircd_s__debug.c @@ -0,0 +1,14 @@ +--- ircd/s_debug.c.orig 2023-12-06 19:34:45 UTC ++++ ircd/s_debug.c +@@ -687,9 +687,8 @@ void count_memory(aClient *cptr, char *nick, int debug + sendto_one(cptr, ":%s %d %s :TOTAL: %lu [REAL]", + me.name, RPL_STATSDEBUG, nick, d_tot); + } +- sendto_one(cptr, ":%s %d %s :TOTAL: %d sbrk(0)-etext: %u", +- me.name, RPL_STATSDEBUG, nick, tot, +- (u_long)sbrk((size_t)0)-(u_long)sbrk0); ++ sendto_one(cptr, ":%s %d %s :TOTAL: %d", ++ me.name, RPL_STATSDEBUG, nick, tot); + return; + } +