This is an archive of the discontinued LLVM Phabricator instance.

Appending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xray
ClosedPublic

Authored by plotfi on Jul 25 2019, 4:21 PM.

Diff Detail

Event Timeline

plotfi created this revision.Jul 25 2019, 4:21 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 25 2019, 4:21 PM
Herald added subscribers: Restricted Project, llvm-commits, mgorny, dberris. · View Herald Transcript
compnerd added inline comments.Jul 25 2019, 4:25 PM
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.

plotfi updated this revision to Diff 211993.Jul 26 2019, 1:05 PM

Removing check for libcxxabi as per @compnerd 's suggestion

plotfi marked an inline comment as done.Jul 26 2019, 1:05 PM
compnerd accepted this revision.Jul 26 2019, 4:27 PM
This revision is now accepted and ready to land.Jul 26 2019, 4:27 PM
This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.Aug 6 2019, 12:45 AM

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()

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?

plotfi added a comment.Aug 6 2019, 1:05 AM

@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.

plotfi added a comment.Aug 6 2019, 1:29 AM

@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)?