joelagnel / adeb

A debian-based shell environment designed for Android and adb
Apache License 2.0
319 stars 100 forks source link

override LINUX_VERSION_CODE is merged, delete extra patches #9

Closed changchengx closed 6 years ago

changchengx commented 6 years ago

bcc commit bfecc24 has been merged. There's no need to maintain seperate patches

Signed-off-by: Liu Changcheng changcheng.liu@aliyun.com

joelagnel commented 6 years ago

The deletion of patches has to accompanied by a change to bashrc too. Upstream uses BCC_LINUX_VERSION_CODE.

Also I will have to update prebuilt BCC in the releases or the changes will break the release. I'll clean this up this week.

joelagnel commented 6 years ago

Agreed on the china mirror patch. I will merge just that patch for now while we're discussing the other changes.

changchengx commented 6 years ago

"WA link issue" means "workaround link issue". I enabled your code base on x86 Android platform. There're some "ldd link issues", such as "/usr/bin/ld: cannot find -lstdc++". The reason is that ldd can't find the right library. I have to manually set LIBRARY_PATH environment variable to tell ldd where to find the required library.

joelagnel commented 6 years ago

I generally don't like WA (workarounds) unless there's other options:

About this patch:

x86 kernel header: set CPATH env for x86 device, I stl

Currently for building BCC on x86, there is no need for specifying CPATH. The x86 instructions are here: https://github.com/iovisor/bcc/blob/master/INSTALL.md

There could be some limitation in adeb filesystem, but since arm64 bcc builds work, I doubt that. I will try an x86 target soon and let you know. Thanks!

joelagnel commented 6 years ago

So I fixed 1/5 and merged 5/5. For 3/5 4/5 and 5/5, I want to spend more time fixing it properly.

Does running gcc on a C++ program work for you? Are the errors only with building BCC?

changchengx commented 6 years ago

@joelagnel Currently, it doesn't need any WA patches. I think it maybe related with gcc update. However, I could confirm there're some "library link issue" and "include head file" issues 2 weeks ago.

The default header file path for clang-6.0 is: #######################Check Clang cpp header path###################### jerry@jerry:~/work/adeb_ver/adeb$ adeb shell "echo 'int main(void){}' | clang-6.0 -xc++ -E -v - 2>&1" | sed -ne '/starts here/,/End of search list/p'

include "..." search starts here:

include <...> search starts here:

. /kernel-headers/include /kernel-headers/arch/x86/include/generated /kernel-headers/arch/x86/include/generated/uapi /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward /usr/include/clang/6.0.1/include /usr/local/include /usr/bin/../lib/gcc/x86_64-linux-gnu/8/include /usr/include/x86_64-linux-gnu /usr/include End of search list. ########################Check end##############################

For your question-A "Does running gcc on a C++ program work for you? " and B "Are the errors only with building BCC?" A: It works on building C++ program on android target device. root@localhost:/# echo -e "#include \n int main(void){ std::cout << 1 << std::endl; return 0;}" | clang++-6.0 -xc++ - -o test; ./test
1 B: Today, there's no problem when building BCC and running BCC tools on target x86 android device. I observed that gcc is updated to 8.0. However, gcc was 7.0 two weeks ago when creating the root file system.