EVMC: Reference EVMC entry point so it's linked into the program

Even though `evmc_create_nimbus_evm` is called, it fails at link time because
the definition of that function isn't included unless it is pulled in
explicitly.

Signed-off-by: Jamie Lokier <jamie@shareable.org>
This commit is contained in:
Jamie Lokier 2021-06-07 15:20:13 +01:00
parent 10807bce39
commit e8a79e7246
No known key found for this signature in database
GPG Key ID: CBC25C68435C30A2
1 changed files with 4 additions and 0 deletions

View File

@ -86,6 +86,10 @@ proc evmcGetHostInterface(): ref evmc_host_interface =
# The built-in Nimbus EVM, via imported C function.
proc evmc_create_nimbus_evm(): ptr evmc_vm {.cdecl, importc.}
# Pull in the definition of the above function because we're not building it as
# a separate library yet.
import ./evmc_vm_glue
proc evmcExecComputation*(host: TransactionHost, code: seq[byte]): EvmcResult =
let vm = evmc_create_nimbus_evm()
if vm.isNil: