From: CRDGW2::CRDGW2::MRGATE::"SMTP::AI.MIT.EDU::TAALEBI" 28-JUL-1989 19:58 To: MRGATE::"ARISIA::EVERHART" Subj: RLIMIT_STACK in ld++ Received: by life.ai.mit.edu (4.1/AI-4.10) id AA01039; Fri, 28 Jul 89 14:56:28 EDT Received: from rutgers.edu ([128.6.21.9]) by life.ai.mit.edu (4.1/AI-4.10) id AA05600; Fri, 28 Jul 89 01:29:30 EDT Received: from cbmvax.UUCP by rutgers.edu (5.59/SMI4.0/RU1.1/3.04) with UUCP id AA14681; Fri, 28 Jul 89 01:27:45 EDT Received: by cbmvax.UUCP (5.57/UUCP-Project/Commodore 12/21/87)) id AA16051; Fri, 28 Jul 89 00:59:25 EDT Received: by cbmvax.UUCP (5.57/UUCP-Project/Commodore 12/21/87)) id AA26995; Mon, 24 Jul 89 13:43:55 EDT Received: by swan.ulowell.edu for swatsun!rice (from ulowell!harvard!prep.ai.mit.edu!info-g++-request) id ; Mon, 24 Jul 89 11:37:24 EDT Received: by harvard.harvard.edu (5.54/a0.25) (for cbmvax!swatsun!rice) id AA24756; Mon, 24 Jul 89 07:25:53 EDT Received: by life.ai.mit.edu (4.1/AI-4.10) id AA26721; Mon, 24 Jul 89 04:55:28 EDT Return-Path: Received: from uunet.uu.net by life.ai.mit.edu (4.1/AI-4.10) id AA26637; Mon, 24 Jul 89 04:50:36 EDT Received: from ukc.UUCP by uunet.uu.net (5.61/1.14) with UUCP id AA00415; Mon, 24 Jul 89 04:50:30 -0400 Received: from root.co.uk by kestrel.Ukc.AC.UK with UUCP id aa29122; 24 Jul 89 9:33 BST Received: from edinburgh.kewill.uucp by kewill.uucp (3.2/SMI-3.2) id AA25932; Sun, 23 Jul 89 17:08:05 BST Received: by edinburgh.kewill.uucp (3.2/SMI-3.2) id AA07577; Sun, 23 Jul 89 17:07:58 BST Date: Sun, 23 Jul 89 17:07:58 BST From: Bryan Boreham Message-Id: <8907231607.AA07577@edinburgh.kewill.uucp> To: info-g++@prep.ai.mit.edu Subject: RLIMIT_STACK in ld++ System info: g++ 1.35.1-, Sun 3/280, SunOS 3.5, 95 degrees in the shade. ld++ was core-dumping on me when I tried to build ET++ programs by linking in the 3 megabyte file "et.o". Tom Vijlbrief suggested it was the stack size limit, which it was. "limit stacksize 2000" cured the problem, when I remembered to type it. So, I moved the following code out of gcc's toplev.c, and that fixed it more permanently. Was there a reason that this code was missed out? *** newld.c~ Thu May 25 11:13:28 1989 --- newld.c Sun Jul 23 16:57:04 1989 *************** *** 114,119 **** --- 114,122 ---- #include #include + #include + #include + #ifdef COFF_ENCAPSULATE #include "a.out.encap.h" #else *************** *** 961,966 **** --- 964,983 ---- char **argv; int argc; { + /* Change by Bryan Boreham, Kewill, Sun Jul 23 16:48:51 1989. + Added this to stop ld++ core-dumping on very large .o files. */ + #ifdef RLIMIT_STACK + /* Get rid of any avoidable limit on stack size. */ + { + struct rlimit rlim; + + /* Set the stack limit huge so that alloca does not fail. */ + getrlimit (RLIMIT_STACK, &rlim); + rlim.rlim_cur = rlim.rlim_max; + setrlimit (RLIMIT_STACK, &rlim); + } + #endif /* RLIMIT_STACK */ + page_size = getpagesize (); progname = argv[0]; Bryan.