tags:

views:

398

answers:

3

Hi All,

Is there a site where I can find the symbols used in a particular library and its version. For e.g. I m trying to compile some code on AIX using gcc, and it throws me a lot of undefined symbol errors For example, here is an output:

ld: 0711-317 ERROR: Undefined symbol: .__fixdfdi
ld: 0711-317 ERROR: Undefined symbol: .__divdi3
ld: 0711-317 ERROR: Undefined symbol: .__moddi3
ld: 0711-317 ERROR: Undefined symbol: .__floatdidf
ld: 0711-317 ERROR: Undefined symbol: .__umoddi3
ld: 0711-317 ERROR: Undefined symbol: .__udivdi3
ld: 0711-317 ERROR: Undefined symbol: .__fixunsdfdi

Where do I go to find where these symbols are. If I run the same gcc command on Linux, it runs fine.

I tried including -lgcc also but then again it throws undefined symbols for some register_frame ...blah blah... and I m getting sick of AIX.

Any help on this would be appreciated..and please don't bother Googling on this issue. You will end up no where.

Many have asked this kind of questions but no answers.

Thanks

+1  A: 

It's been a long time since I compiled anything on AIX (thankfully) and I do feel your pain having spent a good year or so trying to get our company's JNI and other software libraries built on AIX.

I do seem to remember that GCC never worked particularly well as it always came up with similar errors. Is there any option to use the native compiler (xlC)?

Failing that I would check the ordering of your libraries, it plays a big part in making stuff work properly..

I take it that you have use the nm utility to iterate through every library in /usr/lib (etc) to find where the missing symbols are located?

Gordon Carpenter-Thompson
A: 

Mostly questions:

  • Which version of GCC?
  • Which version of AIX are you on?
  • Which version of AIX was your copy of GCC built for?
  • What exactly is the link line you are using?

I've seen that sort of error when using a version of GCC compiled on a down-version of AIX. For example, if the GCC was compiled for AIX 4.3.3 and is being run on AIX 5.x. Usually, if GCC was compiled on an up-version of AIX, it won't run on the down-version, so that is unlikely to be the problem.

One other (rather unlikely) possibility: is your GCC installed where it was compiled to expect to be installed? When you build it, you specify (possibly implicitly) the install location (by default, under /usr/local). If you have your copy installed somewhere else, but there's an old GCC in /usr/local and your copy expects to be installed in /usr/local, then you can run into this sort of problem. This is much less likely than version mismatching.

Jonathan Leffler
+1  A: 

Those are math symbols. Try adding -lm to your link line.

John Grieggs