libffi-sys-rs: Low-level Rust bindings for [libffi]
NOTE: this repository has been merged into https://github.com/tov/libffi-rs. Please report issues and submit pull requests there, instead of in this project.
[DEPRECATED; see README.md] Low-level Rust bindings for libffi
License: Apache License 2.0
NOTE: this repository has been merged into https://github.com/tov/libffi-rs. Please report issues and submit pull requests there, instead of in this project.
With libffi
0.6.2 as a dependency, which pulls libffi-sys
0.6.0, I get this error when building any project with that dependency:
error: unexpected close delimiter: `]`
--> /home/alek/dev/bad-libffi/target/debug/build/libffi-sys-a12426917ae6713c/out/generated.rs:391:32
|
391 | #[derive(Copy, Clone)]; 8usize ] , pub ptr : * mut :: std :: os :: raw :: c_void , _bindgen_union_align : u64 , }#[test]
| ^
error: Could not compile `libffi-sys`.
I have a project that has libffi-sys
0.5.3 in the Cargo.lock, and that does not break with this error. I'm not sure if it's a libffi-sys
thing, or a bindgen
thing, but it's pretty consistent and breaking.
This seems to be because it depends on texinfo
, which docs.rs doesn’t have available. See tov/libffi-rs#10.
The FFI README says the following:
If you don't want to build documentation, use the --disable-docs configure switch.
libffi-sys-rs does not seem to be using this. I can't exactly figure it out, but this might remove the need for installing texinfo just to build libffi-sys-rs/libffi.
It's likely that I broke my system while doing an upgrade from 14.04 -> 16.04. Here's the output from a libffi build:
--- stderr
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:31: installing './compile'
configure.ac:19: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'
configure: WARNING: unrecognized options: --disable-docs
configure: WARNING: unrecognized options: --disable-docs
configure: WARNING: unrecognized options: --disable-docs
../src/closures.c: In function ‘dlmmap_locked’:
../src/closures.c:488:7: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
ftruncate (execfd, offset);
^
../src/closures.c:500:7: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
ftruncate (execfd, offset);
^
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
/home/chris/repos/Gfapi-sys/target/debug/build/libffi-sys-119d5af33d831421/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:114:3: error: unknown type name 'size_t'
/home/chris/repos/Gfapi-sys/target/debug/build/libffi-sys-119d5af33d831421/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:292:1: error: unknown type name 'size_t'
/home/chris/repos/Gfapi-sys/target/debug/build/libffi-sys-119d5af33d831421/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:305:1: error: unknown type name 'size_t'
/home/chris/repos/Gfapi-sys/target/debug/build/libffi-sys-119d5af33d831421/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:333:26: error: unknown type name 'size_t'
thread 'main' panicked at '
**********
Bindgen generation failed. Please file a bug report.
**********
: ()', /buildslave/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libcore/result.rs:868
note: Run with `RUST_BACKTRACE=1` for a backtrace.
I'm not sure how size_t couldn't be found because I can create hello-world.c files that include size_t and they compile just fine.
With #37 merged, I think it's a nice time to bump the version to 1.0.0; once #38 is merged at least. By bumping to 1.0.0, existing users can continue to use the 0.9 series, without the new release suddenly breaking their setup.
@tov To release a new version of libffi-sys-rs (and libffi-rs after that), I'll need to be added as a maintainer to the crates on crates.io. Could you add me as an owner? You can do so as follows:
cargo owner --add YorickPeterse libffi-sys
cargo owner --add YorickPeterse libffi
Hello! We're interested in using libffi
from Rust but would ideally like to avoid the bulid-time dependency on bindgen
and libclang.
Other *-sys
crates seem to not depend on bindgen, for example llvm-sys
. Is there a reason why this is necessary in the libffi case? If not, would you all be interested in having this feature in libffi-sys-rs
?
Testing PRs to libffi-sys
is difficult because the version in master does not match the version that you need to patch.
The standard way to test a PR for libffi-sys
+ libffi
would be to patch using the PR branch:
[dependencies]
libffi = "0.9.0"
[patch.crates-io]
libffi-sys = { git = "https://github.com/timfish/libffi-sys-rs.git", branch = "msvc-build" }
However, this doesn't work because [patch]
only works when the versions match. The PR branch (msvc-build
) is based of master (0.9.1-alpha.0
) and the version being patched is 0.9.0
so you'll get an error:
error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
Caused by:
patch for `libffi-sys` in `https://github.com/rust-lang/crates.io-index` did not resolve to any crates.
This behaviour in cargo-release
is a bit counterproductive!
Same version builds fine for me on Mac, I assume there's something not right with my CentOS system but I have no idea where to start in debugging this. The libffi-sys crate is not something I'm using directly, it's referenced from the MPI bindings.
Thanks in advance for your help!
Compiling db v0.1.0 (file:///home/bkeller/topovs/db)
Compiling libffi-sys v0.6.0
error: failed to run custom build command for `libffi-sys v0.6.0`
process didn't exit successfully: `/home/bkeller/topovs/db/target/debug/build/libffi-sys-91f03439e14a3523/build-script-build` (exit code: 101)
--- stdout
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
continue configure in default builddir "./x86_64-unknown-linux-gnu"
....exec /bin/sh .././configure "--srcdir=.." "--enable-builddir=x86_64-unknown-linux-gnu" "linux
gnu"
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld
checking if the linker (/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/rh/devtoolset-6/root/usr/bin/nm -B
checking the name lister (/opt/rh/devtoolset-6/root/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /opt/rh/devtoolset-6/root/usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld -m elf_x86_64
checking if the linker (/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/opt/rh/devtoolset-6/root/usr/libexec/gcc/x86_64-redhat-linux/6.3.1/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking size of size_t... 8
checking for C compiler vendor... gnu
checking whether C compiler accepts -fstrict-aliasing... yes
checking whether C compiler accepts -ffast-math... yes
checking for gcc architecture flag...
checking for x86 cpuid 0 output... 14:756e6547:6c65746e:49656e69
checking for x86 cpuid 1 output... 406f1:43400800:7ffefbff:bfebfbff
checking whether C compiler accepts -march=core2... yes
checking for gcc architecture flag... -march=core2
checking whether C compiler accepts -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2... yes
checking CFLAGS for maximum warnings... -Wall
checking whether to enable maintainer-specific portions of Makefiles... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for mkostemp... yes
checking for sys/mman.h... (cached) yes
checking for mmap... (cached) yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking for ANSI C header files... (cached) yes
checking for memcpy... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking size of double... 8
checking size of long double... 16
checking whether byte ordering is bigendian... no
checking assembler .cfi pseudo-op support... yes
checking assembler supports pc related relocs... yes
checking assembler .ascii pseudo-op support... yes
checking assembler .string pseudo-op support... yes
checking for _ prefix in compiled symbols... no
checking toolchain supports unwind section type... yes
checking whether .eh_frame section should be read-only... yes
checking for __attribute__((visibility("hidden")))... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating include/Makefile
config.status: creating include/ffi.h
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating man/Makefile
config.status: creating libffi.pc
config.status: creating fficonfig.h
config.status: linking ../src/x86/ffitarget.h to include/ffitarget.h
config.status: executing buildir commands
config.status: create top_srcdir/Makefile guessed from local Makefile
config.status: build in x86_64-unknown-linux-gnu (HOST=x86_64-unknown-linux-gnu)
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing include commands
config.status: executing src commands
MAKE x86_64-unknown-linux-gnu : 1 * install
make[1]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu'
Making install in include
make[2]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/include'
make[3]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/include'
make[3]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/libffi-3.2.1/include'
/usr/bin/install -c -m 644 ffi.h ffitarget.h '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/libffi-3.2.1/include'
make[3]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/include'
make[2]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/include'
Making install in testsuite
make[2]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/testsuite'
make[3]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/testsuite'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/testsuite'
make[2]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/testsuite'
Making install in man
make[2]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/man'
make[3]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/man'
make[3]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/share/man/man3'
/usr/bin/install -c -m 644 ../../man/ffi.3 ../../man/ffi_call.3 ../../man/ffi_prep_cif.3 ../../man/ffi_prep_cif_var.3 '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/share/man/man3'
make[3]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/man'
make[2]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu/man'
make[2]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu'
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd .. && \
rm -rf $backupdir && mkdir $backupdir && \
if (/bin/sh /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/missing makeinfo --version) >/dev/null 2>&1; then \
for f in ../doc/libffi.info ../doc/libffi.info-[0-9] ../doc/libffi.info-[0-9][0-9] ../doc/libffi.i[0-9] ../doc/libffi.i[0-9][0-9]; do \
if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
cd "$am__cwd"; \
if /bin/sh /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/missing makeinfo -I doc -I ../doc \
-o ../doc/libffi.info ../doc/libffi.texi; \
then \
rc=0; \
CDPATH="${ZSH_VERSION+.}:" && cd ..; \
else \
rc=$?; \
CDPATH="${ZSH_VERSION+.}:" && cd .. && \
$restore $backupdir/* `echo "./../doc/libffi.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
depbase=`echo src/prep_cif.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF $depbase.Tpo -c -o src/prep_cif.lo ../src/prep_cif.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF src/.deps/prep_cif.Tpo -c ../src/prep_cif.c -fPIC -DPIC -o src/.libs/prep_cif.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/prep_cif.lo -MD -MP -MF src/.deps/prep_cif.Tpo -c ../src/prep_cif.c -fPIC -DPIC -o src/prep_cif.o >/dev/null 2>&1
depbase=`echo src/types.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/types.lo -MD -MP -MF $depbase.Tpo -c -o src/types.lo ../src/types.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/types.lo -MD -MP -MF src/.deps/types.Tpo -c ../src/types.c -fPIC -DPIC -o src/.libs/types.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/types.lo -MD -MP -MF src/.deps/types.Tpo -c ../src/types.c -fPIC -DPIC -o src/types.o >/dev/null 2>&1
depbase=`echo src/raw_api.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/raw_api.lo -MD -MP -MF $depbase.Tpo -c -o src/raw_api.lo ../src/raw_api.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/raw_api.lo -MD -MP -MF src/.deps/raw_api.Tpo -c ../src/raw_api.c -fPIC -DPIC -o src/.libs/raw_api.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/raw_api.lo -MD -MP -MF src/.deps/raw_api.Tpo -c ../src/raw_api.c -fPIC -DPIC -o src/raw_api.o >/dev/null 2>&1
depbase=`echo src/java_raw_api.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/java_raw_api.lo -MD -MP -MF $depbase.Tpo -c -o src/java_raw_api.lo ../src/java_raw_api.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/java_raw_api.lo -MD -MP -MF src/.deps/java_raw_api.Tpo -c ../src/java_raw_api.c -fPIC -DPIC -o src/.libs/java_raw_api.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/java_raw_api.lo -MD -MP -MF src/.deps/java_raw_api.Tpo -c ../src/java_raw_api.c -fPIC -DPIC -o src/java_raw_api.o >/dev/null 2>&1
depbase=`echo src/closures.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/closures.lo -MD -MP -MF $depbase.Tpo -c -o src/closures.lo ../src/closures.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c ../src/closures.c -fPIC -DPIC -o src/.libs/closures.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c ../src/closures.c -fPIC -DPIC -o src/closures.o >/dev/null 2>&1
depbase=`echo src/x86/ffi64.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/x86/ffi64.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/ffi64.lo ../src/x86/ffi64.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/x86/ffi64.lo -MD -MP -MF src/x86/.deps/ffi64.Tpo -c ../src/x86/ffi64.c -fPIC -DPIC -o src/x86/.libs/ffi64.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/x86/ffi64.lo -MD -MP -MF src/x86/.deps/ffi64.Tpo -c ../src/x86/ffi64.c -fPIC -DPIC -o src/x86/ffi64.o >/dev/null 2>&1
depbase=`echo src/x86/unix64.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/unix64.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/unix64.lo ../src/x86/unix64.S &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/unix64.lo -MD -MP -MF src/x86/.deps/unix64.Tpo -c ../src/x86/unix64.S -fPIC -DPIC -o src/x86/.libs/unix64.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/unix64.lo -MD -MP -MF src/x86/.deps/unix64.Tpo -c ../src/x86/unix64.S -fPIC -DPIC -o src/x86/unix64.o >/dev/null 2>&1
depbase=`echo src/x86/ffi.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/x86/ffi.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/ffi.lo ../src/x86/ffi.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/x86/ffi.lo -MD -MP -MF src/x86/.deps/ffi.Tpo -c ../src/x86/ffi.c -fPIC -DPIC -o src/x86/.libs/ffi.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -MT src/x86/ffi.lo -MD -MP -MF src/x86/.deps/ffi.Tpo -c ../src/x86/ffi.c -fPIC -DPIC -o src/x86/ffi.o >/dev/null 2>&1
depbase=`echo src/x86/sysv.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/sysv.lo -MD -MP -MF $depbase.Tpo -c -o src/x86/sysv.lo ../src/x86/sysv.S &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/sysv.lo -MD -MP -MF src/x86/.deps/sysv.Tpo -c ../src/x86/sysv.S -fPIC -DPIC -o src/x86/.libs/sysv.o
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -MT src/x86/sysv.lo -MD -MP -MF src/x86/.deps/sysv.Tpo -c ../src/x86/sysv.S -fPIC -DPIC -o src/x86/sysv.o >/dev/null 2>&1
/bin/sh ./libtool --tag=CC --mode=link gcc -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -o libffi_convenience.la src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
/bin/sh ./libtool --tag=CC --mode=link gcc -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2 -Wall -fexceptions -no-undefined -version-info `grep -v '^#' ../libtool-version` -o libffi.la -rpath /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64 src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo src/x86/sysv.lo
libtool: link: gcc -shared -fPIC -DPIC src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi64.o src/x86/.libs/unix64.o src/x86/.libs/ffi.o src/x86/.libs/sysv.o -O3 -march=core2 -Wl,-soname -Wl,libffi.so.6 -o .libs/libffi.so.6.0.4
libtool: link: (cd ".libs" && rm -f "libffi.so.6" && ln -s "libffi.so.6.0.4" "libffi.so.6")
libtool: link: (cd ".libs" && rm -f "libffi.so" && ln -s "libffi.so.6.0.4" "libffi.so")
libtool: link: ar cru .libs/libffi.a src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/x86/ffi64.o src/x86/unix64.o src/x86/ffi.o src/x86/sysv.o
libtool: link: ranlib .libs/libffi.a
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
make[3]: Entering directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu'
/usr/bin/mkdir -p '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64'
/bin/sh ./libtool --mode=install /usr/bin/install -c libffi.la '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64'
libtool: install: /usr/bin/install -c .libs/libffi.so.6.0.4 /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64/libffi.so.6.0.4
libtool: install: (cd /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64 && { ln -s -f libffi.so.6.0.4 libffi.so.6 || { rm -f libffi.so.6 && ln -s libffi.so.6.0.4 libffi.so.6; }; })
libtool: install: (cd /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64 && { ln -s -f libffi.so.6.0.4 libffi.so || { rm -f libffi.so && ln -s libffi.so.6.0.4 libffi.so; }; })
libtool: install: /usr/bin/install -c .libs/libffi.lai /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64/libffi.la
libtool: install: /usr/bin/install -c .libs/libffi.a /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64/libffi.a
libtool: install: chmod 644 /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64/libffi.a
libtool: install: ranlib /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64/libffi.a
libtool: finish: PATH="/home/bkeller/.cargo/bin:/opt/rh/devtoolset-6/root/usr/bin:/opt/rh/devtoolset-6/root/usr/bin:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/bin/intel64:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin:/export/swtools/intel/debugger_2017/gdb/intel64_mic/bin:/home/bkeller/.cargo/bin:/home/bkeller/.local/bin:/home/bkeller/bin:/home/bkeller/anaconda3/bin:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/bin/intel64:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin:/export/swtools/intel/debugger_2017/gdb/intel64_mic/bin:/home/bkeller/.cargo/bin:/home/bkeller/.local/bin:/home/bkeller/bin:/home/bkeller/anaconda3/bin:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/bin/intel64:/export/swtools/intel/compilers_and_libraries_2017.2.174/linux/mpi/intel64/bin:/export/swtools/intel/debugger_2017/gdb/intel64_mic/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/export/swtools/bazel:/export/swtools/hadoop/bin:/export/swtools/hadoop/sbin:/export/swtools/sbt/bin:/export/swtools/spark/bin:/export/swtools/spark/sbin:/export/swtools/bazel:/export/swtools/hadoop/bin:/export/swtools/hadoop/sbin:/export/swtools/sbt/bin:/export/swtools/spark/bin:/export/swtools/spark/sbin:/export/swtools/bazel:/export/swtools/hadoop/bin:/export/swtools/hadoop/sbin:/export/swtools/sbt/bin:/export/swtools/spark/bin:/export/swtools/spark/sbin:/sbin" ldconfig -n /home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64
----------------------------------------------------------------------
Libraries have been installed in:
/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/../lib64
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/share/info'
/usr/bin/install -c -m 644 ../doc/libffi.info '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/share/info'
install-info --info-dir='/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/share/info' '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/share/info/libffi.info'
/usr/bin/mkdir -p '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/pkgconfig'
/usr/bin/install -c -m 644 libffi.pc '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/pkgconfig'
make[3]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu'
make[2]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu'
make[1]: Leaving directory '/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-build/x86_64-unknown-linux-gnu'
--- stderr
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:40: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am: installing './depcomp'
Makefile.am:56: installing './mdate-sh'
autoreconf: Leaving directory `.'
/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:75:10: fatal error: 'stddef.h' file not found
/home/bkeller/topovs/db/target/debug/build/libffi-sys-5c56f19040e3c580/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:75:10: fatal error: 'stddef.h' file not found, err: true
thread 'main' panicked at '
**********
Bindgen generation failed. Please file a bug report.
**********
: ()', libcore/result.rs:945:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:207
3: std::panicking::default_hook
at libstd/panicking.rs:223
4: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:402
5: std::panicking::begin_panic_fmt
at libstd/panicking.rs:349
6: rust_begin_unwind
at libstd/panicking.rs:325
7: core::panicking::panic_fmt
at libcore/panicking.rs:72
8: core::result::unwrap_failed
at /checkout/src/libcore/macros.rs:26
9: <core::result::Result<T, E>>::expect
at /checkout/src/libcore/result.rs:809
10: build_script_build::main
at ./build.rs:61
11: std::rt::lang_start::{{closure}}
at /checkout/src/libstd/rt.rs:74
12: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:306
13: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:102
14: std::rt::lang_start_internal
at libstd/panicking.rs:285
at libstd/panic.rs:361
at libstd/rt.rs:58
15: std::rt::lang_start
at /checkout/src/libstd/rt.rs:74
16: main
17: __libc_start_main
18: <unknown>
I ran into this today due to a Makefile that sets DESTDIR
for my own project, but doesn't clear it when running cargo build
. This results in the following error:
Compiling libffi-sys v0.9.2-alpha.0 (/home/yorickpeterse/Projects/rust/libffi-sys-rs)
error: could not find native static library `ffi`, perhaps an -L flag is missing?
error: aborting due to previous error
For example:
env DESTDIR=/tmp/blorb cargo build
I think libffi-sys-rs should clear the environment variables before building libffi from source (as is done when building it on a non MSVC Windows environment), ensuring outer environment variables don't mess up the libffi compilation.
I'm currently trying to use libffi, and I would like to support windows. When building libffi-sys on x86_64 windows (either using GNU or MSVC), the output is as follows (full build output: https://ci.appveyor.com/project/YorickPeterse/inko/build/166/job/5p9n02e84nrwu3bu):
Compiling libffi-sys v0.6.2
error: failed to run custom build command for `libffi-sys v0.6.2`
process didn't exit successfully: `C:\projects\inko\vm\target\debug\build\libffi-sys-cdc3debe8ea09211\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Generating configure: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', libcore\result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
make: *** [Makefile:30: test] Error 101
The FFI README says the following for Windows (followed by some more notes for Windows):
It's also possible to build libffi on Windows platforms with Microsoft's Visual C++ compiler. In this case, use the msvcc.sh wrapper script during configuration like so:
path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP="cl -nologo -EP"
For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and CXX="path/to/msvcc.sh -m64". You may also need to specify --build appropriately.
The build script however doesn't seem to use anything, instead it just does the following:
Lines 67 to 68 in d65c185
As such my question is simple: should I do anything else (or install any other dependencies besides the one mentioned in the README), or does libffi-sys-rs need to make some changes to support Windows?
Just tried compiling this crate on a 64-bit NixOS system.
And I ran into the issue that the compiled native libffi
ended up in a lib64/
folder, not in lib/
. So changing line 23 of build.rs
from
let libdir = Path::new(&prefix).join("lib");
to
let libdir = Path::new(&prefix).join("lib64");
made it compile for me. I assume a more robust solution would be to just add both variants to the search path for rustc?
For reference, this is the Nix expression I used to setup the environment:
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "libffi-rs-sys";
src = ./.;
LIBCLANG_PATH = "${llvmPackages.clang.cc}/lib";
buildInputs = [ automake file gnum4 libtool clang texinfo autoconf rustc cargo ];
}
Please see rust-lang/cargo#5237 . Any update to a bindgen dependency that uses a new, semver-incompatible clang-sys
dependency (such as libffi-sys's 0.6.4
update) is a breaking change due to this shortcoming of cargo.
libffi-sys 0.6.4
should be yanked and rereleased as libffi-sys 0.7.0
.
After many years, a new release of libffi is finally available: https://github.com/libffi/libffi/releases/tag/v3.3. This would probably allow building without documentation (#18), reducing the dependencies needed.
From tov/libffi-rs#7
Ubuntu 17.10
$ rustc --version
rustc 1.25.0-nightly (f62f77403 2018-01-10)
--- stderr
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:31: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am: installing './depcomp'
Makefile.am:56: installing './mdate-sh'
autoreconf: Leaving directory `.'
../src/closures.c: In function ‘dlmmap_locked’:
../src/closures.c:488:7: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
ftruncate (execfd, offset);
^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/closures.c:500:7: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
ftruncate (execfd, offset);
^~~~~~~~~~~~~~~~~~~~~~~~~~
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
/home/ehiggs/src/home/ripawk/target/release/build/libffi-sys-075697e5eb3875eb/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:75:10: fatal error: 'stddef.h' file not found
/home/ehiggs/src/home/ripawk/target/release/build/libffi-sys-075697e5eb3875eb/out/libffi-root/lib/libffi-3.2.1/include/ffi.h:75:10: fatal error: 'stddef.h' file not found, err: true
thread 'main' panicked at '
**********
Bindgen generation failed. Please file a bug report.
**********
: ()', libcore/result.rs:916:5
If I make the following test file, I can build it using gcc ((Ubuntu 7.2.0-8ubuntu3) 7.2.0):
$ cat test.c
#include <stddef.h>
int main () {}
$ gcc test.c
$
I have libffi-dev
installed so it would be nice if pkg-config
and just used that version:
$ pkg-config --libs --cflags libffi
-lffi
Hi when running sample code from https://github.com/rsmpi/rsmpi using cargo build
or cargo run
, I encounter the following. I would appreciate it if I could know what to do. Thanks very much!
/code/trans_sort$ RUST_BACKTRACE=full cargo build
Compiling libffi-sys v0.6.0
error: failed to run custom build command for `libffi-sys v0.6.0`
Caused by:
process didn't exit successfully: `/code/trans_sort/target/debug/build/libffi-sys-3cdb33c6e0567cd9/build-script-build` (exit code: 101)
--- stdout
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
continue configure in default builddir "./x86_64-unknown-linux-gnu"
....exec /bin/bash .././configure "--srcdir=.." "--enable-builddir=x86_64-unknown-linux-gnu" "linux
gnu"
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... none
checking dependency style of gcc... none
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... none
checking dependency style of gcc... none
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking size of size_t... 8
checking for C compiler vendor... gnu
checking whether C compiler accepts -fstrict-aliasing... yes
checking whether C compiler accepts -ffast-math... yes
checking for gcc architecture flag...
checking for x86 cpuid 0 output... 16:756e6547:6c65746e:49656e69
checking for x86 cpuid 1 output... 906ea:2060800:defa2203:178bfbff
checking whether C compiler accepts -march=core2... yes
checking for gcc architecture flag... -march=core2
checking whether C compiler accepts -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math -march=core2... yes
checking CFLAGS for maximum warnings... -Wall
checking whether to enable maintainer-specific portions of Makefiles... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking for mkostemp... yes
checking for sys/mman.h... (cached) yes
checking for mmap... (cached) yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking for ANSI C header files... (cached) yes
checking for memcpy... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking size of double... 8
checking size of long double... 16
checking whether byte ordering is bigendian... no
checking assembler .cfi pseudo-op support... yes
checking assembler supports pc related relocs... yes
checking assembler .ascii pseudo-op support... yes
checking assembler .string pseudo-op support... yes
checking for _ prefix in compiled symbols... no
checking toolchain supports unwind section type... yes
checking whether .eh_frame section should be read-only... yes
checking for __attribute__((visibility("hidden")))... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating include/Makefile
config.status: creating include/ffi.h
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating man/Makefile
config.status: creating libffi.pc
config.status: creating fficonfig.h
config.status: linking ../src/x86/ffitarget.h to include/ffitarget.h
config.status: executing buildir commands
config.status: create top_srcdir/Makefile guessed from local Makefile
config.status: build in x86_64-unknown-linux-gnu (HOST=x86_64-unknown-linux-gnu)
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing include commands
config.status: executing src commands
--- stderr
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:31: installing './compile'
configure.ac:8: installing './config.guess'
configure.ac:8: installing './config.sub'
configure.ac:19: installing './install-sh'
configure.ac:19: installing './missing'
Makefile.am: installing './depcomp'
Makefile.am:56: installing './mdate-sh'
autoreconf: Leaving directory `.'
thread 'main' panicked at 'Building libffi: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/cuhksz_csc/.cargo/registry/src/github.com-1ecc6299db9ec823/libffi-sys-0.6.0/build.rs:27:30
stack backtrace:
0: 0x55d813afc8c5 - backtrace::backtrace::libunwind::trace::h14d338b30b3ea0a7
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
1: 0x55d813afc8c5 - backtrace::backtrace::trace_unsynchronized::h73ea91d74a3fd67f
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
2: 0x55d813afc8c5 - std::sys_common::backtrace::_print_fmt::hd42948c952866e12
at src/libstd/sys_common/backtrace.rs:78
3: 0x55d813afc8c5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha8f928866ff7571e
at src/libstd/sys_common/backtrace.rs:59
4: 0x55d813b26dec - core::fmt::write::he0c1e5f7426d2718
at src/libcore/fmt/mod.rs:1076
5: 0x55d813af8f02 - std::io::Write::write_fmt::hf3afc6cfd57d0033
at src/libstd/io/mod.rs:1537
6: 0x55d813aff4e0 - std::sys_common::backtrace::_print::hfc0110703f3696fd
at src/libstd/sys_common/backtrace.rs:62
7: 0x55d813aff4e0 - std::sys_common::backtrace::print::h3f77c6990ddfaa22
at src/libstd/sys_common/backtrace.rs:49
8: 0x55d813aff4e0 - std::panicking::default_hook::{{closure}}::heae49580a8d62d75
at src/libstd/panicking.rs:198
9: 0x55d813aff22c - std::panicking::default_hook::hecc34e3f729e213c
at src/libstd/panicking.rs:217
10: 0x55d813affb23 - std::panicking::rust_panic_with_hook::he82f5d0644692441
at src/libstd/panicking.rs:526
11: 0x55d813aff71b - rust_begin_unwind
at src/libstd/panicking.rs:437
12: 0x55d813b254a1 - core::panicking::panic_fmt::h09c929f06bb87c98
at src/libcore/panicking.rs:85
13: 0x55d813b252c3 - core::option::expect_none_failed::h188f17af6c9f404b
at src/libcore/option.rs:1269
14: 0x55d813651969 - core::result::Result<T,E>::expect::h74d1ed625e19981f
at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libcore/result.rs:963
15: 0x55d8136510dc - build_script_build::main::run_command::h11e9b2be338cc8d3
at /home/cuhksz_csc/.cargo/registry/src/github.com-1ecc6299db9ec823/libffi-sys-0.6.0/build.rs:27
16: 0x55d813650675 - build_script_build::main::h3bfc16c3e45662b9
at /home/cuhksz_csc/.cargo/registry/src/github.com-1ecc6299db9ec823/libffi-sys-0.6.0/build.rs:50
17: 0x55d813651c3b - std::rt::lang_start::{{closure}}::he72a22465750b8d1
at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/rt.rs:67
18: 0x55d813affef3 - std::rt::lang_start_internal::{{closure}}::h5d3ea623498f5f43
at src/libstd/rt.rs:52
19: 0x55d813affef3 - std::panicking::try::do_call::hac65e71be769a440
at src/libstd/panicking.rs:348
20: 0x55d813affef3 - std::panicking::try::hd4706e264bcf6712
at src/libstd/panicking.rs:325
21: 0x55d813affef3 - std::panic::catch_unwind::h948a0fb4a8b3ee82
at src/libstd/panic.rs:394
22: 0x55d813affef3 - std::rt::lang_start_internal::h72cc068ed2d0ac53
at src/libstd/rt.rs:51
23: 0x55d813651c17 - std::rt::lang_start::h4859f2d6fc25fa55
at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9/src/libstd/rt.rs:67
24: 0x55d81365114a - main
25: 0x7f91c3a98b97 - __libc_start_main
26: 0x55d81364fdba - _start
27: 0x0 - <unknown>
Hello!
I tried to compile lib and I had an error "thread 'main' panicked at 'function not loaded: clang_Type_getNumTemplateArguments', ../.cargo/registry/src/github.com-1ecc6299db9ec823/clang-sys-0.21.2/src/lib.rs:1456:1"
"error: failed to run custom build command for `libffi-sys v0.6.0 "
I have on 1st PC:
clang version 7.0.0 (trunk 326027) (llvm/trunk 326026)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/clang/bin
On another PC I have:
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
And it works.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.