Compiling mips android source code

Tagged: 

This topic contains 12 replies, has 3 voices, and was last updated by  oldandroidgeek 4 years ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #31512

    Hi,

    I am compiling mips android source code.If i am using toolchain that came with Broadcom processor i am getting compilation error
    -EL option not found,error due to little endian.what changes i should do in order to avoid this error.Is it possible to compile the mips android source code for someother SOC e.g broadcom settop box chip.what changes i have to do in order to accomplish the same.

    Regards,
    Mayank

    #38097

    Sean
    Moderator

    Mayank,

    Which version of GCC are you using?

    Please detail the arguments you are passing to the tools.
    Note: When you do this, please enclose these in a code section so the text is not reformatted. to do this type <code> at the beginning of the section and </code> at the end.

    Have you seen the outine on our developer site?

    Sean.

    #38098

    Hi,

    I am trying to compile the android source code for mips using broadcom toolchain.
    when i do gcc -v i am getting below output:


    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

    i am building the code using following commands:
    source build/envset.sh
    lunch full_mips-eng

    In lunch itself i am getting the following errors:

    cc: error: unrecognized option ‘-EL’

    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’
    cc: error: unrecognized option ‘-EL’

    Any pointers/help to resolve the above error.when i am using the default toolchain i am not getting this error.

    Regards,

    #38099

    Sean
    Moderator

    I would suggest you check your configure arguments:
    --target=x86_64-linux-gnu

    #38100

    HI,
    If you could be more specific.I also tried to find out where in the files -EL option is there but it doesn’t help,how can we modify linker command options so that it includes -EL option.

    Regards

    #38101

    Sean
    Moderator

    Where did you get the toolchain from? Did you compile if from source?

    You’ll need a MIPS specific toolchain.

    Sean.

    #38102

    Hi,

    After resolving the earlier error by changing toolchain path in build/core/combo/TARGET fiile i am getting the following new errors:

    Install: out/host/linux-x86/bin/acp
    host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
    target C++: libbccAndroidBitcode <= frameworks/compile/libbcc/lib/AndroidBitcode/ABCCompiler.cpp
    target C++: libbccAndroidBitcode <= frameworks/compile/libbcc/lib/AndroidBitcode/ABCExpandVAArgPass.cpp
    target C++: libbccAndroidBitcode <= frameworks/compile/libbcc/lib/AndroidBitcode/ABCCompilerDriver.cpp
    target C++: libbccAndroidBitcode <= frameworks/compile/libbcc/lib/AndroidBitcode/Mips/MipsABCCompilerDriver.cpp
    target C++: libbccAndroidBitcode <= frameworks/compile/libbcc/lib/AndroidBitcode/Mips/MipsABCExpandVAArg.cpp
    target C++: libbccRenderscript <= frameworks/compile/libbcc/lib/Renderscript/RSCompiler.cpp
    target C++: libbccRenderscript <= frameworks/compile/libbcc/lib/Renderscript/RSCompilerDriver.cpp
    as: unrecognized option ‘-EL’
    as: unrecognized option ‘-EL’
    as: unrecognized option ‘-EL’
    as: unrecognized option ‘-EL’
    as: unrecognized option ‘-EL’
    as: unrecognized option ‘-EL’
    make: *** [out/target/product/generic_mips/obj/STATIC_LIBRARIES/libbccAndroidBitcode_intermediates/ABCCompiler.o] Error 1
    make: *** Waiting for unfinished jobs….
    make: *** [out/target/product/generic_mips/obj/STATIC_LIBRARIES/libbccAndroidBitcode_intermediates/ABCExpandVAArgPass.o] Error 1
    make: *** [out/target/product/generic_mips/obj/STATIC_LIBRARIES/libbccAndroidBitcode_intermediates/Mips/MipsABCCompilerDriver.o] Error 1
    make: *** [out/target/product/generic_mips/obj/STATIC_LIBRARIES/libbccAndroidBitcode_intermediates/Mips/MipsABCExpandVAArg.o] Error 1
    make: *** [out/target/product/generic_mips/obj/STATIC_LIBRARIES/libbccRenderscript_intermediates/RSCompiler.o] Error 1
    make: *** [out/target/product/generic_mips/obj/STATIC_LIBRARIES/libbccRenderscript_intermediates/RSCompilerDriver.o] Error 1
    as: unrecognized option ‘-EL’

    in folder frameworks/compile/lib/libbcc all c files are giving errors,if i am missing any changes.

    regards

    #38103

    Sean
    Moderator

    It looks like the wrong assembler is being called or it has been given the wrong target.
    I do not have the toolchain here and you have not told me where you got it from so I cannot be specific as to how this is the case.
    Sean.

    #38104

    Hi

    I am taking the toolchain that comes with android source code for assembler.also i am exporting the AS to mipsel-linux-android-as.as -v gives x86_64.which as gives /usr/bin/a s
    My doubts:
    1.if the android assembler toolchain for mipsel has -EL option,how can we check that.
    2.when i am exporting as to android as toolchain why which as gives /usr/bin/as
    got confused
    thanks for help

    regards

    #38105

    DuaneSand
    Member

    Hi Mayank,

    Android can only be built for machines running little-endian addressing. The standard gcc toolchains included within the Android source repo can compile to either big-endian or little-endian Mips targets, but only the little-endian choice works with the rest of the Android sources. So the included cross compilers and cross-assemblers are told to do this via the -EL compiler option. In the standard Android sources at Google’s aosp repo, these -EL options are set in the build control files build/core/combo/arch/mips/mips32*.mk . You should have or make a similar but separately-named .mk file for the broadcom cpu, with the options needed by gcc compilers for that cpu’s variant of the Mips instr set architecture. I’ll ask around here for the options we’ve used for broadcom work.

    It sounds like the broadcom cross-compiler toolchain you are using (instead of the tools built into the aosp repo), are set up for big-endian target cpus only, and so do not yet support the -EL option common in current gcc releases. If that toolchain is defaulting to little-endian anyway, you could just delete the -EL option from your .mk file and things should go better. Or maybe that toolchain expects a different spelling for that option. But if the toolchain you are trying to use, is hard-wired to be big-endian only, it will never work for building and running Android.

    In Mips’s early submissions to aosp, we tried to augment Android sources with various fixes to allow building and running a big-endian variant of Android. But most of those fixes were never accepted by Google, and Google has implicitly committed to only supporting little-endian cpus, and many subsequent adds to the Android source tree have added further little-endian dependencies. So Mips also stopped aiming to support big-endian for Android. (We continue supporting big-endian for general Linux use.) Another consideration is that a big-endian Android variant would not be able to share any Android application marketplace binaries with the standard little-endian version.

    I think some Broadcom Mips-iset cores are effectively big-endian only in hardware and drivers, and other Broadcom Mips-iset cores are bi-endian for some operating systems.

    For us to help you further with this, we’ll need to know which core you are targeting (or what publicly-known core it is compatible with), and exactly where you got the toolchain you are attempting to use, and how we could obtain and install that same version of the toolchain.

    I believe it should be possible to generate Broadcom-compatible code via the gcc compilers included at aosp, and from even-newer gcc compilers built from gnu.org; it should just be a matter of getting the right compiler options for the targeted cpu core.

    regards, Duane

    #38106

    DuaneSand
    Member

    In the Broadcom document “Android Installation and Usage Guide for Broadcom STB Platforms”, file AndroidInstallationGuide_v1.9.pdf, in the section “Install Broadcom toolchain”, it says

    “For Gingerbread or earlier Android versions, the Broadcom toolchain is needed to build Android
    and the kernel. In ICS and later versions, the toolchains in the Android source (in prebuilt/linux-
    x86/toolchain) is used to build Android instead and Broadcom toolchain is only used to build
    kernel.”

    So I think Broadcom only uses the aosp Mips compilers, not Broadcom’s own toolchain for Linux, when building current Android releases for Broadcom chips.

    #38107

    Hi,

    Thanks for your reply.Even after removing -EL option from build/core/combo/arch/mips/mips32r2-fp.mk file it is giving the same error.The purpose is to up the BCM7425 board with android.
    Further in the mips source code there is no kernel code.
    From where i will get the android mips kernel image for BCM7425 chipset.

    Regards

    #38108

    Hi,

    The toolchain i am using is stbgcc-4.5.3.2.2.I am trying to compile the mips android source code with this toolchain instead of default toolchain,but its giving me errors as: unrecognized option ‘-EL’

    regards

Viewing 13 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic.