Note:66442.1: FAQ about ‘C’ Compiler Issues on HP-UX

CONTENTS
——–
1. What is a bundled C compiler?
2. What is an ANSI C compiler?
3. How can one tell which compiler is installed?
4. When does Oracle need an ANSI C Compiler?
5. Which compiler is used by Oracle?
6. Why does the C compiler issue warnings during relinks?
7. Which version of the compiler is required for installing Oracle?
8. Upgrading HP-UX Related Issues
9. How does the C compiler affect the linker?
10. Common Linking Issues

QUESTIONS & ANSWERS

1. What is a bundled C compiler?

A bundled C compiler is the ‘C’ compiler that comes with the HP-UX operating
system as standard. There is no extra charge for this compiler.

2. What is an ANSI C compiler?

ANSI is the American National Standards Institution. ANSI has implemented a
standard for C compilers. The HP-UX ANSI C compiler is not part of the
standard HP-UX operating system. This compiler can be purchased at an
additional cost.

3. How can one tell which compiler is installed?

a. Here is an example of the bundled compiler:

hp100% which cc
/usr/bin/cc

hp100% ls -la /usr/bin/cc
lr-xr-xr-t 1 root sys 15 Jun 10 1996 /usr/bin/cc -> /usr/ccs/bin/cc

hp100% ls -la /usr/ccs/bin/cc
-r-xr-xr-x 1 bin bin 172032 Jun 10 1996 /usr/ccs/bin/cc

hp100% what /usr/ccs/bin/cc
/usr/ccs/bin/cc:
HP92453-01 A.10.32.00 HP C (Bundled) Compiler
/usr/lib/libc: $Revision: 76.3 $

This tells us that version A.10.32 of the bundled HP C compiler is
installed.

b. Here is an example of an ANSI C compiler:

hp200% which cc
/bin/cc

hp200% ls -la /bin/cc
lr-xr-xr-t 1 root sys 17 Oct 28 17:25 /bin/cc@ -> /opt/ansic/bin/cc

hp200% what /opt/ansic/bin/cc
/opt/ansic/bin/cc:
HP92453-01 A.10.11 HP C Compiler
(LINT A.10.11 CXREF A.10.11)
/usr/lib/libc: $Revision: 76.3 $

This tells us that version A.10.11 of the HP ANSI C compiler is installed.

In the previous example, the bundled C compiler was installed as
/usr/ccs/bin/cc. The following shows that the bundled C compiler is also
installed on the node called hp200:

hp200% ls -la /usr/ccs/bin/cc
-r-xr-xr-x 1 bin bin 172032 Jun 10 1996 /usr/ccs/bin/cc

hp200% what /usr/ccs/bin/cc
/usr/ccs/bin/cc:
HP92453-01 A.10.32.00 HP C (Bundled) Compiler
/usr/lib/libc: $Revision: 76.3 $

The PATH environment variable dictates that the ANSI C compiler
will be executed.

4. When does Oracle need an ANSI C Compiler?

For installing Oracle, or when relinking Oracle executables, the bundled C
compiler is sufficient. In this case, the ANSI C compiler is not required.
Examples are the oracle, exp, proc (the ProC precompiler) executables.

The ANSI C compiler is required for compiling ProC and OCI programs, such as
*.pc files.

5. Which compiler is used by Oracle?

When relinking, the compiler used by Oracle is determined by the appropriate
makefile

If the makefile has an entry like

CC=cc

then the compiler returned by ‘which cc’ is used.

Alternatively, the makefile may have a hardcoded path name to a compiler, such
as

CC=/opt/ansic/bin/cc

In this case, Oracle has hardcoded use of the ANSI C compiler. Relinking
would fail if /opt/ansic/bin/cc does not exist. As discussed in Question 4,
Oracle does not require a ANSI C compiler for relinking. So, this makefile
could be editted to read

CC=cc

6. Why does relinking cause warnings during relinks?

Oracle Development use ANSI C compilers when developing code.
As a result, the makefiles tend to be written to work with ANSI C compilers
(this can be seen by the +Aa flag). When a bundled C compiler is used for
relinks, it will give warnings whenever an ANSI C compiler feature (option)
is encountered. These warning can be ignored, as the exectable will be
relinked regardless.

7. Which version of the compiler is required for installing Oracle?

The ICG gives recommendations of the minimum required version of the HP-UX
bundled compiler for installing Oracle. Newer versions than the recommended
version are assumed to be backwardly compatible.
Generally, if the HP-UX version requirement is met, the version of the C
compiler is correct.

8. Upgrading HP-UX Related Issues

a. bundled C compiler
Upgrading HP-UX implicitly upgrades the bundled C compiler
b. ANSI C compiler
Upgrading HP-UX does NOT upgrade the ANSI C Compiler implicitly. The ANSI C
compiler must also be upgraded.

9. How does the C compiler affect the linker?

The version of the linker (ld) is independant of the compiler being used.

10. Common Linking Issues

a. undefined symbols shl_findsym (code)
shl_load (code)
shl_unload (code)

ensure the environment variables LDFLAGS and LDOPTS are not set

b. During relink, the following is given:
‘The linked output may not run on a PA 1.x system.’

See Note 60856.1

c. During relink of svrmgrm, Motif libs cannot be found

eg, following errors given:
/usr/ccs/bin/ld: Can’t find library for -lXm
/usr/ccs/bin/ld: Can’t find library for -lXt
/usr/ccs/bin/ld: Can’t find library for -lX11

For V7.3.4 on HP-UX 10.20, ensure the following symbolic links exist:
ln -s /usr/lib/Motif1.2_R6/libXm. /usr/lib/libXm.sl
ln -s /usr/lib/X11R6/libXt.<identifier> /usr/lib/libXt.sl
ln -s /usr/lib/X11R6/libX11.<identifier> /usr/lib/libX11.sl

where <identifier> is the most recent library eg, libXm.2 is more recent
than libXm.1

For releases on HP-UX 10.10 and 10.01, ensure the following symbolic links
exist:
ln -s /usr/lib/Motif1.2/libXm.<identifier> /usr/lib/libXm.sl
ln -s /usr/lib/X11R5/libXt.<identifier> /usr/lib/libXt.sl
ln -s /usr/lib/X11R5/libX11.<identifier> /usr/lib/libX11.sl

.

Leave a comment