Operating System - HP-UX
1827802 Members
2316 Online
109969 Solutions
New Discussion

Error with gcc compiler - HP UX 11.0

 
Viswanadhan
Regular Advisor

Error with gcc compiler - HP UX 11.0

Hi Admin,

I have installed gcc compiler ( gcc-2.95.3-11.00.sd ), while installation i did not get any error(s) in the log. I tried to check that whether gcc is working or not, i have a small program

hello.c
#include
int main()
{
printf("Hello world\n");
}

# gcc hello.c
as: "/var/tmp/cckHn6wc.s", line 22: error 1052: Directive name not recognized - NSUBSPA

Really there is no file called /var/tmp/cckHn6wc.s
I got above erro.
Please guide to rectify this ?

Regards,
Viswa.
17 REPLIES 17
Murat SULUHAN
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

Hi Viswa

Please check the following url according to your environment
http://gcc.gnu.org/install/specific.html


Best Regards
Murat
Murat Suluhan
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Murat,

Thanks for valubale doc. Let me try to follow the doc.

Regards,
Viswa.
Steven Schweda
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

> I tried to check that whether gcc is
> working or not, [...]

Apparently not.

> Really there is no file called /var/tmp/cckHn6wc.s

It looks like a temporary assembly language
file producted by the C compiler, and your
assembler ("as") does not like it.

I know nothing, but perhaps GNU "as" would
help. It's in the GNU binutils package.
However, if this GCC is using HP's "as" now,
it's not clear to me how you'd get it to use
GNU "as" (/usr/local/bin/as, I assume)
instead, after you install that. Perhaps
putting /usr/local/bin first on your PATH
would do it, but that's not the ideal
solution.

This looks like a mess (again).

You could try installing GNU binutils (and
playing with PATH) to see if that helps. If
you ever do get to a point where you can
compile something, the first thing I'd do is
build a GCC from the source.


> Please check the following url [...]

I like this part best:

http://gcc.gnu.org/install/specific.html#hppa-hp-hpux11

GCC 3.0 and up support HP-UX 11. GCC
2.95.x is not supported and cannot be
used to compile GCC 3.0 and up.

On the other hand, you seem to have a 2.95.3
kit intended for 11.00.
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Steven,

A file called "as" is physically located. But im trying to install the gcc 3.x.

Thanks for help.

Regards,
Viswa.
Steven Schweda
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

> But im trying to install the gcc 3.x.

3.x? With a kit named "*2.95.3*"?

> A file called "as" is physically located.

Some C compilers produce object files
directly. Others produce intermediate
assembly-language files, and then feed those
into an assembler (like "as"), and the
assembler produces the actual object file.

In such cases, it helps if you use an
assembler which can understand the code
being put out by the compiler. "as : [...]
Directive name not recognized" suggests that
this assembler can not understand the code
being put out by this compiler. Hence my
suggestion to try the GNU assembler.
Dennis Handly
Acclaimed Contributor

Re: Error with gcc compiler - HP UX 11.0

Steven is correct. That's the typical error you get if you pass gcc assembler output to HP's as(1). You need to use GNU's assembler.
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Admins,

I have downloaded the gcc-3.3.2-11.00.sd.bz, and gcc-4.2.1-hppa-11.11.depot.gz. And installed bzip2 1.0.1 ver without problem.

When i do bzip for gcc-3.3.2-11.00.sd.bz, then system is hanging.

If i do
# /usr/contrib/bin/gunzip -d gcc-4.2.1-hppa-11.11.depot.gz

The i got error as
gunzip: /u06/gcc-4.2.1-hppa-11.11.depot.gz: not in gzip format

Please anyone can give the gcc compiler as .sd or .depot

Or any direct url for .sd or .depot

Regards,
Viswa.
Dennis Handly
Acclaimed Contributor

Re: Error with gcc compiler - HP UX 11.0

>I have downloaded gcc-4.2.1-hppa-11.11.depot.gz.
>If i do
# /usr/contrib/bin/gunzip -d gcc-4.2.1-hppa-11.11.depot.gz
>I got error as
gunzip: /u06/gcc-4.2.1-hppa-11.11.depot.gz: not in gzip format

What does does this show?:
file gcc-4.2.1-hppa-11.11.depot.gz

Some browsers may have gunzipped it but not renamed it. If you see "tar file" then that is what happened.
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Denis,

# file gcc-4.2.1-hppa-11.11.depot.gz
gcc-4.2.1-hppa-11.11.depot.gz: tar file

# tar -xvf gcc-4.2.1-hppa-11.11.depot.gz: tar file

Now i got catalog, and gcc directories.

Now shall i make changes to /home/root/.profile file accoding to bin directory for PATH env variable.

Regards,
Viswa.
Steven Schweda
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

> The i got error as
> gunzip: /u06/gcc-4.2.1-hppa-11.11.depot.gz: not in gzip format

Wow. Just like last time:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1173152

Same fix, too. Amazing.

> And installed bzip2 1.0.1 ver without problem.

bzip2 1.0.4 is the current version.

http://www.bzip.org/

> When i do bzip for gcc-3.3.2-11.00.sd.bz,
> then system is hanging.

As usual, showing the actual command you used
would be more helpful than a vague
description of what you did.
Dennis Handly
Acclaimed Contributor

Re: Error with gcc compiler - HP UX 11.0

# file gcc-4.2.1-hppa-11.11.depot.gz
gcc-4.2.1-hppa-11.11.depot.gz: tar file

Ok, the file was misnamed. Just rename it:
$ mv gcc-4.2.1-hppa-11.11.depot.gz gcc-4.2.1-hppa-11.11.depot

Now you can do swinstall.

# tar -xvf gcc-4.2.1-hppa-11.11.depot.gz: tar file

Don't use tar, use swinstall. So remove those first.

>Steven: Wow. Just like last time:

Good memory. :-) I knew some one had it.
Steven Schweda
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

> Good memory. :-) I knew some one had it.

Yeah. Now if only I could remember where I
left it ...

Actually, this fellow got so much bad advice
in that thread that it was fairly memorable
(at least for a little while). That whole
bzip2 excursion was particularly unfortunate.
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Steven,

I did as follows for bzip2-1.0.1.tar

# tar -xvf bzip2-1.0.1.tar
/opt/opt/precompiled/bzip2-1.0.1/bin> ls -l bzip2

-rwxr-xr-x 1 235 users 155648 Jul 17 2001 bzip2

# ln -s bzip2 /usr/bin/bzip2

# ls -l /usr/bin/bzip2
lrwxrwxrwx 1 root sys 42 Nov 14 22:29 /usr/bin/bzip2 ->/opt/opt/precompiled/bzip2-1.0.1/bin/bzip2

# vi /home/root/.profile
PATH=.:/usr/sbin:/usr/bin:

Anything else require ?

Regards,
Viswa.
Steven Schweda
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

> Anything else require ?

If it works, it's ok with me. My only
complaints were:

1) Bzip2 1.0.4 is the current version.

2) I didn't think that you needed bzip2 for
anything (until recently).

If you can ever get a C compiler to work,
building the latest bzip2 from a source kit
should be easy enough. Until then, an old
one should be good enough.

> > When i do bzip for gcc-3.3.2-11.00.sd.bz,
> > then system is hanging.

> As usual, showing the actual command you used
> would be more helpful than a vague
> description of what you did.

Still true.
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Admin,

Finally with great effort I installed gcc-3.3.2-11.00.sd without any error.

And check with small program

#include
int main()
{
printf("Hello world\n");
}

# gcc hello.c

Then i got output file called a.out

#./a.out
Hello world

Anything else require ? I have to install binutils or else ?

Regards,
Viswa.
Steven Schweda
Honored Contributor

Re: Error with gcc compiler - HP UX 11.0

> #./a.out
> Hello world

Glad to hear it.

> Anything else require ? I have to install
> binutils or else ?

Required for what? You seem to have a
working C compiler. If you want to build the
current GCC version (4.2.2), my notes suggest
that it needed some kind of "yacc", so I got
GNU "bison". Building "bison" required GNU
"m4". Building GNU "m4" required GNU "diff".
Putting /usr/local/bin at the beginning of my
PATH (while I was doing this work) let the
builders find the GNU programs instead of the
HP ones of the same names.

The GCC build failed with "Too many open
files" somewhere in the Java stuff, so I
increased the kernel parameter "maxfiles"
from 60 to 256. Then it failed with:

jc1: out of memory allocating 4072 bytes
after a total of 268149896 bytes

Raising the kernel parameter maxdsize from
0x10000000 = 268435456 to 0x80000000 =
2147483648 changed this to:

jc1: out of memory allocating 4072 bytes
after a total of 707417224 bytes

A Google search suggested that I wasn't the
first to see this problem, but I didn't find
a solution for it, so I stopped trying to
build the Java stuff. The following sequence
worked for me:

dy # mkdir gcc-4.2.2_obj
dy # cd gcc-4.2.2_obj

dy # langs='c,c++,objc,obj-c++,treelang'

dy # ../gcc-4.2.2/configure --enable-languages=$langs

dy # gmake bootstrap-lean

dy # gmake install

dy # gcc --version
gcc (GCC) 4.2.2
[...]

And you probably need GNU "tar" to unpack the
GCC source kit, and I assumed that it'd need
GNU "make". I may have missed something in
this list, but I have _not_ installed GNU
binutils, so I doubt that it's needed.

Otherwise, what could go wrong?

http://www.gnu.org/software/make/
http://www.gnu.org/software/tar/
http://www.gnu.org/software/diffutils/
http://www.gnu.org/software/m4/
http://www.gnu.org/software/bison/

http://gcc.gnu.org/
http://gcc.gnu.org/install/

Note that
http://gcc.gnu.org/install/prerequisites.html
says that you don't really need all this
stuff, but reality seemed (to me) to be
different from the spec.

dy # uname -a
HP-UX dy B.11.11 U 9000/785 2012616114 unlimited-user license

and I started with a GCC 4.1.2 depot, so I
don't know what GCC 3.3.2 will do on your
system.
Viswanadhan
Regular Advisor

Re: Error with gcc compiler - HP UX 11.0

Hi Admins,

Thanks to all helping in various situations to install gcc sucessefully in HP BOX.

Regards,
Viswa.