[PATCH] D74358: Marking internal_dlinfo as unsupported for Android sanitizers to fix runtimes builds.

Puyan Lotfi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 14:24:52 PST 2020


plotfi created this revision.
plotfi added reviewers: compnerd, dim, MaskRay, smeenai.
Herald added subscribers: llvm-commits, Sanitizers, dexonsmith, kristof.beyls.
Herald added projects: Sanitizers, LLVM.

In our internal runtimes builds I hit a build break due to the addition of D73990 <https://reviews.llvm.org/D73990>. D73990 <https://reviews.llvm.org/D73990> assumes that linux has a dlinfo function but Android Linux (both armv7 and aarch64) does not support this function so I am ifdefing internal_dlinfo as UNSUPPORTED like all the other platforms in the android sanitizer case.

  -- Build files have been written to: build/Release/bootstrap/toolchain/runtimes/runtimes-x86_64-unknown-linux-gnu-bins
  [473/523] Performing build step for 'runtimes-armv7-none-linux-androideabi'
  [77/645] Building CXX object compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.arm.dir/sanitizer_linux.cpp.o
  FAILED: compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.arm.dir/sanitizer_linux.cpp.o
  
  /home/plotfi/local/toolchain_dev_oncall2/build/Release/bootstrap/toolchain/bin/clang++ --target=armv7-none-linux-androideabi16 --sysroot=/home/plotfi/local/toolchain_dev_oncall2/external/android-ndk/r21/toolchains/llvm/prebuilt/linux-x86_64/sysroot  -DHAVE_RPC_XDR_H=0 -D_DEBUG -D__STDC_CON
  STANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/plotfi/local/toolchain_dev_oncall2/external/llvm-project/compiler-rt/lib/sanitizer_common/.. --gcc-toolchain=/home/plotfi/local/toolchain_dev_oncall2/external/android-ndk/r21/toolchains/llvm/prebuilt/linux-x86_64 -g -DANDROI
  D -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -march=armv7-a -mfpu=vfpv3-d16 -mthumb -stdlib++-isystem /home/plotfi/local/toolchain_dev_oncall2/external/android-ndk/r21/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/in
  clude/c++/v1  -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-n
  on-virtual-dtor -Wno-comment -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -fdebug-prefix-map=/home/plotfi/local/toolchain_dev_oncall2/build/Release/bootstrap/toolchain/runtimes/runtimes-armv7-none-linux-androideabi-bins=../../build/Release/bootstrap/toolchain
  /runtimes/runtimes-armv7-none-linux-androideabi-bins -fdebug-prefix-map=/home/plotfi/local/toolchain_dev_oncall2/external/llvm-project/= -no-canonical-prefixes -Wall -std=c++14 -Wno-unused-parameter -O3  -fPIC    -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 -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -UNDEBUG -MD -MT compiler-rt/lib/sanitizer_common/CMakeFiles/RTSaniti
  zerCommonNoTermination.arm.dir/sanitizer_linux.cpp.o -MF compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.arm.dir/sanitizer_linux.cpp.o.d -o compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoTermination.arm.dir/sanitizer_linux.cpp.o -c /home/plotfi/lo
  cal/toolchain_dev_oncall2/external/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
  /home/plotfi/local/toolchain_dev_oncall2/external/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp:739:10: error: use of undeclared identifier 'dlinfo'
    return dlinfo(handle, request, p);
           ^
  1 error generated.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74358

Files:
  compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp


Index: compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
@@ -736,7 +736,11 @@
 }
 
 int internal_dlinfo(void *handle, int request, void *p) {
+#if SANITIZER_ANDROID
+  UNIMPLEMENTED();
+#else
   return dlinfo(handle, request, p);
+#endif
 }
 
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74358.243674.patch
Type: text/x-patch
Size: 510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200210/31c05ffc/attachment.bin>


More information about the llvm-commits mailing list