AntelopeIO / spring

C++ implementation of the Antelope protocol with Savanna consensus
Other
10 stars 5 forks source link

Refactor: use ORCv2 for compatibility with modern LLVM versions with EOS VM OC #578

Open spoonincode opened 1 year ago

spoonincode commented 1 year ago

EOS VM OC was implemented using LLVM's ORCv1 interface. This was actually already in deprecation at the time of EOSIO 2.0's release (circa LLVM 9). LLVM removed ORCv1 in version 12 meaning Leap cannot be compiled with LLVM 12+

So far this hasn't been too much of a problem: Ubuntu 22.04 and upcoming 23.04 ship with an optional llvm-11-dev package that works. Both Arch & even upcoming Fedora 38 still provide an llvm11 package. But the days of a legacy LLVM 11 package being provided by distros are numbered. Upcoming Debian 12 does not have an LLVM 11 package.

EOS VM OC needs to be refactored to support modern LLVM versions (such refactoring may not be limited to just ORC interface). ORCv2 was available in LLVM 7 I believe, so it's possible the implementation could be refactored to support all versions from 7 to 16. But we could opt to reduce the scope of the support if need be (Ubuntu 20.04 ships with LLVM 10 as the "default" LLVM).

stephenpdeos commented 1 year ago

Expected to be a pressing issue when the next Ubuntu UTS is released.

ScottBailey commented 1 year ago

It looks like llvm-11-dev in unavailable in Ubuntu Lunar / 23.04.

Lunar's llvm-dev points to llvm-15-dev, additionally versions 13, 14, and 16 are also available.

spoonincode commented 1 year ago

bummer, I guess they removed it since I originally put in the comment. (23.04 still not released)

ScottBailey commented 1 year ago

bummer, I guess they removed it since I originally put in the comment. (23.04 still not released)

Right. It could still change. And we could also just build and distribute llvm-11. But we will need to make this change eventually.

Debian Bookworm - also not released yet - is versions 13, 14, and 15. With llvm-dev pointing to 14.

However, the user can install llvm-11-dev by adding either bullseye to Debian or kinetic universe to Ubuntu. It feels a bit sub-optimal - the user has to fetch the additional repos on every apt update - but in practice it should work fine for anyone with a modern machine and decent network.

spoonincode commented 1 year ago

Early versions of EOSIO required solely LLVM 4.0. Just that version. Nothing else. This was a terrible experience for building EOSIO. It got to the point it was hard to build LLVM 4.0 since it would error out on recent compilers unless you patched LLVM. I don't want to go back to those dark ages: we need to support a reasonable broad range.