Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Mac Programming / September 2004



Tip: Looking for answers? Try searching our database.

Problem with OS X /usr/bin/as

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
r5 - 30 Sep 2004 00:28 GMT
Passing the --version argument to /usr/bin/as in OS X
causes it to hang:

% /usr/bin/as --version
Apple Computer, Inc. version cctools-498.obj~14, GNU assembler version 1.38
<hangs...>

Is there a fix for this?  I came across this when trying to
configure glibc as part of building a cross-compiler:

% ../glibc-2.3.3/configure --prefix=/usr \
 --build=powerpc-apple-darwin7.5.0 --host=mips-TiVo-linux \
 --without-cvs --disable-sanity-checks \
 --with-headers=/tivo/tmp/install/mips-TiVo-linux/include \
 --enable-hacker-mode
checking build system type... powerpc-apple-darwin7.5.0
checking host system type... mips-TiVo-linux-gnu
<snip>
checking whether /usr/bin/as is GNU as... yes
checking whether ld is GNU ld... no
checking for /usr/bin/as... /usr/bin/as
checking version of /usr/bin/as...
<hangs...>
Paul Russell - 30 Sep 2004 01:23 GMT
> Passing the --version argument to /usr/bin/as in OS X
> causes it to hang:
[quoted text clipped - 19 lines]
> checking version of /usr/bin/as...
> <hangs...>

Two things:

(a) you need to use -v rather than --version

(b) you need to supply an EOF

% /usr/bin/as -v < /dev/null
Apple Computer, Inc. version cctools-525.obj~1, GNU assembler version 1.38
%

Paul
Gregory Weston - 30 Sep 2004 01:25 GMT
In article
<r5ahhj-BFACD6.18283729092004@newssvr30-ext.news.prodigy.com>,

> Passing the --version argument to /usr/bin/as in OS X
> causes it to hang:
[quoted text clipped - 19 lines]
> checking version of /usr/bin/as...
> <hangs...>

It appears that the version of "as" included with OS X (10.3.5 here)
_needs_ input and does not support the --version argument that's
supposed to cancel that need. I would suggest that the proper way to
execute the command for the behavior you want is:

/usr/bin/as -v < /dev/null

How does the configurator determine that it's GNU as?

G

Signature

Standard output is like your butt. Everyone has one. When using a bathroom,
they all default to going into a toilet. However, a person can redirect his
"standard output" to somewhere else, if he so chooses.  - Jeremy Nixon

r5 - 30 Sep 2004 01:42 GMT
> How does the configurator determine that it's GNU as?

Thanks for the rapid responses.  Looking at line 3723 of
glibc-2.3.3/configure shows that it is passing --version
to as:

|  ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`

Inserting '< /dev/null' does the trick.  Thanks.
Gregory Weston - 30 Sep 2004 02:09 GMT
In article
<r5ahhj-9AA660.19424629092004@newssvr30-ext.news.prodigy.com>,

> > How does the configurator determine that it's GNU as?
>
[quoted text clipped - 6 lines]
>
> Inserting '< /dev/null' does the trick.  Thanks.

Glad it worked. The question I was asking would be a few lines up from
where you were. I wasn't looking for the version command, but how it
determined that it was looking at a GNU build before it even tried to
get the version. The first line in what you posted:

> <snip>
> checking whether /usr/bin/as is GNU as... yes
> checking whether ld is GNU ld... no
> checking for /usr/bin/as... /usr/bin/as
> checking version of /usr/bin/as...
> <hangs...>

Signature

Standard output is like your butt. Everyone has one. When using a bathroom,
they all default to going into a toilet. However, a person can redirect his
"standard output" to somewhere else, if he so chooses.  - Jeremy Nixon

Ian Gregory - 30 Sep 2004 01:49 GMT
> Passing the --version argument to /usr/bin/as in OS X
> causes it to hang:
[quoted text clipped - 4 lines]
>
> Is there a fix for this?

First of all, in my case it produces an error (using bash):

dune:~ iang$ /usr/bin/as --version
/usr/libexec/gcc/darwin/ppc/as: I don't understand '-' flag!
Apple Computer, Inc. version cctools-495.obj~4, GNU assembler version 1.38

But then "--version" is not a documented option so using "-v":

dune:~ iang$ /usr/bin/as -v
Apple Computer, Inc. version cctools-495.obj~4, GNU assembler version 1.38

Admittedly it appears to hang at that point, but in fact it is not
really hung. The man page points out that if no files are specified
it reads from stdin, so in fact it is just waiting for you to indicate
EOF by typing ctrl-D. It seems that "-v" means "print version before
starting assembly". Try this:

dune:~ iang$ /usr/bin/as -v < /dev/null
Apple Computer, Inc. version cctools-495.obj~4, GNU assembler version 1.38
dune:~ iang$

Signature

Ian Gregory
http://www.zenatode.org.uk/ian/

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.