在Mac OS Catalina下编译AOSP报错:
FAILED: build out/target/product/generic_x86_64/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests
Outputs: out/target/product/generic_x86_64/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests
Error: exited with code: 1
Command: /bin/bash -c "(out/host/darwin-x86/bin/sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib -f out/target/product/generic_x86_64/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/generic_x86_64/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -p out/target/product/generic_x86_64/obj/ETC/sepolicy_intermediates/sepolicy ) && (touch out/target/product/generic_x86_64/obj/ETC/sepolicy_tests_intermediates/sepolicy_tests )"
Output:
/bin/bash: line 1: 28159 Segmentation fault: 11 ( out/host/darwin-x86/bin/sepolicy_tests -l out/host/darwin-x86/lib64/libsepolwrap.dylib -f out/target/product/generic_x86_64/obj/ETC/plat_file_contexts_intermediates/plat_file_contexts -f out/target/product/generic_x86_64/obj/ETC/vendor_file_contexts_intermediates/vendor_file_contexts -p out/target/product/generic_x86_64/obj/ETC/sepolicy_intermediates/sepolicy )
这个看起来是Mac的兼容性问题,下面是个临时方案:
make SELINUX_IGNORE_NEVERALLOWS=true
还有个官方方案(已验证),打上下面的patch:
1f944107a3341ab593c93bbdf09e22436cc0e3d3
下面这个是Catalina MacOS SDK 10.15的patch:
89dad60ed5ec30b0f732b612d454151abdb4e449