This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizer] Get the Linux ptrace test working on PowerPC64
ClosedPublic

Authored by foad on Nov 4 2014, 2:42 AM.

Details

Summary

The test refers to user_regs_struct.rip so it can only ever have worked
on x86-64. Put this code inside an appropriate #if, and add a similar
case for PowerPC64. (If we do likewise for ARM we can probably remove
the XFAILs, but I have no way of testing that.)

Those changes are enough to get the test working for me on big-endian
PowerPC64 Fedora 19.

Diff Detail

Event Timeline

foad updated this revision to Diff 15752.Nov 4 2014, 2:42 AM
foad retitled this revision from to [Sanitizer] Get the Linux ptrace test working on PowerPC64.
foad updated this object.
foad edited the test plan for this revision. (Show Details)
foad added reviewers: kcc, willschm, samsonov.
foad added a subscriber: Unknown Object (MLST).Nov 4 2014, 2:43 AM
foad updated this revision to Diff 15753.Nov 4 2014, 2:46 AM

(Creating a new revision because I forgot to Cc llvm-commits the first time. There are no changes)

kcc edited edge metadata.Nov 4 2014, 9:36 AM
  • please upload patcehs with full context (easier with 'arc')
  • please don't rename the file to .c, instead cast integer to the enum type and file a bug against the linux headers and/or clang -- this warning must not be there.
foad updated this revision to Diff 15781.Nov 4 2014, 12:52 PM
foad edited edge metadata.

Add casts instead of converting to C.

foad added a comment.Nov 4 2014, 12:55 PM
In D6108#7, @kcc wrote:
  • please upload patcehs with full context (easier with 'arc')

Done.

  • please don't rename the file to .c, instead cast integer to the enum type

Done.

and file a bug against the linux headers and/or clang -- this warning must not be there.

OK, I'll try to find someone to report it to.

kcc added inline comments.Nov 4 2014, 1:01 PM
test/sanitizer_common/TestCases/Linux/ptrace.cc
1

#endif // x86_64

11

Can you file a bug against clang?
It should not issue a waning here even w/o the explicit cast.
The bug may end up being in the Linux headers, not in clang)

15

#endif // powerpc64

foad updated this revision to Diff 15783.Nov 4 2014, 1:30 PM

Add comments on #endifs.

kcc accepted this revision.Nov 4 2014, 4:47 PM
kcc edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 4 2014, 4:47 PM
foad closed this revision.Nov 5 2014, 12:53 AM
foad updated this revision to Diff 15795.

Closed by commit rL221337 (authored by @foad).

foad updated this object.Nov 5 2014, 12:56 AM
foad edited edge metadata.
foad added a comment.Nov 6 2014, 1:27 AM
In D6108#7, @kcc wrote:
  • please don't rename the file to .c, instead cast integer to the enum type and file a bug against the linux headers and/or clang -- this warning must not be there.

I've filed a bug against the linux headers: https://bugzilla.kernel.org/show_bug.cgi?id=87861