https://llvm.org/bugs/show_bug.cgi?id=28629

            Bug ID: 28629
           Summary: Clang generates calls to __mulodi4() for ARM even when
                    not using compiler-rt
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: srhi...@google.com
                CC: arnaud.degrandmai...@arm.com,
                    llvm-bugs@lists.llvm.org, pir...@google.com,
                    renato.go...@linaro.org, silviu.bara...@arm.com
            Blocks: 21420
    Classification: Unclassified

The instructions use NDK version r11c, but the latest version r12/r13beta also
reproduce this issue.

STEPS TO REPRODUCE:
1. make standalone toolchain using the following command

    ./build/tools/make-standalone-toolchain.sh \
        --use-llvm              \
        --arch=arm64    \
        --platform=android-24 \
        --install_dir=$TOOLCHAIN_DIR

2.  compile the Skia test executables using the instructions found at
https://skia.org/user/quick/android
3.  push the executable to the device and run.

EXPECTED RESULTS:
executable runs to completion

OBSERVED RESULTS:
crashes on launch with the following error message

dlopen failed: cannot locate symbol "__mulodi4" referenced by
“libskia_android.so"

ADDITIONAL INFORMATION:
In step 2, if we use the gcc binaries included with the toolchain then the
executable runs with no issues.  We have a quick hack at
https://codereview.chromium.org/2011073002/ that attempts to work around the
issue but is not desireable.

https://llvm.org/bugs/show_bug.cgi?id=17693 seems similar, but this is not for
sanitizer code, so we should be able to use a different rtlib than compiler-rt.
Is it expected for clang to lower sequences of __builtin_smull_overflow
(https://android.googlesource.com/platform/external/dng_sdk.git/+/master/source/dng_safe_arithmetic.h#112)
to __mulodi4 in all cases? It is known that libgcc won't provide this symbol,
so at the very least, clang should warn/error that the rtlib selected won't be
able to resolve this symbol at runtime.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to