JuliaHubOSS / llvm-cbe

resurrected LLVM "C Backend", with improvements
Other
826 stars 141 forks source link

Expected ')' at end of argument list #115

Closed XAMPPRocky closed 3 years ago

XAMPPRocky commented 3 years ago

Another attempt at compiling Rustc generated LLVM IR. This time with a library compiled to WebAssembly.

Error

tools/llvm-cbe/llvm-cbe: ../../reqwest/target/wasm32-unknown-unknown/debug/deps/reqwest-b6ce881b9b35171a.ll:387:250: error: expected ')' at end of argument list
define hidden void @"_ZN103_$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h7cf6a9f1c1e5f073E"(%"std::option::Option<http::header::map::Bucket<http::HeaderValue>>"* noalias nocapture sret(%"std::option::Option<http::header::map::Bucket<http::HeaderValue>>") dereferenceable(56) %0, %"std::vec::IntoIter<http::header::map::Bucket<http::HeaderValue>>"* align 4 dereferenceable(16) %self) unnamed_addr #0 !dbg !719 {
hikari-no-yume commented 3 years ago

I think LLVM-CBE just uses LLVM's facilities for reading LLVM IR, so if there's a problem reading some IR it's unlikely to be its fault. Are you perhaps using mismatched LLVM versions between Rust and LLVM-CBE?

XAMPPRocky commented 3 years ago

Yep, you're right. I was trying to use CBE compiled with LLVM 10 with output from LLVM 12. I've tried building CBE with LLVM 12 but ran into other issues. https://github.com/JuliaComputingOSS/llvm-cbe/issues/116

hikari-no-yume commented 3 years ago

LLVM does provide some backwards compatibility, but it only works for consuming older versions' output with newer versions, not the other way around. (By the way, the guarantees are stronger for bitcode rather than the textual form.)

Would it be an option to use an older version of Rust?

XAMPPRocky commented 3 years ago

Would it be an option to use an older version of Rust?

Definitely, you could also build the latest version with an older LLVM. That just takes a long time (hours to build rustc) so I was testing with the defaults.