From: Tomas By Newsgroups: comp.os.msdos.djgpp Subject: Compiling Sicstus Prolog Date: Thu, 27 Mar 1997 00:53:54 +0000 Organization: University of Sheffield, UK Message-ID: <3339C521.167EB0E7@dcs.shef.ac.uk> NNTP-Posting-Host: bamford.dcs.shef.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit CC: tomas Lines: 42 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Hi all, I wanted to compile Sicstus Prolog 2.1#9 under DJGPP 2.01, and had some problems with an undefined variable. Searching for "sicstus" in the DJGPP mail archive, I found the following: > > [_bss_start is an undefined reference] > > line 538: > > holes[h++].end = (char *)&_bss_start; > > As the bss segement start can be referenced by edata, you can > change the code to the following: > > holes[h].begin = (char *)&edata; > holes[h++].end = (char *)SP_ALIGN(&edata,0x1000); /* line 538 */ > holes[h].begin = (char *)&_go32_info_block; > holes[h++].end = (char *)&_go32_info_block+40; Which seems to be exactly what I wanted. After I made these changes, it compiles ok, but when I try to restore anything (including spdump) it says: | C:\SICSTUS>sicstus | {ERROR: restore/1: error while reading data segments} | {ERROR: segmentation violation} | {ERROR: segmentation violation} | [...] The macro SP_ALIGN in the code above is defined as follows: | #define SP_ALIGN(Value, Alignment) \ | (((unsigned long)(Value) + Alignment-1) & ~(unsigned)(Alignment-1)) I found the magic number 0x1000 at some places in the code but could not tell if it's the right value for the macro call. Can anyone who knows the relationship between edata and _bss_start confirm that the change above makes sense? Has anyone compiled Sicstus 2.1#9 successfully under DJGPP 2? /Tomas