Unix make issue

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
bmarkus
Posts: 111
Joined: Tue Oct 21, 2014 5:58 am

Unix make issue

Post by bmarkus » Thu Jan 29, 2015 10:49 am

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
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: Unix make issue

Post by Damien » Thu Jan 29, 2015 12:37 pm

You need to build without ffi enabled (see unix/mpconfigport.mk) or install libffi.

blmorris
Posts: 348
Joined: Fri May 02, 2014 3:43 pm
Location: Massachusetts, USA

Re: Unix make issue

Post by blmorris » Thu Jan 29, 2015 1:50 pm

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

User avatar
bmarkus
Posts: 111
Joined: Tue Oct 21, 2014 5:58 am

Re: Unix make issue

Post by bmarkus » Thu Jan 29, 2015 3:44 pm

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.
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

User avatar
bmarkus
Posts: 111
Joined: Tue Oct 21, 2014 5:58 am

Re: Unix make issue

Post by bmarkus » Thu Jan 29, 2015 4:15 pm

It is not a symlink problem. Disabling ffi and readline it builds and works, so it is a linking issue. Will review make.
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

User avatar
bmarkus
Posts: 111
Joined: Tue Oct 21, 2014 5:58 am

Re: Unix make issue

Post by bmarkus » Fri Mar 06, 2015 10:10 am

I just built 1.3.10 in Linux (x86). I still had to disable libffi, but the readline issue is gone, it works now.
Tiny Core Linux (piCore) developer
HAM radio call: HA5DI (Béla)

Post Reply