2

I'm trying to build Android 5.1.1_r38 from source on a Intel i5 machine running Ubuntu 16.04.

I've added the binaries for Nexus 6 and selected that option after executing "lunch" in the terminal.

After about an hour running, If gives me the following errors

    external/chromium_org/third_party/yasm/source/patched-yasm/tools/genmacro/genmacro.c:90: error: unsupported reloc 43

    external/chromium_org/third_party/yasm/source/patched-yasm/tools/genmacro/genmacro.c:48: error: unsupported reloc 43

    external/chromium_org/third_party/yasm/source/patched-yasm/tools/genmacro/genmacro.c:55: error: unsupported reloc 43

    external/chromium_org/third_party/yasm/source/patched-yasm/tools/genmacro/genmacro.c:68: error: unsupported reloc 43

    clang: error: linker command failed with exit code 1 (use -v to see invocation)

    build/core/host_executable_internal.mk:31: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmacro_x86_host_gyp_intermediates/genmacro' failed

    make: *** [out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmacro_x86_host_gyp_intermediates/genmacro] Error 1

    make: *** Waiting for unfinished jobs....

    prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmodule_x86_host_gyp_intermediates/third_party/yasm/source/patched-yasm/libyasm/genmodule.o: unsupported reloc 43 against global symbol stderr

    prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmodule_x86_host_gyp_intermediates/third_party/yasm/source/patched-yasm/libyasm/genmodule.o: unsupported reloc 43 against global symbol stderr

    prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmodule_x86_host_gyp_intermediates/third_party/yasm/source/patched-yasm/libyasm/genmodule.o: unsupported reloc 43 against global symbol stderr

    prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6//x86_64-linux/bin/ld: error: out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmodule_x86_host_gyp_intermediates/third_party/yasm/source/patched-yasm/libyasm/genmodule.o: unsupported reloc 43 against global symbol stderr

    external/chromium_org/third_party/yasm/source/patched-yasm/libyasm/genmodule.c:87: error: unsupported reloc 43

    external/chromium_org/third_party/yasm/source/patched-yasm/libyasm/genmodule.c:63: error: unsupported reloc 43

    external/chromium_org/third_party/yasm/source/patched-yasm/libyasm/genmodule.c:174: error: unsupported reloc 43

    external/chromium_org/third_party/yasm/source/patched-yasm/libyasm/genmodule.c:183: error: unsupported reloc 43

    host StaticLib: third_party_yasm_genperf_libs_x86_host_gyp_32 (out/host/linux-x86/obj32/STATIC_LIBRARIES/third_party_yasm_genperf_libs_x86_host_gyp_intermediates/third_party_yasm_genperf_libs_x86_host_gyp.a)

    clang: error: linker command failed with exit code 1 (use -v to see invocation)


    build/core/host_executable_internal.mk:31: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmodule_x86_host_gyp_intermediates/genmodule' failed


    make: *** [out/host/linux-x86/obj32/EXECUTABLES/third_party_yasm_genmodule_x86_host_gyp_intermediates/genmodule] Error 1

I've run apt-get update and make clobber and anything else I can think of (note: I'm quite new to ubuntu)

2 Answers 2

1

Try applying the following change:

WORKING_DIRECTORY$ repo diff
project build/
diff --git a/core/clang/HOST_x86_common.mk b/core/clang/HOST_x86_common.mk
index 0241cb6..77547b7 100644
--- a/core/clang/HOST_x86_common.mk
+++ b/core/clang/HOST_x86_common.mk
@@ -8,6 +8,7 @@ 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 \
+  -B$($(clang_2nd_arch_prefix)HOST_TOOLCHAIN_FOR_CLANG)/x86_64-linux/bin \
   -no-integrated-as

 CLANG_CONFIG_x86_LINUX_HOST_EXTRA_CFLAGS := \

See also: https://groups.google.com/forum/#!topic/android-building/op5ZbyEfakE

Sign up to request clarification or add additional context in comments.

Comments

0

I modify Host_x86_common.mk,but the problem remains.

At last,I modify the art / build/Android.common_build.mk,like this:

# Clang build support.

# Host.
ART_HOST_CLANG := false
- ifneq ($(WITHOUT_HOST_CLANG),true)
+ ifeq ($(WITHOUT_HOST_CLANG),false)
# By default, host builds use clang for better warnings.
ART_HOST_CLANG := true
endif

fortunately,this help me fix the error.

This tips which I used is from 15th floor

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.