AOSP build fails with clang issue can't find <stddef.h> file

392 views
Skip to first unread message

bulat davlyatshin

unread,
Nov 2, 2017, 2:39:18 AM11/2/17
to android-llvm
Trying to compile Android sources and getting those errors

System: Ubuntu 14.04
We have installed gcc, gcc-4.6, gcc-4.8, clang-4.0, clang-5.0 no success

[  0% 488/63306] host C++: conscrypt_g...ants/src/gen/cpp/generate_constants.cc
FAILED
: out/host/linux-x86/obj/EXECUTABLES/conscrypt_generate_constants_intermediates/constants/src/gen/cpp/generate_constants.o
/bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++     -I external/conscrypt -I out/host/linux-x86/obj/EXECUTABLES/conscrypt_generate_constants_intermediates -I out/host/linux-x86/gen/EXECUTABLES/conscrypt_generate_constants_intermediates -I libnativehelper/include_deprecated \$(cat out/host/linux-x86/obj/EXECUTABLES/conscrypt_generate_constants_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  -c  -fno-exceptions -Wno-multichar -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -O2 -g -fno-strict-aliasing --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 -fstack-protector-strong -m64 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -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 -fdebug-prefix-map=\$PWD/=   -target x86_64-linux-gnu -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin  -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -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/backward -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -std=gnu++14  -fPIE -D_USING_LIBCXX -nostdinc++  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type   -MD -MF out/host/linux-x86/obj/EXECUTABLES/conscrypt_generate_constants_intermediates/constants/src/gen/cpp/generate_constants.d -o out/host/linux-x86/obj/EXECUTABLES/conscrypt_generate_constants_intermediates/constants/src/gen/cpp/generate_constants.o external/conscrypt/constants/src/gen/cpp/generate_constants.cc"
In file included from external/conscrypt/constants/src/gen/cpp/generate_constants.cc:18:
In file included from external/libcxx/include/stdio.h:108:
In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/stdio.h:34:
external
/libcxx/include/stddef.h:18:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
             
^~~~~~~~~~
1 error generated.
[  0% 490/63306] host C++: aapt <= frameworks/base/tools/aapt/Main.cpp
FAILED
: out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/Main.o
/bin/bash -c "PWD=/proc/self/cwd  prebuilts/clang/host/linux-x86/clang-4053586/bin/clang++     -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_deprecated \$(cat out/host/linux-x86/obj/EXECUTABLES/aapt_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  -c  -fno-exceptions -Wno-multichar -Wa,--noexecstack -fPIC -no-canonical-prefixes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS -O2 -g -fno-strict-aliasing --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 -fstack-protector-strong -m64 -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -DNDEBUG -UDEBUG -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 -fdebug-prefix-map=\$PWD/=   -target x86_64-linux-gnu -Bprebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/bin  -Wsign-promo -Wno-inconsistent-missing-override -Wno-null-dereference -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -Wno-thread-safety-negative -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/backward -isystem prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/x86_64-linux/include/c++/4.8/x86_64-linux -std=gnu++14  -DAAPT_VERSION=\\\"\$(cat out/build_number.txt)\\\" -Wall -Werror -fPIE -D_USING_LIBCXX -DANDROID_STRICT -nostdinc++  -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=address-of-temporary -Werror=return-type   -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"
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/libutils/include/utils/Log.h:7:
In file included from system/core/liblog/include/log/log.h:22:
In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/pthread.h:25:
In file included from prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8/sysroot/usr/include/sched.h:30:
external
/libcxx/include/stddef.h:18:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
             
^~~~~~~~~~
1 error generated.
[  0% 491/63306] target Prebuilt: andr..._v18_intermediates/classes-header.jar)
ninja
: build stopped: subcommand failed.
11:36:29 ninja failed with: exit status 1

#### failed to build some targets (08:52 (mm:ss)) ####


Stephen Hines

unread,
Nov 2, 2017, 10:43:01 AM11/2/17
to bulat davlyatshin, android-llvm
Hi,

This error is a bit confusing without some further information. What branch did you use to repo init? Is this aosp/master? What target are you trying to build (lunch and m commands)? Are there any other modifications to the source tree? This isn't necessarily the best group for getting help with building Android (https://groups.google.com/forum/#!forum/android-building is probably better), but we can try to help too.

Can you make sure that you have all the initial steps done from https://source.android.com/source/initializing? As far as installing all those other compilers, they shouldn't be necessary Android is hermetic for toolchains, so it should download everything as part of repo init. One other thing to try is to make sure that your "repo sync" completes successfully. You can also run "repo status" to see if you have changes to any project, which could also be causing issues here.

Thanks,
Steve

--
You received this message because you are subscribed to the Google Groups "android-llvm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-llvm+unsubscribe@googlegroups.com.
To post to this group, send email to androi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages