Operating System - HP-UX
1829048 Members
2920 Online
109986 Solutions
New Discussion

compiling gcc on hpux 11.11

 
SOLVED
Go to solution
Russ Jones_1
Advisor

compiling gcc on hpux 11.11

I want to compile gcc on an hpux 11.11 box, and I'm running into problems.

I'm trying to install the gcc prereq binutils 2.13, using HP's ansi C compiler (I export CC=/opt/ansic/bin/cc), with gnu make. I created a separate object path like the README recommends.

I run configure with no options, and it runs fine, and then make runs for a pretty long time, and eventually enters the object/gprof directory, and starts throwing errors while trying to compile gmon_io.c. Then make recurses back up to the top and ends up exiting with an error.

Also, I don't want to use the depots that you can find on some of the distribution sites. I've tried them and they just don't work.

So, does anyone have any hints? Are there some configure parms I should supply? This is making me (and my customer) crazy!
12 REPLIES 12
Geoff Wild
Honored Contributor

Re: compiling gcc on hpux 11.11

The CC that comes with HP-UX is for compiling the kernel only - it won't work in compiling source files. You will just have to get a depot....then once gcc is installed - you will be able to compile source's.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Russ Jones_1
Advisor

Re: compiling gcc on hpux 11.11

I'm not using the bundled C. I know it's a dog. I'm using HP's ansi C compiler, the one that costs extra (but is still kind of a dog).
H.Merijn Brand (procura
Honored Contributor
Solution

Re: compiling gcc on hpux 11.11

Install the lot from the precompiled available archive on my ITRC site: https://www.beepz.com/personal/merijn/ or http://www.cmve.net/~merijn/
Then read the instructions on that page to use it to rebuild gcc from the source tree, then use /that/ gcc to rebuild the binutils from scratch, and rebuild gcc from scratch again.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: compiling gcc on hpux 11.11

Using gcc to (re)build binutils, I use the following script:

--8<---
#!/usr/bin/sh

export CONFIG_SITE=
export CC="gcc -mpa-risc-2-0"
export PATH=.:/usr/local/pa20_32/bin:/pro/local/bin
export PATH=$PATH"":/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/opt/langtools/bin
export PATH=$PATH"":/opt/imake/bin

make -i distclean
rm -f config.status config.cache config.log
find . -name \*.[oa] -exec rm -f {} \;

configure --prefix=/usr/local/pa20_32 --with-local-prefix=/usr/local/pa20_32 --with-gnu-as --with-as=/usr/local/pa20_32/bin/as --disable-shared --disable-nls
make -i
make install
-->8---

Another example for building 64bit ELF-64 binutils using HP C-ANSI-C:

--8<---
#!/usr/bin/sh

export CONFIG_SITE=
export CC="cc -Ae +DA2.0W"
export PATH=.:/pro/local/bin
export PATH=$PATH"":/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/opt/langtools/bin
export PATH=$PATH"":/usr/local/pa20_64/bin:/opt/imake/bin

make -i distclean
rm -f config.status config.cache config.log
find . -name \*.[oa] -exec rm -f {} \;

configure --prefix=/usr/local/pa20_64 --with-local-prefix=/usr/local/pa20_64 --disable-shared --disable-nls --host=hppa64-hp-hpux11.00
make -i
-->8---

Of course you might not have /pro/bin, but that is where my GNU make and such are installed.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Russ Jones_1
Advisor

Re: compiling gcc on hpux 11.11

thanks H.Merijn, you're my hero
H.Merijn Brand (procura
Honored Contributor

Re: compiling gcc on hpux 11.11

You're welcome. It took me over 4 month to build gcc-64 from scratch, even with help from the gcc folks. At least they listen!

OTOH my effort in getting things going revealed some bugs in gcc while building perl with it, and reporting that back for sure made gcc as of version 3.0.4 a hell lot more reliable on hpux.

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Russ Jones_1
Advisor

Re: compiling gcc on hpux 11.11

Wouldn't you know it? gcc is just a path on my to Perl 5.8 with threading. Thanks again for your help.
H.Merijn Brand (procura
Honored Contributor

Re: compiling gcc on hpux 11.11

Whoah there, reconsider!

?? HP C-ANSI-C perl builds are up to 25% faster than gcc builds
?? Non-threaded builds are up to 18% faster than threaded builds
?? 32bit builds are up to 8% faster than 64bit builds

(Numbers of top of my head, I can verify if you realy want to know)

So you need a darn good reason to build a threaded perl with gcc.

Enjoy, have FUN! H.Merijn [ The Perl 5.9.x Configure Pumpkin ]
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: compiling gcc on hpux 11.11

Ahh, got them here:

cc = HP C-ANSI-C
gcc = gcc-3.3

Higher is better

100 cc
92 cc with perl debugging
88 gcc
88 gcc with perl debugging
90 cc 64bit
81 cc 64bit with perl debugging
93 gcc 64bit
93 gcc 64bit with perl debugging
76 cc with threading
66 cc with threading and perl debugging
63 gcc with threading
65 gcc with threading and perl debugging
71 cc 64bit with threading
61 cc 64bit with threading and perl debugging
60 gcc 64bit with threading
63 gcc 64bit with threading and perl debugging

64bit threaded perl from gcc is 40% slower than cc 32bit non-threaded perl. Remember that.

[ I left out the influence of the new $PERLIO environment. Setting that to "perlio" may gain you up to 4% ]

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Russ Jones_1
Advisor

Re: compiling gcc on hpux 11.11

Thanks for all the stats. They show what I'd suspected about threading, and my default Perl is compiled without it.

I have a user that does need threading support for some unknown/unknowable reason, so I'm building her a separate Perl. I tried building it with HP's cc, but when I tried to add in the DBI::Oracle modules, which she also needs, all hell broke loose.

Performance aside, I've had better luck in the past compiling with gcc than with cc, so to get her out of my hair, I'm trying to take the path of least resistance. (Yeah, right, THIS has sure been low resistance, huh?)

Again, thanks for all your help.

Russ
H.Merijn Brand (procura
Honored Contributor

Re: compiling gcc on hpux 11.11

FWIW DBD::Oracle does *not* need a threaded perl. It only needs the "cl" and "pthread" library to appear in the $libs *first*.

Download the latest DBD::Oracle to read a fully updated README.hpux (totally revised and updated)

IMHO using HP C-ANSI-C is much less of a hassle than using gcc, so the path of least resistance ....

[ Please assign points to all posts. null points is OK, but try to skip none ]

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Russ Jones_1
Advisor

Re: compiling gcc on hpux 11.11

I know that DBI/DBD doesn't need threaded. My user needs both. I dunno why.

Thanks again.