K From:	CRDGW2::CRDGW2::MRGATE::"SMTP::AI.MIT.EDU::TAALEBI" 28-JUL-1989 19:58  To:	MRGATE::"ARISIA::EVERHART" Subj:	RLIMIT_STACK in ld++  R Received: by life.ai.mit.edu (4.1/AI-4.10) id AA01039; Fri, 28 Jul 89 14:56:28 EDTr 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 EDTM 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 P         for swatsun!rice (from ulowell!harvard!prep.ai.mit.edu!info-g++-request)B         id <AA00829@swan.ulowell.edu>; Mon, 24 Jul 89 11:37:24 EDT- Received: by harvard.harvard.edu (5.54/a0.25) B 	(for cbmvax!swatsun!rice) id AA24756; Mon, 24 Jul 89 07:25:53 EDTR Received: by life.ai.mit.edu (4.1/AI-4.10) id AA26721; Mon, 24 Jul 89 04:55:28 EDT1 Return-Path: <ukc!kewill.uucp!bryan@uunet.uu.net> d 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 -0400G Received: from root.co.uk by kestrel.Ukc.AC.UK   with UUCP  id aa29122;            24 Jul 89 9:33 BSTA Received: from edinburgh.kewill.uucp by kewill.uucp (3.2/SMI-3.2) ( 	id AA25932; Sun, 23 Jul 89 17:08:05 BST0 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 1 From: Bryan Boreham <kewill!bryan@britain.eu.net> 6 Message-Id: <8907231607.AA07577@edinburgh.kewill.uucp> To: info-g++@prep.ai.mit.edu Subject: RLIMIT_STACK in ld++   H System info: g++ 1.35.1-, Sun 3/280, SunOS 3.5, 95 degrees in the shade.  B ld++ was core-dumping on me when I tried to build ET++ programs byE linking in the 3 megabyte file "et.o". Tom Vijlbrief suggested it was D the stack size limit, which it was. "limit stacksize 2000" cured the& problem, when I remembered to type it.  D So, I moved the following code out of gcc's toplev.c, and that fixedF 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 <sys/file.h>    #include <fcntl.h>   + #include <sys/time.h>  + #include <sys/resource.h>  +    #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. G +    Added this to stop ld++ core-dumping on very large .o files.    */  + #ifdef RLIMIT_STACK 8 +   /* Get rid of any avoidable limit on stack size.  */ +   {  +     struct rlimit rlim;  + B +     /* 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.