Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

Why are my .o files not removed after archiving using Solaris C++?

Sun's Solaris C++ compiler has a very nice feature to do library closure when an arhive library is made. This is done using the compiler's -xar flag, and implies templates needed by the library will be instaniated and included automatically in the archive, making it easier to link with the library (for more info see the compiler documentation or man page.)

The down side is the compiler does not have the ability to do incremental updates of archive libraries. That is, it cannot replace single .o files, it must regenerate the archive every time. This is why the .o files are not deleted when making archive libraries with Sun's Solaris C++ compiler; the .o files are needed by the compiler if the library is updated.

nmake 3.0 was unaware of compilers that support library closure, so you see the default behavior when using 3.0. Releases from 3.1 up are aware of these compilers and take advanage of the feature when it is present.

In general we suggest taking advantage of the compiler's archive feature with the side affect of leaving .o files around. However, if you know you do not need this feature and you really want the old behavior you can force the use of ar to make the archives and delete the .o files afterwards by including the following lines in your global makefile. (Keep in mind you will be turning off library closure, so don't later ask us how to do library closure with this compiler.):

    .PROBEINIT : .myPROBE

    .myPROBE : .FORCE .MAKE .AFTER
	    CC.ARFLAGS =

CC.ARFLAGS is set to -xar in the make probe file for the Solaris C++ compiler. When this flag is set it triggers the new behavior to use the compiler to make the archive library. The above will unset the flag so the old behavior is restored. You can also edit the probe file and clear the CC.ARFLAGS setting, but we recommend the above approach so you do not have to maintain the probe file when a new compiler or nmake release is installed.

Last Update: Friday,12-Aug-2016 10:48:58 EDT