Haven't found a better way to pass the libcxx include path for building compiler-rt with libcxx.
This seems to only be an issue with xray.
Details
- Reviewers
beanz compnerd - Commits
- rGc9d90d50025b: [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3)
rL367962: [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3)
rCRT367962: [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3)
rGa9c59b28738e: [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)
rCRT367250: [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)
rL367250: [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)
rCRT367239: Appending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xray
rGba7b7f1de47d: Appending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xray
rL367239: Appending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xray
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
lib/xray/CMakeLists.txt | ||
---|---|---|
122 | I think that the ABI is unused here since we are not using the libc++abi headers here. Lets just simplify this to just be conditional on COMPILER_RT_USE_LIBCXX. |
I see a lot of errors when building XRay against the just built libc++ in the runtimes build after this change landed:
/b/s/w/ir/k/recipe_cleanup/clang1YIxKp/llvm_build_dir/./bin/clang++ --target=aarch64-unknown-fuchsia --sysroot=/b/s/w/ir/k/cipd/sdk/arch/arm64/sysroot -DXRAY_HAS_EXCEPTIONS=1 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/s/w/ir/k/llvm-project/compiler-rt/lib/xray/.. -I/b/s/w/ir/k/llvm-project/compiler-rt/lib/xray/../../include -I/b/s/w/ir/k/cipd/sdk/pkg/fdio/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -ffunction-sections -fdata-sections -fdebug-prefix-map=/b/s/w/ir/k/recipe_cleanup/clang1YIxKp/llvm_build_dir/runtimes/runtimes-aarch64-unknown-fuchsia-bins=../recipe_cleanup/clang1YIxKp/llvm_build_dir/runtimes/runtimes-aarch64-unknown-fuchsia-bins -fdebug-prefix-map=/b/s/w/ir/k/llvm-project/= -no-canonical-prefixes -Wall -std=c++11 -Wno-unused-parameter -O2 -g -UNDEBUG -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -isystem /b/s/w/ir/k/llvm-project/llvm/../libcxx/include -fno-rtti -MD -MT compiler-rt/lib/xray/CMakeFiles/RTXray.aarch64.dir/xray_init.cpp.obj -MF compiler-rt/lib/xray/CMakeFiles/RTXray.aarch64.dir/xray_init.cpp.obj.d -o compiler-rt/lib/xray/CMakeFiles/RTXray.aarch64.dir/xray_init.cpp.obj -c /b/s/w/ir/k/llvm-project/compiler-rt/lib/xray/xray_init.cpp In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/xray/xray_init.cpp:21: In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/xray/xray_interface_internal.h:18: In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/xray/../../include/xray/xray_interface.h:18: /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:152:8: error: no member named 'int8_t' in the global namespace using::int8_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:153:8: error: no member named 'int16_t' in the global namespace using::int16_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:154:8: error: no member named 'int32_t' in the global namespace using::int32_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:155:8: error: no member named 'int64_t' in the global namespace using::int64_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:157:8: error: no member named 'uint8_t' in the global namespace using::uint8_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:158:8: error: no member named 'uint16_t' in the global namespace using::uint16_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:159:8: error: no member named 'uint32_t' in the global namespace using::uint32_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:160:8: error: no member named 'uint64_t' in the global namespace using::uint64_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:162:8: error: no member named 'int_least8_t' in the global namespace using::int_least8_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:163:8: error: no member named 'int_least16_t' in the global namespace using::int_least16_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:164:8: error: no member named 'int_least32_t' in the global namespace using::int_least32_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:165:8: error: no member named 'int_least64_t' in the global namespace using::int_least64_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:167:8: error: no member named 'uint_least8_t' in the global namespace using::uint_least8_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:168:8: error: no member named 'uint_least16_t' in the global namespace using::uint_least16_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:169:8: error: no member named 'uint_least32_t' in the global namespace using::uint_least32_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:170:8: error: no member named 'uint_least64_t' in the global namespace using::uint_least64_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:172:8: error: no member named 'int_fast8_t' in the global namespace using::int_fast8_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:173:8: error: no member named 'int_fast16_t' in the global namespace using::int_fast16_t; ~~^ /b/s/w/ir/k/llvm-project/llvm/../libcxx/include/cstdint:174:8: error: no member named 'int_fast32_t' in the global namespace using::int_fast32_t; ~~^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.
See https://luci-milo.appspot.com/p/fuchsia/builders/ci/clang-x64-linux/b8905896666240143152 for a full log. IMHO this should be conditionalized on NOT HAVE_LIBCXX (which is set by the runtimes build). Can we please address this issue or revert this change?
@phosek Can you verify that your bot has pulled r367962 ??
What I added in the most recent commit checks against HAVE_LIBCXX for the runtimes build:
+if(COMPILER_RT_USE_LIBCXX) + if (SANITIZER_CXX_ABI_LIBNAME STREQUAL "libc++") + if (HAVE_LIBCXX) + set(SANITIZER_COMMON_CFLAGS "${SANITIZER_COMMON_CFLAGS} -isystem ${COMPILER_RT_LIBCXX_PATH}/include") + endif() + endif() +endif()
@phosek Ah I see the bot is at r367980. I can revert. I might need your cmake invocation to repro this your bot build break.
@phosek Hmm, could there be a header conflict with set(FUCHSIA_${target}_COMPILER_FLAGS "-I${FUCHSIA_SDK}/pkg/fdio/include") as set in clang/cmake/caches/Fuchsia-stage2.cmake when trying to also include the libcxx headers for runtimes builds? Or maybe I just need to pass -nostdinc++ as well (even in the HAVE_LIBCXX case)?
I think that the ABI is unused here since we are not using the libc++abi headers here. Lets just simplify this to just be conditional on COMPILER_RT_USE_LIBCXX.