Strangely, when I use -frandom-seed I get a bigger set of differing data between the resulting library files. I checked the documentation for gcc and it states this options is used to "produce reproducibly identical object files." So I assume this will only work on .o files? Also, I decided to take a comparison of the build directories XCode makes. All of the .o files stay the same and I get 3 file differences overall: pbxindex.header, strings.pbxstrings/control, and symbols0.pbxsymbols. Perhaps this is a better way of localizing the problem. Any ideas? ~Caleb On 12/5/06, Perry Smith <pedz@xxxxxxxxxxxxxxxx> wrote:
The header of object files for xcoff have timestamps in them but I'm not sure what file format a Mac uses. There is also something about the "random seed" for gcc. (Look up -frandom-seed=string in the docs). I remember this topic came up on either gcc or gcc-help within the past year. You might search the archives to see if you can find some hits. I just did a trivial test on my Mac and the files compared equal (using g++ 4.0.1). But what I was going to suggest is to use cmp -l to get the list of places that are different. It should be just four or eight bytes I would also try comparing the object files and see which ones match and which ones don't -- try and break down what is not matching. Not sure this helps much... On Dec 5, 2006, at 9:51 AM, Caleb Cittadino wrote: Hi Perry, Here is the start of the thread: __________________________________ Hello, I need to compare two binaries build by gcc to determine if they have the same contents. My issue is that I can't build (using the same build target) two of the same binary. I believe this is because a timestamp or something of the kind is being put in. Is there another way I can check these contents against each other without the extra info? Thanks, ~Caleb _________________________ On 12/4/06, Perry Smith < pedz@xxxxxxxxxxxxxxxx> wrote: > > > > On Dec 4, 2006, at 7:31 PM, Caleb Cittadino wrote: > > > > Well, you didn't mention anything about what platform and object format > you're using so I don't think you're going to get any definitive > answers. > > > I'm using MacOSX + gcc4. What do you mean by object format? > > > Different machines have different object file formats. The two I am aware of is dwarf and xcoff. I'm not sure what Mac OSX uses but that should be enough for the others on the help list to know. > > > I didn't see the start of this thread. Are you trying to compare object files? > > > Perry Smith ( pedz@xxxxxxxxxxxxxxxx ) > Ease Software, Inc. ( http://www.easesoftware.com ) > > Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems > > > Perry Smith ( pedz@xxxxxxxxxxxxxxxx ) Ease Software, Inc. ( http://www.easesoftware.com ) Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems