This is an archive of the discontinued LLVM Phabricator instance.

Add missing _US_ACTION_MASK constant to unwind.h
ClosedPublic

Authored by dim on Sep 4 2016, 1:40 PM.

Details

Summary

During building of recent compiler-rt sources on FreeBSD for arm, I
noticed that our unwind.h (which originates in libunwind) was missing
the _US_ACTION_MASK constant:

compiler-rt/lib/builtins/gcc_personality_v0.c:187:18: error: use of undeclared identifier '_US_ACTION_MASK'
    if ((state & _US_ACTION_MASK) != _US_UNWIND_FRAME_STARTING)
                 ^

It appears that both clang's internal unwind.h, and libgcc's unwind.h
define this constant as 3, so let's add this to libunwind's version too.

Diff Detail

Event Timeline

dim updated this revision to Diff 70292.Sep 4 2016, 1:40 PM
dim retitled this revision from to Add missing _US_ACTION_MASK constant to unwind.h.
dim updated this object.
dim added reviewers: emaste, logan, kledzik.
dim added a subscriber: llvm-commits.
davide accepted this revision.Sep 4 2016, 2:09 PM
davide added a reviewer: davide.
This revision is now accepted and ready to land.Sep 4 2016, 2:09 PM
joerg added a subscriber: joerg.Sep 4 2016, 2:21 PM

Please restrict this to ARM EHABI.

dim added a comment.Sep 4 2016, 2:23 PM

Please restrict this to ARM EHABI.

Huh? This whole is under #if _LIBUNWIND_ARM_EHABI already? :)

joerg added a comment.Sep 4 2016, 2:25 PM

Missed line 54, ignore that remark.

dim added a comment.Sep 4 2016, 2:45 PM

One additional note: it seems libgcc and other unwinders use _US_ACTION_MASK to mask out the _US_UNWIND_FRAME_STARTING and _US_UNWIND_FRAME_RESUME values, as they handle _US_FORCE_UNWIND (and _US_END_OF_STACK which we also don't have) separately. It doesn't look like libunwind uses this method?

emaste accepted this revision.Sep 5 2016, 5:40 AM
emaste edited edge metadata.
dim closed this revision.Sep 5 2016, 11:09 AM