article thumbnail image
Published 2018. 2. 6. 10:21
반응형

우분투 16.04에서 Oreo를 빌드할 때는 특별한 이슈가 없었는데 6.0.1 (marshmallow)을 빌드하려고 하니 아래와 같은 clang 에러 발생

out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o:function art_quick_to_interpreter_bridge: error: unsupported reloc 43
out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o:function art_quick_to_interpreter_bridge: error: unsupported reloc 43
out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o:function art_quick_instrumentation_entry: error: unsupported reloc 43
out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o:function art_quick_instrumentation_entry: error: unsupported reloc 43
out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o:function art_quick_instrumentation_exit: error: unsupported reloc 43
out/host/linux-x86/obj32/SHARED_LIBRARIES/libart_intermediates/arch/x86/quick_entrypoints_x86.o:function art_quick_deoptimize: error: unsupported reloc 43
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:51: recipe for target 'out/host/linux-x86/obj32/lib/libart.so' failed
make: *** [out/host/linux-x86/obj32/lib/libart.so] Error 1
Saved manifest to out/target/product/kvim/manifests/manifest-170226-1358.xml

안드로이드를 빌드하다가 위와 같은 에러를 만나게 된다면 다음과 같이 수정하면 된다.

project build/
diff --git a/core/clang/HOST_x86_common.mk b/core/clang/HOST_x86_common.mk
index 74b5a69..afbe1c7 100644
--- a/core/clang/HOST_x86_common.mk
+++ b/core/clang/HOST_x86_common.mk
@@ -11,7 +11,8 @@ endif
 ifeq ($(HOST_OS),linux)
 CLANG_CONFIG_x86_LINUX_HOST_EXTRA_ASFLAGS := \
   --gcc-toolchain=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG) \
-  --sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot
+  --sysroot=$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/sysroot  \
+  -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin

현재 최신 안드로이드 코드에는 이미 반영이 되어 있다.

https://android-review.googlesource.com/c/platform/build/+/223100



코드를 수정하고도 계속 에러가 발생하면 out/host/ 이하 파일을 지우고 다시 시도해 보시기 바랍니다.


반응형
복사했습니다!