Operating System - OpenVMS
1753872 Members
7668 Online
108809 Solutions
New Discussion юеВ

HP C V6.4 and CRT on VAX 5.5-2

 
Malleka Ramachandran
Frequent Advisor

HP C V6.4 and CRT on VAX 5.5-2

We have a problem when porting our application to use DEC C compiler. Historically, they have used this application on the VAX 5.5-2 with VAX C compiler V3.2.
The problem seems to be typical to a VAX Macro/C interface and/or VAXCTLG which I am trying to isolate.
The application was built using the GFLOAT qualifier for VAX C compiler and the linker option to use VAXCRTLG.EXE and PSECT_ATTR for $CODE, $DATA and $CHARACTER...
We had to use HP C because of ANSI constructs in OpenSSL code which we are using for this release.
With HP C, the compiler qualifiers used are:
/Standard=VAXC/EXTERN=COMMON/prefix=all/gfloat
With the CRT accompanying the HP C 6.4, there are VAXCRTLG.EXE, .OLB and DECC$SHR.EXE. I am not sure which one to use. The online help for C compiler says "If you are using object libraries, use VAXCRTLG.OLB when using /gfloat qualifier. Is there an option to use shareable image?
I linked using just the decc$shr/share in the linker option and VAXCRTLG.EXE/share. There were no link errors but the executable does not seem to work.
Actually it is a MACRO program calling a C routine. The C routine calls system services to get the information about hardware architecture etc. and computes some kind of CRC/encryption code that will be subsequently used in the licensing.
One thing I noticed is that on the linker map file, there is no entry corresponding to the $CHARACTER_STRING psect now but it is there with the VAX C build.
Could someone point me to where the problem might be?
Thanks,
Malleka
6 REPLIES 6
Steven Schweda
Honored Contributor

Re: HP C V6.4 and CRT on VAX 5.5-2

No bets, but I believe that with DEC/Compaq/HP
C, if you use /PREFIX = ALL, a simple LINK
(with _no_ references to DECC$SHR or
VAXCRTLG.EXE, and so on) will use the right
shareable image. Have you tried that?

The description, "does not seem to work" is not
very informative.

Do the C functions have any arguments which are
shorter than "int" (like char or short)?
Depending on the declarations, this can cause trouble.
Arch_Muthiah
Honored Contributor

Re: HP C V6.4 and CRT on VAX 5.5-2

Mallega,

I could suggest only one info for you at this moment.

I hope your sys$library will be having DECC$CRTL.OLB and DECC$CRTL.EXE. This is part of your HP C compiler distribution. The earliest version VMS which are supported by this object lib are OVMS 5.5-2 for VAX and OVMS 6.1 for Alpha. So for your case you can use these object lib and sharable image (for MAP).

Prior to C compiler version 5.6, DECC$SHR sharable image had been used to obtain which functions are present in the object lib; but after C comp version 5.6, the DECC$CRTL.EXE sharable image is being referenced by the compiler. Even if you distribute your application, you no need to worry about DECC$SHR copy found in the target machine.

If you want you define this old and sharable image as follows.

$ define DECC$CRTLMAP sys$library:DECC$CRTL.EXE

$ define LNK$LIBRARY sys$library:DECC$CRTL.OLB

If you could send the runtime error, if any, will be good.

Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: HP C V6.4 and CRT on VAX 5.5-2

Mallega,

As long as you compile your MACRO 32 source in VAX, there won't any problem with your MACRO/C combined programs.

But I suspect there are few new string functions and modified string functions are included with the new HP C RTLs, so if any of your programs use those RTL functions, make sure the function's -arguments- are converted and passed to MACRO programs.

Archunan
Regards
Archie
Malleka Ramachandran
Frequent Advisor

Re: HP C V6.4 and CRT on VAX 5.5-2

Thanks for your quick responses.
I noticed that there was a bug which perhaps went unnoticed with the earlier C compiler versions.
What I meant by "does not seem to work" was that the behavior was unusual. The program was supposed to print a single line of output, indicating either success or failure but I did not get any output at all. I was wondering if the transfer address was incorrect or something like that, so the executable was not doing anything at all. That's why I started looking at the map file to make sure my build was OK.
I built a debug version and discovered that the a C function requiring 2 arguments was called with only one argument. The second argument happened to be the length of output to be printed. In the called routine, the value of this second argument was set to some huge number (uninitialized value) so there was no output.
Arch_Muthiah
Honored Contributor

Re: HP C V6.4 and CRT on VAX 5.5-2

Hi Malleka,

May I know what is the OLB and sharable image you are using now?.
What is that function which is difft in the old version?


Archunan
Regards
Archie
John Gillings
Honored Contributor

Re: HP C V6.4 and CRT on VAX 5.5-2

Malleka,

I'm not sure I understand exactly what you're doing.

A BIG difference between VAXC and DECC is how you LINK your programs. Under DECC, DO NOT specify any C RTLs in the LINK command. That was necessary on VAXC because C RTL names weren't qualified.

So, start by removing ALL references to RTLs in your LINK commands and options files. Just LINK your program.


A crucible of informative mistakes