Why xlC compiler on aix always generates different object files for the same c++ source code?

550 views Asked by At

When I compile a simple test.cpp file twice using xlC compiler on AIX:

xlC_r test.cpp -o test1
xlC_r test.cpp -o test2

Then test1 and test2 are diffrent! They have diffrent md5sum.

But when I do the same on linux (with g++ of course instead of xlc) then test1 and test2 are the same...

Anybody please could tell me why this strange behavior happens in AIX??

Thanks

2

There are 2 answers

2
Nicola Musatti On

Maybe it includes a timestamp in the compiled program. You could try and find where they differ by saving an octal or headecimal dump of each program and comparing the results. Many UNIX variants provide the od and diff programs which you could use, but I don't know if they are available under AIX.

3
Dwayne Moore On

Yes, the compiler stores a timestamp in each object file that it creates. As of Version 12.1 of the compiler, one can specify the option -qnotimestamps when compiling to suppress the storing of timestamps.