[armv7 linux build] Cross compile fail on graphene: build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to `ffi_type_void'
I am trying to cross compile gstreamer for Hisi3516D, which is an armv7 architecture device, with cerbero. I have setup my environment variable linked to the toolchain. But the build process failed at building graphene. Its output log indicated that it seemed like libffi had some problems. I had tried to export LIBFFI_LIBS and LIBFFI_CFLAGS but things did not go well. The build process error log is listed as follow.
$ cerbero -c $HOME/cerbero/config/cross-lin-arm.cbc package gstreamer-1.0
[70/80] arm-linux-gnueabi-gcc -o src/tests/point3d 'src/tests/a4ccf2d@@point3d@exe/point3d.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group src/libgraphene-1.0.so.0.800.2 -lm /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libglib-2.0.so -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/..' -Wl,-rpath-link,/home/jlu/Application/cerbero/build/sources/linux_armv7/graphene-1.8.2/_builddir/src -L/home/jlu/Application/cerbero/build/dist/linux_armv7/lib -march=armv7-a -march=armv7-a
FAILED: src/tests/point3d
arm-linux-gnueabi-gcc -o src/tests/point3d 'src/tests/a4ccf2d@@point3d@exe/point3d.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group src/libgraphene-1.0.so.0.800.2 -lm /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libglib-2.0.so -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/..' -Wl,-rpath-link,/home/jlu/Application/cerbero/build/sources/linux_armv7/graphene-1.8.2/_builddir/src -L/home/jlu/Application/cerbero/build/dist/linux_armv7/lib -march=armv7-a -march=armv7-a
/mnt/ficusiceland/zchen/hisi-linux/x86-arm/Hi3519AV100R001C02SPC010/arm-himix200-linux/host_bin/../lib/gcc/arm-linux-gnueabi/6.3.0/../../../../arm-linux-gnueabi/bin/ld: warning: libffi.so.7, needed by /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so, not found (try using -rpath or -rpath-link)
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_void' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_double'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_prep_cif' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_sint32'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_float' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_uint64'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_sint64' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_pointer'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_uint32' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_call'
collect2: error: ld returned 1 exit status
[71/80] arm-linux-gnueabi-gcc -o src/tests/plane 'src/tests/a4ccf2d@@plane@exe/plane.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group src/libgraphene-1.0.so.0.800.2 -lm /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libglib-2.0.so -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/..' -Wl,-rpath-link,/home/jlu/Application/cerbero/build/sources/linux_armv7/graphene-1.8.2/_builddir/src -L/home/jlu/Application/cerbero/build/dist/linux_armv7/lib -march=armv7-a -march=armv7-a
FAILED: src/tests/plane
arm-linux-gnueabi-gcc -o src/tests/plane 'src/tests/a4ccf2d@@plane@exe/plane.c.o' -Wl,--no-undefined -Wl,--as-needed -Wl,--start-group src/libgraphene-1.0.so.0.800.2 -lm /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libglib-2.0.so -Wl,--end-group -pthread '-Wl,-rpath,$ORIGIN/..' -Wl,-rpath-link,/home/jlu/Application/cerbero/build/sources/linux_armv7/graphene-1.8.2/_builddir/src -L/home/jlu/Application/cerbero/build/dist/linux_armv7/lib -march=armv7-a -march=armv7-a
/mnt/ficusiceland/zchen/hisi-linux/x86-arm/Hi3519AV100R001C02SPC010/arm-himix200-linux/host_bin/../lib/gcc/arm-linux-gnueabi/6.3.0/../../../../arm-linux-gnueabi/bin/ld: warning: libffi.so.7, needed by /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so, not found (try using -rpath or -rpath-link)
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_void' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_double'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_prep_cif' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_sint32'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_float' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_uint64'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_sint64' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_type_pointer'
/home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to ffi_type_uint32' /home/jlu/Application/cerbero/build/dist/linux_armv7/lib/libgobject-2.0.so: undefined reference to
ffi_call'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
***** Error running 'package' command: Recipe 'graphene' failed at the build step 'compile' Fatal Error: Running ['sh', '-c', 'ninja -v -d keeprsp'], returncode 1