- User Since
- Feb 14 2019, 10:47 AM (241 w, 2 d)
Wed, Sep 27
Hi @ldionne, It would be appreciated if you could take a look at this patch and provide guidance on how to proceed.
Tue, Sep 26
I am taking over this revision because @cebowleratibm is working on a different project.
Sat, Sep 16
Fri, Sep 15
Thu, Sep 7
I've reverted this patch to unblock the internal AIX buildbot.
Sat, Sep 2
LGTM, provided the CI is clean.
Aug 31 2023
- add instruction bl $+4 in the assembly code of the test case
Aug 30 2023
- add code to handle the case where a function does not store the back chain (stores_bc is 0)
- swap the order of getting sigcontext from a signal trampoline frame, now trying stack + STKMINALIGN first and then stack + STKMIN
- remove the condition check when restoring the SP
- add the test case for the case where a function does not store the back chain
Aug 25 2023
- removed mentioning of buying stack frame in a code comment
- added if (!lastStack) and under the condition, set returnAddress to NULL
- removed condition TBTable->tb.saves_lr || !lastStack when restoring SP
- added code to initialize the LR value in context to 0
Aug 24 2023
Addressed a comment:
- fix the comment - not all branches change LR.
Aug 23 2023
Aug 21 2023
GCC uses __register_frame_info and friends on platforms where the eh_frame_hdr/eh_frame sections are not supported such as AIX. But we can turn the macro on if GCC compat is needed on those OSs.
May 16 2023
Thanks for working on this feature! LGTM once CI is fixed, which is a clang-format issue.
May 3 2023
May 1 2023
Feb 15 2023
Feb 14 2023
This patch is specific to the support for AIX legacy xlclang++ compiler generated code. It has been reviewed and approved by AIX compiler/runtime experts. If there are no objections, I will commit it tomorrow.
Feb 2 2023
Diff with context.
- Call abort() instead of std::abort().
Changed function name from skipNonCxxEHAwareFrames to skip_non_cxx_eh_aware_frames to be consistent with function naming in snake_case in this file.
- changed a comment as suggested to be more descriptive
- fixed the text of a trace print
Feb 1 2023
- removed an unnecessary cast
- call std::abort() instead of std::terminate() when unwinding reaches the end of stack frames
- update callerStack instead of using another variable callerStack2
- added missing reference to t2.cpp source in the 32-bit test case
Jan 31 2023
Jan 19 2023
Jan 18 2023
- added test scenarios for option fopenmp in clang/test/Driver/aix-ld.c
Jan 16 2023
Jan 9 2023
Dec 15 2022
Nov 29 2022
Nov 25 2022
- use instruction vspltisb to initialize RS63, RS62
- set RS63, RS62 to 16 bytes each with value 0x01 and 0x02 respectively
- compare RS63/RS62 against expected values using instruction vcmpequb
Nov 24 2022
Nov 21 2022
The compiler generated prologue/epilogue uses instructions stvx/lvx to save/restore vector registers onto/from the stack. On the other hand, libunwind currently uses stxvd2x/lxvd2x to save/restore VSX vector to/from unwinder's context. Since stxvd2x/lxvd2x stores/loads VSX vector as 2 double words into/from memory, these instructions essentially change the byte orders of the contents if the machine is in little-endian mode. As a result, VSX vectors saved by prologues are not correctly represented in the unwinder context. PowerPC ISA 3.0 (Power9) has added instructions stxv/lxv that stores/loads VSX vectors and matches the behavior of stvx/lvx. Unfortunately, since supporting of older PowerPCs such as Power8 and earlier are still needed, we cannot replace stxvd2x/lxvd2x with stxv/lxv yet. Checking if the build system has the GLIBC facility for detecting the CPU architecture, and detecting at run time and going a different path add a lot of complicity to the code base. IMHO, we can simply add instruction xxswapd to before stxvd2x and after lxvd2x for little-endian like in your patch as a workaround for now. xxswapd is not an expensive instruction so it is unlikely to affect the performance in a significant way, noting that saving and restoring context are only executed when raising an exception and jumping to the landing pad. It will be good though to have a comment stating that we should replace them with stxv/lxv once only Power9 and higher are supported for little-endian PowerPC (RHEL 9.0 already supports minimum Power9). Thanks very much for working on this issue!
Nov 18 2022
@ldionne, can you please take a look for #libc_abi? Thanks!
Nov 16 2022
- rename AIXLongDoubleBuiltins to AIXLongDouble64Builtins
- test IR output instead of assembly output
- fix a typo in a comment
- mention frexpl(), ldexpl(), and modfl() are for 128-bit IBM long double, i.e. __ibm128
Nov 14 2022
Nov 10 2022
Oct 27 2022
This patch is AIX specific and it has been thoroughly reviewed and approved by AIX compiler experts @hubert.reinterpretcast, @cebowleratibm (Thank you!). Since we need to have the patch in the coming service pack, I've committed it in rGa499051f10a2d0150b60c14493558476039f701a. Commit rGfb391e45e9cc35429f077413ca660f4f5f5212c1 modified a comment.
Oct 26 2022
Refreshed the patch with context.
Oct 21 2022
Changes in the update:
- addressed comment: rename dummy() to force_a_stackframe();
- added attribute optnone to force_a_stackframe();
- use assembly for IBM legacy compiler xlclang++ generated test cases instead of binary object files.
Oct 20 2022
Updated diff to include binary files.
Oct 19 2022
Sep 16 2022
- always define before_epoch_time & friends to reduce the scope of the workaround.
Sep 9 2022
Sep 8 2022
Sep 1 2022
Aug 12 2022
- _Unwind_FindEnclosingFunction() returns NULL if argument pc is NULL;
- dropped else for returning NULL as suggested.
Hi @ldionne, What do you think about this? The affected test case works with GCC.
Aug 11 2022
Aug 8 2022
I'm not opposed to the change, but I wonder if we should consider placing this in an #if defined(_AIX) guard. This would avoid touching errno on other platforms, which would likely > be a TLS access. It would also make it more obvious that this is a workaround for AIX. At the very least, I think that we should add some comments to explain the issue so that it is > obvious at the site rather than having to go through the change log.