Building a luajit rumpkernel

  • From: Indrajeet Singh <singhi@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 12 Jan 2018 13:59:57 -0800

Hi Everyone,

I have been trying to build a luajit unikernel and am following luajits 
instructions on cross compiling http://luajit.org/install.html#cross . I have ;
the tool chain setup and have ran the hello world example there. Sadly, I am 
unable to build luajit.  I have made some attempts and have attached the output 
for each of these commands. I would really appreciate any help in this matter. 
There are lots of talk about building a luajit unikernel but I can’t seem to 
find the process. So here it goes

—————————————————
$ make CC="gcc" CROSS="x86_64-rumprun-netbsd-" TARGET_SYS=Other
<initial lines skipped>
BUILDVM   jit/vmdef.lua
DYNLINK   libluajit.so
libluajit.so: In function `lj_err_throw':
(.text+0x5289): undefined reference to `_Unwind_RaiseException'
libluajit.so: In function `lj_err_unwind_dwarf':
(.text+0x5317): undefined reference to `_Unwind_GetCFA'
libluajit.so: In function `lj_err_unwind_dwarf':
(.text+0x535e): undefined reference to `_Unwind_DeleteException'
libluajit.so: In function `lj_err_unwind_dwarf':
(.text+0x5397): undefined reference to `_Unwind_SetGR'
libluajit.so: In function `lj_err_unwind_dwarf':
(.text+0x53ba): undefined reference to `_Unwind_SetIP'
libluajit.so: In function `lj_err_unwind_dwarf':
(.text+0x544e): undefined reference to `_Unwind_SetGR'
libluajit.so: In function `lj_err_unwind_dwarf':
(.text+0x5462): undefined reference to `_Unwind_SetIP'
/home/indra/rumprun/./rumprun/rumprun-x86_64/lib/pseudolinkstubs.o: In function 
`_want_main':
/home/indra/rumprun/./obj-amd64-hw/pseudolinkstubs.c:6: undefined reference to 
`main'
collect2: error: ld returned 1 exit status
Makefile:680: recipe for target 'libluajit.so’ failed
make: *** [libluajit.so] Error 1
——————————————

Based on the suggestion “ For a minimal target OS, you may need to disable the 
built-in allocator insrc/Makefile and use TARGET_SYS=Other. Don't forget to 
specify the same TARGET_SYS for the install step, too.” I uncommented line 131 
"XCFLAGS+= -DLUAJIT_USE_SYSMALLOC” and ran it again

——————————————
$ make CC="gcc" CROSS="x86_64-rumprun-netbsd-" TARGET_SYS=Other
<initial lines skipped>
CC        lj_alloc.o
CC        lib_aux.o
lib_aux.c:306:2: error: #error "Must use builtin allocator for 64 bit target"
 #error "Must use builtin allocator for 64 bit target"
  ^
Makefile:651: recipe for target 'lib_aux.o' failed
make: *** [lib_aux.o] Error 1
——————————————

After this last failed attempt I thought let me contact the pros as they have 
done it right already.

To me it seems like the building of the .so and the whole ldl process is 
failing. In short could I build a luajit binary without building libluajit.so ? 

Thanks
Indrajeet

Other related posts: