When a exe or library calls another one:

Hi,

Might be a simple one, but i need it.

As far as i know, when a library or exe has build time dependency on another shared library:

It keeps the name of the shared library in its table somewhere and uses the symbol name of the function or variable which it requires.

If its an archive library then it copies the stuff it requires.

I am facing a issue where a shared library has added/changed some variables in some functions, there is no change in implementation.

This function is used by many other libraries and executables.

Now the problem is, the end library/exe which uses that library is different in Solaris in terms of size/checksum or both, but same in Linux.

What can be the reason?

This forum states "Solaris & Linux", so i thought to post it here. :-)

[831 byte] By [Vibhor_Agarwal] at [2007-11-26 9:47:01]
# 1

The build dependencies are a 'make' issue. That depends on how you write or generate your makefiles.

If you want to ensure that your shared libraries are consistent, then use the -zdefs option and link with all of the other dependent libraries. This will ensure that all symbols are resolved at build time, and will cause a relink if there are changed dependencies.

Paul

Paul_Floyd at 2007-7-7 0:52:55 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

I think you misunderstood me.

There is no problem with building.

Everything is going fine.

Was just confused how the sizes/checksum got different in Solaris but not in Linux.

We use a post build utility which compares sizes/checksums.

This is failing in Linux, that's why wanted to know the reason.

Whether there is something different there.

Vibhor_Agarwal at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
Forgot to add one thing:We use -zdefs.
Vibhor_Agarwal at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 4

The compilers and linkers on Solaris and Linux are not the same. You might be seeing a difference in detailed compiler or linker operation. Without a specific example, it's impossible to say. By "specific example", I mean two versions of source code that when put into shared libraries, show a difference on Solaris but no difference on Linux.

clamage45 at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 5

Hi Clamage,

I can't give you a concrete eg. as its a huge chunk of code going in.

What's the case exactly is:

We build our code on all platforms Sol, Hp, Aix, Sgi & linux.

Some base libraries have changed.

All the dependent exe & lib which use those base libraries have changed in all platforms in terms of size/checksum or both except linux.

No code has changed in these.

We have a post utility which compares them from the previous ones on the basis of size & checkum. This thing is failing in linux as they are not getting changed.

I don't have any meaningful reason for this.

Can you suggest some?

Thanks

Vibhor_Agarwal at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
I was thinking of is there is something different in how the libraries are linked, as i stated in my opening post.
Vibhor_Agarwal at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7

Compilers, linkers, and object format details are different on Sol, Hp, Aix, Sgi & linux.

I can't tell from your original problem description exactly what changed, and in what way you expect that change to be refelcted in a library that was not itself changed. If you can provide a step-by-step description of exactly how the components are built and exactly what their dependencies are, I might be able to suggest a reason for the difference

clamage45 at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 8

Hi,

Providing the whole discription is out of my scope.

I can tell you the synopsis.

We have 3 modules: A, B & C.

A creates shared libraries, B & C create both libraries and executables.

B & C both use the libraries created by A.

No code has changed in B & C, only some enhacements have been done in A. No change in implementations.

Now the libs & exe of B & C have changed in all platforms name sol, hp, aix & sgi except linux in terms of size/checksum or both.

We have a post-build utility which does this comaprison for internal use using MD5 checksum and size.

I belong to the build team.

Now, people are after me why nothing has changed in linux platform except for the libraries of A, as in all other platforms B & C have changed.

How can i satisfy them for this?

Any help will be grateful!!!

Vibhor_Agarwal at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 9

Are the libraries created by A shared libraries (.so) or static (.a)? If some of each, do modulse B and C use any static libraries from A?

Have the headers assocated with those libraries changed? That is, a library usually has a header file that defines its interface. Has anything in those headers changed?

Have you verified that the ehanced functionality in the A libraries is actually available int he Linux build? One possible reason for no change only on Linux is that the changes are not being picked up, possibly due to errors in makefile dependendies, or build commands, or a bug in make or the linker.

clamage45 at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 10

A produces both static and dynamic.

No headers have changed. The code does contain the change in linux.

Some modules link both and some the dynamic ones only.

Yet. none of them are getting visible in linux. It might be the case that the .o which are getting extracted might not have changed.

So ultimately its the shared libraries that are somehow reflecting the change.

Vibhor_Agarwal at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 11
I'm afraid I can't suggest anything without specific examples.
clamage45 at 2007-7-7 0:52:56 > top of Java-index,Development Tools,Solaris and Linux Development Tools...