Problems linking C++ code s on the Cray X1

R

Rob Ratcliff

I'm compiling the latest version of a CORBA ORB called MICO on a Cray
X1. It makes heavy use of templates and namespaces.
Up until the link step, the C++ source code compiled flawlessly. But,
when it tried to link, I got the attached warnings and then an error.
Any ideas why the linker wouldn't see the objects in the library? They
look like pretty long names,
so maybe there is some type of symbol length or mangling issue going
on? The mangled names appear in the ".ti" files as well.
Anybody have similar problems with linking similar C++ code on the Cray?

I'm not an expert C++ programmer, but I have a lot of tenacity and
energy. :)
So if you have any ideas I can try out no matter how obscure, please
let me know.

CC -I. -I../idl -I../include -O2 -L. -L../idl -L../orb main.o -L.
-lidl -lmicoir2.3.11 -lmico2.3.11 -ldl -lelf -lm -o ird
ld-400 ld: WARNING
Unresolved text symbol
"release__34ObjVar__tm__20_Q2_5CORBA9StringDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__36ObjVar__tm__22_Q2_5CORBA10WstringDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__37ObjVar__tm__23_Q2_5CORBA11SequenceDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__33ObjVar__tm__19_Q2_5CORBA8FixedDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__33ObjVar__tm__19_Q2_5CORBA8ArrayDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__38ObjVar__tm__24_Q2_5CORBA12PrimitiveDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
....
Unresolved text symbol
"release__59ObjVar__tm__45_Q2_14PortableServer23RequestProcessingPolicySFPZ1Z_v"
-- First referenced in
"../orb/libmico2.3.11.a:poa_impl.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__50ObjVar__tm__36_Q2_14PortableServer14ServantManagerSFPZ1Z_v"
-- First referenced in
"../orb/libmico2.3.11.a:poa_impl.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__52ObjVar__tm__38_Q2_14PortableServer16AdapterActivatorSFPZ1Z_v"
-- First referenced in
"../orb/libmico2.3.11.a:poa_impl.o".
ld-401 ld: ERROR
Unresolved text symbol(s). Loading terminated.
 
J

John Harrison

Rob Ratcliff said:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray
X1. It makes heavy use of templates and namespaces.
Up until the link step, the C++ source code compiled flawlessly. But,
when it tried to link, I got the attached warnings and then an error.
Any ideas why the linker wouldn't see the objects in the library? They
look like pretty long names,
so maybe there is some type of symbol length or mangling issue going
on? The mangled names appear in the ".ti" files as well.
Anybody have similar problems with linking similar C++ code on the Cray?

I'm not an expert C++ programmer, but I have a lot of tenacity and
energy. :)
So if you have any ideas I can try out no matter how obscure, please
let me know.

The FAQ might help, 34.12 to 34.15

http://www.parashift.com/c++-faq-lite/containers-and-templates.html

john
 
R

Rob Ratcliff

Hi John,

Thanks for the link to the FAQ. There is a lot of great information
there. I read over the 34.12 and 34.5 and looked through the MICO source
code a bit more. It appears that the developers dutifully defined all of
the templates in include files so the linker should be able to tell what
to do. The code compiles fine with g++ 3.3 on IRIX (using the SGI's
linker), Solaris and Linux. The Cray doesn't have g++ ported yet as far
as I know. I wonder if there is a bug in the compiler or the linker?
Could there be something else wrong besides a bug?

Thanks,

Rob
 
J

John Harrison

Rob Ratcliff said:
Hi John,

Thanks for the link to the FAQ. There is a lot of great information
there. I read over the 34.12 and 34.5 and looked through the MICO source
code a bit more. It appears that the developers dutifully defined all of
the templates in include files so the linker should be able to tell what
to do. The code compiles fine with g++ 3.3 on IRIX (using the SGI's
linker), Solaris and Linux. The Cray doesn't have g++ ported yet as far
as I know. I wonder if there is a bug in the compiler or the linker?
Could there be something else wrong besides a bug?

Thanks,

Rob

I'm afraid I don't know enough about CORBA or the Cray to diagnose your
problem. You could try looking through the source for the undefined symbols
StringDef, WstringDef, SequenceDef etc. to see if there is anything about
those that stands out.

john
 
A

Alf P. Steinbach

* Rob Ratcliff said:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray
X1. It makes heavy use of templates and namespaces.
Up until the link step, the C++ source code compiled flawlessly. But,
when it tried to link, I got the attached warnings and then an error.
Any ideas why the linker wouldn't see the objects in the library? They
look like pretty long names,
so maybe there is some type of symbol length or mangling issue going
on? The mangled names appear in the ".ti" files as well.
Anybody have similar problems with linking similar C++ code on the Cray?

I'm not an expert C++ programmer, but I have a lot of tenacity and
energy. :)
So if you have any ideas I can try out no matter how obscure, please
let me know.

CC -I. -I../idl -I../include -O2 -L. -L../idl -L../orb main.o -L.
-lidl -lmicoir2.3.11 -lmico2.3.11 -ldl -lelf -lm -o ird
ld-400 ld: WARNING
Unresolved text symbol
"release__34ObjVar__tm__20_Q2_5CORBA9StringDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__36ObjVar__tm__22_Q2_5CORBA10WstringDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__37ObjVar__tm__23_Q2_5CORBA11SequenceDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__33ObjVar__tm__19_Q2_5CORBA8FixedDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__33ObjVar__tm__19_Q2_5CORBA8ArrayDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__38ObjVar__tm__24_Q2_5CORBA12PrimitiveDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".
ld-400 ld: WARNING
...
Unresolved text symbol
"release__59ObjVar__tm__45_Q2_14PortableServer23RequestProcessingPolicySFPZ1Z_v"
-- First referenced in
"../orb/libmico2.3.11.a:poa_impl.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__50ObjVar__tm__36_Q2_14PortableServer14ServantManagerSFPZ1Z_v"
-- First referenced in
"../orb/libmico2.3.11.a:poa_impl.o".
ld-400 ld: WARNING
Unresolved text symbol
"release__52ObjVar__tm__38_Q2_14PortableServer16AdapterActivatorSFPZ1Z_v"
-- First referenced in
"../orb/libmico2.3.11.a:poa_impl.o".
ld-401 ld: ERROR
Unresolved text symbol(s). Loading terminated.

Perhaps too obvious, but have you noticed that all of the missing symbols
are of the form


release__xxObjVar__tm__yy__Q2__


where xx and yy are numbers within small ranges?

Depending on the name mangling scheme of your compiler 'release' might be a
function called 'release' or a destructor; the former is much more likely,
I think.

Perhaps it's ObjVar::release that isn't defined, or release( ObjVar )?

Now I remember from earlier experience with Corba that you had to generate
some wrapper/interface-code by running a special tool.

Are you sure that's being done, and included in the build?
 
R

Rob Ratcliff

Rob said:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray
X1. It makes heavy use of templates and namespaces.
Up until the link step, the C++ source code compiled flawlessly. But,
when it tried to link, I got the attached warnings and then an error.
Any ideas why the linker wouldn't see the objects in the library? They
look like pretty long names,
so maybe there is some type of symbol length or mangling issue going
on? The mangled names appear in the ".ti" files as well.
Anybody have similar problems with linking similar C++ code on the Cray?

I saw this blurb at Cray about the prelinker:

1.

When the object files are linked together, a program called the
/prelinker/ is run. It examines the object files, looking for
references and definitions of template entities and for any
additional information about entities that could be instantiated.

*Caution:*


The prelinker examines the object files in a library (.a) file
but, because it does not modify them, is not able to assign
template instantiations to them.

http://www.cray.com/craydoc/manuals/S-2179-51/html-S-2179-51/qwxbmrwh.html

So I'm running some experiments without using libraries....stay tuned.
 
A

Alf P. Steinbach

Could you please refrain from posting HTML on the Usenet?

Look at any quality FAQ for guidelines on how to post, and what not
to post.
 
R

Rob Ratcliff

Alf said:
Could you please refrain from posting HTML on the Usenet?

Look at any quality FAQ for guidelines on how to post, and what not
to post.
I actually posted it in text and HTML. Did it not work in your
newsreader? I figured these days, most people use readers that can grok
multipart documents with HTML formatted text. (I usually post in plain
text, but I had cut and pasted some formatted text from Cray's web page
and I thought the formatting would actually add to the discussion in
this case.) I'll clean up my act so to speak until the FAQ is updated
though. :)

Thanks,

Rob
 
R

Rob Ratcliff

Rob said:
http://www.cray.com/craydoc/manuals/S-2179-51/html-S-2179-51/qwxbmrwh.html

So I'm running some experiments without using libraries....stay tuned


Well, that worked! The prelinker needed to modify the object files to
instantiate the template code and it couldn't do that when the object
files were already in the library. So the solution is to either link the
object files together without using libraries or to do a "dummy" link
with the object files before adding them to the respective archive
(library).
 
J

J. Otto Tennant

Rob Ratcliff said:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray
X1. It makes heavy use of templates and namespaces.
Up until the link step, the C++ source code compiled flawlessly. But,
when it tried to link, I got the attached warnings and then an error.
Any ideas why the linker wouldn't see the objects in the library? They
look like pretty long names,
so maybe there is some type of symbol length or mangling issue going
on? The mangled names appear in the ".ti" files as well.
Anybody have similar problems with linking similar C++ code on the Cray?
I'm not an expert C++ programmer, but I have a lot of tenacity and
energy. :)
So if you have any ideas I can try out no matter how obscure, please
let me know.
CC -I. -I../idl -I../include -O2 -L. -L../idl -L../orb main.o -L.
-lidl -lmicoir2.3.11 -lmico2.3.11 -ldl -lelf -lm -o ird
ld-400 ld: WARNING
Unresolved text symbol
"release__34ObjVar__tm__20_Q2_5CORBA9StringDefSFPZ1Z_v" -- First
referenced in "../idl/libidl.a:db.o".

Ghu only knows that I do not know anything about this. Almost a decade
ago, I did "maintain" and "develop" loaders, but I neither nor never
created ".ti" files.

First, I do not think that the length of the mangled name has anything
to do with it.

Second, the problem is almost certainly within the CORBA stuff.

Somewhere in the AT&T stuff, or Cray stuff, there is a demangler. The
first thing I would do is to demangle the names. That may give you a
clue to which template or namespace is at fault.

And my memory is faulty. I'm pretty certain that I never wrote a
message beginning "ld-XXX", unless it was for COS --- and that never ran
UNICOS.

C++ with templates is difficult.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,440
Latest member
YoungBorel

Latest Threads

Top