This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH for COLLECT2 (revised)


> Can we use pexecute.c instead of conditionalizing the code in collect2.c?

I'll take a look.

> 
> Is it actually necessary to change / to \?  I thought DOS accepted both.

The file system in both DOS and Win95 can indeed handle / , but 
command.com (the default shell) in both can't. The system() function 
eventually calls the shell and if the shell is command.com, / will 
definitely not work because it's considered an option switch. DJGPP's 
system() provides a workaround when the proper flags are set (which I 
do in collect2.c's main() ).

> 
> I don't think it'll work to do
> 
>   system ("cd foo");
>   system ("do stuff in foo");
> 
> On Unix, at least, the first call has no effect.  I think you should
> change the code to use chdir(3) instead.  That way you won't need to
> conditionalize it.

I should have put in some comments on what the parts of my patch 
does and why they're neccessary. The code you mention is 
conditionalized for Win95 and DOS (except DJGPP) to send the 
commands one at a time because command.com (both in DOS and 
Win95) doesn't support executing multiple commands on the 
command line.

I'll submit a new patch once I've had a chance to add some comments 
and see if pexecute.c is of use.

Mark

-- 
Mark Elbrecht snowball3@usa.net
http://members.xoom.com/snowball3/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]