Page 1 of 1

Unix make issue

Posted: Thu Jan 29, 2015 10:49 am
by bmarkus
I'm trying to make 1.3.9 unix version. On CentOS-7 64-bit it builds and works fine. Making it on Tiny Core (x86 and arm) I get the following error:

Code: Select all

CC modtermios.c
CC modsocket.c
CC modffi.c
LINK micropython
/bin/sh: libdir: not found
build/modffi.o: In function `ffifunc_call':
modffi.c:(.text+0x1b0): undefined reference to `ffi_call'
modffi.c:(.text+0x1c0): undefined reference to `ffi_call'
build/modffi.o: In function `mod_ffi_callback':
modffi.c:(.text+0x560): undefined reference to `ffi_closure_alloc'
modffi.c:(.text+0x5d4): undefined reference to `ffi_prep_cif'
modffi.c:(.text+0x600): undefined reference to `ffi_prep_closure_loc'
build/modffi.o: In function `ffimod_func':
modffi.c:(.text+0x71c): undefined reference to `ffi_prep_cif'
build/modffi.o:(.rodata+0xd0): undefined reference to `ffi_type_uint8'
build/modffi.o:(.rodata+0xd4): undefined reference to `ffi_type_pointer'
build/modffi.o:(.rodata+0xe8): undefined reference to `ffi_type_uint16'
build/modffi.o:(.rodata+0xec): undefined reference to `ffi_type_uint32'
build/modffi.o:(.rodata+0xf8): undefined reference to `ffi_type_uint32'
build/modffi.o:(.rodata+0x104): undefined reference to `ffi_type_pointer'
build/modffi.o:(.rodata+0x108): undefined reference to `ffi_type_pointer'
build/modffi.o:(.rodata+0x150): undefined reference to `ffi_type_sint8'
build/modffi.o:(.rodata+0x158): undefined reference to `ffi_type_double'
build/modffi.o:(.rodata+0x160): undefined reference to `ffi_type_float'
build/modffi.o:(.rodata+0x168): undefined reference to `ffi_type_sint16'
build/modffi.o:(.rodata+0x16c): undefined reference to `ffi_type_sint32'
build/modffi.o:(.rodata+0x178): undefined reference to `ffi_type_sint32'
build/modffi.o:(.rodata+0x188): undefined reference to `ffi_type_pointer'
build/modffi.o:(.rodata+0x194): undefined reference to `ffi_type_pointer'
build/modffi.o:(.rodata+0x1a0): undefined reference to `ffi_type_void'
/usr/local/lib/libreadline.so: undefined reference to `tputs'
/usr/local/lib/libreadline.so: undefined reference to `tgoto'
/usr/local/lib/libreadline.so: undefined reference to `tgetflag'
/usr/local/lib/libreadline.so: undefined reference to `UP'
/usr/local/lib/libreadline.so: undefined reference to `tgetent'
/usr/local/lib/libreadline.so: undefined reference to `tgetnum'
/usr/local/lib/libreadline.so: undefined reference to `PC'
/usr/local/lib/libreadline.so: undefined reference to `tgetstr'
/usr/local/lib/libreadline.so: undefined reference to `BC'
collect2: error: ld returned 1 exit status
../py/mkrules.mk:82: recipe for target 'micropython' failed
make: *** [micropython] Error 1
Help appreciated.

Thanks... Bela

Re: Unix make issue

Posted: Thu Jan 29, 2015 12:37 pm
by Damien
You need to build without ffi enabled (see unix/mpconfigport.mk) or install libffi.

Re: Unix make issue

Posted: Thu Jan 29, 2015 1:50 pm
by blmorris
On OSX I also needed to install pkgconfig (or pkg-config?) in addition to libffi in order for the linker to find ffi.

I don't remember the details perfectly, but I also had the error '/bin/sh: libdir: not found' even after installing libffi, and I think I needed to (re)install pkg-config to fix it.

-Bryan

Re: Unix make issue

Posted: Thu Jan 29, 2015 3:44 pm
by bmarkus
Thanks for advices. pkgconfig and libffi-dev installed. In fact it is my development environment used to build many packages without such issue.

BTW, libs are symlinked to loop mounted squash archives which can be a problem. Will try w/o symlinks.

Re: Unix make issue

Posted: Thu Jan 29, 2015 4:15 pm
by bmarkus
It is not a symlink problem. Disabling ffi and readline it builds and works, so it is a linking issue. Will review make.

Re: Unix make issue

Posted: Fri Mar 06, 2015 10:10 am
by bmarkus
I just built 1.3.10 in Linux (x86). I still had to disable libffi, but the readline issue is gone, it works now.