rust-mos icon indicating copy to clipboard operation
rust-mos copied to clipboard

Build failure in llvm-wrapper

Open sagacity opened this issue 1 year ago • 3 comments

Thanks for your work on this project!

When compiling llvm-wrapper/PassWrapper.cpp I get this error:

  cargo:warning=llvm-wrapper/PassWrapper.cpp:321:57: error: no member named 'getCPUTable' in 'llvm::MCSubtargetInfo'
  cargo:warning=  const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable();
  cargo:warning=                                                ~~~~~~  ^

This is with https://github.com/llvm-mos/llvm-mos/commit/50b5e6c217232fdba65e40966cc83e1b4354ed42 and https://github.com/llvm-mos/llvm-mos-sdk/commit/3db8fe6f53f51f5c4f5e4dd4e09ac2537ce709ce (so pretty much the current commits at the time of writing). Is there something I can do to fix this?

sagacity avatar Oct 28 '22 11:10 sagacity

Just as an exercise I removed the references to getCPUTable and the hardware features table and replaced them with some dummy values (1 CPU, no features). This caused the rest of the compilation to succeed. However, trying to compile any example rust code causes a crash inside the compiler so I guess having no hardware features is not really an option :)

sagacity avatar Oct 29 '22 09:10 sagacity

I've also tried a build with the revisions mentioned in https://github.com/mrk-its/rust-mos/issues/16 but that returns the same error.

sagacity avatar Nov 01 '22 16:11 sagacity

@sagacity

I had the same problems and got this running by setting llvm-has-rust-patches to false in the config.toml.

Also I used his llvm-mos fork from here: https://github.com/mrk-its/llvm-mos

titanlab avatar Mar 29 '23 10:03 titanlab