twizzler-operating-system / OLD-twizzler

The main source repo for Twizzler
10 stars 5 forks source link

Build fails at Rust compilation on Ubuntu 21.04 #8

Closed fabalchemy closed 9 months ago

fabalchemy commented 3 years ago

Hi,

On Ubuntu 21.04, the first compilation step (building the toolchain) fails at the Rust compilation step :

FAILED: rustc-prefix/src/rustc-stamp/rustc-build ```code error occurred: Command "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I/usr/lib/llvm-12/include" "-std=c++14" "-fno-exceptions" "-D_GNU_SOURCE" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_AARCH64" "-DLLVM_COMPONENT_AMDGPU" "-DLLVM_COMPONENT_ARM" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_AVR" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_COVERAGE" "-DLLVM_COMPONENT_HEXAGON" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_LTO" "-DLLVM_COMPONENT_MIPS" "-DLLVM_COMPONENT_MSP430" "-DLLVM_COMPONENT_NVPTX" "-DLLVM_COMPONENT_POWERPC" "-DLLVM_COMPONENT_RISCV" "-DLLVM_COMPONENT_SPARC" "-DLLVM_COMPONENT_SYSTEMZ" "-DLLVM_COMPONENT_WEBASSEMBLY" "-DLLVM_COMPONENT_X86" "-DNDEBUG" "-o" "twizzler/build/tools/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/build/rustc_llvm-db0862b5ac2e556c/out/llvm-wrapper/PassWrapper.o" "-c" "llvm-wrapper/PassWrapper.cpp" with args "c++" did not execute successfully (status code exit code: 1). warning: build failed, waiting for other jobs to finish... error: build failed command did not execute successfully: "twizzler/build/tools/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--features" " llvm max_level_info" "--manifest-path" "twizzler/tools/rust/compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics" expected success, got: exit code: 101 failed to run: twizzler/build/tools/rust/build/bootstrap/debug/bootstrap build -j 8 Build completed unsuccessfully in 0:02:15 [111/114] Completed 'utils' FAILED: rustc-prefix/src/rustc-stamp/rustc-build ```

I have tried to delete and clone everything before rebuilding, with no luck

dbittman commented 3 years ago

Hi, is the c++ command clang or gcc on your system, and which version?

fabalchemy commented 3 years ago
$ gcc --version
gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0
fabalchemy commented 3 years ago

Same problem with clang 12.0 :(

It seems like a few function definitions are missing when we compile llvm-wrapper/PassWrapper.cpp

Complete Clang error `stderr` ``` cargo:warning=llvm-wrapper/PassWrapper.cpp:679:7: error: no member named 'registerBeforePassCallback' in 'llvm::PassInstrumentationCallbacks' cargo:warning= PIC.registerBeforePassCallback([LlvmSelfProfiler, BeforePassCallback]( cargo:warning= ~~~ ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:683:42: error: variable 'PassName' cannot be implicitly captured in a lambda with no capture-default specified cargo:warning= BeforePassCallback(LlvmSelfProfiler, PassName.c_str(), IrName.c_str()); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:681:17: note: 'PassName' declared here cargo:warning= std::string PassName = Pass.str(); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:679:34: note: lambda expression begins here cargo:warning= PIC.registerBeforePassCallback([LlvmSelfProfiler, BeforePassCallback]( cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:683:60: error: variable 'IrName' cannot be implicitly captured in a lambda with no capture-default specified cargo:warning= BeforePassCallback(LlvmSelfProfiler, PassName.c_str(), IrName.c_str()); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:682:17: note: 'IrName' declared here cargo:warning= std::string IrName = LLVMRustwrappedIrGetName(Ir); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:679:34: note: lambda expression begins here cargo:warning= PIC.registerBeforePassCallback([LlvmSelfProfiler, BeforePassCallback]( cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:755:28: error: no matching constructor for initialization of 'llvm::StandardInstrumentations' cargo:warning= StandardInstrumentations SI; cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/StandardInstrumentations.h:269:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 0 were provided cargo:warning=class StandardInstrumentations { cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/StandardInstrumentations.h:283:3: note: candidate constructor not viable: requires at least argument 'DebugLogging', but no arguments were provided cargo:warning= StandardInstrumentations(bool DebugLogging, bool VerifyEach = false); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:771:15: error: no matching constructor for initialization of 'llvm::PassBuilder' cargo:warning= PassBuilder PB(TM, PTO, PGOOpt, &PIC); cargo:warning= ^ ~~~~~~~~~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:272:12: note: candidate constructor not viable: no known conversion from 'llvm::PipelineTuningOptions' to 'llvm::TargetMachine *' for 2nd argument cargo:warning= explicit PassBuilder(bool DebugLogging = false, TargetMachine *TM = nullptr, cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:141:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 4 were provided cargo:warning=class PassBuilder { cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:141:7: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 4 were provided cargo:warning=llvm-wrapper/PassWrapper.cpp:780:36: error: calling 'buildDefaultAAPipeline' with incomplete return type 'llvm::AAManager' cargo:warning= FAM.registerPass([&] { return PB.buildDefaultAAPipeline(); }); cargo:warning= ~~~^~~~~~~~~~~~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:456:13: note: 'buildDefaultAAPipeline' declared here cargo:warning= AAManager buildDefaultAAPipeline(); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/Target/TargetMachine.h:29:7: note: forward declaration of 'llvm::AAManager' cargo:warning=class AAManager; cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:917:50: error: too many arguments to function call, expected 5, have 6 cargo:warning= /*IsCS=*/false, PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile); cargo:warning= ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:694:8: note: 'addPGOInstrPassesForO0' declared here cargo:warning= void addPGOInstrPassesForO0(ModulePassManager &MPM, bool RunProfileGen, cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:922:44: error: no viable conversion from 'const function &)>' to 'const function' cargo:warning= PB.registerPipelineStartEPCallback(C); cargo:warning= ^ cargo:warning=/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:337:7: note: candidate constructor not viable: no known conversion from 'const std::function &)>' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument cargo:warning= function(nullptr_t) noexcept cargo:warning= ^ cargo:warning=/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:348:7: note: candidate constructor not viable: no known conversion from 'const std::function &)>' to 'const std::function &, llvm::PassBuilder::OptimizationLevel)> &' for 1st argument cargo:warning= function(const function& __x); cargo:warning= ^ cargo:warning=/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:357:7: note: candidate constructor not viable: no known conversion from 'const std::function &)>' to 'std::function &, llvm::PassBuilder::OptimizationLevel)> &&' for 1st argument cargo:warning= function(function&& __x) noexcept : _Function_base() cargo:warning= ^ cargo:warning=/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/std_function.h:381:2: note: candidate template ignored: requirement '_Callable> &)>, std::__invoke_result> &)> &, llvm::PassManager> &, llvm::PassBuilder::OptimizationLevel>>::value' was not satisfied [with _Functor = std::function &)>, $1 = void] cargo:warning= function(_Functor); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:608:74: note: passing argument to parameter 'C' here cargo:warning= const std::function &C) { cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:933:63: error: too many arguments to function call, expected single argument 'Level', have 2 arguments cargo:warning= MPM = PB.buildThinLTOPreLinkDefaultPipeline(OptLevel, DebugPassManager); cargo:warning= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:400:21: note: 'buildThinLTOPreLinkDefaultPipeline' declared here cargo:warning= ModulePassManager buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:947:59: error: too many arguments to function call, expected single argument 'Level', have 2 arguments cargo:warning= MPM = PB.buildLTOPreLinkDefaultPipeline(OptLevel, DebugPassManager); cargo:warning= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:429:21: note: 'buildLTOPreLinkDefaultPipeline' declared here cargo:warning= ModulePassManager buildLTOPreLinkDefaultPipeline(OptimizationLevel Level); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:952:74: error: too many arguments to function call, expected 2, have 3 cargo:warning= MPM = PB.buildThinLTODefaultPipeline(OptLevel, DebugPassManager, nullptr); cargo:warning= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:414:3: note: 'buildThinLTODefaultPipeline' declared here cargo:warning= buildThinLTODefaultPipeline(OptimizationLevel Level, cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:955:70: error: too many arguments to function call, expected 2, have 3 cargo:warning= MPM = PB.buildLTODefaultPipeline(OptLevel, DebugPassManager, nullptr); cargo:warning= ~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/Passes/PassBuilder.h:442:21: note: 'buildLTODefaultPipeline' declared here cargo:warning= ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level, cargo:warning= ^ cargo:warning=In file included from llvm-wrapper/PassWrapper.cpp:6: cargo:warning=In file included from llvm-wrapper/LLVMWrapper.h:8: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/Analysis/Lint.h:22: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassManager.h:47: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:53: cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:195:5: error: void function 'CallImpl<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' should not return a value [-Wreturn-type] cargo:warning= return Func(std::forward(Params)...); cargo:warning= ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:332:10: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::CallImpl<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= &CallImpl}; cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:253:49: note: in instantiation of static data member 'llvm::detail::UniqueFunctionBase::CallbacksHolder<(lambda at llvm-wrapper/PassWrapper.cpp:679:34), (lambda at llvm-wrapper/PassWrapper.cpp:679:34)>::Callbacks' requested here cargo:warning= &CallbacksHolder::Callbacks, IsInlineStorage); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:350:9: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::UniqueFunctionBase<(lambda at llvm-wrapper/PassWrapper.cpp:679:34), (lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= : Base(std::forward(Callable), cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/SmallVector.h:912:33: note: in instantiation of function template specialization 'llvm::unique_function::unique_function<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= ::new ((void *)this->end()) T(std::forward(Args)...); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:118:29: note: in instantiation of function template specialization 'llvm::SmallVectorImpl>::emplace_back<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= BeforeAnalysisCallbacks.emplace_back(std::move(C)); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:679:7: note: in instantiation of function template specialization 'llvm::PassInstrumentationCallbacks::registerBeforeAnalysisCallback<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= PIC.registerBeforePassCallback([LlvmSelfProfiler, BeforePassCallback]( cargo:warning= ^ cargo:warning=In file included from llvm-wrapper/PassWrapper.cpp:6: cargo:warning=In file included from llvm-wrapper/LLVMWrapper.h:8: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/Analysis/Lint.h:22: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassManager.h:47: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:53: cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:195:12: error: no matching function for call to object of type '(lambda at llvm-wrapper/PassWrapper.cpp:679:34)' cargo:warning= return Func(std::forward(Params)...); cargo:warning= ^~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:332:10: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::CallImpl<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= &CallImpl}; cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:253:49: note: in instantiation of static data member 'llvm::detail::UniqueFunctionBase::CallbacksHolder<(lambda at llvm-wrapper/PassWrapper.cpp:679:34), (lambda at llvm-wrapper/PassWrapper.cpp:679:34)>::Callbacks' requested here cargo:warning= &CallbacksHolder::Callbacks, IsInlineStorage); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:350:9: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::UniqueFunctionBase<(lambda at llvm-wrapper/PassWrapper.cpp:679:34), (lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= : Base(std::forward(Callable), cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/SmallVector.h:912:33: note: in instantiation of function template specialization 'llvm::unique_function::unique_function<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= ::new ((void *)this->end()) T(std::forward(Args)...); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:108:24: note: in instantiation of function template specialization 'llvm::SmallVectorImpl>::emplace_back<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= AfterPassCallbacks.emplace_back(std::move(C)); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:679:7: note: in instantiation of function template specialization 'llvm::PassInstrumentationCallbacks::registerAfterPassCallback<(lambda at llvm-wrapper/PassWrapper.cpp:679:34)>' requested here cargo:warning= PIC.registerBeforePassCallback([LlvmSelfProfiler, BeforePassCallback]( cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:679:34: note: candidate function not viable: requires 2 arguments, but 3 were provided cargo:warning= PIC.registerBeforePassCallback([LlvmSelfProfiler, BeforePassCallback]( cargo:warning= ^ cargo:warning=In file included from llvm-wrapper/PassWrapper.cpp:6: cargo:warning=In file included from llvm-wrapper/LLVMWrapper.h:8: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/Analysis/Lint.h:22: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassManager.h:47: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:53: cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:195:12: error: no matching function for call to object of type '(lambda at llvm-wrapper/PassWrapper.cpp:688:7)' cargo:warning= return Func(std::forward(Params)...); cargo:warning= ^~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:332:10: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::CallImpl<(lambda at llvm-wrapper/PassWrapper.cpp:688:7)>' requested here cargo:warning= &CallImpl}; cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:253:49: note: in instantiation of static data member 'llvm::detail::UniqueFunctionBase::CallbacksHolder<(lambda at llvm-wrapper/PassWrapper.cpp:688:7), (lambda at llvm-wrapper/PassWrapper.cpp:688:7)>::Callbacks' requested here cargo:warning= &CallbacksHolder::Callbacks, IsInlineStorage); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:350:9: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::UniqueFunctionBase<(lambda at llvm-wrapper/PassWrapper.cpp:688:7), (lambda at llvm-wrapper/PassWrapper.cpp:688:7)>' requested here cargo:warning= : Base(std::forward(Callable), cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/SmallVector.h:912:33: note: in instantiation of function template specialization 'llvm::unique_function::unique_function<(lambda at llvm-wrapper/PassWrapper.cpp:688:7)>' requested here cargo:warning= ::new ((void *)this->end()) T(std::forward(Args)...); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:108:24: note: in instantiation of function template specialization 'llvm::SmallVectorImpl>::emplace_back<(lambda at llvm-wrapper/PassWrapper.cpp:688:7)>' requested here cargo:warning= AfterPassCallbacks.emplace_back(std::move(C)); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:687:7: note: in instantiation of function template specialization 'llvm::PassInstrumentationCallbacks::registerAfterPassCallback<(lambda at llvm-wrapper/PassWrapper.cpp:688:7)>' requested here cargo:warning= PIC.registerAfterPassCallback( cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:688:7: note: candidate function not viable: requires 2 arguments, but 3 were provided cargo:warning= [LlvmSelfProfiler, AfterPassCallback](StringRef Pass, llvm::Any Ir) { cargo:warning= ^ cargo:warning=In file included from llvm-wrapper/PassWrapper.cpp:6: cargo:warning=In file included from llvm-wrapper/LLVMWrapper.h:8: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/Analysis/Lint.h:22: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassManager.h:47: cargo:warning=In file included from /usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:53: cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:195:12: error: no matching function for call to object of type '(lambda at llvm-wrapper/PassWrapper.cpp:693:7)' cargo:warning= return Func(std::forward(Params)...); cargo:warning= ^~~~ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:332:10: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::CallImpl<(lambda at llvm-wrapper/PassWrapper.cpp:693:7)>' requested here cargo:warning= &CallImpl}; cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:253:49: note: in instantiation of static data member 'llvm::detail::UniqueFunctionBase::CallbacksHolder<(lambda at llvm-wrapper/PassWrapper.cpp:693:7), (lambda at llvm-wrapper/PassWrapper.cpp:693:7)>::Callbacks' requested here cargo:warning= &CallbacksHolder::Callbacks, IsInlineStorage); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/FunctionExtras.h:350:9: note: in instantiation of function template specialization 'llvm::detail::UniqueFunctionBase::UniqueFunctionBase<(lambda at llvm-wrapper/PassWrapper.cpp:693:7), (lambda at llvm-wrapper/PassWrapper.cpp:693:7)>' requested here cargo:warning= : Base(std::forward(Callable), cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/ADT/SmallVector.h:912:33: note: in instantiation of function template specialization 'llvm::unique_function::unique_function<(lambda at llvm-wrapper/PassWrapper.cpp:693:7)>' requested here cargo:warning= ::new ((void *)this->end()) T(std::forward(Args)...); cargo:warning= ^ cargo:warning=/usr/lib/llvm-12/include/llvm/IR/PassInstrumentation.h:113:35: note: in instantiation of function template specialization 'llvm::SmallVectorImpl>::emplace_back<(lambda at llvm-wrapper/PassWrapper.cpp:693:7)>' requested here cargo:warning= AfterPassInvalidatedCallbacks.emplace_back(std::move(C)); cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:692:7: note: in instantiation of function template specialization 'llvm::PassInstrumentationCallbacks::registerAfterPassInvalidatedCallback<(lambda at llvm-wrapper/PassWrapper.cpp:693:7)>' requested here cargo:warning= PIC.registerAfterPassInvalidatedCallback( cargo:warning= ^ cargo:warning=llvm-wrapper/PassWrapper.cpp:693:7: note: candidate function not viable: requires single argument 'Pass', but 2 arguments were provided cargo:warning= [LlvmSelfProfiler, AfterPassCallback](StringRef Pass) { cargo:warning= ^ cargo:warning=16 errors generated. exit code: 1 ```
fabalchemy commented 3 years ago

Hi,

After more research, something is definitely going on with registerBeforePassCallback() and LLVM. In the main Rust repo, llvm-wrapper/PassWrapper.cpp was patched (here) but the Twizzler fork was not (here).

With that in mind, I tried to compile using clang-11, with no luck.

Would you mind sharing your Travis configuration or your own work environment?

dbittman commented 3 years ago

Hmm, maybe I can get away with just applying that patch. Will try soon. I use the docker file here to build on our CI system.