[LineageOS Questions & Answers] mitix67:
Hi, I'm trying to build LineageOS 16.0 for Xperia L (taoshan), but I'm getting this error:

I tried searching for a solution, but i couldnt find anything. Plase help!

Sources are available on my github: mitix67

[ 4% 1055/23655] target thumb C++: libmemalloc <= hardware/qcom/display-caf/msm8960/libgralloc/ionalloc.cpp
FAILED: /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/ionalloc.o
/bin/bash -c "PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++	-I device/sony/taoshan/include -I hardware/qcom/display-caf/msm8960/libgralloc -I hardware/qcom/display-caf/msm8960/liboverlay -I hardware/qcom/display-caf/msm8960/libcopybit -I hardware/qcom/display-caf/msm8960/libqdutils -I hardware/qcom/display-caf/msm8960/libhwcomposer -I hardware/qcom/display-caf/msm8960/libexternal -I hardware/qcom/display-caf/msm8960/libqservice -I hardware/qcom/display-caf/msm8960/libvirtual -I hardware/qcom/display-caf/msm8960/libgralloc -I /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates -I /home/mateusz/android/lineage/out/target/product/taoshan/gen/SHARED_LIBRARIES/libmemalloc_intermediates -I libnativehelper/include_jni \$(cat /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/import_includes) -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -isystem /home/mateusz/android/lineage/out/target/product/taoshan/obj/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -c -fomit-frame-pointer -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -Wno-zero-as-null-pointer-constant -fdebug-prefix-map=\$PWD/= -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -msoft-float -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mcpu=krait -mfpu=neon-vfpv4 -D__ARM_FEATURE_LPAE=1 -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden -std=gnu++14 -mthumb -Os -fno-rtti -DDEBUG_CALC_FPS -Wno-missing-field-initializers -Werror -Wno-error=unused-parameter -D__ARM_HAVE_NEON -DSECURE_MM_HEAP -DLOG_TAG=\\\"qdmemalloc\\\" -fPIC -D_USING_LIBCXX -DANDROID_STRICT -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-null-pointer-arithmetic -Wno-enum-compare -Wno-enum-compare-switch -MD -MF /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/ionalloc.d -o /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/ionalloc.o hardware/qcom/display-caf/msm8960/libgralloc/ionalloc.cpp"
In file included from hardware/qcom/display-caf/msm8960/libgralloc/ionalloc.cpp:34:
In file included from bionic/libc/include/fcntl.h:95:
bionic/libc/include/bits/fortify/fcntl.h:62:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'open' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:62:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:69:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:69:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:82:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'openat' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:82:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:89:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:89:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:108:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'open64' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:108:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:115:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:115:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:128:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'openat64' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:128:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:135:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:135:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
hardware/qcom/display-caf/msm8960/libgralloc/ionalloc.cpp:168:57: warning: unused parameter 'offset' [-Wunused-parameter]
int IonAlloc::unmap_buffer(void *base, size_t size, int offset)
^
1 warning and 16 errors generated.
[ 4% 1063/23655] target thumb C++: libmemalloc <= hardware/qcom/display-caf/msm8960/libgralloc/alloc_controller.cpp
FAILED: /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/alloc_controller.o
/bin/bash -c "PWD=/proc/self/cwd /usr/bin/ccache prebuilts/clang/host/linux-x86/clang-4691093/bin/clang++	-I device/sony/taoshan/include -I hardware/qcom/display-caf/msm8960/libgralloc -I hardware/qcom/display-caf/msm8960/liboverlay -I hardware/qcom/display-caf/msm8960/libcopybit -I hardware/qcom/display-caf/msm8960/libqdutils -I hardware/qcom/display-caf/msm8960/libhwcomposer -I hardware/qcom/display-caf/msm8960/libexternal -I hardware/qcom/display-caf/msm8960/libqservice -I hardware/qcom/display-caf/msm8960/libvirtual -I hardware/qcom/display-caf/msm8960/libgralloc -I /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates -I /home/mateusz/android/lineage/out/target/product/taoshan/gen/SHARED_LIBRARIES/libmemalloc_intermediates -I libnativehelper/include_jni \$(cat /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/import_includes) -I system/core/include -I system/media/audio/include -I hardware/libhardware/include -I hardware/libhardware_legacy/include -I hardware/ril/include -I libnativehelper/include -I frameworks/native/include -I frameworks/native/opengl/include -I frameworks/av/include -isystem /home/mateusz/android/lineage/out/target/product/taoshan/obj/include -isystem bionic/libc/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/uapi/asm-arm -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -c -fomit-frame-pointer -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fno-strict-aliasing -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-reserved-id-macro -Wno-format-pedantic -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-expansion-to-defined -Wno-zero-as-null-pointer-constant -fdebug-prefix-map=\$PWD/= -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=date-time -Werror=format-security -nostdlibinc -msoft-float -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mcpu=krait -mfpu=neon-vfpv4 -D__ARM_FEATURE_LPAE=1 -target arm-linux-androideabi -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -Wno-gnu-include-next -fvisibility-inlines-hidden -std=gnu++14 -mthumb -Os -fno-rtti -DDEBUG_CALC_FPS -Wno-missing-field-initializers -Werror -Wno-error=unused-parameter -D__ARM_HAVE_NEON -DSECURE_MM_HEAP -DLOG_TAG=\\\"qdmemalloc\\\" -fPIC -D_USING_LIBCXX -DANDROID_STRICT -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-null-pointer-arithmetic -Wno-enum-compare -Wno-enum-compare-switch -MD -MF /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/alloc_controller.d -o /home/mateusz/android/lineage/out/target/product/taoshan/obj/SHARED_LIBRARIES/libmemalloc_intermediates/alloc_controller.o hardware/qcom/display-caf/msm8960/libgralloc/alloc_controller.cpp"
In file included from hardware/qcom/display-caf/msm8960/libgralloc/alloc_controller.cpp:30:
In file included from system/core/liblog/include/log/log.h:34:
In file included from system/core/liblog/include/log/log_read.h:26:
In file included from bionic/libc/include/fcntl.h:95:
bionic/libc/include/bits/fortify/fcntl.h:62:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'open' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:62:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:69:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:69:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:82:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'openat' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:82:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:89:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:89:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:108:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'open64' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:108:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:115:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:115:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:128:26: error: use of undeclared identifier 'O_TMPFILE'
__clang_error_if(__open_modes_useful(flags), "'openat64' " __open_too_few_args_error) {
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:128:26: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:135:29: error: use of undeclared identifier 'O_TMPFILE'
__clang_warning_if(!__open_modes_useful(flags) && modes,
^
bionic/libc/include/bits/fortify/fcntl.h:46:71: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)
^
bionic/libc/include/bits/fortify/fcntl.h:135:29: error: use of undeclared identifier 'O_TMPFILE'
bionic/libc/include/bits/fortify/fcntl.h:46:85: note: expanded from macro '__open_modes_useful'
#define __open_modes_useful(flags) (((flags) & O_CREAT) || ((flags) & O_TMPFILE) == O_TMPFILE)