linking/compiling failed with +O4 option (204 Views)
Reply
Advisor
chenn_1
Posts: 20
Registered: ‎05-27-2010
Message 1 of 12 (204 Views)

linking/compiling failed with +O4 option

platform: HP-UX B.11.23 PA

when I use +O4 option to build ssh-pkcs11-helper, CC stopped and dumped error info like below:

==================================

cc +DA2.0 +O4 -o ssh-pkcs11-helper ssh-pkcs11-helper.o ssh-pkcs11.o -L. -Lopenbsd-compat/ -L../libs-PA2.0/1123/ -lssh -lopenbsd-compat -Wl,+nodefaultrpath -lcrypto -lz
-lnsl -lxnet -lsec -lgssapi_krb5 -lkrb5 -lpthread
/usr/ccs/bin/ld: Fixup applied to unknown instruction
Reference from: ssh-pkcs11.o(0xf04)
/usr/ccs/bin/ld: Target of conditional branch is out of range
Reference from: ssh-pkcs11.o(0xff0)
/usr/ccs/bin/ld: Target of conditional branch is out of range
Reference from: ssh-pkcs11.o(0x1030)
/usr/ccs/bin/ld: Target of conditional branch is out of range
Reference from: ssh-pkcs11.o(0x106c)
/usr/ccs/bin/ld: Target of conditional branch is out of range
Reference from: ssh-pkcs11.o(0x10a4)
/usr/ccs/bin/ld: Fixup applied to unknown instruction
Reference from: ssh-pkcs11.o(0x10d8)
/usr/ccs/bin/ld: Fixup applied to unknown instruction
Reference from: ssh-pkcs11.o(0x10e8)
/usr/ccs/bin/ld: Target of unconditional branch is out of range
Reference from: ssh-pkcs11.o(0x12c0)
/usr/ccs/bin/ld: Invalid fixups exist
*** Error exit code 1

Stop.

==================================

Note that when I try +O2 instead of +O4, it is OK and the build passed. Anyone knows about this problem? Thanks in advance.

PS: I had a try with "-g +O4", and it passed. Compared with the failure with "+O4", this makes me more confused. Since HP C online doc said that:

" To enable debugging of optimized code, specify the -g compile-line option together with the -O, +O1, or +O2 option. Currently, debugging is supported at optimization levels 2 and below. If you try to use -g with the +O3 or +O4 option, the compiler will issue a warning stating that the options are incompatible, and will ignore the -g option. "
Please use plain text.
Advisor
chenn_1
Posts: 20
Registered: ‎05-27-2010
Message 2 of 12 (204 Views)

Re: linking/compiling failed with +O4 option


Additionally, I noticed that this failure only comes with "+DA2.0". The build is passed with "+DD64".
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 25,001
Registered: ‎03-06-2006
Message 3 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

What version of the C compiler are you using?
You may want to try +O3 instead.
Please use plain text.
Advisor
chenn_1
Posts: 20
Registered: ‎05-27-2010
Message 4 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

The compiler version is:
HP C/aC++ Version A.06.20

The reason why I want to try +O4 is that I am testing the binaries' performances with different optimization levels. The performances with +O2/+O3 are similar, then I want to try +O4 next.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 25,001
Registered: ‎03-06-2006
Message 5 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

>The compiler version is: HP C/aC++ Version A.06.20

This contradicts +DA2.0 and B.11.23 PA.
A.06.20 is an Integrity compiler version.
Again, what compiler version are you using?

>I want to try +O4 next.

Unless you use PBO, using +O4 may not help that much.
Please use plain text.
Advisor
chenn_1
Posts: 20
Registered: ‎05-27-2010
Message 6 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

Please see the compiler version info is as below:

/opt/ansic/bin/cc:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030316 $
LINT B.11.11.08 CXREF B.11.11.08
HP92453-01 B.11.11.08 HP C Compiler
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $


And thanks, I'm trying PBO too.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 25,001
Registered: ‎03-06-2006
Message 7 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

>HP92453-01 B.11.11.08 HP C Compiler

That's too old. The latest is at least B.11.11.20.
Please use plain text.
Advisor
Kannan M Jeganathan
Posts: 16
Registered: ‎05-11-2009
Message 8 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

> >HP92453-01 B.11.11.08 HP C Compiler
> That's too old. The latest is at least B.11.11.20.
Right. The latest is B.11.11.22. Refer to:
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=6208a8ea6...
Please use plain text.
Advisor
chenn_1
Posts: 20
Registered: ‎05-27-2010
Message 9 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

Hi, I've updated the compiler to version B.11.11.20(I used online swinstall, and B.11.11.20 is the latest source I can get), but the build still failed. The same error msg during linking ssh-pkcs11-helper. How could I deal with this next?

Additionally, I noticed something as below, hope they're helpful.

(1). This failure only happens when building 32bit(PA2.0) ssh-pkcs11-helper with "+DA2.0 +O4 ...". Meanwhile, it is OK when I use "+DD64 +O4 ..." to build 64bit(PA2.0) binary.

(2). Building 32bit/64bit binaries are both OK on my B.11.31 machine(compiler version is B.11.11.20).

(3). As the 1st post said, building with "+DA2.0 +O4 -g..." will be passed. The "-g" option does something magical.
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 25,001
Registered: ‎03-06-2006
Message 10 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

>I've updated the compiler to version B.11.11.20

You could try B.11.11.22 to see if that would fix it?

>How could I deal with this next?

If you have a support contract, you could report it to the Response Center. Otherwise you need to stop trying to use +O4 with that source, ssh-pkcs11.c.

>(2) Building 32bit/64bit binaries are both OK on my B.11.31 machine (compiler version is B.11.11.20).

Not sure why they would be different. Have you tried installing a newer linker patch?

>(3) building with "+O4 -g..." will be passed. The "-g" option does something magical.

Probably drops the opt level. This will happen with aC++.
Please use plain text.
Advisor
Kannan M Jeganathan
Posts: 16
Registered: ‎05-11-2009
Message 11 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

> > (3) building with "+O4 -g..." will be passed.
> > The "-g" option does something magical.
> Probably drops the opt level. This will happen with aC++.
Right. You should be getting a warning stating the same:
$cc +O4 -g ....
cc: warning 414: Optimization reduced to +O2 for compatibility with Debug.
Please use plain text.
Advisor
chenn_1
Posts: 20
Registered: ‎05-27-2010
Message 12 of 12 (204 Views)

Re: linking/compiling failed with +O4 option

Thanks all. I decide not using +O4 by now.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation