1834485 Members
3394 Online
110067 Solutions
New Discussion

Re: cc compilor

 
MKADMI_1
New Member

cc compilor

Hello,
I compiled a C program with a CC compiler 11.11.06 compiler under a monoprocessor 9000/800/L1000-44 hardware and CPU version : 2.0 PA8500.

This program is executed whithout problem under the same machine.

I tried whithout success to compile the same program whith a 11.11.02 CC compiler, under a quadriprocessor 9000/800/L3000-7x machine with CPU Version: PA 8700 CPU Module 2.3.
Here is messages :

$ make -f execU
cc -DMI_SERVBUILD +Z -I/ifx/9.30.FC3/incl/public -I/ifx/9.30.FC3/incl/esql -I/ifx/9.30.FC3/incl -D_HPUX_SOURCE -DHP -DUNIX -DNON_STANDARD_TYPES -D__hpux64 -O +Ofastaccess +DS2.0 +DA2.0W -c exec.c -o exec.o
(Bundled) cc: warning 480: The +Z option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The -O option is available only with the C/ANSI C product; ignored.
(Bundled) cc: warning 480: The +Ofastaccess option is available only with the C/ANSI C product; ignored.
(Bundled) cc: "/ifx/9.30.FC3/incl/public/milib.h", line 2211: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "/ifx/9.30.FC3/incl/public/mitrace.h", line 97: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "exec.h", line 19: error 1000: Unexpected symbol: "*".
(Bundled) cc: "exec.h", line 19: error 1000: Unexpected symbol: "mi_string".
(Bundled) cc: "exec.h", line 19: error 1000: Unexpected symbol: "mi_integer".
(Bundled) cc: "exec.h", line 19: error 1000: Unexpected symbol: "mi_integer".
(Bundled) cc: "exec.h", line 19: error 1705: Function prototypes are an ANSI feature.
(Bundled) cc: "exec.h", line 19: error 1573: Type of "<<>>" is undefined due to an illegal declaration.
(Bundled) cc: "exec.h", line 21: error 1000: Unexpected symbol: "Send_Query".
(Bundled) cc: error 2017: Cannot recover from earlier errors, terminating.
*** Error exit code 1


Is this due to differences between versions of CC compiler, or between machines ?

I transfered the compiled code and execute it under the quadriprocessor machine but it has a random behavior. Is this normal ?

What may I do to compile this program an execute it under the quadriprocessor machine?

Thanks.
9 REPLIES 9
Jean-Luc Oudart
Honored Contributor

Re: cc compilor

Hi,

it seems that you do not have the ANSI/C compiler on this second server.

What result do you have if you enter :
swlist -l fileset | grep -i ANSI

on both machines ?

Regards,
Jean-Luc
fiat lux
Muthukumar_5
Honored Contributor

Re: cc compilor

what is your CC compiler version. cc -V

Problem may be because of compilers.

Can you check with a small program as,

#include
main()
{
printf("test\n");
}

machine:
cc -O file.c

machine2:
cc -O file.c

What are you getting.?
Easy to suggest when don't know about the problem!
Robert-Jan Goossens
Honored Contributor

Re: cc compilor

Could be you need to upgrade your compiler version. Check below link for updates.

http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,1255,00.html

Regards,
Robert-Jan
MKADMI_1
New Member

Re: cc compilor


The result of : swlist -l fileset | grep -i ANSI :

on Machine 1 :
# C-ANSI-C B.11.11.06 HP C/ANSI C Compiler
C-ANSI-C.C B.11.11.06 C Programming Language
C-ANSI-C.C-HELP B.11.11.06 C Online help
C-ANSI-C.C-MAN B.11.11.06 C References Pages

on machine 2 : No result


Result of cc -cV foo.c

on machine 1 :
cpp.ansi: HP92453-01 B.11.11.06 HP C Preprocessor (ANSI)
ccom: HP92453-01 B.11.11.06 HP C Compiler

On machine 2 :
cpp: HP92453-01 B.11.11.02 HP C (Bundled) Preprocessor
ccom: HP92453-01 A.11.01.21 HP C (Bundled) Compiler

Result of cc -O file.c is the same a.out with 20400 Bytes but not the output :

On machine 1 :
/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (foo.o) was detected. The linked output may not run on a PA 1.x system.
On machine2 :
(Bundled) cc: warning 480: The -O option is available only with the C/ANSI C product; ignored.


Thanks for you all
A. Clay Stephenson
Acclaimed Contributor

Re: cc compilor

You will need to purchase the ANSI C compiler (or aCC, the C++ compiler) for the second machine. The Bundled compiler only speaks K&R C and is really only intended to generate kernels although it can be used to generate application code as long as all the source code is K&R C.
If it ain't broke, I can fix that.
MKADMI_1
New Member

Re: cc compilor

Thanks,

But is it normal that the code compiled in the first machine can't be executed in the second one ?

Muthukumar_5
Honored Contributor

Re: cc compilor

/usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (foo.o) was detected. The linked output may not run on a PA 1.x system.

It is stating that machine is capable of PA2.0. IF you want that object to run on PA 1.x you to compile as,

cc +DA1.1W -O -o obj file.c

On machine2 :
(Bundled) cc: warning 480: The -O option is available only with the C/ANSI C product; ignored

It is already known as your compiler age is very less.

I hope you can run the object which compiled on machine1 upon capable to run on machine2. Depends upon the environment and system settings, it can be run / or not.

You did not specify about your test on multi system as,

compile object on machine1. Try to run on machine2
Easy to suggest when don't know about the problem!
A. Clay Stephenson
Acclaimed Contributor

Re: cc compilor

The code compiled on the PA-8500 machine should run without problems on the PA-8700. Both use PA2.0 instructions. You need to better define what is meant by "random behavior"; the most common cause of this condition is poor code --- typically testing the value of an auto storage class variable before assigning it a value. If the code won't execute, more than likely there is a difference in shared libraries.

Execute ldd on the target machine and determine if all the shared libraries are present. You should also compare patch levels to make sure that run-time libraries (e.g. libC) are valid and/or compatible.
If it ain't broke, I can fix that.
MKADMI_1
New Member

Re: cc compilor

By "ramdom behavior" I mean that some times the program halts in the second machine and causes my database to fall down.

In fact it's an external program called by the Informix Engine wich falls down in some cases when that program is executed.

It seems like that the object code, compiled in the first machine is not suitable for the second one.

Thanks for all.