配置:错误:找到 libffi 但无法使用它进行链接和编译

配置:错误:找到 libffi 但无法使用它进行链接和编译

当我运行configure时,它告诉我它无法链接到libffi它并与之编译。

这很奇怪,因为它已经安装了,而且我不知道应该做什么,因为所有需要的软件包都已安装。

命令:

bash configure \
--enable-option-checking=fatal \
--disable-warnings-as-errors \
--enable-headless-only \
--with-jvm-variants=zero \
--build=x86_64-unknown-linux-gnu \
--host=i686-linux-android \
--target=i686-linux-android \
--with-cups-include=/usr/include \
--with-devkit=$ANDROID_DEVKIT \
--with-extra-ldflags=-L/root/libffi-3.4.2 \
--with-debug-level=release \
--with-boot-jdk=/root/jdk-17.0.1

这是输出:

Warning: You are using legacy autoconf cross-compilation flags.
It is recommended that you use --openjdk-target instead.

configure: Configuration created at Thu Nov 18 13:45:16 CET 2021.
checking for basename... /usr/bin/basename
checking for dirname... /usr/bin/dirname
checking for file... /usr/bin/file
checking for ldd... /usr/bin/ldd
checking for bash... /usr/bin/bash
checking for cat... /usr/bin/cat
checking for chmod... /usr/bin/chmod
checking for cp... /usr/bin/cp
checking for cut... /usr/bin/cut
checking for date... /usr/bin/date
checking for gdiff... [not found]
checking for diff... /usr/bin/diff
checking for echo... echo [builtin]
checking for expr... /usr/bin/expr
checking for find... /usr/bin/find
checking for gunzip... /usr/bin/gunzip
checking for pigz... /usr/bin/pigz
checking for head... /usr/bin/head
checking for ln... /usr/bin/ln
checking for ls... /usr/bin/ls
checking for gmkdir... [not found]
checking for mkdir... /usr/bin/mkdir
checking for mktemp... /usr/bin/mktemp
checking for mv... /usr/bin/mv
checking for gawk... /usr/bin/gawk
checking for printf... printf [builtin]
checking for rm... /usr/bin/rm
checking for rmdir... /usr/bin/rmdir
checking for sh... /usr/bin/sh
checking for sort... /usr/bin/sort
checking for tail... /usr/bin/tail
checking for gtar... [not found]
checking for tar... /usr/bin/tar
checking for tee... /usr/bin/tee
checking for touch... /usr/bin/touch
checking for tr... /usr/bin/tr
checking for uname... /usr/bin/uname
checking for wc... /usr/bin/wc
checking for xargs... /usr/bin/xargs
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 a sed that does not truncate output... /usr/bin/sed
checking for df... /usr/bin/df
checking for nice... /usr/bin/nice
checking for greadlink... [not found]
checking for readlink... /usr/bin/readlink
checking for cygpath... [not found]
checking for wslpath... /usr/bin/wslpath
checking for lsb_release... /usr/bin/lsb_release
checking for cmd.exe... /mnt/c/windows/system32/cmd.exe
checking for cmp... /usr/bin/cmp
checking for uniq... /usr/bin/uniq
checking build system type... x86_64-unknown-linux-gnu
checking host system type... i686-linux-android
checking target system type... i686-linux-android
checking openjdk-build os-cpu... linux-x86_64
checking openjdk-build C library... gnu
checking openjdk-target os-cpu... android-x86
checking compilation type... cross
checking for top-level directory... /root/mobile
checking if custom source is suppressed (openjdk-only)... disabled, default
checking for --enable-debug... disabled, default
checking which debug level to use... release
checking which variants of the JVM to build... zero
checking if absolute paths should be allowed in the build output... no, release build
checking for sysroot...
checking for toolchain path...
checking for extra path...
checking where to store configuration... in default location
checking what configuration name to use... android-x86-zero-release
checking for zypper... [not found]
checking for apt-get... /usr/bin/apt-get
checking for pandoc... [not found]
checking for gmake... [not found]
checking for make... /usr/bin/make
configure: Testing potential make at /usr/bin/make, found using make in PATH
configure: Using GNU make at /usr/bin/make (version: GNU Make 4.2.1)
checking if make --output-sync is supported... yes
checking for output-sync value... none
checking if find supports -delete... yes
checking what type of tar was found... gnu
checking that grep (/usr/bin/grep) -Fx handles empty lines in the pattern list correctly... yes
checking for unzip... /usr/bin/unzip
checking for zip... /usr/bin/zip
checking for greadelf... [not found]
checking for readelf... /usr/bin/readelf
checking for dot... [not found]
checking for hg... /usr/bin/hg
checking for git... /usr/bin/git
checking for stat... /usr/bin/stat
checking for time... time [builtin]
checking for flock... /usr/bin/flock
checking for dtrace... [not found]
checking for gpatch... [not found]
checking for patch... /usr/bin/patch
checking for ulimit... ulimit [builtin]
checking bash version... 5.0.17
checking if bash supports pipefail... yes
checking if bash supports errexit (-e)... yes
checking for i686-linux-android-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking for default LOG value...
checking if packaged modules are kept... enabled, default
checking for version string... 18-internal+0-adhoc.root.mobile
configure: Found potential Boot JDK using configure arguments
checking for Boot JDK... /root/jdk-17.0.1
checking Boot JDK version... openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-39) OpenJDK 64-Bit Server VM (build 17.0.1+12-39, mixed mode, sharing)
checking for java [Boot JDK]... $BOOT_JDK/bin/java
checking for javac [Boot JDK]... $BOOT_JDK/bin/javac
checking for javadoc [Boot JDK]... $BOOT_JDK/bin/javadoc
checking for jar [Boot JDK]... $BOOT_JDK/bin/jar
checking if Boot JDK is 32 or 64 bits... 64
checking for local Boot JDK Class Data Sharing (CDS)... yes, created
checking for Build JDK... yes, will build it for the host platform
checking for docs-reference JDK... no, using interim javadoc for the docs-reference targets
checking if we should build headless-only (no GUI)... enabled, from command line
checking if linker should clean out unused code (linktime-gc)... disabled, default
checking for graphviz dot... no, cannot generate full docs
checking for pandoc... no, cannot generate full docs
checking for --enable-full-docs... disabled, from default 'auto'
checking for cacerts file... default
checking for --enable-unlimited-crypto... enabled, default
checking for jni library path... default
checking if static build is available... no
checking if static build is enabled... disabled, default
configure: Using default toolchain gcc (GNU Compiler Collection)
configure: WARNING: Ignoring LDFLAGS(/home/umut/musl-cross-make/gcc-9.4.0/libffi:/home/umut/musl-cross-make/build/local/aarch64-linux-musl/src_gcc/libffi:/home/umut/musl-cross-make/gcc-9.4.0.orig/libffi) found in environment. Use --with-extra-ldflags
checking for i686-linux-android-gcc... [not found]
checking for gcc... /usr/bin/gcc
checking resolved symbolic links for CC... /usr/bin/x86_64-linux-gnu-gcc-9
configure: Using gcc C compiler version 9.3.0 [gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0]
checking for i686-linux-android-/usr/bin/gcc... /usr/bin/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... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking for i686-linux-android-g++... [not found]
checking for g++... /usr/bin/g++
checking resolved symbolic links for CXX... /usr/bin/x86_64-linux-gnu-g++-9
configure: Using gcc C++ compiler version 9.3.0 [g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0]
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/bin/g++ accepts -g... yes
checking how to run the C preprocessor... /usr/bin/gcc -E
checking how to run the C++ preprocessor... /usr/bin/g++ -E
configure: Using gcc linker version 2.34 [GNU ld (GNU Binutils for Ubuntu) 2.34]
configure: comparing linker version to minimum version 2.18
checking for i686-linux-android-ar... [not found]
checking for ar... /usr/bin/ar
checking for i686-linux-android-strip... [not found]
checking for strip... /usr/bin/strip
checking for i686-linux-android-nm... [not found]
checking for nm... /usr/bin/nm
checking for i686-linux-android-gobjdump... [not found]
checking for gobjdump... [not found]
checking for i686-linux-android-objdump... [not found]
checking for objdump... /usr/bin/objdump
checking for i686-linux-android-c++filt... [not found]
checking for c++filt... /usr/bin/c++filt
checking for cc... /usr/bin/cc
checking for CC... [not found]
checking for g++... /usr/bin/g++
checking for nm... /usr/bin/nm
checking for ar... /usr/bin/ar
checking for objcopy... /usr/bin/objcopy
checking for strip... /usr/bin/strip
checking for jtreg... [not found]
checking for jtreg test harness... no, not found
checking for jmh (Java Microbenchmark Harness)... no, disabled
checking for jib... no
checking if @file is supported by gcc... yes
checking if CC supports "-m32"... yes
checking if CXX supports "-m32"... yes
checking if both CC and CXX support "-m32"... yes
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 stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking size of int *... 4
checking for target address size... 32 bits
checking whether byte ordering is bigendian... no
checking what source date to use... determined at build time, from 'updated'
checking for --enable-reproducible-build... disabled, default
checking for --enable-warnings-as-errors... disabled, from command line
checking if CC supports "-Xassembler -mrelax-relocations=no"... yes
checking if CXX supports "-Xassembler -mrelax-relocations=no"... yes
checking if both CC and CXX support "-Xassembler -mrelax-relocations=no"... yes
checking if TARGET is x86... yes
checking if control flow protection is enabled by additional compiler flags... no, forcing -march=i586
checking if CC supports "-fno-delete-null-pointer-checks"... yes
checking if CXX supports "-fno-delete-null-pointer-checks"... yes
checking if both CC and CXX support "-fno-delete-null-pointer-checks"... yes
checking if CC supports "-fno-lifetime-dse"... yes
checking if CXX supports "-fno-lifetime-dse"... yes
checking if both CC and CXX support "-fno-lifetime-dse"... yes
checking if CC supports "-fmacro-prefix-map=/root/mobile/="... yes
checking if CXX supports "-fmacro-prefix-map=/root/mobile/="... yes
checking if both CC and CXX support "-fmacro-prefix-map=/root/mobile/="... yes
checking how to prevent absolute paths in output... using compiler options
checking if CC supports "-ffp-contract=off"... yes
checking if CXX supports "-ffp-contract=off"... yes
checking if both CC and CXX support "-ffp-contract=off"... yes
checking if BUILD is x86... no
checking if BUILD_CC supports "-fno-delete-null-pointer-checks"... yes
checking if BUILD_CXX supports "-fno-delete-null-pointer-checks"... yes
checking if both BUILD_CC and BUILD_CXX support "-fno-delete-null-pointer-checks"... yes
checking if BUILD_CC supports "-fno-lifetime-dse"... yes
checking if BUILD_CXX supports "-fno-lifetime-dse"... yes
checking if both BUILD_CC and BUILD_CXX support "-fno-lifetime-dse"... yes
checking if BUILD_CC supports "-fmacro-prefix-map=/root/mobile/="... yes
checking if BUILD_CXX supports "-fmacro-prefix-map=/root/mobile/="... yes
checking if both BUILD_CC and BUILD_CXX support "-fmacro-prefix-map=/root/mobile/="... yes
checking how to prevent absolute paths in output... using compiler options
checking if BUILD_CC supports "-ffp-contract=off"... yes
checking if BUILD_CXX supports "-ffp-contract=off"... yes
checking if both BUILD_CC and BUILD_CXX support "-ffp-contract=off"... yes
checking what type of native debug symbols to use... external
checking if we should add external native debug symbols to the shipped bundles... no
checking if native coverage is available... yes
checking for --enable-native-coverage... disabled, default
checking if AddressSanitizer (asan) is available... yes
checking for --enable-asan... disabled, default
checking for cups headers... yes
Using freetype: bundled
checking for --enable-libffi-bundling... disabled, default
checking for LIBFFI... yes
checking if libffi works... no
configure: error: Found libffi but could not link and compile with it. You might be able to fix this by running 'sudo apt-get install libffi-dev'.
configure exiting with result code 1

答案1

你说“[ libffi] 已安装”,但配置脚本另有声明:

配置:错误:找到 libffi 但无法使用它进行链接和编译。您也许可以通过运行“sudo apt-get install libffi-dev”来修复此问题。

很可能libffi没有安装在标准位置,例如它可能位于/opt/lib或下/usr/local/lib,并且您尚未更新链接器配置以包含目标目录,或者您尚未安装开发包libffi-dev

相关内容