Failed build due to outdated libffi
Hi, I saw your Reddit post and I'm trying to go through the process.
When running make build_env build_module login, I get the following error:
>>> host-libffi 3.4.4 Building
MAKE x86_64-pc-linux-gnu : 0 * all-all
Making all in include
Making all in testsuite
Making all in man
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/x86/ffiw64.c -fPIC -DPIC -o src/x86/.libs/ffiw64.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/raw_api.c -fPIC -DPIC -o src/.libs/raw_api.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/java_raw_api.c -fPIC -DPIC -o src/.libs/java_raw_api.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/closures.c -fPIC -DPIC -o src/.libs/closures.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/prep_cif.c -fPIC -DPIC -o src/.libs/prep_cif.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/types.c -fPIC -DPIC -o src/.libs/types.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/tramp.c -fPIC -DPIC -o src/.libs/tramp.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -Wall -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -fexceptions -c ../src/x86/ffi64.c -fPIC -DPIC -o src/x86/.libs/ffi64.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -I. -I../include -Iinclude -I../src -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -c ../src/x86/win64.S -fPIC -DPIC -o src/x86/.libs/win64.o
libtool: compile: /usr/bin/gcc -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I/home/remo/repos/text_to_morse/build/buildroot/host/include -I. -I../include -Iinclude -I../src -O2 -I/home/remo/repos/text_to_morse/build/buildroot/host/include -c ../src/x86/unix64.S -fPIC -DPIC -o src/x86/.libs/unix64.o
../src/java_raw_api.c: In function ‘ffi_java_raw_call’:
../src/java_raw_api.c:317:3: warning: ‘ffi_java_raw_to_ptrarray’ is deprecated [-Wdeprecated-declarations]
317 | ffi_java_raw_to_ptrarray (cif, raw, avalue);
| ^~~~~~~~~~~~~~~~~~~~~~~~
../src/java_raw_api.c:76:1: note: declared here
76 | ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
| ^~~~~~~~~~~~~~~~~~~~~~~~
../src/java_raw_api.c: In function ‘ffi_java_translate_args’:
../src/java_raw_api.c:328:3: warning: ‘ffi_java_raw_size’ is deprecated [-Wdeprecated-declarations]
328 | ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
| ^~~~~~~~~~~~
../src/java_raw_api.c:45:1: note: declared here
45 | ffi_java_raw_size (ffi_cif *cif)
| ^~~~~~~~~~~~~~~~~
../src/java_raw_api.c:331:3: warning: ‘ffi_java_ptrarray_to_raw’ is deprecated [-Wdeprecated-declarations]
331 | ffi_java_ptrarray_to_raw (cif, avalue, raw);
| ^~~~~~~~~~~~~~~~~~~~~~~~
../src/java_raw_api.c:157:1: note: declared here
157 | ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
| ^~~~~~~~~~~~~~~~~~~~~~~~
../src/java_raw_api.c: In function ‘ffi_prep_java_raw_closure’:
../src/java_raw_api.c:369:3: warning: ‘ffi_prep_java_raw_closure_loc’ is deprecated [-Wdeprecated-declarations]
369 | return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
| ^~~~~~
../src/java_raw_api.c:337:1: note: declared here
337 | ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/tramp.c: In function ‘ffi_tramp_get_temp_file’:
../src/tramp.c:262:22: error: implicit declaration of function ‘open_temp_exec_file’ [-Wimplicit-function-declaration]
262 | tramp_globals.fd = open_temp_exec_file ();
| ^~~~~~~~~~~~~~~~~~~
make[6]: *** [Makefile:1323: src/tramp.lo] Error 1
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [Makefile:1395: all-recursive] Error 1
make[4]: *** [Makefile:623: all] Error 2
make[3]: *** [Makefile:591: all-all] Error 2
make[2]: *** [package/pkg-generic.mk:283: /home/remo/repos/text_to_morse/build/buildroot/build/host-libffi-3.4.4/.stamp_built] Error 2
make[1]: *** [Makefile:48: build_buildroot] Error 2
make: *** [Makefile:45: build_env] Error 2
I found this GitHub issue which indicates that the problem should be solved with the recent version 3.4.6 of libffi.
The error message I got indicates that version 3.4.4 is being built.
I tried to update my own version from 3.4.4 (Fedora 39 repo) to 3.4.6 (Fedora Rawhide repo), but it didn't work.
I'm guessing the version built here is determined by something else.
What determines the version of libffi being built? How should I go about updating it? (Or solve the problem in a different way?) Thanks for any help.
I think I was able to solve it, at least the build is continuing further right now. I had to do the following:
- in
env/buildroot/package/libffi/libffi.mk, updateLIBFFI_VERSIONto3.4.6. - in
env/buildroot/package/libffi/libffi.hashupdate this line (version and hash):sha256 b0dea9df23c863a7a50e825440f3ebffabd65df1497108e5d437747843895a4e libffi-3.4.6.tar.gz
Thanks for raising the issue. The versions in use are defined in buildroot used to build the linux rootfs. I try used buildroot as it is therefore I will not patch it. But there should be an upcoming buildroot release in may and I'll update to the new release. Lets hope that it fixes your issue. Until then, I'll leave it open.
Hi @senekor,
After an operating system update, I ran into the same issue. Since Buildroot 2024.05 is not released yet, I update it to buildroot 2024.05-rc1. It solved the issue.
Cheer Simon