The problem described in #215 happens because the sys_alloc_aligned function is present in the athena VM library - in the host code, not in a guest program. It makes no sense to have it there as it is only needed by guest programs running in a VM. This PR removes the export "C" so the function is not exported and is not included in the VM library.
Note: the same statement is true for other exported system calls. They are also wrongly included in the VM library. However, because of #117, it is not possible to remove them easily without refactoring. There is a weird dependency cycle:
athena-vm (vm/entrypoint) depends on athena-lib (vm/lib)
athena-lib calls functions from athena-vm
This dependency cycle is "fixed" by using exported functions, which are resolved at link time.
Fixes #215, Closes #217
The problem described in #215 happens because the
sys_alloc_aligned
function is present in the athena VM library - in the host code, not in a guest program. It makes no sense to have it there as it is only needed by guest programs running in a VM. This PR removes theexport "C"
so the function is not exported and is not included in the VM library.Before:
After:
Note: the same statement is true for other exported system calls. They are also wrongly included in the VM library. However, because of #117, it is not possible to remove them easily without refactoring. There is a weird dependency cycle:
athena-vm
(vm/entrypoint) depends onathena-lib
(vm/lib)athena-lib
calls functions fromathena-vm
This dependency cycle is "fixed" by using exported functions, which are resolved at link time.