[PATCH] D77359: [libunwind] add hexagon support

Brian Cain via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 9 16:53:52 PDT 2020


bcain added inline comments.


================
Comment at: libunwind/src/UnwindRegistersSave.S:1109
   WEAK_ALIAS(__unw_getcontext, unw_getcontext)
+#endif
 
----------------
mstorsjo wrote:
> bcain wrote:
> > mstorsjo wrote:
> > > What's the purpose and need of handling the weak alias differently here? Does the assembler use a different syntax for the weak things there, or do you apply weak to the symbol `__unw_getcontext` as well?
> > > 
> > > I think it might be better to move this difference into `assembly.h` to encapsulate the implementation details of how to set up a weak alias there (there's three different cases there already).
> > > Does the assembler use a different syntax for the weak things there
> > 
> > Yes -- the assembler can't stack the directives with semicolons, AFAICT we need a newline.
> > 
> > I played with definitions of WEAK_ALIAS in `assembly.h` but couldn't get it right.  I gave up too easily, though -- I'll fix it.
> If you use llvm as assembler, it might be possible to fix it to support some separator char though (if it's ok to require the latest version of llvm for building libunwind for hexagon).
> If you use llvm as assembler, it might be possible to fix it to support some separator char though (if it's ok to require the latest version of llvm for building libunwind for hexagon).

I misunderstood the nature of the problem.  It's not related to separators, semicolons work just fine.

It was the alias assignment statement, it's not supported by the assembler.  So I found the `.equiv` directive and it looks like it satisfies the same use case.

After this patch, I checked that the resulting hexagon libunwind.a had the same type, visibility, binding for __unw_getcontext and unw_getcontext as the one of the x86 libunwind.a binaries from 10.0.0 hosted on releases.llvm.org.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77359/new/

https://reviews.llvm.org/D77359





More information about the llvm-commits mailing list