Operating System - HP-UX
1830939 Members
2777 Online
110017 Solutions
New Discussion

How to use gcc instead of cc ? My Brain is near to be exploded !

 
Kenneth_61
Frequent Advisor

How to use gcc instead of cc ? My Brain is near to be exploded !

HP unix's C complier problem is a mess in hp.com and all around the world.

HP-Unix is very stable , but is dropping market share. Could anyone can help me ? My Brain is near to be exploded , after reading many huge mess document and install patches. I cannot "make" the Apache 2.0.52 in OS 10.20.
I hope to install Apache and PHP4 afterwards, but I am now stucked in Apache. :-(

#

PHCO_19798 B.10.00.00.AA sed(1) cumulative patch.
PHCO_23684 B.10.00.00.AA libc cumulative patch
PHCO_26022 B.10.00.00.AA ls(1) cumulative patch
binutils 2.11.2 binutils
bison 1.35 bison
flex 2.5.4a flex
gcc 2.95.2 gcc
make 3.79.1 make
perl 5.6.0 perl

# .make
Making all in srclib
Making all in apr
Making all in strings
/bin/sh /download/apache/httpd-2.0.52/srclib/apr/libtool --silent --mode=compile cc -g -Ae +Z +DAportable -DHAVE_CONFIG_H
-D_XOPEN_SOURCE_EXTENDED -D_REENTRANT -I../include -I../include/arch/unix -c apr_cpystrn.c && touch apr_cpystrn.lo
(Bundled) cc: warning 480: The -g option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The +Z option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The +Z option is available only with the C/ANSI C product; ignored.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
cpp: "apr.h", line 393: warning 2013: Unknown preprocessing directive.
(Bundled) cc: "../include/apr_errno.h", line 51: error 1000: Unexpected symbol: "statcode".
(Bundled) cc: "../include/apr_errno.h", line 52: error 1000: Unexpected symbol: "apr_size_t".
(Bundled) cc: "../include/apr_general.h", line 178: error 1000: Unexpected symbol: "apr_initialize".
(Bundled) cc: error 2017: Cannot recover from earlier errors, terminating.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.
9 REPLIES 9
Kenneth_61
Frequent Advisor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

#swlist

B3920CA B.10.20 HP-UX Media Kit (Reference Only. See Description)
B5725AA_APZ A.1.42 HP-UX Installation Utilities (Ignite-UX - S800 - 10.20)
HPUXEngCR800 B.10.20 English HP-UX CDE Runtime Environment
Ignite-UX-10-20 A.1.42 HP-UX Installation Utilities for Installing 10.20 Systems
STK-HPUX B.11.23 HP-UX STK 2.3 (Software Transition Kit)
#
# Product(s) not contained in a Bundle:
#

PHCO_19798 B.10.00.00.AA sed(1) cumulative patch.
PHCO_23684 B.10.00.00.AA libc cumulative patch
PHCO_26022 B.10.00.00.AA ls(1) cumulative patch
binutils 2.11.2 binutils
bison 1.35 bison
flex 2.5.4a flex
gcc 2.95.2 gcc
make 3.79.1 make
perl 5.6.0 perl
Steve Steel
Honored Contributor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

Hi

The bundled compiler is only there for building kernels and is a subset of the real compiler


Get a full C/ANSI C product or get gcc from the net http://hpux.connect.org.uk/ or similar and change the make file to use it


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

Have you edited the Makefile and changed/added

CC=gcc

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Zygmunt Krawczyk
Honored Contributor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

Hi,
the best solution for you is to upgrade the HP-UX to 11i v1 (11.11) version and install HP supported HP-UX Web Server Suite (based on Apache 2.0.52)

http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPUXWSSUITE

Regards,
Zygmunt
H.Merijn Brand (procura
Honored Contributor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

For HP-UX 10.20 I have both a very recent Perl (5.8.5) and a *very* recent gcc (3.4.3) available for download.

Perl-5.6.0 is *old*, in the 5.6.x range, 5.6.2 is the most recent.
binutils-2.11 is *old*, and you should upgrade to 2.15, which has a lot of PA-RISC improvements (my gcc-3.4.3 port includes binutils-2.15)

most recent versions:
binutils 2.15
bison 1.875
flex 2.5.4a
gcc 3.4.3
make 3.80
perl 5.8.5

Default HP cc is a *non ANSI* braindead (that might explain your brain exploding) C compiler, only to be used for recompiling the kernel.

If you are to use gcc a lot, I would consider writing a file (shell script) that holds your preferences, and refer to it with $CONFIG_SITE, a variable known by almost all Open Source projects that use "configure" to make the Makefile

I have both HP C-ANSI-C and GNU gcc, and my $CONFIG_SITE knows about it, so I switch with

# configure --prefix=/pro/local --disable-nls
# env CC=gcc configure --prefix=/pro/local --disable-nls
# env CFLAGS=+DA2.0w LDFLAGS=+DD64 configure --prefix=/pro/local --disable-nls
# env CC=gcc64 configure --prefix=/pro/local --disable-nls

and so on

cc vs gcc
+z => -fpic
+Z => -fPIC
+Aa => -ansi
+Ae => (default)
+O2 => -O2
+DAportable => -mpa-risc-1-1

If you have a PA8xxx processor, please add -mpa-risc-2-0 to the list of gcc options

on 10.20 64bit compiles are impossible, so I don't need to tell about the differences

My HP ITRC site pages can be found at (please use LA as primary choice):

USA Los Angeles http://mirrors.develooper.com/hpux/
SGP Singapore https://www.beepz.com/personal/merijn/
USA Chicago http://ww.hpux.ws/merijn/
NL Hoofddorp http://www.cmve.net/~merijn/

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Kenneth_61
Frequent Advisor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

Thanks Duncan. It works !! after CC=gcc
I can "make" and "make install"

I have another problem. I had checked the httpd.conf and search info in internet. It says that we should create a user www for HP-UNIX. I had create www with password. I use :

User www
# Group #-1

However, it display the error also when I "apachectl start". httpd service cannot start. Do anyone know how can I fix ?

# cat error_log
[Thu Nov 11 00:04:02 2004] [warn] pid file /usr/local/apache2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Nov 11 00:04:02 2004] [emerg] (22)Invalid argument: Couldn't set permissions on cross-process lock; check User and Group directives
Steve Post
Trusted Contributor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

Besides setting the CC flag, look at your PATH. I bet the commands are looking at HP's CC before gcc. Put the paths to gcc in first.

When you run make, are you sure you're running the new make you loaded? When I did this, it ran the old make. I needed to have gmake in before make.

When I first did this stuff, I was fed up. I moved cc to cc.org and make to make.org, then made a link of cc -> gcc, and make ->gmake.
I worked. But it was the the wrong way to go. Update the PATH variable.

How?
1 env > /tmp/my_environment
2 vi /tmp/my_environment
3 Modify the line that says PATH=
4 Save the file.
5 source the file via: . /tmp/my_environment

Steve



Kenneth_61
Frequent Advisor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

May be listen to Zygmunt Krawczyk to upgrade to v11 to "escape" this general installation problem although v11 OS stil have. But, I guess that v11 is more clever. I wonder why Apache or HP.com not to list out clearly for all the general errors with searching engine instead to tell us the installation steps. ha ha
H.Merijn Brand (procura
Honored Contributor

Re: How to use gcc instead of cc ? My Brain is near to be exploded !

11.11 is no walhalla either. I've still not been able to build Qt-3.3.3 or 64bit gdb on 11.11, where 11.00 gives me no problems.

So if you are only looking for a stable *DEVELOPMENT* system, I would go for 11.00

I've never had so many signal 11's as in the past two weeks.
I've rebuilt my tcsh to be a 64bit shell, so I have higher limits, but still

Enjoy, Have FUN! H.Merijn [ Now where did you hide the Z80? ]
Enjoy, Have FUN! H.Merijn