[compiler-rt] a09be08 - [compiler-rt][profile][AIX] pass extra link opts for test

David Tenty via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 25 10:58:21 PST 2022


Author: David Tenty
Date: 2022-01-25T13:57:02-05:00
New Revision: a09be08594a8b980f3cd0ad7e8aea1f9545517ae

URL: https://github.com/llvm/llvm-project/commit/a09be08594a8b980f3cd0ad7e8aea1f9545517ae
DIFF: https://github.com/llvm/llvm-project/commit/a09be08594a8b980f3cd0ad7e8aea1f9545517ae.diff

LOG: [compiler-rt][profile][AIX] pass extra link opts for test

The AIX linker doesn't export any symbols by default, so an export list is usually used. Since clang doesn't have the tools to auto-generate an export list yet, just pass the linker an extra opt to tell it to export everything. This is  generally not recommended for real shared libs, but is fine for the purpose of this test.

Differential Revision: https://reviews.llvm.org/D118101

Added: 
    

Modified: 
    compiler-rt/test/profile/Posix/instrprof-get-filename-merge-mode.c
    compiler-rt/test/profile/Posix/lit.local.cfg.py

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/profile/Posix/instrprof-get-filename-merge-mode.c b/compiler-rt/test/profile/Posix/instrprof-get-filename-merge-mode.c
index 7e26e3e6b5dd3..afd113c5fa7c5 100644
--- a/compiler-rt/test/profile/Posix/instrprof-get-filename-merge-mode.c
+++ b/compiler-rt/test/profile/Posix/instrprof-get-filename-merge-mode.c
@@ -1,6 +1,6 @@
 // Test __llvm_profile_get_filename when the on-line merging mode is enabled.
 //
-// RUN: %clang_pgogen -fPIC -shared -o %t.dso %p/../Inputs/instrprof-get-filename-dso.c
+// RUN: %clang_pgogen -fPIC -shared %shared_linker_xopts -o %t.dso %p/../Inputs/instrprof-get-filename-dso.c
 // RUN: %clang_pgogen -o %t %s %t.dso
 // RUN: env LLVM_PROFILE_FILE="%t-%m.profraw" %run %t
 

diff  --git a/compiler-rt/test/profile/Posix/lit.local.cfg.py b/compiler-rt/test/profile/Posix/lit.local.cfg.py
index 60a9460820a62..eb79b385cc486 100644
--- a/compiler-rt/test/profile/Posix/lit.local.cfg.py
+++ b/compiler-rt/test/profile/Posix/lit.local.cfg.py
@@ -7,3 +7,10 @@ def getRoot(config):
 
 if root.host_os in ['Windows']:
   config.unsupported = True
+
+# AIX usually usually makes use of an explicit export list when linking a shared
+# object, but for the purposes of these tests just export all symbols.
+if root.host_os in ['AIX']:
+  config.substitutions.append(('%shared_linker_xopts', '-Wl,-bexpfull'))
+else:
+  config.substitutions.append(('%shared_linker_xopts', ''))


        


More information about the llvm-commits mailing list