[PATCH] D129165: [AIX][clang/test] Set/propagate AIXTHREAD_STK for AIX

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 5 15:46:38 PDT 2022


hubert.reinterpretcast created this revision.
hubert.reinterpretcast added reviewers: xingxue, daltenty, Jake-Egan, cebowleratibm.
Herald added subscribers: ormris, arphaman, steven_wu, hiraditya, kristof.beyls.
Herald added a project: All.
hubert.reinterpretcast requested review of this revision.
Herald added a project: clang.

Some tests perform deep recursion, which requires a larger pthread stack
size than the relatively low default of 192 KiB for 64-bit processes on
AIX. The `AIXTHREAD_STK` environment variable provides a non-intrusive
way to request a larger pthread stack size for the tests. The required
pthread stack size depends on the build configuration.

A 4 MiB default is generous compared to the 512 KiB of macOS; however,
it is known that some compilers on AIX produce code that uses
comparatively more stack space.

This patch expands the solution from D65688 <https://reviews.llvm.org/D65688> to apply to all Clang LIT
tests.

This also reverts commit c3c75d805c2174388417080f762230961b3433d6 <https://reviews.llvm.org/rGc3c75d805c2174388417080f762230961b3433d6>,
"[clang][test] Mark test arm-float-abi-lto.c unsupported on AIX".

The problem was caused by the test running up against the per-thread
stack limit on AIX. This is resolved by having the tests run with
`AIXTHREAD_STK` set for 4 MiB.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129165

Files:
  clang/test/Driver/arm-float-abi-lto.c
  clang/test/Index/lit.local.cfg
  clang/test/lit.cfg.py


Index: clang/test/lit.cfg.py
===================================================================
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -264,3 +264,13 @@
                       '/ASTMerge/anonymous-fields', '/ASTMerge/injected-class-name-decl'):
         exclude_unsupported_files_for_aix(config.test_source_root + directory)
 
+# Some tests perform deep recursion, which requires a larger pthread stack size
+# than the relatively low default of 192 KiB for 64-bit processes on AIX. The
+# `AIXTHREAD_STK` environment variable provides a non-intrusive way to request
+# a larger pthread stack size for the tests. Various applications and runtime
+# libraries on AIX use a default pthread stack size of 4 MiB, so we will use
+# that as a default value here.
+if 'AIXTHREAD_STK' in os.environ:
+    config.environment['AIXTHREAD_STK'] = os.environ['AIXTHREAD_STK']
+elif platform.system() == 'AIX':
+    config.environment['AIXTHREAD_STK'] = '4194304'
Index: clang/test/Index/lit.local.cfg
===================================================================
--- clang/test/Index/lit.local.cfg
+++ /dev/null
@@ -1,12 +0,0 @@
-import platform
-
-# Some tests perform deep recursion, which requires a larger pthread stack size
-# than the relatively low default of 192 KiB for 64-bit processes on AIX. The
-# `AIXTHREAD_STK` environment variable provides a non-intrusive way to request
-# a larger pthread stack size for the tests. Various applications and runtime
-# libraries on AIX use a default pthread stack size of 4 MiB, so we will use
-# that as a default value here.
-if 'AIXTHREAD_STK' in os.environ:
-    config.environment['AIXTHREAD_STK'] = os.environ['AIXTHREAD_STK']
-elif platform.system() == 'AIX':
-    config.environment['AIXTHREAD_STK'] = '4194304'
Index: clang/test/Driver/arm-float-abi-lto.c
===================================================================
--- clang/test/Driver/arm-float-abi-lto.c
+++ clang/test/Driver/arm-float-abi-lto.c
@@ -1,5 +1,3 @@
-// FIXME: Produces a segmentation fault on AIX after the introduction of opaque pointers (D125847). 
-// UNSUPPORTED: system-aix
 // REQUIRES: arm-registered-target
 
 // RUN: %clang --target=arm-none-eabi -mcpu=cortex-m33 -mfloat-abi=hard -O1 %s -S -o - -emit-llvm -DCALL_LIB -DDEFINE_LIB | FileCheck %s


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129165.442407.patch
Type: text/x-patch
Size: 2300 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220705/4c2aa779/attachment.bin>


More information about the cfe-commits mailing list