Building i.MX6 Android L5.1.1_2.1.0 on Ubuntu 16.04

Document created by jim.lin Employee on May 16, 2016Last modified by ebiz_ws_prod on Dec 13, 2017
Version 4Show Document
  • View in full screen mode

Few issues encountered trying to build L5.1.1_2.1.0 Android for i.MX6:

(some of them can apply to Android M6 build also)


Issue-1: OpenJDK-7 required to build L5.1.1_2.1.0 but not able to download/install in Ubuntu 16.04:

solution: Ubuntu 16.04 and openjdk 7 - Ask Ubuntu


sudo add-apt-repository ppa:openjdk-r/ppa

sudo apt-get update

sudo apt-get install openjdk-7-jdk






Issue-2: without any modification, got error message like: "You have tried to change the API from what has been previously approved." during compilation.

solution: follow the suggestion in the error message, do "make update-api"





Issue-3: error messages like


external/libcxx/include/thread:149: error: unsupported reloc 43

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

build/core/ recipe for target 'out/host/linux-x86/obj32/lib/' failed

make: *** [out/host/linux-x86/obj32/lib/] Error 1



related post on Internet:


solution:(as mentioned in the link above)

replaced "prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.6/x86_64-linux/bin/ld" with the symlink to "/usr/bin/"

so this should look like:


~/myandroid/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6/x86_64-linux/bin$ ls -l ld*

lrwxrwxrwx 1 jimlin jimlin      16     May  6 14:48 ld -> /usr/bin/

-rwxrwxr-x 1 jimlin jimlin 1645584 May  6 11:24 ld.bfd

-rwxrwxr-x 1 jimlin jimlin 3497448 May  6 11:24

-rwxrwxr-x 1 jimlin jimlin 3497448 May  6 11:24






to this point I can build L5.1.1_2.1.0 successfully.(on 2016, May, 12.)







Issue-4: can't run the SD tool "" used to partition/format SD card in "~/myandroid/device/fsl/common/tools"


root-cause: in Ubuntu 16.04, "sfdisk" tool doesn't support "-u" parameter:


sfdisk from util-linux 2.27.1

-u, --unit S              deprecated, only sector unit is supported



error message encountered when running the script:


~/myandroid/device/fsl/common/tools$ sudo ./ /dev/sdc

sfdisk: unsupported unit 'M'

sfdisk: unsupported unit 'M'



I've modified the script a bit to adapt the changes, as attached.

Original Attachment has been moved to:

6 people found this helpful