public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
* Re: [cygnus.gas2] binutils bug: config.guess
       [not found] <Pine.LNX.3.95.990405125857.5800B-100000@moshpit.cygnus.com>
@ 1999-04-04 22:57 ` Per Bothner
  1999-04-04 23:02   ` Ben Elliston
  1999-04-05  3:26   ` Ben Elliston
  0 siblings, 2 replies; 9+ messages in thread
From: Per Bothner @ 1999-04-04 22:57 UTC (permalink / raw)
  To: Ben Elliston; +Cc: hjl, carlo, gas2, bfd

> I don't think I am prepared to hack up
> config.guess to cater for this, unless someone has a more elegant
> solution.

Alternatives:
* Give full path of ld:  /usr/bin/ld.
* Cd to some directory unlikely to contain ld:  (cd /; ld)

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-04 22:57 ` [cygnus.gas2] binutils bug: config.guess Per Bothner
@ 1999-04-04 23:02   ` Ben Elliston
  1999-04-04 23:25     ` Per Bothner
  1999-04-05  3:26   ` Ben Elliston
  1 sibling, 1 reply; 9+ messages in thread
From: Ben Elliston @ 1999-04-04 23:02 UTC (permalink / raw)
  To: Per Bothner; +Cc: hjl, carlo, gas2, bfd

> Alternatives:
> * Give full path of ld:  /usr/bin/ld.

This is almost certainly guaranteed to fail on 50% of the systems I have
ever used.  I think hardcoding the location of `ld' is a bad idea.

> * Cd to some directory unlikely to contain ld:  (cd /; ld)

This idea, on the other hand, shows promise.  Since the script can run
`ld' from anywhere, perhaps all this needs in addition is something like:

	(here=`pwd`; cd /; ld; cd $here)

(to restore the original working directory afterwards).  Thanks, Per.
I'll look into this.

Ben


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-04 23:02   ` Ben Elliston
@ 1999-04-04 23:25     ` Per Bothner
  1999-04-04 23:33       ` Ben Elliston
  0 siblings, 1 reply; 9+ messages in thread
From: Per Bothner @ 1999-04-04 23:25 UTC (permalink / raw)
  To: Ben Elliston; +Cc: hjl, carlo, gas2, bfd

>> * Give full path of ld:  /usr/bin/ld.
> This is almost certainly guaranteed to fail on 50% of the systems I have
> ever used.

That is irrelevant.  The question is:  Is it likely to fail on
*Linux* systems, since (as far as I can tell) those are the only
ones that will be running ld?

>	(here=`pwd`; cd /; ld; cd $here)
> (to restore the original working directory afterwards).  Thanks, Per.

Or just do:
	(cd /; ld)
Remember: (CMD) runs CMD in a sub-shell.

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-04 23:25     ` Per Bothner
@ 1999-04-04 23:33       ` Ben Elliston
  1999-04-05  8:17         ` Carlo Wood
  1999-04-06  2:20         ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Ben Elliston @ 1999-04-04 23:33 UTC (permalink / raw)
  To: Per Bothner; +Cc: hjl, carlo, gas2, bfd

> That is irrelevant.  The question is:  Is it likely to fail on
> *Linux* systems, since (as far as I can tell) those are the only
> ones that will be running ld?

True; although, for instance, my ld is not in /usr/bin.  My ld is in
/usr/local/bin, and /usr/bin/ld will report the wrong executable format.
The point I was trying to make is that the script should be using the PATH
to pick up the user's choice of tools in as many circumstances as
possible.

> Or just do:
> 	(cd /; ld)
> Remember: (CMD) runs CMD in a sub-shell.

Silly me.  Thanks,

Ben


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-04 22:57 ` [cygnus.gas2] binutils bug: config.guess Per Bothner
  1999-04-04 23:02   ` Ben Elliston
@ 1999-04-05  3:26   ` Ben Elliston
  1999-04-05  6:46     ` Jim Meyering
  1 sibling, 1 reply; 9+ messages in thread
From: Ben Elliston @ 1999-04-05  3:26 UTC (permalink / raw)
  To: Per Bothner; +Cc: hjl, carlo, gas2, bfd

> * 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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-05  3:26   ` Ben Elliston
@ 1999-04-05  6:46     ` Jim Meyering
  0 siblings, 0 replies; 9+ messages in thread
From: Jim Meyering @ 1999-04-05  6:46 UTC (permalink / raw)
  To: Ben Elliston; +Cc: Per Bothner, hjl, carlo, gas2, bfd

Ben Elliston <bje@cygnus.com> 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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-04 23:33       ` Ben Elliston
@ 1999-04-05  8:17         ` Carlo Wood
  1999-04-06  2:20         ` Richard Stallman
  1 sibling, 0 replies; 9+ messages in thread
From: Carlo Wood @ 1999-04-05  8:17 UTC (permalink / raw)
  To: Ben Elliston; +Cc: bothner, hjl, carlo, gas2, bfd, dkl

| > Or just do:
| > 	(cd /; ld)
| > Remember: (CMD) runs CMD in a sub-shell.
| 
| Silly me.  Thanks,
| 
| Ben

I'd suggest to do that where you detect the path to ld:

	ld_exec=`(cd /; which ld)`

After all, the problem is in `which', not in the normal
shell search.

[ proof:

~/tmp>ls -ld ld
drwxr-xr-x   2 carlo    users        1024 Apr  5 15:55 ld/
~/tmp>ld -V
GNU ld version 2.9.1 (with BFD 2.9.1.0.15)
  Supported emulations:
   elf_i386
   i386linux

]

I already mailed to Ben, I intend to rewrite `which' so
it behaves the same as the shell search (ie, will skip
directories).

I suppose that

    if (!access(test, X_OK) && !stat(test, &m))
      found = S_ISREG(m.st_mode);

will do?

[ Now it just does the access(test, X_OK) ].

I suppose the main problem will be to get
everyone to upgrade their `which' ;).

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>

PS dkl@redhat.com : reference, bug #1998

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-04 23:33       ` Ben Elliston
  1999-04-05  8:17         ` Carlo Wood
@ 1999-04-06  2:20         ` Richard Stallman
  1999-04-06  9:21           ` Carlo Wood
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Stallman @ 1999-04-06  2:20 UTC (permalink / raw)
  To: Per Bothner; +Cc: bothner, hjl, carlo, gas2, bfd, bje

    > That is irrelevant.  The question is:  Is it likely to fail on
    > *Linux* systems, since (as far as I can tell) those are the only
    > ones that will be running ld?

Please keep in mind that Linux is the kernel; the system in which
Linux is typically used is basically a modified version of the GNU
system.  Please help the GNU Project by calling the system GNU/Linux.
While I know this won't help solve the particular bug at hand, it is
very important for the GNU Project.  See
http://www.gnu.org/gnu/linux-and-gnu.html for more explanation.

In this case, the issue probably has nothing to do with the kernel per
se.  It is an issue of the GNU system.

Thank you in advance.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [cygnus.gas2] binutils bug: config.guess
  1999-04-06  2:20         ` Richard Stallman
@ 1999-04-06  9:21           ` Carlo Wood
  0 siblings, 0 replies; 9+ messages in thread
From: Carlo Wood @ 1999-04-06  9:21 UTC (permalink / raw)
  To: rms; +Cc: bothner, hjl, carlo, gas2, bfd, bje

Richard Stallman wrote:
| In this case, the issue probably has nothing to do with the kernel per
| se.  It is an issue of the GNU system.

I'd like to repeat that the problem is in `which', I recall that in
binutils I saw `which' being used to determine the path to `ld',
which was the problem.

I rewrote `which' and called it which-2.0.tar.gz

This is a more mature version ;), and I'd welcome it if it
could become a (the) standard GNU utility, although it won't
work likely on other architectures than GNU/Linux yet.

I uploaded it to metalab and announced it to comp.os.linux.announce
I am in the process to get it added to RedHat 6.0 and I suppose
that will succeed.

Home page: http://www.xs4all.nl/~carlo17/which/

-- 
 Carlo Wood  <carlo@runaway.xs4all.nl>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1999-04-06  9:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.3.95.990405125857.5800B-100000@moshpit.cygnus.com>
1999-04-04 22:57 ` [cygnus.gas2] binutils bug: config.guess Per Bothner
1999-04-04 23:02   ` Ben Elliston
1999-04-04 23:25     ` Per Bothner
1999-04-04 23:33       ` Ben Elliston
1999-04-05  8:17         ` Carlo Wood
1999-04-06  2:20         ` Richard Stallman
1999-04-06  9:21           ` Carlo Wood
1999-04-05  3:26   ` Ben Elliston
1999-04-05  6:46     ` Jim Meyering

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).