delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/08/29/08:46:41

X-Authentication-Warning: new-smtp2.ihug.com.au: Host p52-max13.syd.ihug.com.au [203.173.155.244] claimed to be acceleron
Message-ID: <01c701c13087$41737b50$0a02a8c0@acceleron>
From: "Andrew Cottrell" <acottrel AT ihug DOT com DOT au>
To: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Cc: "Charles Sandmann" <sandmann AT clio DOT rice DOT edu>, <djgpp-workers AT delorie DOT com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010829145544 DOT 16952I-100000 AT is>
Subject: Re: GCC query
Date: Wed, 29 Aug 2001 22:36:40 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
Reply-To: djgpp-workers AT delorie DOT com

> > What is the expected result of ">&5" is the examples below?
>
> You will see that the configure script (every configure script created by
> Autoconf, in fact) has this near its beginning:
>
>    exec 5>./config.log
>
> This redirects the handle 5 to the file config.log.  "1>&5" means the
> script wants stdout of the command to be redirected to config.log as
> well.

Thansk, Now I know what this means.

> > configure:1689: gcc -o conftest -g -O2   conftest.c  1>&5
> > ${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS
conftest.$ac_ext
> > $LIBS 1>&5
> > d:/dj204/bin/ld.exe: cannot open output file conftest: Permission denied
> > (EACCES)
> > collect2: ld returned 1 exit status
>
> Was Bash you used here built with all the latest W2K-related patches in
> _open, _creat, fstat, etc.?  How about GCC and Binutils?
Bash was built with the latest LIBC from 26-Aug-2001. GCC and Binutils are a
bit stale probably only haev the _open patch. I will be building these again
on the next few days. Does this matter?

> > DJGPP_204 D:\dj204\gnu\bash-2.05>gcc -o conftest -g -O2   conftest.c
1>&5
> > The handle could not be duplicated during redirection of handle 1.
>
> This is expected: handle 5 is not connected to anything, so you cannot
> redirect handle 1 to it.  (Also, you shouldn't assume that CMD.EXE
> supports the full syntax of a Unixy shell, as far as redirection is
> concerned.)
I didn't know about the handle 5 re0direction so I thought this info may
help out.

> If you want a simple way to reproduce the problem, try doing so in a
script
> which begins with the above-mentioned `exec' command, or from a program
> which opens some file on handle 5 before it spawns Bash.

I created a small test script as follows and ran it and the output also
included below looked fine. Loks like I need to have a closer look at the
configure output to see if there are any othe failures above it exits on the
gcc comamnd above. I will try this on Friday.

test.sh
#! /bin/sh
exec 5>./test.log
echo "Test Start" 1>&5
gcc -o conftest -g -O2   conftest.c  1>&5

test.log file:
Test Start
Test End


- Raw text -


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