Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

build with android-ndk failed #62

Open
leleliu008 opened this issue Jul 22, 2021 · 0 comments
Open

build with android-ndk failed #62

leleliu008 opened this issue Jul 22, 2021 · 0 comments

Comments

@leleliu008
Copy link

leleliu008 commented Jul 22, 2021

report error logs:

configure:3668: checking whether the C compiler works
configure:3690: armv7a-linux-androideabi21-clang --sysroot /usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Qunused-arguments -Os -fpic  -fPIC -march=armv7-a -mfpu=neon --target=arm-linux-androideabi --sysroot /usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Qunused-arguments -I/usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/arm-linux-androideabi -include /Users/leleliu008/.ndk-pkg/include.h  conftest.c  >&5
/usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/usr/local/opt/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ld: error: cannot open crtend_android.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3694: $? = 1
configure:3732: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "fontconfig"
| #define PACKAGE_TARNAME "fontconfig"
| #define PACKAGE_VERSION "2.11.1"
| #define PACKAGE_STRING "fontconfig 2.11.1"
| #define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig"
| #define PACKAGE_URL ""
| #define PACKAGE "fontconfig"
| #define VERSION "2.11.1"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }

reason:
we usually use the CC command like $TARGET-clang, for example armv7a-linux-androideabi21-clang, there is no need to specify --target=VALUE argument to this command. if specify --target=VALUE, VALUE must equal to armv7a-linux-androideabi21, otherwise will throw a error as above.

relavent code: makefile.cargo#L8-L13

ifeq (armv7-linux-androideabi,$(TARGET))
	# Reset TARGET variable because armv7 target name used by Rust is not 
	# the same as the target name needed for the CXX toolchain.
	TARGET = arm-linux-androideabi
	FLAGS += -march=armv7-a -mfpu=neon --target=$(TARGET)
endif

workaround:
remove the --target=$(TARGET) argument.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant