Commit 3ac9d211 authored by Eduardo Souza's avatar Eduardo Souza

Added extra argument to not consider whitelist when compiling to a shared lib,...

Added extra argument to not consider whitelist when compiling to a shared lib, to export only the context.
parent 825fae0f
......@@ -372,19 +372,15 @@ class MuVM:
# type: (MuTrapHandler, MuCPtr) -> None
self._mu.c_set_trap_handler(self._mu, trap_handler, userdata)
def compile_to_sharedlib(self, lib_name, extra_srcs):
def compile_to_sharedlib(self, lib_name, extra_srcs, context_only):
# type: (str, [MuCString]) -> None
with rffi.scoped_str2charp(lib_name) as lib_name_buf:
extra_srcs_arr, extra_srcs_sz = lst2arr(MuCString, extra_srcs)
self._mu.c_compile_to_sharedlib(self._mu, lib_name_buf, extra_srcs_arr, extra_srcs_sz)
if extra_srcs_arr:
rffi.free_charpp(extra_srcs_arr)
if context_only:
self._mu.c_compile_to_sharedlib(self._mu, lib_name_buf, extra_srcs_arr, extra_srcs_sz, MuCmpOptr.FTRUE)
else:
self._mu.c_compile_to_sharedlib(self._mu, lib_name_buf, extra_srcs_arr, extra_srcs_sz, MuCmpOptr.FFALSE)
def export_context(self, lib_name, extra_srcs):
# type: (str, [MuCString]) -> None
with rffi.scoped_str2charp(lib_name) as lib_name_buf:
extra_srcs_arr, extra_srcs_sz = lst2arr(MuCString, extra_srcs)
self._mu.c_export_context(self._mu, lib_name_buf)
if extra_srcs_arr:
rffi.free_charpp(extra_srcs_arr)
......@@ -1335,7 +1331,7 @@ _MuVM.become(rffi.CStruct(
('name_of', rffi.CCallback([_MuVMPtr, MuID], MuName)),
('set_trap_handler', rffi.CCallback([_MuVMPtr, MuTrapHandler, MuCPtr], lltype.Void)),
('export_context', rffi.CCallback([_MuVMPtr, MuCString], lltype.Void)),
('compile_to_sharedlib', rffi.CCallback([_MuVMPtr, MuCString, MuCStringPtr, MuArraySize], lltype.Void)),
('compile_to_sharedlib', rffi.CCallback([_MuVMPtr, MuCString, MuCStringPtr, MuArraySize, MuFlag], lltype.Void)),
('current_thread_as_mu_thread', rffi.CCallback([_MuVMPtr, MuCPtr], lltype.Void)),
))
_MuCtx.become(rffi.CStruct(
......
......@@ -162,7 +162,7 @@ class MuBundleGen:
if self.mu_config.testjit:
libname = targetname + '.' + platform.so_ext
self.mu.compile_to_sharedlib(libname, [])
self.mu.compile_to_sharedlib(libname, [], False)
else:
hmain = self.ctx.handle_from_func(self._id_of(self.db.tlc.entry_point_graph))
topdefs = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment