n00b: a make depends issue while building android image?

63 views
Skip to first unread message

Jason Kim

unread,
Jul 14, 2015, 8:19:43 PM7/14/15
to android-...@googlegroups.com
Hi

After several iterations of figuring out what was going wrong, I am slowly coming to the conclusion that the android build system has a potential gap in its dependency processing.

For example, when I modify a header file in src/bionic/... and I run make -j4 showcommands in src/
the files that are recompiled are not what I expected.

For example, if I modify src/bionic/libc/include/string.h, I expect nearly everything to be recompiled, but AFAIK, this does not happen.

Matter of fact, when I run the generated executable (linked with the new bionic) within the remote debugger (my target is a nexus 9), a breakpoint at memset (for example) does not coincide with the changes I've made to the bionic sources. The lines as reported by gdb do not coincide with the modifications I made to the source!!

I've had to manually do something like (find src/ -type f -name "*.[chp]*" | xargs touch) to get what is likely to be a proper build.

Given that I am a relative novice in building android, I am thinking that there is something I am missing. Is there a different/better strategy I can use to ensure that my android build is always properly current (other than doing a "make clean" ?)

Thanks everyone.
-Jason

Ying Wang

unread,
Jul 14, 2015, 8:36:31 PM7/14/15
to Android Building
The Android build system should be taking care of the header dependencies, using dependency file (.P in the intermediate dir) generated by the compiler.
For example, you should be able to find bionic/libc/include/string.h in out/target/product/*/obj/EXECUTABLES/ping_intermediates/ping.P .


--
--
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.

jason.w.kim...@gmail.com

unread,
Jul 17, 2015, 8:03:58 PM7/17/15
to android-...@googlegroups.com
Thanks, but I still am having issues --

After a recent successfull build, I modified two header files that are new to bionic.
They are located in bionic/libc/include and one or both are #included in the following files:
The two files have been added to the bionic's git repo and is commited locally.

./libc/bionic/malloc_debug_common.cpp
./libc/bionic/mmap.cpp
./libc/bionic/open.cpp
./libc/bionic/pthread_create.cpp
./libc/bionic/pthread_join.cpp
./libc/bionic/pthread_mutex.cpp
./libc/bionic/thread_private.cpp
./libc/include/fcntl.h
./libc/include/pthread.h
./libc/include/sys/mman.h
./libc/private/ScopedPthreadMutexLocker.h
./libc/stdio/snprintf.c


A subsequent make -j4 showcommands recompiled precisely ZERO files being recompiled.

Jason Kim

unread,
Oct 3, 2015, 10:12:44 AM10/3/15
to android-...@googlegroups.com

So it turns out that the culprit is CCACHE.
Disabling it makes builds a lot more predictable. (i.e. touching an included  header file kicks off what looks like the proper set of recompilations)
As of right now, http://source.android.com/source/initializing.html still mentions using CCACHE.
Perhaps a refresh of the public docs are in order?

Thanks



You received this message because you are subscribed to a topic in the Google Groups "Android Building" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-building/CTaXg44y-Bc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-buildi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages