Skip to content

Chapter12 m88k.diff file broken and will not compile m88k target specific code #5

@doon386

Description

@doon386

Hi,

The m88k.diff file found in .../Target/M88k will not apply correctly to llvm-12 as it currently exists.

The output from the patch command is shown below.

patch -p1 < ../Learn-LLVM-12-master/Chapter12/m88k.diff
patching file llvm/CMakeLists.txt
Hunk #1 succeeded at 328 (offset 14 lines).
patching file llvm/include/llvm/ADT/Triple.h
Hunk #1 FAILED at 58.
Hunk #2 succeeded at 743 (offset 8 lines).
1 out of 2 hunks FAILED -- saving rejects to file llvm/include/llvm/ADT/Triple.h.rej
patching file llvm/include/llvm/BinaryFormat/ELF.h
Hunk #1 succeeded at 501 (offset 9 lines).
patching file llvm/include/llvm/BinaryFormat/ELFRelocs/M88k.def
patching file llvm/include/llvm/Object/ELFObjectFile.h
Hunk #1 succeeded at 1179 (offset 24 lines).
Hunk #2 succeeded at 1252 (offset 26 lines).
patching file llvm/lib/Object/ELF.cpp
Hunk #1 succeeded at 44 (offset 7 lines).
patching file llvm/lib/ObjectYAML/ELFYAML.cpp
Hunk #1 succeeded at 708 with fuzz 2 (offset 17 lines).
patching file llvm/lib/Support/Triple.cpp
Hunk #1 FAILED at 44.
Hunk #2 succeeded at 109 with fuzz 2 (offset 4 lines).
Hunk #3 FAILED at 284.
Hunk #4 FAILED at 422.
Hunk #5 succeeded at 1446 with fuzz 2 (offset 740 lines).
Hunk #6 FAILED at 1281.
Hunk #7 FAILED at 1365.
Hunk #8 FAILED at 1417.
Hunk #9 succeeded at 1533 (offset 13 lines).
Hunk #10 succeeded at 1566 (offset 14 lines).
Hunk #11 succeeded at 1596 (offset 14 lines).
6 out of 11 hunks FAILED -- saving rejects to file llvm/lib/Support/Triple.cpp.rej
patching file llvm/lib/Target/M88k/AsmParser/CMakeLists.txt
patching file llvm/lib/Target/M88k/AsmParser/LLVMBuild.txt
patching file llvm/lib/Target/M88k/AsmParser/M88kAsmParser.cpp
patching file llvm/lib/Target/M88k/CMakeLists.txt
patching file llvm/lib/Target/M88k/Disassembler/CMakeLists.txt
patching file llvm/lib/Target/M88k/Disassembler/M88kDisassembler.cpp
patching file llvm/lib/Target/M88k/M88k.h
patching file llvm/lib/Target/M88k/M88k.td
patching file llvm/lib/Target/M88k/M88kAsmPrinter.cpp
patching file llvm/lib/Target/M88k/M88kCallingConv.td
patching file llvm/lib/Target/M88k/M88kCondCode.h
patching file llvm/lib/Target/M88k/M88kFrameLowering.cpp
patching file llvm/lib/Target/M88k/M88kFrameLowering.h
patching file llvm/lib/Target/M88k/M88kISelDAGToDAG.cpp
patching file llvm/lib/Target/M88k/M88kISelLowering.cpp
patching file llvm/lib/Target/M88k/M88kISelLowering.h
patching file llvm/lib/Target/M88k/M88kInstrFormats.td
patching file llvm/lib/Target/M88k/M88kInstrInfo.cpp
patching file llvm/lib/Target/M88k/M88kInstrInfo.h
patching file llvm/lib/Target/M88k/M88kInstrInfo.td
patching file llvm/lib/Target/M88k/M88kMCInstLower.cpp
patching file llvm/lib/Target/M88k/M88kMCInstLower.h
patching file llvm/lib/Target/M88k/M88kRegisterInfo.cpp
patching file llvm/lib/Target/M88k/M88kRegisterInfo.h
patching file llvm/lib/Target/M88k/M88kRegisterInfo.td
patching file llvm/lib/Target/M88k/M88kSchedule.td
patching file llvm/lib/Target/M88k/M88kSubtarget.cpp
patching file llvm/lib/Target/M88k/M88kSubtarget.h
patching file llvm/lib/Target/M88k/M88kTargetMachine.cpp
patching file llvm/lib/Target/M88k/M88kTargetMachine.h
patching file llvm/lib/Target/M88k/MCTargetDesc/CMakeLists.txt
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kInstPrinter.cpp
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kInstPrinter.h
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCAsmBackend.cpp
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCAsmInfo.cpp
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCAsmInfo.h
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCCodeEmitter.cpp
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCObjectWriter.cpp
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCTargetDesc.cpp
patching file llvm/lib/Target/M88k/MCTargetDesc/M88kMCTargetDesc.h
patching file llvm/lib/Target/M88k/README.txt
patching file llvm/lib/Target/M88k/TargetInfo/CMakeLists.txt
patching file llvm/lib/Target/M88k/TargetInfo/M88kTargetInfo.cpp
patching file llvm/lib/Target/M88k/TargetInfo/M88kTargetInfo.h
patching file llvm/test/CodeGen/M88k/and.ll
patching file llvm/test/CodeGen/M88k/or.ll
patching file llvm/test/CodeGen/M88k/shift.ll
patching file llvm/test/CodeGen/M88k/xor.ll
patching file llvm/test/MC/M88k/valid.s

In addition after patching the files by hand the resulting code will not compile. Relevent error messages from the build are shown below.

[ 20%] Building M88kGenAsmMatcher.inc...
Included from /home/doon/Downloads/llvm-project/llvm/lib/Target/M88k/M88k.td:30:
/home/doon/Downloads/llvm-project/llvm/lib/Target/M88k/M88kInstrInfo.td:361:11: error: Value specified for template argument 'LoadStore::OpNode' (#2) is of type PatFrag; expected type SDNode: load
defm LD : LoadStore<0b0001, "ld", load>;
^
make[2]: *** [lib/Target/M88k/CMakeFiles/M88kCommonTableGen.dir/build.make:134: lib/Target/M88k/M88kGenAsmMatcher.inc] Error 1
make[1]: *** [CMakeFiles/Makefile2:29080: lib/Target/M88k/CMakeFiles/M88kCommonTableGen.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 20%] Building X86GenRegisterBank.inc...
[ 20%] Building X86GenRegisterInfo.inc...
[ 20%] Building X86GenSubtargetInfo.inc...
[ 20%] Built target X86CommonTableGen
make: *** [Makefile:171: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions