Linaro Build Error - Android Q&A, Help & Troubleshooting

I'm trying to compile an CM AOSP build using the Linaro toolchain and I get a build error.
Code:
target thumb C++: libmedia <= frameworks/base/media/libmedia/MediaProfiles.cpp
frameworks/base/media/libmedia/MediaProfiles.cpp: In member function 'void android::MediaProfiles::checkAndAddRequiredProfilesIfNecessary()':
frameworks/base/media/libmedia/MediaProfiles.cpp:521:16: error: redeclaration of 'size_t n'
frameworks/base/media/libmedia/MediaProfiles.cpp:505:24: error: 'size_t n' previously declared here
frameworks/base/media/libmedia/MediaProfiles.cpp: In static member function 'static android::MediaProfiles* android::MediaProfiles::getInstance()':
frameworks/base/media/libmedia/MediaProfiles.cpp:642:5: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'android::MediaProfiles*' [-Wformat]
make: *** [out/target/product/maguro/obj/SHARED_LIBRARIES/libmedia_intermediates/MediaProfiles.o] Error 1
As you can see by the last line I am attempting to build for maguro (GSM Galaxy Nexus) and when using the standard toolchain without Linaro the product compiles perfectly. I get the same result when compiling for different devices and there have been no recent changes to libmedia in the repo and since I can build fine without Linaro I'm completely certain that it is related to that toolchain.
The exact toolchain package I am using is linaro-android/toolchain-4.7-2012.06/android-toolchain-eabi-linaro-4.7-2012
toolchain export command: export TARGET_TOOLS_PREFIX=prebuilt/linux-x86/toolchain/android-toolchain-eabi/bin/arm-linux-androideabi-
Since it is libmedia that fails to build is this an issue with hardware acceleration support? Also, if I comment out the libmedia from the build can I extract the binary file for it from another ROM, and would that ROM need to be Linaro based as well?
Thanks

While I am not sure how to fix it you are now seeing why some are not using it. Encluding the CM team. It breaks things at random
Sent from my Inspire 4G using Tapatalk 2

Did somebody run a bunch of tests that proved all this "different compiler is better" stuff anyways? Let me go try and find the link...
Sent from my SCH-R760 using Tapatalk 2

Found it, read through this for more info.
http://forum.xda-developers.com/showthread.php?t=1371044
Sent from my SCH-R760 using Tapatalk 2

Github.com/teamhorizon
Check out the frameworks patches for linaro and cherry pick them. Don't forget to remove the current patches.
Github.com/teamgummy
Cherry-pick the linaro patches from all the external repositories.
Sent from my Galaxy Nexus using Tapatalk 2

I wanted to try and install Kubuntu 12.04 because they said it had MTP installed out of the box but when I checked it in vm and tried to get the build environment ready this is what I got. Make version was still 3.81 but it had the linaro toolchain . Should I install it locally or stick with 10.04?
$gcc --version
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

Some info I found about building AOSP with Linaro, in case that helps you
Look at this script (or run it, it will do the job):
http://snapshots.linaro.org/android...nexus-linaro/231/linaro_android_build_cmds.sh
Some more info:
https://android-build.linaro.org/builds/~linaro-android/galaxynexus-linaro/
http://www.linaro.org/linaro-blog/2011/09/15/building-a-linaro-android-build-from-source/

Related

[Q] Building a kernel with linaro toolchain

Hello, i am trying to build a kernel using the linaro toolchain from here http://is.gd/Au5yrh . Kernel builds fine with gcc-4.4.3 from cyanogenmod but with linaro all the warnings are treated as errors like the one below.
Code:
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:298:15: warning: 'offset.un' may be used uninitialized in this function [-Wuninitialized]
error, forbidden warning: alignment.c:298
make[1]: *** [arch/arm/mm/alignment.o] Error 1
I know one way to solve this is to actually edit the code and fix this warning but since this works and i might end up braking something i am looking maybe for an easier solution.
I have tried editing the Makefile CFLAGS removing -Werror but yet no luck.
The kernel tree is this if it helps https://github.com/ezeteze/kernel_huawei
Thanks in advance!
ezet said:
Hello, i am trying to build a kernel using the linaro toolchain from here http://is.gd/Au5yrh . Kernel builds fine with gcc-4.4.3 from cyanogenmod but with linaro all the warnings are treated as errors like the one below.
Code:
arch/arm/mm/alignment.c: In function 'do_alignment':
arch/arm/mm/alignment.c:298:15: warning: 'offset.un' may be used uninitialized in this function [-Wuninitialized]
error, forbidden warning: alignment.c:298
make[1]: *** [arch/arm/mm/alignment.o] Error 1
I know one way to solve this is to actually edit the code and fix this warning but since this works and i might end up braking something i am looking maybe for an easier solution.
I have tried editing the Makefile CFLAGS removing -Werror but yet no luck.
The kernel tree is this if it helps https://github.com/ezeteze/kernel_huawei
Thanks in advance!
Click to expand...
Click to collapse
edit and find "offset.un" and add = NULL; at the end
so code looks like this.. offset.un = NULL;
go ahead and try it..
OR
offset.un = 0;

[GUIDE] How to build a kernel for the Galaxy Player

After numerous requests I've received from users concerning how-to build kernels, this guide will mostly answer your need to do so.
This guide will be separated in 3 distinct parts: Downloading sources, Building the actual kernel and making a working boot image and or zImage. So let's begin!!
Requirements: A linux computer
Part 1: Downloading sources
Before bulding any kernels, you must have it's source code. Every Android device manufacturers have the OBLIGATION to post them in order to comply with the GPL (GNU General Public License). You can mostly find them in their developpers specified site. You have two ways of download the required source in order to build a kernel: The manufacturer website or git.
1.1: Downloading using the manufacturer's website
You can download your Galaxy Player kernel source using mostly this website: opensource.samsung.com
When you're in it, you can go to the MP3 players section and take the source according to your device. To get the kernel source, unzip the xxxopensource.zip and you should see 2 separate files. Unzip the one with the mention KERNEL in it, it is your kernel.
1.2: Using git
Some of you may know it, some others not. For those who don't know what git is, here's a little explication from it's website
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Click to expand...
Click to collapse
A lot of developpers from around the world do use git because of it ease of use. There are several websites that uses the git protocol. The two most known are github and gitbucket. In order to download your kernel source, you must have found someone who uploaded it into these websites. For this example we will use the Cyanogenmod github's profile. You can download the source with 2 ways:
First way
1. Go into a existing kernel source repository (for example this one: https://github.com/CyanogenMod/android_kernel_samsung_aries)
2. Click the Download zip button situated at the mid-right
3. Unzip the zip and you should find your kernel source.
Note: When using this method, you must be sure of the branch choosen. Problems can happen if the wrong branch is used.
Second way
Note: You must have the git dependencies for linux. To download them for Debian, Ubuntu, please run this command: sudo apt-get install git-core, gnupg, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl, libncurses5-dev, zlib1g-dev, ia32-libs, lib32z1-dev, lib32ncurses5-dev, gcc-multilib, g++-multilib
1. Go into a existing kernel source repository (https://github.com/CyanogenMod/android_kernel_samsung_aries)
2. We're going to "clone" the repository, to do so you will so this particular command:
Code:
git clone https://github.com/CyanogenMod/android_kernel_samsung_aries.git aries
(the second aries word will be the name of the actual folder)
If you want to download another branch (because the one downloaded is the one shown in the website)
Code:
git clone https://github.com/CyanogenMod/android_kernel_samsung_aries.git -b jellybean aries
(where's the -b means branch)
You should have your kernel source named aries output in the folder you specified.
Second part will cover mostly how to build a kernel.
Part 2 Building an actual kernel
In order to build a kernel, you must use an arm toolchain.
The GNU toolchain is a blanket term for a collection of programming tools produced by the GNU Project.
Click to expand...
Click to collapse
Here's a zip containing the arm-eabi-4.4.3 and arm-androideabi-4.6 toolchains
Toolchains Download
2.1 Exporting the toolchain path
Once you've downloaded a toolchain and are ready to build the kernel source into a kernel binary, enter to the directory of that said kernel, (cd aries in this case). You must export the location of your toolchain so the kernel source can know from where it has to build. To do so:
For arm-eabi-4.4.3
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
"export ARCH=arm"
For arm-linux-androideabi-4.6
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-"
"export ARCH=arm"
2.2 Using a config file
In order to build a kernel, you MUST use a config file which defines the device's components. The easiest way of doing so is to take the manufacturer's stock configuration file (generaly it's a defconfig file found in arch/arm/configs). To create one, you use the make menuconfig command while in your kernel root directory. If you use a different source than your manufacturer one, You have to either ask the developper or to search for this file. (I can't say really much about it ).
2.3 Building the kernel
Once you've your config file and toolchain set up, you can begin the build. To do so you execute these command:
Code:
make cyanogenmod_galaxys_defconfig (This is just as a example, replace it by whatever your defconfig is)
make -jx (x is the number of jobs your computer can do a the same time. The recommended way to know how many to use is to take the number of cores in your CPU +1
Depending on the number of threads (jobs) used, it will be either long or not to compile your kernel. (Generally it takes between 5-15 minutes to compile a single kernel).
Once your kernel have been built, you will have it into the form of a file named zImage situated in arch/arm/boot. This kernel is usable for some devices, however it is not usable for ours. DO NOT EVER EVER FLASH THIS BINARY. I'M NOT RESPONSIBLE FOR ANY BRICKS!!
The third part will help you getting a bootable kernel for your device.
Part 3: Making a bootable kernel
Note: This is a in-progress part so it may be unclear to some people. I will try to do it as much as understandable for everybody.
The kernel binary obtained at the second post is mostly not bootable due to the the fact that the initramfs isn't inclued. The initramfs is the actual ramdisk of your device. To find one... well you must find it (I can't really do anything for you). If you do have one initramfs in a folder, you must specify it in the config file with this current line:
Code:
CONFIG_INITRAMFS_SOURCE=""
Once this has been applied, you can make build this kernel and it should boot
Note that this applies mostly to the model of the 4.0 and 5.0 (and for GB as well). 3.6 and 4.2 uses a different method of using a boot image
One last time...
thanks!! really gonna try this sometimes!!! (once you get part two and three out of the tutorial XD )
If someone is interested in the config file for the Galaxy Player 3.6, he can find it on my GitHub: http://www.github.com/team-hurricane-xda.
How to set it up:
0. Download the config file
1. Rename the config file to aalto-deconfig
2. Copy the file to <kernelsource>/arch/arm/config
3. cd ~/path/to/kernel
4. make aalto-deconfig
5. make
MrBrubble
Sent from my YP-GS1 using xda app-developers app
Build_Error
I've searched and haven't found a straight answer, i get the same build error on every kernel i try to build. Even on this one. Any help is appreciated.
Code:
make: /home/alex/home/alexandroid_toolchains/arm-eabi-linaro-4.6.2gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /home/alex/home/alexandroid_toolchains/arm-eabi-linaro-4.6.2gcc: Command not found
CHK include/linux/version.h
UPD include/linux/version.h
CC scripts/mod/empty.o
/bin/sh: 1: /home/alex/home/alexandroid_toolchains/arm-eabi-linaro-4.6.2gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs..
This is in: file system/usr/include/linux>version.h
#define LINUX_VERSION_CODE 197895
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Anything in particular that should be here?
Also I have tried to use the linaro toolchains and the one included in the ndk.
2.1 Exporting the toolchain path
Once you've downloaded a toolchain and are ready to build the kernel source into a kernel binary, enter to the directory of that said kernel, (cd aries in this case). You must export the location of your toolchain so the kernel source can know from where it has to build. To do so:
For arm-eabi-4.4.3
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
"export ARCH=arm"
For arm-linux-androideabi-4.6
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-"
"export ARCH=arm"
2.2 Using a config file
Can you please explain where I need to put the folders/files to make this cmd work. I am using windows7 if that helps. I currently have them in the C:\ thanks. I am hung up here and would greatly appreciate some extra guidance.
po8pimp said:
2.1 Exporting the toolchain path
Once you've downloaded a toolchain and are ready to build the kernel source into a kernel binary, enter to the directory of that said kernel, (cd aries in this case). You must export the location of your toolchain so the kernel source can know from where it has to build. To do so:
For arm-eabi-4.4.3
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
"export ARCH=arm"
For arm-linux-androideabi-4.6
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-"
"export ARCH=arm"
2.2 Using a config file
Can you please explain where I need to put the folders/files to make this cmd work. I am using windows7 if that helps. I currently have them in the C:\ thanks. I am hung up here and would greatly appreciate some extra guidance.
Click to expand...
Click to collapse
zaclimon said:
...
Requirements: A linux computer
...
Click to expand...
Click to collapse
It's in the OP
seriously I must have totally missed that, I read it over again just to make sure. I will try it again in Ubuntu. Thanks for such a quick reply and apologize for my ignorance. Most things are compiled using Linux, however some I have been doing with windows lately so my assumptions got the best of me it seems. Thanx again
Ok so I am at the point where I need to make the Kernel. I am at this point:
make cyanogenmod_galaxys_defconfig (This is just as a example, replace it by whatever your defconfig is)
My question is which .defconfig do I use and how can I find the current one running on my device? I am assuming the best to fit all different platforms would be to chose the "android_hugo_r03_eng_defcongfig". Is this correct. I currently own the USA model if that helps. However I want to be able to help out all models without building 3 different kernels. Thank you in advance.
Here are the options available:
android_hugop2p_r01_eng_defcongfig
android_hugop2p_r01_user_defcongfig
android_hugop2p_r02_eng_defcongfig
android_hugop2p_r02_user_defcongfig
android_hugop2p_r03_eng_defcongfig
android_hugop2p_r03_user_defcongfig
android_hugo_r01_eng_defcongfig
android_hugo_r01_user_defcongfig
android_hugo_r02_eng_defcongfig
android_hugo_r02_user_defcongfig
android_hugo_r03_eng_defcongfig
android_hugo_r03_user_defcongfig
android_hugo_r03_eng_EUR_defcongfig
android_hugo_r03_user_EUR_defcongfig
android_hugo_r03_eng_KOR_defcongfig
android_hugo_r03_user_KOR_defcongfig
android_hugo_r03_eng_USA_defcongfig
android_hugo_r03_user_USA_defcongfig
po8pimp said:
Ok so I am at the point where I need to make the Kernel. I am at this point:
make cyanogenmod_galaxys_defconfig (This is just as a example, replace it by whatever your defconfig is)
My question is which .defconfig do I use and how can I find the current one running on my device? I am assuming the best to fit all different platforms would be to chose the "android_hugo_r03_eng_defcongfig". Is this correct. I currently own the USA model if that helps. However I want to be able to help out all models without building 3 different kernels. Thank you in advance.
Here are the options available:
android_hugop2p_r01_eng_defcongfig
android_hugop2p_r01_user_defcongfig
android_hugop2p_r02_eng_defcongfig
android_hugop2p_r02_user_defcongfig
android_hugop2p_r03_eng_defcongfig
android_hugop2p_r03_user_defcongfig
android_hugo_r01_eng_defcongfig
android_hugo_r01_user_defcongfig
android_hugo_r02_eng_defcongfig
android_hugo_r02_user_defcongfig
android_hugo_r03_eng_defcongfig
android_hugo_r03_user_defcongfig
android_hugo_r03_eng_EUR_defcongfig
android_hugo_r03_user_EUR_defcongfig
android_hugo_r03_eng_KOR_defcongfig
android_hugo_r03_user_KOR_defcongfig
android_hugo_r03_eng_USA_defcongfig
android_hugo_r03_user_USA_defcongfig
Click to expand...
Click to collapse
In your case, it is more than just using different configs, sometimes there are more than one config because the different variants of the device uses drivers for other components. If you want to make 1 kernel for all the device, you need to modify it's source so that you can include all the variants drivers. Things like this requires a bit of comparing and programming skills.
I have the zImage created, now I need to make it bootable, can someone please fill me in on what is the next step. I have a bootable kernel to use as a shell if need be. Thank you in advance. This is for the 4.2 by the way.
EDIT: Figured it out I think. I am now running off a new kernel. How do I tell what the actual Kernel Version is? I used the toolchain provided here arm-eabi-4.4.3 to build it. Is there a way to know what the kernel version is from the toolchain?
---------- Post added at 11:04 AM ---------- Previous post was at 10:22 AM ----------
Looking at the readme in the folder for the toolchain, it says this is for ICS. If that is correct, then it is a step in the right direction. Here is the download link to the recovery/kernel
EDIT: removed link to kernel as it does not have wifi working.
po8pimp said:
I have the zImage created, now I need to make it bootable, can someone please fill me in on what is the next step. I have a bootable kernel to use as a shell if need be. Thank you in advance. This is for the 4.2 by the way.
EDIT: Figured it out I think. I am now running off a new kernel. How do I tell what the actual Kernel Version is? I used the toolchain provided here arm-eabi-4.4.3 to build it. Is there a way to know what the kernel version is from the toolchain?
---------- Post added at 11:04 AM ---------- Previous post was at 10:22 AM ----------
Looking at the readme in the folder for the toolchain, it says this is for ICS. If that is correct, then it is a step in the right direction.
Click to expand...
Click to collapse
Code:
cat /proc/version
Meticulus said:
Code:
cat /proc/version
Click to expand...
Click to collapse
thanks I will try that
EDIT: Linux version 2.6.35.7 (gcc version 4.4.3 (GCC))

Cannot build openssl while compiling Zenfone 2 Kernel

Hi all,
Recently I have issues with building a zenfone kernel in uBuntu Trusty Tahr.
When I ran "make openssl", I got this error:
x86_64-linux-android-gcc: error: unrecognized command line option '-fno-canonical-system-headers'
make: *** [/out/zenfone-ze551ml/target/product/generic_x86/obj/STATIC_LIBRARIES/third_party_openssl_openssl_gyp_intermediates/third_party/openssl/openssl/crypto/aes/asm/aes-586.o] Error 1
Click to expand...
Click to collapse
and the compilation process stopped.
I have been searching to many forums but fail to find the solution to this problem.
Could you help me?
The gcc --version is gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
leenakeenev said:
Hi all,
Recently I have issues with building a zenfone kernel in uBuntu Trusty Tahr.
When I ran "make openssl", I got this error:
and the compilation process stopped.
I have been searching to many forums but fail to find the solution to this problem.
Could you help me?
The gcc --version is gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4
Click to expand...
Click to collapse
U built for Lollipop or Marshmallow? And go to your prebuilts/gcc toolchain folder, then execute this below command to correct gcc version as suggested by ASUS "git checkout tools_r22.2"
Sent from my ASUS_Z00AD using Tapatalk
quanganh2627 said:
U built for Lollipop or Marshmallow? And go to your prebuilts/gcc toolchain folder, then execute this below command to correct gcc version as suggested by ASUS "git checkout tools_r22.2"
Sent from my ASUS_Z00AD using Tapatalk
Click to expand...
Click to collapse
I built it for Lollipop 5.0.0 (android-5.0.0_r7).
Git checkout tools_r22.2 doesn't work as it always says "error: pathspec 'tools_r22.2' did not match any file(s) known to git."
So according to this topic: asus.com/zentalk/forum.php?mod=viewthread&tid=7537 I downloaded the "tool_r22.2.tgz" tools from the page instead.
However it doesn't solve the problem.
sr, not read carefully. u followed Asus Readme in kernel package , didn't u? maybe they forgot to update that guide, "tools_r22.2" is deprecated of gcc4.7 and prior only, now at gcc4.8 or 4.9 on Aosp haven't got it, but u can use "lollipop-released" or "android-5.0.0_r7". And make sure ur local repo have "external/openssl" inside.
Sent from my ASUS_Z00AD using Tapatalk

Makefile error: *** multiple target patterns. Stop.

I am currently trying to build an Ubuntu Touch-compatible kernel for use with the Xperia Z5 Compact. I have been following the How to build and flash a Linux kernel for AOSP supported devices guide and am at the point at which I have created an Ubuntu-compatible .config file but am having issues finally building the kernel (Step 7) using the .config file as I receive the following error:
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j 14
Makefile:791: *** multiple target patterns. Stop.
I know that this error is related to the call of link-vmlinux.sh which is referenced as follows on line 791 of the Makefile:
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
Any suggestions for debugging this problem would be greatly appreciated.
blackstar1744 said:
I am currently trying to build an Ubuntu Touch-compatible kernel for use with the Xperia Z5 Compact. I have been following the How to build and flash a Linux kernel for AOSP supported devices guide and am at the point at which I have created an Ubuntu-compatible .config file but am having issues finally building the kernel (Step 7) using the .config file as I receive the following error:
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j 14
Makefile:791: *** multiple target patterns. Stop.
I know that this error is related to the call of link-vmlinux.sh which is referenced as follows on line 791 of the Makefile:
vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
Any suggestions for debugging this problem would be greatly appreciated.
Click to expand...
Click to collapse
Yah, I'm facing the same problem. Only with 64-bit targets (G4 and G4 Stylus), this doesn't happen with any 32bit targets. It doesn't matter if I swap out the toolchain, it doesn't matter which tree I'm working -- Omni, Bliss, CM13 -- all can't get past that error.
So it doesn't seem like it's in the build tree, but maybe my system. I'm using Arch, so I'm used to Android building snafus, but still I cannot figure this out. I've gone through every chain leading to the error and I can't seem to pin it down. It's really harshing my build.
Lil' help, y'all?
UPDATE: Nevermind, just had to set USE_HOST_LEX. Goddammit, I though I already tried that.
Any explanation for why you need to set USE_HOST_LEX? Is this an OS- or compiler-related modification? I'm compiling with UBERTC 4.9 on Ubuntu 14.04 LTS. I currently don't have USE_HOST_LEX in my .config file.
culot said:
Yah, I'm facing the same problem. Only with 64-bit targets (G4 and G4 Stylus), this doesn't happen with any 32bit targets. It doesn't matter if I swap out the toolchain, it doesn't matter which tree I'm working -- Omni, Bliss, CM13 -- all can't get past that error.
So it doesn't seem like it's in the build tree, but maybe my system. I'm using Arch, so I'm used to Android building snafus, but still I cannot figure this out. I've gone through every chain leading to the error and I can't seem to pin it down. It's really harshing my build.
Lil' help, y'all?
UPDATE: Nevermind, just had to set USE_HOST_LEX. Goddammit, I though I already tried that.
Click to expand...
Click to collapse
blackstar1744 said:
Any explanation for why you need to set USE_HOST_LEX? Is this an OS- or compiler-related modification? I'm compiling with UBERTC 4.9 on Ubuntu 14.04 LTS. I currently don't have USE_HOST_LEX in my .config file.
Click to expand...
Click to collapse
USE_HOST_LEX set the build to use host's Flex instead of the one in-tree. See build/core/config.mk:
Code:
ifeq ($(USE_HOST_LEX),yes)
LEX := flex
else
LEX := prebuilts/misc/$(BUILD_OS)-$(HOST_PREBUILT_ARCH)/flex/flex-2.5.39
endif
I don't know about elsewhere, but this has been a problem on Arch for a while. Lately this has not longer been a problem for me, so I assumed it was not an issue. Apparently still a problem for 64bit build, but not 32bit. Hmm.
Another workaround was to preface your make with LC_ALL=C, but I tried that without setting 'USE_HOST_LEX=yes' and it didn't help.
EDIT: I don't think it's compiler-related, as I did try different toolchains and different toolchain versions -- none made a difference. I tried 3 different Make versions, no help. USE_HOST_LEX? That fixed it. Compiling as we speak.
I added export USE_HOST_LEX=yes to my .bashrc and went back to the GCC compiler...new problem to debug. Any suggestions on debugging control groups would be greatly appreciated
Code:
make ARCH=arm64 CROSS_COMPILE=$CROSS_COMPILE -j 1
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CALL scripts/checksyscalls.sh
<stdin>:1226:2: warning: #warning syscall sched_setattr not implemented [-Wcpp]
<stdin>:1229:2: warning: #warning syscall sched_getattr not implemented [-Wcpp]
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
CHK include/generated/compile.h
SKIPPED include/generated/compile.h
CC kernel/cgroup.o
kernel/cgroup.c: In function 'subsys_cgroup_allow_attach':
kernel/cgroup.c:2138:59: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
if (current != task && cred->euid != tcred->uid &&
^
kernel/cgroup.c:2139:18: error: invalid operands to binary != (have 'kuid_t' and 'kuid_t')
cred->euid != tcred->suid)
^
make[1]: *** [kernel/cgroup.o] Error 1
make: *** [kernel] Error 2
Random side rant: The way Google shows search results is going wayyy downhill.

[HELP][SOLVED]Errors while building from source

I am trying to port AOSPA marshmallow-caf (paranoid android) to victara and i cant get past these 2
1.
Code:
frameworks/base/packages/StatementService/src/com/android/statementservice/DirectStatementService.java:149: error: cannot access OkCacheContainer
mHttpResponseCache = HttpResponseCache.install(httpCacheDir, HTTP_CACHE_SIZE_IN_BYTES);
^
class file for com.android.okhttp.OkCacheContainer not found
1 error
make: *** [build/core/java.mk:394: out/target/common/obj/APPS/StatementService_intermediates/classes-full-debug.jar] Error 41
i tried building for the bacon using device trees and vendor stuff from official aospa repos but it also throws this error so i think its not device specific.
2.
Secondly the kernel is not compiling its throwing section mismatch error
Code:
ERROR: modpost: Found 11 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
i am using the CM kernel sources and defconfig
On googling someone suggested to change toolchains so switched to the one provided in AOSPA manifest (namely eabi-4.8 toolchain in google aosp repos , revision android-r16) previously i was using UBERTC arm-eabi-4.8.
But the exact same error popped up and the exact same file vmlinux.o
Interestingly the kernel is built successfully if i build it separately outside the AOSPA tree , or if i build it inside resurrection remix source tree , with both the toolchains .
Also since i mentioned bacon previously , bacon's kernel doesn't throw this error.
EDIT :
I reverted this
the kernel compiled without section mismatches but i encountered
Code:
The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.
make[2]: *** [modules] Error 1
make[1]: *** [sub-make] Error 2
i think this and this were responsible
i tried compiling with
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
and got the bootimg
so i guess kernel is done
but the class file not found error remains
Ok so i was able to fix the class file not found error also
The problem was that i was using jdk8 i switched to jdk7 and it compiled successfully

Categories

Resources