bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DJGPP build


From: Chet Ramey
Subject: Re: DJGPP build
Date: Sat, 10 Mar 2012 10:53:49 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2

On 3/5/12 5:21 PM, fabrizio gennari wrote:
> Hello.
> 
> I tried to build bash-4.2 for the DJGPP (GNU for MS-DOS) 
> platform. It had been done before, but the latest available version was 
> 2.04.
> 
> Something interesting has been found in the process. First: 
> version.c protects the use of snprintf with #if defined 
> (HAVE_SNPRINTF). But HAVE_SNPRINTF is always defined, only it is 
> defined as 0 if snprintf is not available. Here is a patch to fix that.

It's interesting that djgpp would somehow require this.  snprintf *is*
always available; if libc doesn't provide it, bash uses the replacement
function in lib/sh/snprintf.c.  There are other places in the code
(e.g., builtins/mapfile.c) where it uses snprintf unconditionally.  I'd
be more interested in why the replacement function is apparently not
being used here.


> Second, the variable 
> job_control is only declared when JOB_CONTROL is #define'd. Yet, there 
> is one case where its use is not protected by a suitable #if. Here's a 
> patch to fix that.

This is bash-4.2 patch 18.

> Third, a comment in posixdir.h says "Posix does not 
> require that the d_ino field be present, and some systems do not 
> provide it". But the #if statement immediately above seems to implay 
> that all non-Posix systems have it, because it assumes that it is 
> always present if _POSIX_SOURCE is not defined. The following patch 
> conditions the use of d_ino to the fact that configure successfully 
> tests it, independently of _POSIX_SOURCE. Also, it avoids using 
> d_fileno not only when d_ino is broken, but also when it is missing 
> altogether.

Thanks.  This is good.  It's always better to use feature checks instead
of relying on something like _POSIX_SOURCE.


> 
> If the above patches were applied, it would be a big step 
> towards having a new version of bash for DJGPP. It wouldn't be enough, 
> because DJGPP does not support the signals SIGCHLD and SIGWINCH and the 
> flag SA_RESTART. And the code would improve anyway, because they fixed 
> some little-tested cases.

I'll take a look at where these are used without testing for their presence.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]