I'm trying to write a script for checking whether the compiler recursed properly. rkotler at mipsswbrd002:~/slave/recurse3be/build$ find . -name "*.o" -exec cmp '{}' ../../recurse2be/build/'{}' \; |& tee foo.txt Is anyone else doing this? There 2 compilers, recurse 2 and recurse3 that in principle should be identical. Obviously if there is date and time information, miscompares can occur. -------------- next part -------------- ./tools/clang/lib/AST/Release+Asserts/ASTDumper.o ../../recurse2be/build/./tools/clang/lib/AST/Release+Asserts/ASTDumper.o differ: byte 181746, line 385 ./tools/clang/lib/AST/Release+Asserts/AttrImpl.o ../../recurse2be/build/./tools/clang/lib/AST/Release+Asserts/AttrImpl.o differ: byte 192192, line 83 ./tools/clang/lib/AST/Release+Asserts/Expr.o ../../recurse2be/build/./tools/clang/lib/AST/Release+Asserts/Expr.o differ: byte 177340, line 236 ./tools/clang/lib/AST/Release+Asserts/MicrosoftCXXABI.o ../../recurse2be/build/./tools/clang/lib/AST/Release+Asserts/MicrosoftCXXABI.o differ: byte 7864, line 14 ./tools/clang/lib/Sema/Release+Asserts/AttributeList.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/AttributeList.o differ: byte 94793, line 191 ./tools/clang/lib/Sema/Release+Asserts/SemaDecl.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/SemaDecl.o differ: byte 538096, line 952 ./tools/clang/lib/Sema/Release+Asserts/SemaDeclAttr.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/SemaDeclAttr.o differ: byte 239545, line 405 ./tools/clang/lib/Sema/Release+Asserts/SemaTemplateInstantiateDecl.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/SemaTemplateInstantiateDecl.o differ: byte 172615, line 245 ./tools/clang/lib/Driver/Release+Asserts/ToolChains.o ../../recurse2be/build/./tools/clang/lib/Driver/Release+Asserts/ToolChains.o differ: byte 202045, line 150 ./tools/clang/lib/Serialization/Release+Asserts/ASTReaderDecl.o ../../recurse2be/build/./tools/clang/lib/Serialization/Release+Asserts/ASTReaderDecl.o differ: byte 278425, line 247 ./tools/clang/lib/Serialization/Release+Asserts/ASTWriter.o ../../recurse2be/build/./tools/clang/lib/Serialization/Release+Asserts/ASTWriter.o differ: byte 450523, line 789 ./tools/llvm-config/Release+Asserts/llvm-config.o ../../recurse2be/build/./tools/llvm-config/Release+Asserts/llvm-config.o differ: byte 25368, line 104 ./lib/Support/Release+Asserts/CommandLine.o ../../recurse2be/build/./lib/Support/Release+Asserts/CommandLine.o differ: byte 59791, line 147 ./lib/IR/Release+Asserts/Function.o ../../recurse2be/build/./lib/IR/Release+Asserts/Function.o differ: byte 823889, line 5168 ./lib/Analysis/Release+Asserts/BasicAliasAnalysis.o ../../recurse2be/build/./lib/Analysis/Release+Asserts/BasicAliasAnalysis.o differ: byte 46912, line 53 ./lib/Transforms/Instrumentation/Release+Asserts/MemorySanitizer.o ../../recurse2be/build/./lib/Transforms/Instrumentation/Release+Asserts/MemorySanitizer.o differ: byte 169027, line 327 ./lib/Target/X86/Release+Asserts/X86ISelDAGToDAG.o ../../recurse2be/build/./lib/Target/X86/Release+Asserts/X86ISelDAGToDAG.o differ: byte 271126, line 2999 ./lib/Target/X86/Release+Asserts/X86RegisterInfo.o ../../recurse2be/build/./lib/Target/X86/Release+Asserts/X86RegisterInfo.o differ: byte 33493, line 108 ./lib/Target/X86/InstPrinter/Release+Asserts/X86ATTInstPrinter.o ../../recurse2be/build/./lib/Target/X86/InstPrinter/Release+Asserts/X86ATTInstPrinter.o differ: byte 93564, line 89 ./lib/Target/X86/InstPrinter/Release+Asserts/X86IntelInstPrinter.o ../../recurse2be/build/./lib/Target/X86/InstPrinter/Release+Asserts/X86IntelInstPrinter.o differ: byte 107220, line 484 ./lib/Target/X86/AsmParser/Release+Asserts/X86AsmParser.o ../../recurse2be/build/./lib/Target/X86/AsmParser/Release+Asserts/X86AsmParser.o differ: byte 287278, line 1617 ./lib/Target/X86/MCTargetDesc/Release+Asserts/X86MCTargetDesc.o ../../recurse2be/build/./lib/Target/X86/MCTargetDesc/Release+Asserts/X86MCTargetDesc.o differ: byte 159231, line 159 ./lib/Target/Sparc/Release+Asserts/SparcISelDAGToDAG.o ../../recurse2be/build/./lib/Target/Sparc/Release+Asserts/SparcISelDAGToDAG.o differ: byte 25814, line 106 ./lib/Target/Sparc/Release+Asserts/SparcRegisterInfo.o ../../recurse2be/build/./lib/Target/Sparc/Release+Asserts/SparcRegisterInfo.o differ: byte 16949, line 12 ./lib/Target/Sparc/InstPrinter/Release+Asserts/SparcInstPrinter.o ../../recurse2be/build/./lib/Target/Sparc/InstPrinter/Release+Asserts/SparcInstPrinter.o differ: byte 26716, line 14 ./lib/Target/Sparc/AsmParser/Release+Asserts/SparcAsmParser.o ../../recurse2be/build/./lib/Target/Sparc/AsmParser/Release+Asserts/SparcAsmParser.o differ: byte 58286, line 535 ./lib/Target/Sparc/Disassembler/Release+Asserts/SparcDisassembler.o ../../recurse2be/build/./lib/Target/Sparc/Disassembler/Release+Asserts/SparcDisassembler.o differ: byte 42480, line 184 ./lib/Target/PowerPC/Release+Asserts/PPCISelDAGToDAG.o ../../recurse2be/build/./lib/Target/PowerPC/Release+Asserts/PPCISelDAGToDAG.o differ: byte 135005, line 376 ./lib/Target/PowerPC/Release+Asserts/PPCRegisterInfo.o ../../recurse2be/build/./lib/Target/PowerPC/Release+Asserts/PPCRegisterInfo.o differ: byte 51221, line 39 ./lib/Target/PowerPC/AsmParser/Release+Asserts/PPCAsmParser.o ../../recurse2be/build/./lib/Target/PowerPC/AsmParser/Release+Asserts/PPCAsmParser.o differ: byte 115582, line 306 ./lib/Target/PowerPC/Disassembler/Release+Asserts/PPCDisassembler.o ../../recurse2be/build/./lib/Target/PowerPC/Disassembler/Release+Asserts/PPCDisassembler.o differ: byte 63187, line 261 ./lib/Target/PowerPC/InstPrinter/Release+Asserts/PPCInstPrinter.o ../../recurse2be/build/./lib/Target/PowerPC/InstPrinter/Release+Asserts/PPCInstPrinter.o differ: byte 40870, line 25 ./lib/Target/PowerPC/MCTargetDesc/Release+Asserts/PPCMCTargetDesc.o ../../recurse2be/build/./lib/Target/PowerPC/MCTargetDesc/Release+Asserts/PPCMCTargetDesc.o differ: byte 132907, line 258 ./lib/Target/AArch64/Release+Asserts/AArch64ISelDAGToDAG.o ../../recurse2be/build/./lib/Target/AArch64/Release+Asserts/AArch64ISelDAGToDAG.o differ: byte 223462, line 2183 ./lib/Target/AArch64/Release+Asserts/AArch64RegisterInfo.o ../../recurse2be/build/./lib/Target/AArch64/Release+Asserts/AArch64RegisterInfo.o differ: byte 20886, line 17 ./lib/Target/AArch64/InstPrinter/Release+Asserts/AArch64InstPrinter.o ../../recurse2be/build/./lib/Target/AArch64/InstPrinter/Release+Asserts/AArch64InstPrinter.o differ: byte 332540, line 591 ./lib/Target/AArch64/AsmParser/Release+Asserts/AArch64AsmParser.o ../../recurse2be/build/./lib/Target/AArch64/AsmParser/Release+Asserts/AArch64AsmParser.o differ: byte 250094, line 1056 ./lib/Target/AArch64/Disassembler/Release+Asserts/AArch64Disassembler.o ../../recurse2be/build/./lib/Target/AArch64/Disassembler/Release+Asserts/AArch64Disassembler.o differ: byte 275066, line 1803 ./lib/Target/ARM/Release+Asserts/ARMBaseRegisterInfo.o ../../recurse2be/build/./lib/Target/ARM/Release+Asserts/ARMBaseRegisterInfo.o differ: byte 51142, line 104 ./lib/Target/ARM/Release+Asserts/ARMISelDAGToDAG.o ../../recurse2be/build/./lib/Target/ARM/Release+Asserts/ARMISelDAGToDAG.o differ: byte 245280, line 1268 ./lib/Target/ARM/InstPrinter/Release+Asserts/ARMInstPrinter.o ../../recurse2be/build/./lib/Target/ARM/InstPrinter/Release+Asserts/ARMInstPrinter.o differ: byte 192432, line 305 ./lib/Target/ARM/AsmParser/Release+Asserts/ARMAsmParser.o ../../recurse2be/build/./lib/Target/ARM/AsmParser/Release+Asserts/ARMAsmParser.o differ: byte 665774, line 1708 ./lib/Target/ARM/Disassembler/Release+Asserts/ARMDisassembler.o ../../recurse2be/build/./lib/Target/ARM/Disassembler/Release+Asserts/ARMDisassembler.o differ: byte 352766, line 1109 ./lib/Target/ARM64/Release+Asserts/ARM64ISelDAGToDAG.o ../../recurse2be/build/./lib/Target/ARM64/Release+Asserts/ARM64ISelDAGToDAG.o differ: byte 190326, line 970 ./lib/Target/ARM64/Release+Asserts/ARM64RegisterInfo.o ../../recurse2be/build/./lib/Target/ARM64/Release+Asserts/ARM64RegisterInfo.o differ: byte 22822, line 22 ./lib/Target/ARM64/InstPrinter/Release+Asserts/ARM64InstPrinter.o ../../recurse2be/build/./lib/Target/ARM64/InstPrinter/Release+Asserts/ARM64InstPrinter.o differ: byte 227628, line 519 ./lib/Target/ARM64/AsmParser/Release+Asserts/ARM64AsmParser.o ../../recurse2be/build/./lib/Target/ARM64/AsmParser/Release+Asserts/ARM64AsmParser.o differ: byte 415950, line 573 ./lib/Target/ARM64/Disassembler/Release+Asserts/ARM64Disassembler.o ../../recurse2be/build/./lib/Target/ARM64/Disassembler/Release+Asserts/ARM64Disassembler.o differ: byte 185919, line 1203 ./lib/Target/Mips/Release+Asserts/Mips16ISelDAGToDAG.o ../../recurse2be/build/./lib/Target/Mips/Release+Asserts/Mips16ISelDAGToDAG.o differ: byte 59954, line 71 ./lib/Target/Mips/Release+Asserts/MipsISelDAGToDAG.o ../../recurse2be/build/./lib/Target/Mips/Release+Asserts/MipsISelDAGToDAG.o differ: byte 55133, line 72 ./lib/Target/Mips/Release+Asserts/MipsRegisterInfo.o ../../recurse2be/build/./lib/Target/Mips/Release+Asserts/MipsRegisterInfo.o differ: byte 23542, line 29 ./lib/Target/Mips/Release+Asserts/MipsSEISelDAGToDAG.o ../../recurse2be/build/./lib/Target/Mips/Release+Asserts/MipsSEISelDAGToDAG.o differ: byte 83281, line 94 ./lib/Target/Mips/InstPrinter/Release+Asserts/MipsInstPrinter.o ../../recurse2be/build/./lib/Target/Mips/InstPrinter/Release+Asserts/MipsInstPrinter.o differ: byte 51888, line 73 ./lib/Target/Mips/Disassembler/Release+Asserts/MipsDisassembler.o ../../recurse2be/build/./lib/Target/Mips/Disassembler/Release+Asserts/MipsDisassembler.o differ: byte 231517, line 500 ./lib/Target/Mips/AsmParser/Release+Asserts/MipsAsmParser.o ../../recurse2be/build/./lib/Target/Mips/AsmParser/Release+Asserts/MipsAsmParser.o differ: byte 136060, line 462 ./lib/Target/XCore/Release+Asserts/XCoreISelDAGToDAG.o ../../recurse2be/build/./lib/Target/XCore/Release+Asserts/XCoreISelDAGToDAG.o differ: byte 22294, line 62 ./lib/Target/XCore/Release+Asserts/XCoreRegisterInfo.o ../../recurse2be/build/./lib/Target/XCore/Release+Asserts/XCoreRegisterInfo.o differ: byte 17460, line 12 ./lib/Target/XCore/Disassembler/Release+Asserts/XCoreDisassembler.o ../../recurse2be/build/./lib/Target/XCore/Disassembler/Release+Asserts/XCoreDisassembler.o differ: byte 119887, line 163 ./lib/Target/XCore/InstPrinter/Release+Asserts/XCoreInstPrinter.o ../../recurse2be/build/./lib/Target/XCore/InstPrinter/Release+Asserts/XCoreInstPrinter.o differ: byte 10736, line 26 ./lib/Target/MSP430/Release+Asserts/MSP430ISelDAGToDAG.o ../../recurse2be/build/./lib/Target/MSP430/Release+Asserts/MSP430ISelDAGToDAG.o differ: byte 24576, line 135 ./lib/Target/MSP430/Release+Asserts/MSP430RegisterInfo.o ../../recurse2be/build/./lib/Target/MSP430/Release+Asserts/MSP430RegisterInfo.o differ: byte 7909, line 7 ./lib/Target/MSP430/InstPrinter/Release+Asserts/MSP430InstPrinter.o ../../recurse2be/build/./lib/Target/MSP430/InstPrinter/Release+Asserts/MSP430InstPrinter.o differ: byte 8304, line 4 ./lib/Target/NVPTX/Release+Asserts/NVPTXISelDAGToDAG.o ../../recurse2be/build/./lib/Target/NVPTX/Release+Asserts/NVPTXISelDAGToDAG.o differ: byte 112898, line 593 ./lib/Target/NVPTX/Release+Asserts/NVPTXRegisterInfo.o ../../recurse2be/build/./lib/Target/NVPTX/Release+Asserts/NVPTXRegisterInfo.o differ: byte 7339, line 7 ./lib/Target/NVPTX/InstPrinter/Release+Asserts/NVPTXInstPrinter.o ../../recurse2be/build/./lib/Target/NVPTX/InstPrinter/Release+Asserts/NVPTXInstPrinter.o differ: byte 93036, line 145 ./lib/Target/Hexagon/Release+Asserts/HexagonISelDAGToDAG.o ../../recurse2be/build/./lib/Target/Hexagon/Release+Asserts/HexagonISelDAGToDAG.o differ: byte 110844, line 760 ./lib/Target/Hexagon/Release+Asserts/HexagonRegisterInfo.o ../../recurse2be/build/./lib/Target/Hexagon/Release+Asserts/HexagonRegisterInfo.o differ: byte 16354, line 5 ./lib/Target/Hexagon/InstPrinter/Release+Asserts/HexagonInstPrinter.o ../../recurse2be/build/./lib/Target/Hexagon/InstPrinter/Release+Asserts/HexagonInstPrinter.o differ: byte 174716, line 475 ./lib/Target/SystemZ/Release+Asserts/SystemZISelDAGToDAG.o ../../recurse2be/build/./lib/Target/SystemZ/Release+Asserts/SystemZISelDAGToDAG.o differ: byte 95478, line 623 ./lib/Target/SystemZ/Release+Asserts/SystemZRegisterInfo.o ../../recurse2be/build/./lib/Target/SystemZ/Release+Asserts/SystemZRegisterInfo.o differ: byte 10549, line 10 ./lib/Target/SystemZ/InstPrinter/Release+Asserts/SystemZInstPrinter.o ../../recurse2be/build/./lib/Target/SystemZ/InstPrinter/Release+Asserts/SystemZInstPrinter.o differ: byte 31092, line 31 ./lib/Target/SystemZ/AsmParser/Release+Asserts/SystemZAsmParser.o ../../recurse2be/build/./lib/Target/SystemZ/AsmParser/Release+Asserts/SystemZAsmParser.o differ: byte 47310, line 189 ./lib/Target/SystemZ/Disassembler/Release+Asserts/SystemZDisassembler.o ../../recurse2be/build/./lib/Target/SystemZ/Disassembler/Release+Asserts/SystemZDisassembler.o differ: byte 82425, line 189 ./lib/Target/R600/Release+Asserts/AMDGPUISelDAGToDAG.o ../../recurse2be/build/./lib/Target/R600/Release+Asserts/AMDGPUISelDAGToDAG.o differ: byte 84998, line 768 ./lib/Target/R600/Release+Asserts/AMDGPURegisterInfo.o ../../recurse2be/build/./lib/Target/R600/Release+Asserts/AMDGPURegisterInfo.o differ: byte 53538, line 333 ./lib/Target/R600/InstPrinter/Release+Asserts/AMDGPUInstPrinter.o ../../recurse2be/build/./lib/Target/R600/InstPrinter/Release+Asserts/AMDGPUInstPrinter.o differ: byte 119518, line 80
Greg Fitzgerald
2014-Apr-03 21:15 UTC
[LLVMdev] comparing .o files from different build trees
I have a tool called 'diffdump' for pretty much exactly this: https://github.com/garious/diffdump I originally wrote it to compare the objdump output between every object file in two directories, where one directory has objects compiled with LLVM and the other with GCC. That usage is described here: https://github.com/garious/diffdump#more-diffdump-examples Let me know if you have any questions. -Greg On Thu, Apr 3, 2014 at 10:43 AM, reed kotler <rkotler at mips.com> wrote:> I'm trying to write a script for checking whether the compiler recursed > properly. > > rkotler at mipsswbrd002:~/slave/recurse3be/build$ find . -name "*.o" -exec cmp > '{}' ../../recurse2be/build/'{}' \; |& tee foo.txt > > Is anyone else doing this? > > There 2 compilers, recurse 2 and recurse3 that in principle should be > identical. > > Obviously if there is date and time information, miscompares can occur. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
I've realized that it's necessary to build the recursed compiler in the same directory as it's previous generation (after moving the previous somewhere else) before doing the diff since the names of various generated files are embedded in the .o somtimes. For example: rkotler at mipsswbrd002:~/slave/recurse2be/build$ diff ../../tmp/1 ../../tmp/2 2c2 < ./tools/clang/lib/AST/Release+Asserts/ASTDumper.o: file format elf32-tradbigmips --- > ../../recurse3be/build/tools/clang/lib/AST/Release+Asserts/ASTDumper.o: file format elf32-tradbigmips 11404c11404 < 2510 652f7265 63757273 65326265 2f627569 e/recurse2be/bui --- > 2510 652f7265 63757273 65336265 2f627569 e/recurse3be/bui 12379c12379 < 6200 76652f72 65637572 73653262 652f6275 ve/recurse2be/bu --- > 6200 76652f72 65637572 73653362 652f6275 ve/recurse3be/bu rkotler at mipsswbrd002:~/slave/recurse2be/build$ On 04/03/2014 10:43 AM, reed kotler wrote:> I'm trying to write a script for checking whether the compiler recursed > properly. > > rkotler at mipsswbrd002:~/slave/recurse3be/build$ find . -name "*.o" -exec > cmp '{}' ../../recurse2be/build/'{}' \; |& tee foo.txt > > Is anyone else doing this? > > There 2 compilers, recurse 2 and recurse3 that in principle should be > identical. > > Obviously if there is date and time information, miscompares can occur. > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Joerg Sonnenberger
2014-Apr-03 21:16 UTC
[LLVMdev] comparing .o files from different build trees
On Thu, Apr 03, 2014 at 10:43:23AM -0700, reed kotler wrote:> I'm trying to write a script for checking whether the compiler > recursed properly.Are you using different path names for src and/or build area? That is going to introduce a lot of variance for __FILE__. The build should *not* depend on time though. Joerg
Krzysztof Parzyszek
2014-Apr-04 14:57 UTC
[LLVMdev] comparing .o files from different build trees
On 4/3/2014 4:16 PM, Reed Kotler wrote:> I've realized that it's necessary to build the recursed compiler in the > same directory as it's previous generation (after moving the previous > somewhere else) before doing the diff since the names of various > generated files are embedded in the .o somtimes.An alternative would be to only compare selected sections of the object files, for example you could skip rodata or other sections that are expected to change. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
On 04/03/2014 02:16 PM, Joerg Sonnenberger wrote:> On Thu, Apr 03, 2014 at 10:43:23AM -0700, reed kotler wrote: >> I'm trying to write a script for checking whether the compiler >> recursed properly. > > Are you using different path names for src and/or build area? > That is going to introduce a lot of variance for __FILE__. > The build should *not* depend on time though. > > Joerg >It only depends on time in one place. CommandLine.cpp you can remove the dependency by configuring with --disable-timestamps