Operating System - HP-UX
1752788 Members
5988 Online
108789 Solutions
New Discussion юеВ

Re: Executable Object size so larger under HPIT 64 and aCC?

 
SOLVED
Go to solution
sohochaser1
Occasional Advisor

Executable Object size so larger under HPIT 64 and aCC?

Hi All,
I am doing a product porting under Unix platform, Solaris 64, Linux 32, AIX 64 and HP IT 64. But the output of the executable is nearly 3 times of other platforms.Here is the file size and memory for loading the objects.
Platform File Size Memory Use
Sol 49M 80M
Linux 37M 50M
HP 247M 205M
HP(Stripped) 133M 205M
...

Here it the related information of compiler under HP.
OS: HP-UX vanpghpp B.11.23 U ia64(uname -a)
aCC: HP aC++/ANSI C B3910B A.05.57
Compiler flag:

-I. +Olit=none -D_INCLUDE__STDC_A1_SOURCE -D__64BIT__ -D__LP64__ -DS
S_64BIT_SERVER +DD64 +W887 -w +W229 +W331 +W361 +W392 +W431 +W655 +W684 +W818 +W819 +W849 +W889 -
D_POSIX_C_SOURCE=199506L -mt -AA +Z +W302 +W829 -DODBC64 -Wl,+b/usr/lib/hpux64
TYPE -DNATIVE_WEB_SERVICE -DNDEBUG -O -D_SCANF_X_INT_ -D_RWCONFIG_12d -DA
CTA_RW_SOURCEPRO -D_HPUX_SOURCE -mt -Wl,+s -DSAPonUNIX -DSAPonHPPA -DDTL_HP -D_HP
_UX -DRFC_USE_STLSTREAM -DSYB_LP64 -L.

Do anyone has suggestion for reducing the size of the output? Thanks in advance.



10 REPLIES 10

Re: Executable Object size so larger under HPIT 64 and aCC?

Well I guess one question is why are ypu compiling as a 64-bit executable? Your code onviously compiles 32 bit (as you indicated it did on Linux), so why are you making it 64-bit? Presumably if you needed lrager memory spaces you wouldn't be worrying about a 100MB of memory...

IA64, being EPIC architecture executables are always larger than their RISC/CISC equivalents as generally there is more intelligence in the compiled code than in the CPU.

You appear to be only doing level 1 optimizations so I don't think adding the "+Osize" option to your compiler flag would make much difference.

Is there a reason why this matters?

HTH

Duncan

I am an HPE Employee
Accept or Kudo
sohochaser1
Occasional Advisor

Re: Executable Object size so larger under HPIT 64 and aCC?

HI Duncan,
Thanks for you reply.

As we need support Linux 32, Sol 64, AIX64 and HPIT64. It is requirement.

I will try to set O3 to check if the size is reduced.Where can i find some reference related to following statment?

IA64, being EPIC architecture executables are always larger than their RISC/CISC equivalents as generally there is more intelligence in the compiled code than in the CPU.


sohochaser1
Occasional Advisor

Re: Executable Object size so larger under HPIT 64 and aCC?

I try to confirm: Is there something wrong with flags or it just because of the platform leading to the difference between HPIT and other platforms.

As we can see the data,

It need 205M to load the programe, which 4 times of linux.

Besides, i use procsize under HPIT to get the below data for the programm:

UAREA TEXT DATA STACK SHMEM IO MMAP Total
v 18 31421 1276 98048 0 0 18363 151175

The statck is 98M, is it right?

Besides, we get 205M memory using top command! Why total of procsize is 151M not 205M?
Bill Hassell
Honored Contributor

Re: Executable Object size so larger under HPIT 64 and aCC?

> It need 205M to load the programe, which 4 times of linux.

I am assuming that your Linux box is a PC. It is meaningless to compare a 32bit CISC architecture program with a 64bit RISC or Itanium box. Every integer in your program is by default 100% larger. A CISC computer chip will by definition require less instructions. There are other optimizations possible but if you are counting MBytes, I would be concerned about the memory constraints you have. Are you trying to run HP-UX in less than 500 MB of RAM?


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor
Solution

Re: Executable Object size so larger under HPIT 64 and aCC?

>HP IT 64

(This is meaningless to just about anyone but you. You should use ia64, IPF, Integrity or Itanium.)

A.05.57 is obsolete and no longer supported. The latest compiler is A.06.20 and does a much better job.

What do you mean by "Memory Use"? The output from size(1)? The size of the text space should be ignored, only R/W data is important.

You shouldn't use +Olit=none, that wastes memory.

As Duncan says, why use +DD64?

>I will try to set O3 to check if the size is reduced.

Using optimization will must likely not reduce the data size.

>just because of the platform leading to the difference between Integrity and other platforms.

The platform, for the size of the text space.

>The stack is 98M, is it right?

You can reduce this with maxssiz.

>Duncan: You appear to be only doing level 1 optimizations

No, -O == +O2.
sohochaser1
Occasional Advisor

Re: Executable Object size so larger under HPIT 64 and aCC?

Yes, the title is bad. What I mean is HP ia64.

We use A.05.57 because project risk.

I get some articles talking about the IA64 architecture, it use EPIC, so the construction is two times of other 64 platforms. Is it right?

Thanks.

Re: Executable Object size so larger under HPIT 64 and aCC?

Dennis,

You are correct (of course) -O = +02

My mistake comes from scan reading documentation, as in this:

http://docs.hp.com/en/B3901-90008/ch05s02.html?btnNext=next%A0%BB

Which states that Level 1 is the default. I interpereted this as "the default when using -O", when in fact its "the default when no other level is included in the compiler flags"

If I'd read two paragraphs further down I'd have seen that...

D'oh!

Duncan


I am an HPE Employee
Accept or Kudo

Re: Executable Object size so larger under HPIT 64 and aCC?

And now I can't type...

-O = +O2

*not*

-O = +02

Think I might just go back to bed...

I am an HPE Employee
Accept or Kudo
Dennis Handly
Acclaimed Contributor

Re: Executable Object size so larger under HPIT 64 and aCC?

>so the construction is two times of other 64 platforms. Is it right?

The instruction size for other RISC platforms.
Nothing to do with "64", other than data size is larger than 32 bit.