delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/02/02/16:05:40

From: rupp AT gnat DOT com (Douglas B. Rupp)
Message-Id: <9702022100.AA22077@nile.gnat.com>
Subject: Re: bash and make gnat1 (or cc1plus)
To: djgpp-workers AT delorie DOT com
Date: Sun, 2 Feb 1997 16:00:19 -0500 (EST)
In-Reply-To: <9702012318.AA19508@nile.gnat.com> from "Douglas B. Rupp" at Feb 1, 97 06:18:31 pm
Mime-Version: 1.0

> 
> 
> After working around the minor configure problems, bash again works
> remarkably well except that:
> 
> 1) make CC=gcc gnat1 (or make CC=gcc cc1plus) gets a sigsegv when
> transitioning to the subdirectory.  The sigsegv appears to be in make.exe
> and caused by the line in FLAGS_TO_PASS:
> "CC=`case '$(CC)' in stage*) echo ...."
> 

After spending some time trying to debug this I discovered that make 
builds a command line that looks like:

/bin/sh.exe -c cd ada;  D:/DJGPP/BIN/make.exe "AR_FLAGS=rc" 
"AR_FOR_TARGET=/usr/local/i386-go32-msdos/bin/ar" "BISON=bison" "BISONFLAGS=" 
"CC=`case 'gcc' in stage*) echo 'gcc' | sed -e 's|stage|../stage|g';; *) 
   echo 'gcc';; esac`" 
"CFLAGS=-g" "GCC_FOR_TARGET=./xgcc -B./" "LDFLAGS=" "LEX=flex" "LEXFLAGS=" 
"MAKEINFO=makeinfo" "MAKEINFOFLAGS=" 
"RANLIB_FOR_TARGET=/usr/local/i386-go32-msdos/bin/ranlib" 
"RANLIB_TEST_FOR_TARGET=[ -f /usr/local/i386-go32-msdos/bin/ranlib ]" 
"SHELL=/bin/sh.exe" "exeext=" "objext=.o" "exec_prefix=/usr/local" 
"prefix=/usr/local" "tooldir=/usr/local/i386-go32-msdos" 
"bindir=/usr/local/bin" "libsubdir=/usr/local/lib/gcc-lib/i386-go32-msdos/2.7.2"
"ADA_FOR_BUILD=" "ADAFLAGS=-gnatpg -gnata" "ADA_FOR_TARGET=" 
"INSTALL_DATA=install -c" ../gnat1

and calls system() after removing the "/bin/sh.exe -c".

system() then creates a temp file e.g d:/djgpp/tmp/dj100000, and writes the 
command to it.  System() then calls 
_dos_exec ("/bin/sh.exe", "d:/djgpp/tmp/dj100000", environment);

and then a sigsegv occurs in _dos_exec().  The interesting thing is that I
can arrange to save the temp file and execute a test program that
simply calls system ("/bin/sh.exe d:/djgpp/tmp/dj100000"), and it works
fine. But if I hack make to hardcode in this identical call (in job.c), it
blows up with the same sigsegv.

One other thing, symify of the traceback from make gives complete garbage.
Also running make under gdb results in a completely bogus traceback.

Anybody have any ideas?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019