* I need some linker help!
@ 1999-06-18 4:00 Steve Kulpa (remove N*O*_S*P*A*M_ before replying)
1999-06-18 4:00 ` Fred Zwarts
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Steve Kulpa (remove N*O*_S*P*A*M_ before replying) @ 1999-06-18 4:00 UTC (permalink / raw)
I have an application that I've ported from a VMS-VAX to a VMS-Alpha.
The application involves both C modules and FORTRAN modules. There is
a FORTRAN common in the program with various structures and variables.
There are various EXTERNS in the C modules which relate to the
structures in the FORTRAN common.
The program compiles, links, and runs on a VAX just fine. On the
Alpha, the program will compile OK, but the linker complains about
some undefined symbols, which happen to be structures in the
FORTRAN common. This program was written by myself (a FORTRAN
programmer) and a co-worker (a C programmer) who is no longer here. I
dragged another C programmer into my office and he took a look at the
source code with me. He says the problem is that the EXTERNS in the C
modules that I'm linking with the FORTRAN modules are not seeing the
symbols declared in the FORTRAN common.
I dragged out my Linker manual (may 1993) on page 2-2 it mentions some
stuff that sounds like what I'm doing.
From the book:
"In some Digital programming languages, certain types of global
symbols, such as external variables in C and COMMON data in FORTRAN,
are not listed in the GSD as global symbol references or definitions.
Because these data types implement virtual memory that is shared, the
languages implement them as program sections that are overlaid. These
symbols appear as program section definitions in the GSD, not as
symbol definitions or reference. (Compilers use program sections to
define the memory requirements of an object module.) The linker does
not include program section definitions in its symbol resoultion
processing. For information about how the linker processes program
sections, see Chapter 3."
Well, I read chapter 3 and can not find a soultion for my problem. I
assume all I need to do is add some lines to the linker options file
for the program, but I don't know that they may be. Does anybody
out there know what I have to add to the linker options file so I can
link this thing?
This is real important to me and I will appreciate any insight anyone
can give me.
Thanks,
Steve Kulpa
Project Leader
Environmental Systems Corp.
Knoxville, TN
Please remove the N*O*_S*P*A*M_ from my e-mail address
before replying to me directly. Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: I need some linker help!
1999-06-18 4:00 I need some linker help! Steve Kulpa (remove N*O*_S*P*A*M_ before replying)
@ 1999-06-18 4:00 ` Fred Zwarts
1999-06-21 4:00 ` Arne Vajhøj
1999-06-25 4:00 ` Hoff Hoffman
2 siblings, 0 replies; 4+ messages in thread
From: Fred Zwarts @ 1999-06-18 4:00 UTC (permalink / raw)
Did you read the documentation about the /EXTERN_MODEL qualifier of the DECC compiler?
The is one of the differences between the VAXC end the DECC compiler.
Steve Kulpa (remove N*O*_S*P*A*M_ before replying) <N*O_S*P*A*M_skulpa@usit.net> wrote in message news:376a55b5.590364339@news.usit.net...
> I have an application that I've ported from a VMS-VAX to a VMS-Alpha.
> The application involves both C modules and FORTRAN modules. There is
> a FORTRAN common in the program with various structures and variables.
> There are various EXTERNS in the C modules which relate to the
> structures in the FORTRAN common.
> The program compiles, links, and runs on a VAX just fine. On the
> Alpha, the program will compile OK, but the linker complains about
> some undefined symbols, which happen to be structures in the
> FORTRAN common. This program was written by myself (a FORTRAN
> programmer) and a co-worker (a C programmer) who is no longer here. I
> dragged another C programmer into my office and he took a look at the
> source code with me. He says the problem is that the EXTERNS in the C
> modules that I'm linking with the FORTRAN modules are not seeing the
> symbols declared in the FORTRAN common.
>
> I dragged out my Linker manual (may 1993) on page 2-2 it mentions some
> stuff that sounds like what I'm doing.
>
> From the book:
> "In some Digital programming languages, certain types of global
> symbols, such as external variables in C and COMMON data in FORTRAN,
> are not listed in the GSD as global symbol references or definitions.
> Because these data types implement virtual memory that is shared, the
> languages implement them as program sections that are overlaid. These
> symbols appear as program section definitions in the GSD, not as
> symbol definitions or reference. (Compilers use program sections to
> define the memory requirements of an object module.) The linker does
> not include program section definitions in its symbol resoultion
> processing. For information about how the linker processes program
> sections, see Chapter 3."
>
> Well, I read chapter 3 and can not find a soultion for my problem. I
> assume all I need to do is add some lines to the linker options file
> for the program, but I don't know that they may be. Does anybody
> out there know what I have to add to the linker options file so I can
> link this thing?
>
> This is real important to me and I will appreciate any insight anyone
> can give me.
> Thanks,
>
> Steve Kulpa
> Project Leader
> Environmental Systems Corp.
> Knoxville, TN
>
> Please remove the N*O*_S*P*A*M_ from my e-mail address
> before replying to me directly. Thanks!
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: I need some linker help!
1999-06-18 4:00 I need some linker help! Steve Kulpa (remove N*O*_S*P*A*M_ before replying)
1999-06-18 4:00 ` Fred Zwarts
@ 1999-06-21 4:00 ` Arne Vajhøj
1999-06-25 4:00 ` Hoff Hoffman
2 siblings, 0 replies; 4+ messages in thread
From: Arne Vajhøj @ 1999-06-21 4:00 UTC (permalink / raw)
To: Steve Kulpa (remove N*O*_S*P*A*M_ before replying)
"Steve Kulpa (remove N*O*_S*P*A*M_ before replying)" wrote:
> I have an application that I've ported from a VMS-VAX to a VMS-Alpha.
> The application involves both C modules and FORTRAN modules. There is
> a FORTRAN common in the program with various structures and variables.
> There are various EXTERNS in the C modules which relate to the
> structures in the FORTRAN common.
> The program compiles, links, and runs on a VAX just fine. On the
> Alpha, the program will compile OK, but the linker complains about
> some undefined symbols, which happen to be structures in the
> FORTRAN common. This program was written by myself (a FORTRAN
> programmer) and a co-worker (a C programmer) who is no longer here. I
> dragged another C programmer into my office and he took a look at the
> source code with me. He says the problem is that the EXTERNS in the C
> modules that I'm linking with the FORTRAN modules are not seeing the
> symbols declared in the FORTRAN common.
I think you are looking for:
$ CC /EXTERNAL=COMMON
Arne
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: I need some linker help!
1999-06-18 4:00 I need some linker help! Steve Kulpa (remove N*O*_S*P*A*M_ before replying)
1999-06-18 4:00 ` Fred Zwarts
1999-06-21 4:00 ` Arne Vajhøj
@ 1999-06-25 4:00 ` Hoff Hoffman
2 siblings, 0 replies; 4+ messages in thread
From: Hoff Hoffman @ 1999-06-25 4:00 UTC (permalink / raw)
Followups set to comp.os.vms
In article <376a55b5.590364339@news.usit.net>, N*O_S*P*A*M_skulpa@usit.net (Steve Kulpa (remove N*O*_S*P*A*M_ before replying)) writes:
:I have an application that I've ported from a VMS-VAX to a VMS-Alpha.
:The application involves both C modules and FORTRAN modules. There is
:a FORTRAN common in the program with various structures and variables.
:There are various EXTERNS in the C modules which relate to the
:structures in the FORTRAN common.
..
:The program compiles, links, and runs on a VAX just fine. On the
:Alpha, the program will compile OK, but the linker complains about
:some undefined symbols, which happen to be structures in the
:FORTRAN common. This program was written by myself (a FORTRAN
:programmer) and a co-worker (a C programmer) who is no longer here. I
:dragged another C programmer into my office and he took a look at the
:source code with me. He says the problem is that the EXTERNS in the C
:modules that I'm linking with the FORTRAN modules are not seeing the
:symbols declared in the FORTRAN common.
..
:"In some Digital programming languages, certain types of global
:symbols, such as external variables in C and COMMON data in FORTRAN,
:are not listed in the GSD as global symbol references or definitions.
..
:Well, I read chapter 3 and can not find a soultion for my problem. I
:assume all I need to do is add some lines to the linker options file
:for the program, but I don't know that they may be. Does anybody
:out there know what I have to add to the linker options file so I can
:link this thing?
Please take a look at the OpenVMS Ask The Wizard area:
http://www.openvms.digital.com/wizard/
Specifically looking for the shareable image cookbook document, and
at one of the Wizard questions on the topic of using COMMONs in C:
"Problems with data reversion in COMMON?" (The latter will eventually
find its way into the cookbook or into a similar document.)
And see if these two will help you any...
Other considerations involve how C is resolving the Fortran symbols
(or not, in this case) located in the COMMON, and if the code correctly
contends with the differing page sizes on OpenVMS Alpha systems -- on
Alpha, pages can be from 8KB to 64KB in size, while VAX pages are 0.5KB.
You may end up becoming more familar with the Alpha SOLITARY attribute
in the linker options file... :-)
If you want to pursue this, I'd recommend starting with something like
the example in "Problems with data reversion in COMMON?" and with your
Fortran code and putting together a reproduer we can look at... (The
example is a C executable image and a C shareable image that both
reference data stored in a C COMMON.)
I personally really dislike using COMMONs and position-dependence in
general -- they do have their uses, but I much prefer to use global
sections as I've encountered various maintenance headaches with COMMONs
over the years.
-------------------------- pure personal opinion ---------------------------
Hoff (Stephen) Hoffman OpenVMS Engineering hoffman#xdelta.zko.dec.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1999-06-25 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-18 4:00 I need some linker help! Steve Kulpa (remove N*O*_S*P*A*M_ before replying)
1999-06-18 4:00 ` Fred Zwarts
1999-06-21 4:00 ` Arne Vajhøj
1999-06-25 4:00 ` Hoff Hoffman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox