Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Compiling the HWASAN version of Android U report LLVM ERROR #1899

Closed
edishan opened this issue Jun 28, 2023 · 3 comments
Closed

[Bug]: Compiling the HWASAN version of Android U report LLVM ERROR #1899

edishan opened this issue Jun 28, 2023 · 3 comments
Labels

Comments

@edishan
Copy link

edishan commented Jun 28, 2023

Description

Android version: Android U
When compiling the HWASAN version of Android U, it will report LLVM ERROR, such as:

[ 85% 99399/116476] //frameworks/base/libs/hwui:libhwui link libhwui.so
FAILED: out/soong/.intermediates/frameworks/base/libs/hwui/libhwui/android_arm64_armv8-a-branchprot_shared_hwasan/unstripped/libhwui.so
prebuilts/clang/host/linux-x86/clang-r450784d/bin/clang++ out/soong/.intermediates/bionic/libc/crtbegin_so/android_arm64_armv8-a-branchprot/crtbegin_so.o @out/soong/.intermediates/frameworks/base/libs/hwui/libhwui/android_arm64_armv8-a-branchprot_shared_hwasan/unstripped/libhwui.so.rsp out/soong/.intermediates/bionic/libc/crtend_so/android_arm64_armv8-a-branchprot/crtend_so.o -o out/soong/.intermediates/frameworks/base/libs/hwui/libhwui/android_arm64_armv8-a-branchprot_shared_hwasan/unstripped/libhwui.so -target aarch64-linux-android10000 -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--build-id=md5 -Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libgcc_stripped.a -Wl,--exclude-libs,libunwind_llvm.a -Wl,--exclude-libs,libunwind.a -fuse-ld=lld -Wl,--icf=safe -Wl,--pack-dyn-relocs=android+relr -Wl,--no-undefined -Wl,--hash-style=gnu -Wl,-z,separate-code -Wl,-z,max-page-size=4096 -nostdlib -Wl,--gc-sections -shared -Wl,-soname,libhwui.so -z max-page-size=0x200000 -Wl,--version-script,frameworks/base/libs/hwui/libhwui.map.txt -Wl,-mllvm,-instcombine-lower-dbg-declare=0 -Wl,-mllvm,--aarch64-enable-global-isel-at-O=-1 -Wl,-mllvm,-fast-isel=false -fsanitize=hwaddress -fno-sanitize-link-runtime -flto=thin -fsplit-lto-unit -Wl,-plugin-opt,-import-instr-limit=5 -Wl,--exclude-libs=libclang_rt.builtins-aarch64-android.a
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !45753
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !45813
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !45873
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46064
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46123
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46182
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46373
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46432
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46491
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46682
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46741
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46800
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !46991
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47050
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47109
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47300
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47359
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47418
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47609
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47668
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47727
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47918
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !47977
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48036
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48227
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48286
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48345
musttail call must precede a ret with an optional bitcast
musttail call void %71(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %68, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48536
musttail call must precede a ret with an optional bitcast
musttail call void %82(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %79, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48595
musttail call must precede a ret with an optional bitcast
musttail call void %93(i64 noundef %0, %struct.SkRasterPipelineStage* noundef nonnull %90, i64 noundef %2, i64 noundef %3, <4 x float> noundef %4, <4 x float> noundef %5, <4 x float> noundef %6, <4 x float> noundef %7, <4 x float> noundef %8, <4 x float> noundef %9, <4 x float> noundef %10, <4 x float> noundef %11) #29, !dbg !48654
LLVM ERROR: Broken module found, compilation aborted!
PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace.
#0 0x0000000002a047d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x2a047d8)
#1 0x0000000002a03940 llvm::sys::RunSignalHandlers() (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x2a03940)
#2 0x0000000002a04c2a (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x2a04c2a)
#3 0x00007f14c8ed7520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007f14c8f2ba7c __pthread_kill_implementation ./nptl/./nptl/pthread_kill.c:44:76
#5 0x00007f14c8f2ba7c __pthread_kill_internal ./nptl/./nptl/pthread_kill.c:78:10
#6 0x00007f14c8f2ba7c pthread_kill ./nptl/./nptl/pthread_kill.c:89:10
#7 0x00007f14c8ed7476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007f14c8ebd7f3 abort ./stdlib/./stdlib/abort.c:81:7
#9 0x0000000001f432e2 llvm::report_fatal_error(llvm::Twine const&, bool) (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x1f432e2)
#10 0x0000000001ca7c45 (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x1ca7c45)
#11 0x000000000229cc07 llvm::UpgradeDebugInfo(llvm::Module&) (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x229cc07)
#12 0x000000000285b86c (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x285b86c)
#13 0x000000000203e70a llvm::Module::materializeAll() (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x203e70a)
#14 0x000000000203e3fa llvm::BitcodeModule::getModuleImpl(llvm::LLVMContext&, bool, bool, bool, llvm::function_ref<llvm::Optional<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > (llvm::StringRef)>) (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x203e3fa)
#15 0x000000000228b9db llvm::BitcodeModule::parseModule(llvm::LLVMContext&, llvm::function_ref<llvm::Optional<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > (llvm::StringRef)>) (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b9db)
#16 0x000000000228b8c4 (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b8c4)
#17 0x000000000228b672 (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b672)
#18 0x000000000228b3cd (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b3cd)
#19 0x000000000228b2cb (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x228b2cb)
#20 0x00000000026da333 (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x26da333)
#21 0x000000000274aea4 (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x274aea4)
#22 0x000000000274ad9f (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x274ad9f)
#23 0x000000000274ad86 (/home/meizu/hardDisk/workspace/QSSI_QUF10_base/prebuilts/clang/host/linux-x86/clang-r450784d/bin/ld.lld+0x274ad86)
#24 0x00007f14c8f29b43 start_thread ./nptl/./nptl/pthread_create.c:442:8
#25 0x00007f14c8fbba00 ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:83:0
clang-14: error: unable to execute command: Aborted (core dumped)
clang-14: error: linker command failed due to signal (use -v to see invocation)

Upstream bug

No response

Commit to cherry-pick

No response

Affected versions

r25

Canary version

No response

Host OS

Linux

Host OS version

Ubuntu 20.04

Affected ABIs

arm64-v8a

@edishan edishan added the bug label Jun 28, 2023
@pirama-arumuga-nainar
Copy link
Collaborator

Since this fails during linking (due to LTO), can you add -Wl,--reproduce=repro.tar and share repro.tar?

@stephenhines
Copy link
Collaborator

clang-r450784d is the toolchain mentioned in the bug, which is part of the NDK, but it looks like you are building the Android platform. I wonder if there's a mismatch between the runtime libraries here.

@pirama-arumuga-nainar
Copy link
Collaborator

I did not notice that the clang version was old. Closing this as there's nothing actionable unless it reproduces with the newest AOSP compiler (clang-r487747c). @edishan re-open with repro.tar if this fails with ToT Android sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants