Discussion:
GUARDIAN C CCOMP and BINDING
(too old to reply)
Luis Silva
2020-11-11 23:00:31 UTC
Permalink
Hi,

How can I Bind a library when cimpiling with CCOMP?

I might be missing something so simple but I can't find it. Hope you can point me in the right direction.

I have one runnable program and another with sobre functionality.

I can compile each of them with no problem.

ccomp /in <myin> /<myout>; runnable, extensions

It works, it executes, ok.

If i try to compile with:

ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions

I get an Illegal library file format.

<mylib> was compiled

ccomp /in <myinlib> /<mylib>; extensions

If I try to use BIND it also generates an error. Specifyin my files are not code 100.
They are: source code 101 and "executable" 800.

The manual tells me to use BIND, buy I can't find a way to compile to maybe object.

What am I missing?

thanks for your help.
Bill Honaker
2020-11-12 00:09:18 UTC
Permalink
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can point me in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are not code 100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to maybe object.
What am I missing?
thanks for your help.
Hi, Luis,

A couple of major things to note. BIND works on Code 100 files (created byt the 'C' comiler program), not code 800 Native object (which is what CCOMP creates).
On a TNS/E system like you're using, you're interested in the eld (Epic Link eDitor) program. (TNS/R and TNS/X systems use different compiler and ld names!)

The short answer (without details of course) is that you can either change the source file of <myinlib> to include a #pragma #search directive,
along with #pragma runnable; or use eld.

The syntax of eld is significantly different from BIND. You may be able to find examples in the "eld/xld" manuals..
The syntax is very similar to what you'll see in a Linux or OSS world, using options like "-l <lib>" or "-L <libpath>" to tell it where to find libraries,
and "-o <executable>" to write the output file. The authors made this specifically obtuse, since the first of those is a lower0case "L" and the second
is an upper-case "L". But you have to explicitly include the C Runtime library files. If I remember right, this functionality
is outlined in the C Programmers Manual. So you may not actually need the eld/xld manual.

Bill
Keith Dick
2020-11-12 03:07:57 UTC
Permalink
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can point me in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are not code 100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to maybe object.
What am I missing?
thanks for your help.
If you don't want to try to figure out using eld, I believe this would work for you, except for a possible problem I mention further below:

ccomp /in <myin> /<myout>; runnable, extensions, eld(-local_libname <mylib>)

I am not sure whether the minus character is to be included in the eld argument.

The possible problem is that the ELD manual says that user libraries are DLLs, not ordinary object files, like they were on older types of NonStop systems. If that is true, then your simple compile for producing <mylib> will not produce the DLL that you need.

This could just be a bit of confusion in the manual if user libraries must be DLLs only on NonStop X, because the manual that describes ELD also describes XLD (the ELD equivalent for the NonStop X systems), so if something is true for one system type but not the other, the manual might not make that clear.

I have created and used user libraries on older system types, but not on TNS/E, so I don't know whether the manual is correct. Since it would be easy for you to try using the ordinary linkfile that the regular compilation for <mylib> will create, I'd suggest you try using it in the syntax for the ccomp command I gave you above. If it works, great. If not, you'll have to decide what to do next.

In case I got the syntax for that command with the ELD pragma wrong, if you cannot get that to work, compile <myout> without the ELD pragma, then try running your program like this:

rund <myout>/lib <mylib>/

If <mylib> is an acceptable user library file, you should get a debug or inspect prompt, from which you can stop the program. If <mylib> is not an acceptable user library file, you should get a clear error message that says it is not acceptable.

If using an ordinary linkfile as a user library does not work, I think you have these choices:

1. Create a .ar file from your linkfile and statically link the functions from <mylib> with your program when producing the runnable file.
2. Use your <mylib> file as another input to the compiler to statically link the whole thing in the runnable file.
3. Create a DLL from your <mylib>

If you want to figure out how to make your user library be a DLL, you'll need to look at the manual "DLL Programmer's Guide for TNS/E and TNS/X Systems". I don't know how to do that.

If you you want to include your whole <mylib> statically linked into your program, you should be able to use the command:

ccomp /in <myin> /<myout>; runnable, extensions, linkfile "<mylib>"

If you want to put your <mylib> into an archive file, you might have to do your compilation in the OSS environment, since I'm not sure you can create and use archive files in the Guardian environment on TNS/E systems. It is not hard to create a Guardian runnable program from the OSS environment, but switching over to that might be more trouble than it is worth to you. The main advantage of using archive files is that the linker will only include into the runnable file the functions from the archive file that actually are referenced, not all of the functions in the file, as is done for ordinary linkfiles.

If the reason you were using a user library is that you ran out of code space in your previous environment, you probably no longer need to use a user library, since native object files have a huge amount of code space available. The second option probably would be fine for you.

If the reason you were using a user library is that you must sometimes use your program with one version of <mylib> and other times must use your program with a different version of <mylib>, then you probably either will have to create two versions of your runnable program <myout> or you will have to learn how to create a DLL from <mylib>.

If you were using a user library for some other reason, you'll have to decide which way to proceed makes sense for your situation.
JShepherd
2020-11-12 17:24:19 UTC
Permalink
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are not
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to maybe
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This

ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions

would run ccomp with a mylib as a user library


if <mylib> is a linkable or a DLL then you specify
it with the other compiler options

if <mylib> is linked as a user library then you need
a follow on link step

eld -change libname <mylib> <myout>
Keith Dick
2020-11-12 17:44:45 UTC
Permalink
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are not
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to maybe
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,

Do you know from your experience that on TNS/E, a linkfile is acceptable as a user library? Your statement here says "if <mylib> is linked as a user library" -- is that different than a normal linkable file?

The manual about ELD and XLD seems to say that only a DLL is acceptable as a user library, but as I said above, the manual might be unclear.
JShepherd
2020-11-13 01:44:58 UTC
Permalink
Post by Keith Dick
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are not
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to maybe
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,
Do you know from your experience that on TNS/E, a linkfile is acceptable as
a us
Post by Keith Dick
er library? Your statement here says "if <mylib> is linked as a user
library" -
Post by Keith Dick
- is that different than a normal linkable file?
The manual about ELD and XLD seems to say that only a DLL is acceptable as a
use
Post by Keith Dick
r library, but as I said above, the manual might be unclear.
We always use the separate eld/xld command (bind for tns mode)
to set the user library for an executable.

Any DLL on the linker search list will be in the liblist
not set as a User Library

This will set mylib as a DLL in the liblist not as a UserLibrary
ccomp /in src /object; [_options],eld(-l object.mylib)


enoft >file object
enoft >liblist

Count ReExport NotFound DLL_Name
----------------------------------------------------------------------
1 no no mylib
2 no no zcredll
3 no no zcrtldll
4 no no ZOSSKDLL
5 no no zossfdll
6 no no ZSECDLL
7 no no zi18ndll
8 no no ZICNVDLL
9 no no zosseDLL
10 no no ZINETDLL
11 no no ZOSSHDLL
12 no no ZOSSCDLL


enoft >la d

Entry Point: _MAIN
Unresolved References: ERROR
C++ Dialect: (Neutral)
Maximum Heap Size: 0x00000000
Main Stack Size: 0x00000000
Space Guarantee: 0x00000000
Fingerprint: 0000-0000-0000-0000
Fingerprint Version: 0
Ctors_vaddr: 0x00000000
Dtors_vaddr: 0x00000000
Initz_vaddr: 0x08000180
Termz_vaddr: 0x00000000
User Library Name: (none) <--------
Interpose User Library: Off
Globalized Symbols: No
Limit Runtime Paths: No
MCB address: 0x08000000
Nbr Procedures: 137 (excl comp/linker generated procs)
Nbr Ptal AltEntrPts: 0
Languages and Dialects: Asm C Ptal
Instrumented File: No
Ansistreams: No
Keith Dick
2020-11-13 02:00:04 UTC
Permalink
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are
not
Post by Keith Dick
Post by Luis Silva
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to
maybe
Post by Keith Dick
Post by Luis Silva
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,
Do you know from your experience that on TNS/E, a linkfile is acceptable as
a us
Post by Keith Dick
er library? Your statement here says "if <mylib> is linked as a user
library" -
Post by Keith Dick
- is that different than a normal linkable file?
The manual about ELD and XLD seems to say that only a DLL is acceptable as a
use
Post by Keith Dick
r library, but as I said above, the manual might be unclear.
We always use the separate eld/xld command (bind for tns mode)
to set the user library for an executable.
Any DLL on the linker search list will be in the liblist
not set as a User Library
This will set mylib as a DLL in the liblist not as a UserLibrary
ccomp /in src /object; [_options],eld(-l object.mylib)
enoft >file object
enoft >liblist
Count ReExport NotFound DLL_Name
----------------------------------------------------------------------
1 no no mylib
2 no no zcredll
3 no no zcrtldll
4 no no ZOSSKDLL
5 no no zossfdll
6 no no ZSECDLL
7 no no zi18ndll
8 no no ZICNVDLL
9 no no zosseDLL
10 no no ZINETDLL
11 no no ZOSSHDLL
12 no no ZOSSCDLL
enoft >la d
Entry Point: _MAIN
Unresolved References: ERROR
C++ Dialect: (Neutral)
Maximum Heap Size: 0x00000000
Main Stack Size: 0x00000000
Space Guarantee: 0x00000000
Fingerprint: 0000-0000-0000-0000
Fingerprint Version: 0
Ctors_vaddr: 0x00000000
Dtors_vaddr: 0x00000000
Initz_vaddr: 0x08000180
Termz_vaddr: 0x00000000
User Library Name: (none) <--------
Interpose User Library: Off
Globalized Symbols: No
Limit Runtime Paths: No
MCB address: 0x08000000
Nbr Procedures: 137 (excl comp/linker generated procs)
Nbr Ptal AltEntrPts: 0
Languages and Dialects: Asm C Ptal
Instrumented File: No
Ansistreams: No
JShepherd,

Interesting, but does not seem to answer the question I'd like answered, which is:

Is a regular linkfile acceptable as a user library, or can only a DLL be used as a user library?

Do you know the answer to that?
JShepherd
2020-11-13 20:34:35 UTC
Permalink
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you can
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files are
not
Post by Keith Dick
Post by Luis Silva
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to
maybe
Post by Keith Dick
Post by Luis Silva
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,
Do you know from your experience that on TNS/E, a linkfile is acceptable as
a us
Post by Keith Dick
er library? Your statement here says "if <mylib> is linked as a user
library" -
Post by Keith Dick
- is that different than a normal linkable file?
The manual about ELD and XLD seems to say that only a DLL is acceptable as a
use
Post by Keith Dick
r library, but as I said above, the manual might be unclear.
We always use the separate eld/xld command (bind for tns mode)
to set the user library for an executable.
Any DLL on the linker search list will be in the liblist
not set as a User Library
This will set mylib as a DLL in the liblist not as a UserLibrary
ccomp /in src /object; [_options],eld(-l object.mylib)
enoft >file object
enoft >liblist
Count ReExport NotFound DLL_Name
----------------------------------------------------------------------
1 no no mylib
2 no no zcredll
3 no no zcrtldll
4 no no ZOSSKDLL
5 no no zossfdll
6 no no ZSECDLL
7 no no zi18ndll
8 no no ZICNVDLL
9 no no zosseDLL
10 no no ZINETDLL
11 no no ZOSSHDLL
12 no no ZOSSCDLL
enoft >la d
Entry Point: _MAIN
Unresolved References: ERROR
C++ Dialect: (Neutral)
Maximum Heap Size: 0x00000000
Main Stack Size: 0x00000000
Space Guarantee: 0x00000000
Fingerprint: 0000-0000-0000-0000
Fingerprint Version: 0
Ctors_vaddr: 0x00000000
Dtors_vaddr: 0x00000000
Initz_vaddr: 0x08000180
Termz_vaddr: 0x00000000
User Library Name: (none) <--------
Interpose User Library: Off
Globalized Symbols: No
Limit Runtime Paths: No
MCB address: 0x08000000
Nbr Procedures: 137 (excl comp/linker generated procs)
Nbr Ptal AltEntrPts: 0
Languages and Dialects: Asm C Ptal
Instrumented File: No
Ansistreams: No
JShepherd,
Interesting, but does not seem to answer the question I'd like answered,
which i
Post by Keith Dick
Is a regular linkfile acceptable as a user library, or can only a DLL
be us
Post by Keith Dick
ed as a user library?
Do you know the answer to that?
A linkfile is not a UL or DDL
but it can be run thru the linker to create a UL or DLL.
Bill Honaker
2020-11-13 22:02:39 UTC
Permalink
Post by Bill Honaker
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you
can
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files
are
Post by Keith Dick
Post by Keith Dick
not
Post by Keith Dick
Post by Luis Silva
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to
maybe
Post by Keith Dick
Post by Luis Silva
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,
Do you know from your experience that on TNS/E, a linkfile is acceptable
as
Post by Keith Dick
Post by Keith Dick
a us
Post by Keith Dick
er library? Your statement here says "if <mylib> is linked as a user
library" -
Post by Keith Dick
- is that different than a normal linkable file?
The manual about ELD and XLD seems to say that only a DLL is acceptable
as a
Post by Keith Dick
Post by Keith Dick
use
Post by Keith Dick
r library, but as I said above, the manual might be unclear.
We always use the separate eld/xld command (bind for tns mode)
to set the user library for an executable.
Any DLL on the linker search list will be in the liblist
not set as a User Library
This will set mylib as a DLL in the liblist not as a UserLibrary
ccomp /in src /object; [_options],eld(-l object.mylib)
enoft >file object
enoft >liblist
Count ReExport NotFound DLL_Name
----------------------------------------------------------------------
1 no no mylib
2 no no zcredll
3 no no zcrtldll
4 no no ZOSSKDLL
5 no no zossfdll
6 no no ZSECDLL
7 no no zi18ndll
8 no no ZICNVDLL
9 no no zosseDLL
10 no no ZINETDLL
11 no no ZOSSHDLL
12 no no ZOSSCDLL
enoft >la d
Entry Point: _MAIN
Unresolved References: ERROR
C++ Dialect: (Neutral)
Maximum Heap Size: 0x00000000
Main Stack Size: 0x00000000
Space Guarantee: 0x00000000
Fingerprint: 0000-0000-0000-0000
Fingerprint Version: 0
Ctors_vaddr: 0x00000000
Dtors_vaddr: 0x00000000
Initz_vaddr: 0x08000180
Termz_vaddr: 0x00000000
User Library Name: (none) <--------
Interpose User Library: Off
Globalized Symbols: No
Limit Runtime Paths: No
MCB address: 0x08000000
Nbr Procedures: 137 (excl comp/linker generated procs)
Nbr Ptal AltEntrPts: 0
Languages and Dialects: Asm C Ptal
Instrumented File: No
Ansistreams: No
JShepherd,
Interesting, but does not seem to answer the question I'd like answered,
which i
Post by Keith Dick
Is a regular linkfile acceptable as a user library, or can only a DLL
be us
Post by Keith Dick
ed as a user library?
Do you know the answer to that?
A linkfile is not a UL or DDL
but it can be run thru the linker to create a UL or DLL.
Or run through AR to create a static link library out of many smaller ones.
Keith Dick
2020-11-13 22:39:27 UTC
Permalink
Post by Bill Honaker
Post by Bill Honaker
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you
can
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files
are
Post by Keith Dick
Post by Keith Dick
not
Post by Keith Dick
Post by Luis Silva
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to
maybe
Post by Keith Dick
Post by Luis Silva
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,
Do you know from your experience that on TNS/E, a linkfile is acceptable
as
Post by Keith Dick
Post by Keith Dick
a us
Post by Keith Dick
er library? Your statement here says "if <mylib> is linked as a user
library" -
Post by Keith Dick
- is that different than a normal linkable file?
The manual about ELD and XLD seems to say that only a DLL is acceptable
as a
Post by Keith Dick
Post by Keith Dick
use
Post by Keith Dick
r library, but as I said above, the manual might be unclear.
We always use the separate eld/xld command (bind for tns mode)
to set the user library for an executable.
Any DLL on the linker search list will be in the liblist
not set as a User Library
This will set mylib as a DLL in the liblist not as a UserLibrary
ccomp /in src /object; [_options],eld(-l object.mylib)
enoft >file object
enoft >liblist
Count ReExport NotFound DLL_Name
----------------------------------------------------------------------
1 no no mylib
2 no no zcredll
3 no no zcrtldll
4 no no ZOSSKDLL
5 no no zossfdll
6 no no ZSECDLL
7 no no zi18ndll
8 no no ZICNVDLL
9 no no zosseDLL
10 no no ZINETDLL
11 no no ZOSSHDLL
12 no no ZOSSCDLL
enoft >la d
Entry Point: _MAIN
Unresolved References: ERROR
C++ Dialect: (Neutral)
Maximum Heap Size: 0x00000000
Main Stack Size: 0x00000000
Space Guarantee: 0x00000000
Fingerprint: 0000-0000-0000-0000
Fingerprint Version: 0
Ctors_vaddr: 0x00000000
Dtors_vaddr: 0x00000000
Initz_vaddr: 0x08000180
Termz_vaddr: 0x00000000
User Library Name: (none) <--------
Interpose User Library: Off
Globalized Symbols: No
Limit Runtime Paths: No
MCB address: 0x08000000
Nbr Procedures: 137 (excl comp/linker generated procs)
Nbr Ptal AltEntrPts: 0
Languages and Dialects: Asm C Ptal
Instrumented File: No
Ansistreams: No
JShepherd,
Interesting, but does not seem to answer the question I'd like answered,
which i
Post by Keith Dick
Is a regular linkfile acceptable as a user library, or can only a DLL
be us
Post by Keith Dick
ed as a user library?
Do you know the answer to that?
A linkfile is not a UL or DDL
but it can be run thru the linker to create a UL or DLL.
Or run through AR to create a static link library out of many smaller ones.
Bill,

Yes, I know about .ar files in the OSS environment. Is it possible to create and use .ar files in the Guardian environment? I did not find anything about that in a very quick look through the manual, but it was a VERY quick look, so I might have missed it. I use .ar files in the OSS environment to build Guardian runnable programs, so I know how that works. Is there a way to create and use files equivalent to .ar files entirely in the Guardian environment?

JShepherd,

Thanks for the direct answer. So I was correct back quite a few comments ago when I warned the original poster that he could not use a native linkfile as a user library as it appeared he was expecting to be able to do. I hope he found a suitable solution to his problem.
Bill Honaker
2020-11-13 23:51:55 UTC
Permalink
Post by Keith Dick
Post by Bill Honaker
Post by Bill Honaker
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
Post by Luis Silva
Hi,
How can I Bind a library when cimpiling with CCOMP?
I might be missing something so simple but I can't find it. Hope you
can
Post by Keith Dick
Post by Keith Dick
Post by Keith Dick
Post by Luis Silva
point m
Post by Luis Silva
e in the right direction.
I have one runnable program and another with sobre functionality.
I can compile each of them with no problem.
ccomp /in <myin> /<myout>; runnable, extensions
It works, it executes, ok.
ccomp /in <myin> , lib <mylib> /<myout>; runnable, extensions
I get an Illegal library file format.
<mylib> was compiled
ccomp /in <myinlib> /<mylib>; extensions
If I try to use BIND it also generates an error. Specifyin my files
are
Post by Keith Dick
Post by Keith Dick
not
Post by Keith Dick
Post by Luis Silva
code
Post by Luis Silva
100.
They are: source code 101 and "executable" 800.
The manual tells me to use BIND, buy I can't find a way to compile to
maybe
Post by Keith Dick
Post by Luis Silva
obje
Post by Luis Silva
ct.
What am I missing?
thanks for your help.
This
ccomp /in <myin>, lib <mylib> /<myout>; runnable, extensions
would run ccomp with a mylib as a user library
if <mylib> is a linkable or a DLL then you specify
it with the other compiler options
if <mylib> is linked as a user library then you need
a follow on link step
eld -change libname <mylib> <myout>
JShepherd,
Do you know from your experience that on TNS/E, a linkfile is acceptable
as
Post by Keith Dick
Post by Keith Dick
a us
Post by Keith Dick
er library? Your statement here says "if <mylib> is linked as a user
library" -
Post by Keith Dick
- is that different than a normal linkable file?
The manual about ELD and XLD seems to say that only a DLL is acceptable
as a
Post by Keith Dick
Post by Keith Dick
use
Post by Keith Dick
r library, but as I said above, the manual might be unclear.
We always use the separate eld/xld command (bind for tns mode)
to set the user library for an executable.
Any DLL on the linker search list will be in the liblist
not set as a User Library
This will set mylib as a DLL in the liblist not as a UserLibrary
ccomp /in src /object; [_options],eld(-l object.mylib)
enoft >file object
enoft >liblist
Count ReExport NotFound DLL_Name
----------------------------------------------------------------------
1 no no mylib
2 no no zcredll
3 no no zcrtldll
4 no no ZOSSKDLL
5 no no zossfdll
6 no no ZSECDLL
7 no no zi18ndll
8 no no ZICNVDLL
9 no no zosseDLL
10 no no ZINETDLL
11 no no ZOSSHDLL
12 no no ZOSSCDLL
enoft >la d
Entry Point: _MAIN
Unresolved References: ERROR
C++ Dialect: (Neutral)
Maximum Heap Size: 0x00000000
Main Stack Size: 0x00000000
Space Guarantee: 0x00000000
Fingerprint: 0000-0000-0000-0000
Fingerprint Version: 0
Ctors_vaddr: 0x00000000
Dtors_vaddr: 0x00000000
Initz_vaddr: 0x08000180
Termz_vaddr: 0x00000000
User Library Name: (none) <--------
Interpose User Library: Off
Globalized Symbols: No
Limit Runtime Paths: No
MCB address: 0x08000000
Nbr Procedures: 137 (excl comp/linker generated procs)
Nbr Ptal AltEntrPts: 0
Languages and Dialects: Asm C Ptal
Instrumented File: No
Ansistreams: No
JShepherd,
Interesting, but does not seem to answer the question I'd like answered,
which i
Post by Keith Dick
Is a regular linkfile acceptable as a user library, or can only a DLL
be us
Post by Keith Dick
ed as a user library?
Do you know the answer to that?
A linkfile is not a UL or DDL
but it can be run thru the linker to create a UL or DLL.
Or run through AR to create a static link library out of many smaller ones.
Bill,
Yes, I know about .ar files in the OSS environment. Is it possible to create and use .ar files in the Guardian environment? I did not find anything about that in a very quick look through the manual, but it was a VERY quick look, so I might have missed it. I use .ar files in the OSS environment to build Guardian runnable programs, so I know how that works. Is there a way to create and use files equivalent to .ar files entirely in the Guardian environment?
JShepherd,
Thanks for the direct answer. So I was correct back quite a few comments ago when I warned the original poster that he could not use a native linkfile as a user library as it appeared he was expecting to be able to do. I hope he found a suitable solution to his problem.
Keith,

There is an AR in $system.system. At least on a TNS/E, it's in T8629. Works pretty much the same.

Also,the latest versionof GMAKE for Guardian (availalbe in ITUGLIB) supports AR files natively just as in Linux/OSS.
Targets in that environment can be arfile(library) format, as can dependencies.

And the eld/xld linkers can use those as inputs to your executable for static linking.

Bill

Loading...