Work around missing __mulodi4() on ARMv7 + Clang builds.
authormtklein <mtklein@chromium.org>
Thu, 23 Jun 2016 18:20:58 +0000 (11:20 -0700)
committerMatthew Leibowitz <mattleibow@live.com>
Fri, 24 Jun 2016 17:47:03 +0000 (19:47 +0200)
commit1b112ecdbd187474b9bfb5603dccc280b75cf9b6
treeca50bdba8d6563db381cb8d9cadd90726ecf9846
parentcd1df5f1253f561848d3b1dedbf3bbb1a473bd46
Work around missing __mulodi4() on ARMv7 + Clang builds.

__mulodi4() is roughly,

    int64_t __mulodi4(int64_t a, int64_t b, int* overflow) {
        int64_t result = a*b;
        *overflow = did_overflow(result);
        return result;
    }

It's used by Clang's __builtin_smulll_overflow(), which is basically the same
except it swaps the positions of the return value and the out parameter.

DNG SDK in turn uses __builtin_smulll_overflow().

When building ARMv7 binaries with Clang, __mulodi4() turns up as a missing symbol.
That's because it's defined in a separate compiler-rt library.  I have not been
able to link that.  Instead, I've provided our own trivial __builtin_smulll_overflow().

Before this patch both nanobench and DM failed dynamically linking __mulodi4().  After this patch nanobench runs for a while, eventually segfaulting.  DM immediately segfaults.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2011073002

Review-Url: https://codereview.chromium.org/2011073002
gyp/dng_sdk.gyp