[PATCH] D128516: [asan][test] XFAIL global-location-nodebug.cpp on Solaris

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 24 05:10:28 PDT 2022


ro created this revision.
ro added reviewers: hctim, eugenis, vitalybuka.
ro added a project: Sanitizers.
Herald added subscribers: Enna1, fedor.sergeev.
Herald added a project: All.
ro requested review of this revision.
Herald added a subscriber: Sanitizers.

A new test `FAIL`s on Solaris:

  FAIL: AddressSanitizer-i386-sunos :: TestCases/global-location-nodebug.cpp (465 of 64279)
  FAIL: AddressSanitizer-i386-sunos-dynamic :: TestCases/global-location-nodebug.cpp (961 of 64279)

The problem is the unconditional use of `-Wl,-S`:

  ld: fatal: dlopen() of support library (-lstdc++) failed with error: ld.so.1: ld: -lstdc++: open failed: No such file or directory

`ld -S` has a completely different semantics compared to GNU `ld -S`/`--strip-debug`: specify a link-edit support library.  To avoid this, I've chosen to `XFAIL` the test.

Tested on `amd64-pc-solaris2.11`.

While Solaris `ld` doesn't support `--strip-debug`, it has `-z strip-class=debug` instead, which makes the test `PASS`.  It would be possible to use a substitution (`%ld_flags_strip_debug`) instead, set in `compiler-rt/test/asan/lit.cfg.py`.  However, this seems like overkill to me.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128516

Files:
  compiler-rt/test/asan/TestCases/global-location-nodebug.cpp


Index: compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
===================================================================
--- compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
+++ compiler-rt/test/asan/TestCases/global-location-nodebug.cpp
@@ -8,6 +8,9 @@
 // RUN: not %run %t f 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=FUNC_STATIC-NO-G
 // RUN: not %run %t l 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=LITERAL-NO-G
 
+/// Solaris ld -S has different semantics.
+// XFAIL: solaris
+
 // CHECK: AddressSanitizer: global-buffer-overflow
 // CLASS_STATIC-NO-G: 0x{{.*}} is located 4 bytes to the right of global variable 'C::array' defined in '{{.*}}global-location.cpp' {{.*}} of size 40
 // GLOB-NO-G: 0x{{.*}} is located 4 bytes to the right of global variable 'global' defined in '{{.*}}global-location.cpp' {{.*}} of size 40


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128516.439704.patch
Type: text/x-patch
Size: 878 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220624/262658db/attachment-0001.bin>


More information about the llvm-commits mailing list