This is an archive of the discontinued LLVM Phabricator instance.

libsanitizer merge from upstream r208536 fix for ARM Linux.
ClosedPublic

Authored by m.ostapenko on May 13 2014, 12:37 AM.

Details

Reviewers
kcc
Summary

I see a couple of errors when building for arm-linux-gnueabi (host is x86_64 Ubuntu 12.04 LTS, host compiler is gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)):

  1. In file included from /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:164:0:

/home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:253:72: error: size of array 'assertion_failed__1128' is negative

typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]

^
/home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:247:30: note: in expansion of macro 'IMPL_COMPILER_ASSERT'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, LINE)

^

/home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1249:3: note: in expansion of macro 'COMPILER_CHECK'

COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
^

/home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:1128:1: note: in expansion of macro 'CHECK_TYPE_SIZE'
CHECK_TYPE_SIZE(XDR::xdr_ops);
^
make[4]: *** [sanitizer_platform_limits_posix.lo] Error 1

  1. /home/max/workspace/downloads/gcc/libsanitizer/sanitizer_common/sanitizer_atomic_clang_other.h:54:77: error: cast from type 'const volatile Type* {aka const volatile unsigned char*}' to type 'volatile Type* {aka volatile unsigned char*}' casts away qualifiers [-Werror=cast-qual] v = __sync_fetch_and_add((typename T::Type volatile*)&a->val_dont_use, 0);

Attached patch seems to help.

-Maxim

Diff Detail

Event Timeline

m.ostapenko retitled this revision from to libsanitizer merge from upstream r208536 fix for ARM Linux..
m.ostapenko updated this object.
m.ostapenko edited the test plan for this revision. (Show Details)
m.ostapenko added a reviewer: kcc.
m.ostapenko set the repository for this revision to rL LLVM.
m.ostapenko added subscribers: ygribov, Unknown Object (MLST).
kcc edited edge metadata.May 13 2014, 12:50 AM
kcc added a subscriber: eugenis.

We build this code on ARM Android and it worked. Evgeniy?

That's because this code is under !SANITIZER_ANDROID.
LGTM, but perhaps rename the constant to something more constant-like, with more caps.

kcc accepted this revision.May 13 2014, 1:10 AM
kcc edited edge metadata.
kcc added inline comments.
sanitizer_common/sanitizer_atomic_clang_other.h
56

<= 80 chars

This revision is now accepted and ready to land.May 13 2014, 1:10 AM
kcc closed this revision.May 13 2014, 1:10 AM

r208673.