From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Meyering To: Ben Elliston Cc: Per Bothner , hjl@gnu.org, carlo@runaway.xs4all.nl, gas2@cygnus.com, bfd@cygnus.com Subject: Re: [cygnus.gas2] binutils bug: config.guess Date: Mon, 05 Apr 1999 06:35:00 -0000 Message-id: <87lng76vhm.fsf@ascend.com> References: X-SW-Source: 1999/msg00063.html Ben Elliston writes: | > * Cd to some directory unlikely to contain ld: (cd /; ld) | | Here is a patch which seems to work fine. Does anyone see any potential | problems with this? | | *** config.guess 1999/03/21 14:01:53 1.138 | --- config.guess 1999/04/05 10:17:18 | *************** | *** 608,614 **** | | # The BFD linker knows what the default object file format is, so | # first see if it will tell us. | ! ld_help_string=`ld --help 2>&1` | ld_supported_emulations=`echo $ld_help_string \ | | sed -ne '/supported emulations:/!d | s/[ ][ ]*/ /g | --- 608,614 ---- | | # The BFD linker knows what the default object file format is, so | # first see if it will tell us. | ! pwd=`pwd`; cd /; ld_help_string=`ld --help 2>&1`; cd $pwd | ld_supported_emulations=`echo $ld_help_string \ | | sed -ne '/supported emulations:/!d | s/[ ][ ]*/ /g That will not change back to the proper directory if pwd fails. It's more robust to do the cd from a subshell instead -- then you don't have to be able to return to the working directory: ld_help_string=`cd /; ld --help 2>&1` Also, I think the `cd /' part deserves a comment.