I get an error when building Android 12

193 views
Skip to first unread message

toufu

unread,
Oct 14, 2021, 1:44:18 AM10/14/21
to Android Building
Hi,I want to build an Android12 but I get an error.

build/make/core/soong_config.mk:195: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
build/make/core/soong_config.mk:196: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=12
TARGET_PRODUCT=aosp_cf_x86_64_phone
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_ARCH=x86_64
TARGET_ARCH_VARIANT=silvermont
TARGET_2ND_ARCH=x86
TARGET_2ND_ARCH_VARIANT=silvermont
TARGET_2ND_CPU_VARIANT=silvermont
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.11.0-37-generic-x86_64-Ubuntu-21.04
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=SP1A.210812.015
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish-opengl device/generic/goldfish-opengl hardware/google/camera hardware/google/camera/devices/EmulatedCamera external/mesa3d vendor/google_devices/common/pr
oprietary/confirmatioui_hal
============================================
[ 98% 1194/1212] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[  2% 3371/150039] target  C: ip-up-vpn <= frameworks/native/cmds/ip-up-vpn/ip-up-vpn.c
FAILED: out/target/product/vsoc_x86_64/obj/EXECUTABLES/ip-up-vpn_intermediates/ip-up-vpn.o
/bin/bash -c "PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang -I frameworks/native/cmds/ip-up-vpn -I out/target/product/vsoc_x86_64/obj/EXECUTABLES/ip-up-vpn_i
ntermediates -I out/target/product/vsoc_x86_64/gen/EXECUTABLES/ip-up-vpn_intermediates -Isystem/core/libcutils/include -Isystem/core/libprocessgroup/include -Isystem/logging/liblog/include -Iexternal/lib
cxx/include -Iexternal/libcxxabi/include -D__LIBC_API__=10000 -Ibionic/libc/async_safe/include -Isystem/logging/liblog/include -Ibionic/libc/system_properties/include -Isystem/core/property_service/libpr
opertyinfoparser/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -isystem bionic/libc/kernel/uapi/a
sm-x86 -D__LIBM_API__=10000 -D__LIBDL_API__=10000 -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -isystem 
bionic/libc/kernel/uapi/asm-x86 -Iexternal/libcxxabi/include   -I system/core/include -I system/logging/liblog/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardwar
e_legacy/include -I hardware/ril/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include  -c  -Werror=implicit-function-declaration -DANDROID -fmessage-length=0 
-W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wunreachable-code-loop-increment -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fdebug-info-for-profiling -fno-strict-ali
asing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -Werror=string-plus-int -Werror=unreachable-code-loop-increment -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof
=__builtin_offsetof -faddrsig -fcommon -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-sign-compare -Wno-defaulted
-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-gnu-folding-constant -Wunguarded-availability -D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -ftrivial-auto-var-init=zero -enable
-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstr
ict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security -nostdlibinc -m64 -march=slm -mssse3 -msse4 -msse4.1 -msse4.2 -maes -mpopcnt -Bp
rebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9/x86_64-linux-android/bin   -std=gnu99    -Wall -Werror -fPIE -DANDROID_STRICT -target x86_64-linux-android10000   -Werror=bool-operation -Werror=implic
it-int-float-conversion -Werror=int-in-bool-context -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=string-compare -Werror=xor-used-as-pow -Wno-void-pointer-to-enum-cast -Wno-void-pointer
-to-int-cast -Wno-pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-reorder-init-lis
t -Wno-implicit-int-float-conversion -Wno-int-in-bool-context -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-misleading-indentation -Wno-zero-
as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-string-compare -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-pessimizing-move -Wno
-non-c-typedef-for-linkage -Wno-string-concatenation -MD -MF out/target/product/vsoc_x86_64/obj/EXECUTABLES/ip-up-vpn_intermediates/ip-up-vpn.d -o out/target/product/vsoc_x86_64/obj/EXECUTABLES/ip-up-vpn
_intermediates/ip-up-vpn.o frameworks/native/cmds/ip-up-vpn/ip-up-vpn.c"
ccache: error: Failed to create directory /home/toufu/.ccache/tmp: Read-only file system
20:56:21 ninja failed with: exit status 1

#### failed to build some targets (02:36 (mm:ss)) ####
 
I didn't get such an error on Android 11.
How can I solve it?

Chang Kyo

unread,
Oct 26, 2021, 4:32:19 PM10/26/21
to Android Building
[current workaround]
a. disable ccache  (will impact compiling speed)
b. let ccache and AOSP source code to different partition (if your tmpfs bigger enough or you already had another partition)
c. mount --bind allow you put ccache and AOSP source code in the same partition.(reference: https://stackoverflow.com/questions/61923015/ccache-fails-with-read-only)

[root cause]
Need to check which commit cause it check this rule when AOSP building.
Because before Android 12, ccache files and AOSP source code in the same partition works fine.
If someone knowledge root case, please share with us.

Thanks a lot.
hamm157...@gmail.com 在 2021年10月14日 星期四下午1:44:18 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages