In AIX, can different versions of compiler makes executables(or libraries) size different?
What can affects on size of executable/libraries?
In here, we have bunch of old executables and libraries which are not source code under version control. We need to figure out the executables are built from source code we have. So we build it again, but the result(exec, libs) is not same in size.
I tried..
Any help, advice, links will be helpful. Thank you.
What can affects on size of executable/libraries?
Different version of compiler.
Of course! It can generate very different binaries not only different in size. It starts with different locations of code and totally different assemble for the same source.
Different compile options.
It must change the size! If you optimize for size or for speed the result must be different. Think about loop unrolling...
Different os version and its libraries(like libm.a, libpthread.a ..).
As they are also compiled with different compilers, the answer is recursive :-)
More?
Maybe a endless list? Ordering of files while linking, different linker options, ...
My hint:
The size of the executable is only the first check. You can have different executables with the same size, quite clear.
Even if you have the same compiler with the same libs and the same OS running, you need to build with the same build script/make to get the same result. If anything is different ( compiler/libs/compiler and/or linker flags, file ordering, is different, your linked executable is different!
In a short: If you can't reproduce an exact copy of the environment for your build, you will never see the same executable, even if the sources are the same!