nathanchance / android-kernel-clang

Information on compiling Android kernels with Clang
291 stars 83 forks source link

compile android-4.9-q #15

Closed xiaoyue10131748 closed 4 years ago

xiaoyue10131748 commented 4 years ago

This repo is pretty cool! However, I still have some problems when I compile msm-4.9-android-10. The first command runs pretty well: make O=out oldconfig ARCH=arm64 -Werror But I encounter a problem when I run:

PATH="/home/yuexiao/Documents/research/diffcvss/LLVM/latest_clang/tc-build/install/bin:/home/yuexiao/Documents/research/diffcvss/LLVM/aarch64-linux-android-4.9/bin:${PATH}" \
make -j$(nproc --all) O=out \
                      ARCH=arm64 \
                      CC=clang \
                      CLANG_TRIPLE=aarch64-linux-gnu- \
                      CROSS_COMPILE=aarch64-linux-android- \
                      CROSS_COMPILE_ARM32=arm-linux-androideabi-

It said ../security/apparmor/crypto.c:37:8: error: fields must have a constant size: I am pretty new to complie Android Kernel with Clang. Any response wil be appreciated!!

CC [M]  fs/ceph/mds_client.o
  CC      security/apparmor/lsm.o
  GEN     security/apparmor/rlim_names.h
  CC      security/apparmor/sid.o
  CC [M]  fs/cifs/file.o
  CC [M]  fs/btrfs/root-tree.o
  CC      security/apparmor/file.o
  CC [M]  fs/coda/file.o
  CC [M]  fs/ceph/mdsmap.o
  CC      security/apparmor/crypto.o
  CC [M]  fs/coda/upcall.o
  CC [M]  fs/btrfs/dir-item.o
../security/apparmor/crypto.c:37:8: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
                char ctx[crypto_shash_descsize(apparmor_tfm)];
                     ^
1 error generated.
make[4]: *** [../scripts/Makefile.build:335: security/apparmor/crypto.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  CC [M]  fs/btrfs/file-item.o
make[3]: *** [../scripts/Makefile.build:648: security/apparmor] Error 2
make[2]: *** [/home/yuexiao/Documents/research/diffcvss/LLVM/andoid_mainline/kernel_common/Makefile:1090: security] Error 2
make[2]: *** Waiting for unfinished jobs....
  CC [M]  fs/btrfs/inode-item.o
  CC [M]  fs/ceph/strings.o
  CC [M]  fs/coda/coda_linux.o
  CC [M]  fs/ceph/ceph_frag.o
  CC [M]  fs/btrfs/inode-map.o
nathanchance commented 4 years ago

I personally have never seen this message but you should be able to pick this to have it be fixed: https://git.kernel.org/linus/9814448da7a84dd50b69e4ada2d7d1c042493daf

xiaoyue10131748 commented 4 years ago

It works! Thanks for quick response!