Android AOSP Lollipop 构建错误没有 sys/types.h
Posted
技术标签:
【中文标题】Android AOSP Lollipop 构建错误没有 sys/types.h【英文标题】:Android AOSP Lollipop build error no sys/types.h 【发布时间】:2015-02-19 17:10:31 【问题描述】:=============================================
enter PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0.50.50.50.50
TARGET_PRODUCT=full_dory
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a7
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-32-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=AOSP
OUT_DIR=out
find /usr/include -name types.h/usr/include/x86_64-linux-gnu/asm/types.h
/usr/include/x86_64-linux-gnu/bits/types.h
/usr/include/x86_64-linux-gnu/sys/types.h
/usr/include/i386-linux-gnu/asm/types.h
/usr/include/i386-linux-gnu/bits/types.h
/usr/include/i386-linux-gnu/sys/types.h
/usr/include/rpc/types.h
/usr/include/c++/4.8/parallel/types.h
/usr/include/linux/types.h
/usr/include/wx-2.8/wx/types.h
/usr/include/sys/types.h
/usr/include/asm-generic/types.h
=============================================
build/core/base_rules.mk:555: warning: ignoring old commands for target `out/target/product/dory/root/sbin/healthd'
PRODUCT_COPY_FILES system/core/rootdir/init.usb.rc:root/init.usb.rc ignored.
PRODUCT_COPY_FILES system/core/rootdir/init.trace.rc:root/init.trace.rc ignored.
PRODUCT_COPY_FILES system/core/rootdir/ueventd.rc:root/ueventd.rc ignored.
build/core/Makefile:71: warning: overriding commands for target `out/target/product/dory/root/default.prop'
build/core/Makefile:34: warning: ignoring old commands for target `out/target/product/dory/root/default.prop'
No private recovery resources for TARGET_DEVICE dory
prebuilts/clang/linux-x86/host/3.6/bin/clang++ -I external/libcxx/include -I frameworks/base/tools/aapt -I out/host/linux-x86/obj/EXECUTABLES /aapt_intermediates -I out/host/linux-x86/gen/EXECUTABLES/aapt_intermediates -I libnativehelper/include/nativehelper -isystem system/core/include -isystem hardware/libhardware/include -isystem hardware/libhardware_legacy/include -isystem hardware/ril/include -isystem libnativehelper/include -isystem frameworks/native/include -isystem frameworks/native/opengl/include -isystem frameworks/av/include -isystem frameworks/base/include -isystem tools/include -isystem out/host/linux-x86/obj/include -c -fno-exceptions -Wno-multichar -m64 -Wa,--noexecstack -fPIC -no-canonical-prefixes -include build/core/combo/include/arch/linux-x86/androidConfig.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -O2 -g -fno-strict-aliasing -DNDEBUG -UDEBUG -D__compiler_offsetof=__builtin_offsetof -Werror=int-conversion -Wno-unused-command-line-argument --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/ --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/ --sysroot=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//sysroot -target x86_64-linux-gnu -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wsign-promo -std=gnu++11 -DNDEBUG -UDEBUG -Wno-inconsistent-missing-override --gcc-toolchain=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/ --sysroot=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//sysroot -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/include/c++/4.8 -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/include/c++/4.8/x86_64-linux -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/include/c++/4.8/backward -target x86_64-linux-gnu -DAAPT_VERSION=\"eng.vip.20150219.213147\" -fpie -D_USING_LIBCXX -nostdinc++ -MD -MF out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/Main.d -o out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/Main.o frameworks/base/tools/aapt/Main.cpp
host C++: aapt <= frameworks/base/tools/aapt/Main.cpp
In file included from frameworks/base/tools/aapt/Main.cpp:6:
In file included from frameworks/base/tools/aapt/Main.h:9:
In file included from system/core/include/utils/Log.h:31:
In file included from system/core/include/cutils/log.h:1:
system/core/include/log/log.h:31:10: fatal error: 'sys/types.h' file not found
#include <sys/types.h>
^
1 error generated.
它不提供gcc arm-linux-androideabi-4.9/bin/ 和主机clang 3.6 我只是下载并复制到目录: gcc arm-linux-androideabi-4.9 我复制并下载到目录中。
uname -a Linux vip-Inspiron-N4030 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
【问题讨论】:
目前尚不清楚这里的确切问题和环境。您似乎正在尝试使用 clang,但您正在构建什么目标? 【参考方案1】:使用命令: “制作表演命令” 也适用于目标,例如“制作 libdvm 显示命令”。
然后我注意到我需要安装 gcc: --sysroot=prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/ 从x86_64-linux-glibc2.15-4.8下载然后就可以编译了。
【讨论】:
以上是关于Android AOSP Lollipop 构建错误没有 sys/types.h的主要内容,如果未能解决你的问题,请参考以下文章
为旗鱼 (AOSP) 问题构建 android CopperheadOS
为 Dragonboard(Ubuntu 16.04)构建 Android 开源项目(AOSP)时“构建某些目标失败”