Cant Build Aosp On Xenial

3,134 views
Skip to first unread message

Michele Bono

unread,
Apr 22, 2016, 4:24:09 PM4/22/16
to Android Building
Hey Guys,

I cannot build anymore after upgrading to ubuntu 16.04

Getting this error

prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld: error: out/host/linux-x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x86_64.o: unsupported reloc 42 against global symbol art::Runtime::instance_
...
out/host/linux-x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x86_64.o:function art_quick_instrumentation_exit: error: unsupported reloc 42
out/host/linux-x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x86_64.o:function art_quick_deoptimize: error: unsupported reloc 42
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

Someone has a solution?

Dan Willemsen

unread,
Apr 22, 2016, 5:16:37 PM4/22/16
to android-...@googlegroups.com
I haven't been able to reproduce this with AOSP master, are you attempting to build a recent master, or some other branch?

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lars Zobbe

unread,
Apr 27, 2016, 12:41:06 PM4/27/16
to android-...@googlegroups.com
'Dan Willemsen' via Android Building <android-building <at> googlegroups.com>
writes:

>
>
> I haven't been able to reproduce this with AOSP master, are you attempting
to build a recent master, or some other branch?
>
> On Fri, Apr 22, 2016 at 1:24 PM Michele Bono <bono.michele94 <at>
gmail.com> wrote:
>
>
> Hey Guys,
> I cannot build anymore after upgrading to ubuntu 16.04
>
> Getting this error
>
> prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-
linux/bin/ld: error: out/host/linux-
x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x
86_64.o: unsupported reloc 42 against global symbol art::Runtime::instance_
> ...
> out/host/linux-
x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x
86_64.o:function art_quick_instrumentation_exit: error: unsupported reloc 42
> out/host/linux-
x86/obj/SHARED_LIBRARIES/libart_intermediates/arch/x86_64/quick_entrypoints_x
86_64.o:function art_quick_deoptimize: error: unsupported reloc 42
> clang++: error: linker command failed with exit code 1 (use -v to see
invocation)Someone has a solution?
>
>
>
>
I have the same problem after I upgraded to ubuntu 16.04. It looks as if it
is related to clang. Maybe somewhere in the build scripts some link flags are
pointing to some dependency that are no longer present in 16.04?

I've tried with "our own" build and with a cyanogenmod 12.1 userdebug build.
My colleagues (who did not upgrade their ubuntu machines) do not have the
same problem. So I suspect some dependency missing in ubuntu 16.04.

Here's from cyanogenmod 12.1:

libnativehelper/JniInvocation.cpp:165: 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:44: recipe for target
'/home/lars/source/cm/cm-12.1/out/host/linux-
x86/obj32/lib/libnativehelper.so' failed
make: *** [/home/lars/source/cm/cm-12.1/out/host/linux-
x86/obj32/lib/libnativehelper.so] Error 1
make: *** Waiting for unfinished jobs....
host StaticLib: libsigchain_32 (/home/lars/source/cm/cm-12.1/out/host/linux-
x86/obj32/STATIC_LIBRARIES/libsigchain_intermediates/libsigchain.a)
make: Leaving directory '/home/lars/source/cm/cm-12.1'

#### make failed to build some targets (23:54 (mm:ss)) ####

In our own build it failed somewhere else but the clang linker command fail,
is the same.





lars....@lumigon.com

unread,
Apr 28, 2016, 10:04:49 AM4/28/16
to Android Building
It was solved by linking to the ubuntu-provided linker under /usr/bin/ like it is described by user CNBLACK here:

kevin....@linaro.org

unread,
May 10, 2016, 6:44:49 PM5/10/16
to Android Building
This is an omission in the clang configuration Makefiles, causing the system assembler to be used instead of the prebuilt one, this is the proper fix: https://android-review.googlesource.com/#/c/223100/

Shyam Saini

unread,
May 26, 2016, 12:14:03 PM5/26/16
to Android Building
This patch hasn't worked for me. one more thing my original  build/core/clang/HOST_x86_common.mk  file had an extra argument  -no-integrated-as , which I removed 


while applying this patch, because before removing it, some Makefile file missing operator error occurred. So, i decided to remove  -no-integrated-as argument. 

please correct me If I'm wrong and if not then post any available solution.

Dan Willemsen

unread,
May 26, 2016, 12:38:46 PM5/26/16
to android-...@googlegroups.com
You should be able to keep both -no-integrated-as and that patch, you just need to make sure the line continuations are proper (\ at the end of each line except the last).

As -no-integrated-as was removed in Marshmallow, I assume you're building Lollipop or earlier. We recommend Ubuntu 12.04 for Gingerbread through Lollipop, and Ubuntu 14.04 for Marshmallow: http://source.android.com/source/requirements.html

If you continue running into issues, I'd suggest building android in a container (Docker or similar) so that you can load the recommeded Ubuntu images as necessary.

- Dan

--

Shyam Saini

unread,
May 27, 2016, 10:10:42 AM5/27/16
to Android Building
Thanks @ Dan Willemsen . It worked for me. You saved my many hours.

kevin....@linaro.org

unread,
May 27, 2016, 10:10:44 AM5/27/16
to Android Building
Indeed, there's no problem keeping -no-integrated-as, assuming you don't break your Makefile of course... In fact, removing -no-integrated-as should make the problem disappear by itself, since it should stop clang from calling as. That said, this is fragile and the proper fix is to use -B (also using the integrated as is untested on Lollipop).

As for the Ubuntu version, there is no reason why this shouldn't work on 14.04, given that AOSP provides almost every executable used for building (FWIW - I don't even use Ubuntu). This bug created a dependency on the system as, that the patched removed.
Reply all
Reply to author
Forward
0 new messages