Page MenuHomePhabricator

Marking internal_dlinfo as unsupported for Android sanitizers to fix runtimes builds.
AbandonedPublic

Authored by plotfi on Feb 10 2020, 2:24 PM.

Details

Summary

In our internal runtimes builds I hit a build break due to the addition of D73990. 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.

Diff Detail

Event Timeline

plotfi created this revision.Feb 10 2020, 2:24 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 10 2020, 2:24 PM
Herald added subscribers: llvm-commits, Restricted Project, dexonsmith, kristof.beyls. · View Herald Transcript
smeenai accepted this revision.Feb 10 2020, 2:32 PM
smeenai added reviewers: danalbert, enh.

LGTM, since it's the same as what was done for other unsupported platforms in D73990. There might be some equivalent to RTLD_DI_LINKMAP in Android, but I think it's fine to look into that as a potential follow-up, and to commit this for now to unbreak Android runtimes builds.

This revision is now accepted and ready to land.Feb 10 2020, 2:32 PM

The breaking change has been reverted

dim added a comment.Feb 10 2020, 2:45 PM

Yeah sorry, I used a whitelist instead, here: rG52f2df1ecdd79cc550b694ab280f3b0396d7cf9a

In D74358#1868152, @dim wrote:

Yeah sorry, I used a whitelist instead, here: rG52f2df1ecdd79cc550b694ab280f3b0396d7cf9a

Thanks!

plotfi abandoned this revision.Feb 10 2020, 3:36 PM