Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No rule to make target '[...]/kbuild/services4/srvkm/env/linux/osfunc.o', needed by '[...]kbuild/pvrsrvkm_sgx540_120.o' #3

Open
shasheene opened this issue Jul 31, 2016 · 4 comments

Comments

@shasheene
Copy link

shasheene commented Jul 31, 2016

First off, it's pretty damn amazing to have a Galaxy Nexus Marshmallow AOSP ROM available after Google wasn't able to even release a 4.4 KitKat because TI dropped support for OMAP4. Great work guys!

That said, I was unable to build the ROM after doing a git checkout. I've ran the commands on the README.md in association to the AOSP build documentation. Also, as recommended by the AOSP documentation I am outputting to a separate physical drive, which happens to be mounted under a directory named '/vm'.

I am using Debian Stable (Jessie) and added jessie-backports to install OpenJDK 1.8 as suggested by the documentation. I was surprised when I ran the build script said it needed 1.7 contrary to the documentation, so I went ahead and installed OpenJDK 1.7 as well.

Anyway, after setting everything up, I ran a make -j2 (I am building on an older Core 2 Duo CPU). The build was going well for a few hours, until it got the following:

Makefile:118: "Assuming we want DVFS and dsscomp support."
Install: /vm/android//android/host/linux-x86/bin/adb
host SharedLib: libbacktrace_test_32 (/vm/android//android/host/linux-x86/obj32/lib/libbacktrace_test.so)
host SharedLib: liblog_32 (/vm/android//android/host/linux-x86/obj32/lib/liblog.so)
host SharedLib: libunwind_32 (/vm/android//android/host/linux-x86/obj32/lib/libunwind.so)
clang: warning: argument unused during compilation: '-nodefaultlibs'
host SharedLib: libcutils_32 (/vm/android//android/host/linux-x86/obj32/lib/libcutils.so)
Install: /vm/android//android/host/linux-x86/lib/libc++.so
  RM       /vm/android//android/target/product/tuna/host/intermediates /vm/android//android/target/product/tuna/target/intermediates /vm/android//android/target/product/tuna/target/kbuild
make[1]: Leaving directory '/home/sge/Documents/fungit/android/hardware/ti/omap4/pvr-source/eurasiacon/build/linux2/omap4430_android'
cp kernel/samsung/tuna/drivers/video/omap2/omapfb/omapfb.h /vm/android//android/target/product/tuna/obj/KERNEL_OBJ/drivers/video/omap2/omapfb/omapfb.h
make -j8 -C hardware/ti/omap4/pvr-source/eurasiacon/build/linux2/omap4430_android ARCH=arm KERNEL_CROSS_COMPILE=arm-eabi- CROSS_COMPILE=arm-eabi- KERNELDIR=/vm/android//android/target/product/tuna/obj/KERNEL_OBJ TARGET_PRODUCT="blaze_tablet" BUILD=release TARGET_SGX=540
make[1]: warning: -jN forced in submake: disabling jobserver mode.
make[1]: Entering directory '/home/sge/Documents/fungit/android/hardware/ti/omap4/pvr-source/eurasiacon/build/linux2/omap4430_android'
host SharedLib: libbase (/vm/android//android/host/linux-x86/obj/lib/libbase.so)
Install: /vm/android//android/host/linux-x86/lib64/liblog.so
Install: /vm/android//android/host/linux-x86/lib64/libunwind.so
Install: /vm/android//android/host/linux-x86/lib64/libbacktrace_test.so
Install: /vm/android//android/host/linux-x86/lib64/libcutils.so
Install: /vm/android//android/host/linux-x86/bin/llvm-tblgen
Install: /vm/android//android/host/linux-x86/lib64/libcompiler_rt.so
host SharedLib: libnativehelper_32 (/vm/android//android/host/linux-x86/obj32/lib/libnativehelper.so)
host Executable: dalvikvm (/vm/android//android/host/linux-x86/obj/EXECUTABLES/dalvikvm_intermediates/dalvikvm64)
Install: /vm/android//android/host/linux-x86/lib64/libnativehelper.so
host C++: libart-compiler <= art/compiler/compiled_method.cc
make -C /home/sge/Documents/fungit/android/kernel/samsung/tuna O=/vm/android/android/target/product/tuna/obj/KERNEL_OBJ/. 
make -C /vm/android/android/target/product/tuna/obj/KERNEL_OBJ \
KBUILD_SRC=/home/sge/Documents/fungit/android/kernel/samsung/tuna \
KBUILD_EXTMOD="/vm/android/android/target/product/tuna/target/kbuild" -f /home/sge/Documents/fungit/android/kernel/samsung/tuna/Makefile \

  LD      /vm/android/android/target/product/tuna/target/kbuild/built-in.o
make[6]: *** No rule to make target '/vm/android/android/target/product/tuna/target/kbuild/services4/srvkm/env/linux/osfunc.o', needed by '/vm/android/android/target/product/tuna/target/kbuild/pvrsrvkm_sgx540_120.o'.  Stop.
make[6]: *** Waiting for unfinished jobs....
/home/sge/Documents/fungit/android/kernel/samsung/tuna/Makefile:1360: recipe for target '_module_/vm/android/android/target/product/tuna/target/kbuild' failed
make[5]: *** [_module_/vm/android/android/target/product/tuna/target/kbuild] Error 2
Makefile:130: recipe for target 'sub-make' failed
make[4]: *** [sub-make] Error 2
Makefile:19: recipe for target 'all' failed
make[3]: *** [all] Error 2
eurasiacon/build/linux2/kbuild/kbuild.mk:56: recipe for target 'kbuild' failed
make[2]: *** [kbuild] Error 2
../config/core.mk:606: recipe for target 'build' failed
make[1]: *** [build] Error 2
make[1]: Leaving directory '/home/sge/Documents/fungit/android/hardware/ti/omap4/pvr-source/eurasiacon/build/linux2/omap4430_android'
device/samsung/tuna/BoardConfig.mk:42: recipe for target 'SGX_MODULES' failed
make: *** [SGX_MODULES] Error 2
make: *** Waiting for unfinished jobs....

(I tried again with just a make (ie, single thread) and had same failure.)

This is my first build of Android, so I may be doing something wrong. I'm very comfortable with git, but its the first time I'm using repo or doing an Android build.

Other than running the commands in the README.md, I don't believe there are any other git repositories I need to manually checkout other than this one...

@Ziyann
Copy link
Member

Ziyann commented Aug 2, 2016

You're correct - provided that you have the Android build system dependencies installed, simply syncing this project is enough to build any supported device. No need to pull in or extract anything else.

That being said, your error message is really strange - I never seen that happen till now. Just to verify, here are the commands you should use to build tuna (otapackage is optional):

. build/envsetup.sh
lunch aosp_tuna-userdebug
make -j2 otapackage

Just to be sure, I'll run a freshly synced build later on to verify the behavior.

@shasheene
Copy link
Author

shasheene commented Aug 8, 2016

I haven't had much time to look into this, but I decided to try and build the same synchronized source but different target directory on a fresh Ubuntu 14.04 (Lubuntu) install, to be sure I'm running in the same package environment as Google recommends. I hit the same issue where OpenJDK 1.7 is needed, not OpenJDK 1.8 like Google's official instructions say. I used exactly the commands above and it failed in the same manner. For the record, the source was synchronized with the git repository first checked out at commit 0243e8a (EDIT: Sorry, I now realize I don't need to use git checkout before a repo init, because repo init uses this git repository anyway)

I had to look this up, but SGX refers to the PowerVR SGX540 graphics chip available on OMAP devices like Galaxy Nexus, not Intel's new 'Software Guard Extension' secure enclave technology available on new x86 CPUs (I saw references to Android x86 while building so I wasn't sure)

I'll try and look into this issue more later this week

@shasheene
Copy link
Author

shasheene commented Aug 28, 2016

After spending some time looking into it, I wasn't able to fix the issue.

It looks like the issue is reproducible by other people. I came across commit 18120b3 on the android_device_samsung_tuna repositories' Android 7.0 Nougat branch, which removes the entire SGX_MODULES make target that was causing the build to fail for me. I don't know how important that kernel module is to correct operation of the ROM, so I'm not sure if it's a solution.

(I should mention at one point (using make -j4 I think) the build somehow succeeded and produce some multigigabyte binaries (named system etc). I wasn't able to reproduce the build success after that, and given I didn't target an otapackage ZIP file I didn't want to risk flash the resulting images.)

I considered doing a repo sync on a commit containing a prior working manifest.xml file, but I need to construct/obtain a manifest_static.xml file.

An aside: It would be good to integrate some continuous integration infrastructure to automatically do a fresh build on every single commit. The free tiers on products like Travis CI have resource limits (timeouts less than a couple hours) so I don't think they're suitable (but they might be). I'll have a look how other community maintained AOSP projects do it.

@shasheene
Copy link
Author

I have compiled the 7.0 Nougat branch without errors (using a modern i5-4590 8gb RAM than an older Core 2 Duo with 4gb RAM it took about 1.5 hours in total with first make -j8 then make -j4).
I was unable to successfully boot the image once flashed (see below).

I used TWRP as my recovery and adb sideload to upload the ROM. After wiping all partitions (including system) except internal memory (/sdcard) and USB OTG. After flashing the ROM I produced with OpenGApps Nano, my phone stayed at the Android logo for 8 hours until I pulled the battery.

I simply ended up using your aosp_n_tuna_2016-08-30.zip ROM, which booted and appears to be working fine.

Assuming my Galaxy Nexus survives and prospers (I think its NAND flash memory is starting to die though), I might try again later and hopefully eventually contribute to this project.

The problem would still be exhibited on the aosp-6.0 branch as of writing, but you may close this issue if you'd like.

For completeness, I note I did encounter the following error during compilation:

[ 53% 15740/29287] target R.java/Manifest.jav.../obj/APPS/Calendar_intermediates/src/R.stamp)
packages/apps/Calendar/res/values-ar-rXB/arrays.xml:0: warning: Resource file packages/apps/Calendar/res/values-ar-rXB/arrays.xml is skipped as pseudolocalization was done automatically.
packages/apps/Calendar/res/values-ar-rXB/strings.xml:0: warning: Resource file packages/apps/Calendar/res/values-ar-rXB/strings.xml is skipped as pseudolocalization was done automatically.
Warning: AndroidManifest.xml already defines minSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
Warning: AndroidManifest.xml already defines targetSdkVersion (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[ 53% 15741/29287] Building with Jack: /vm/bu...ramework_intermediates/with-local/classes.dex
FAILED: /bin/bash /vm/build/android/target/common/obj/JAVA_LIBRARIES/framework_intermediates/with-local/classes.dex.rsp
Out of memory error (version 1.2-rc4 'Carnac' (298900 f95d7bdecfceb327f9d201a1348397ed8a843843 by android-jack-team@google.com)).
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
[ 53% 15741/29287] Building with Jack: /vm/bu...RARIES/xmp_toolkit_intermediates/classes.jack
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (45:01 (mm:ss)) ####

...and the solution from here fixed my problem:

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants