[llvm-branch-commits] [compiler-rt-branch] r368680 - Merging r368516:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 13 05:21:30 PDT 2019
Author: hans
Date: Tue Aug 13 05:21:30 2019
New Revision: 368680
URL: http://llvm.org/viewvc/llvm-project?rev=368680&view=rev
Log:
Merging r368516:
------------------------------------------------------------------------
r368516 | dim | 2019-08-10 21:07:38 +0200 (Sat, 10 Aug 2019) | 25 lines
Add support for FreeBSD's LD_32_LIBRARY_PATH
Summary:
Because the dynamic linker for 32-bit executables on 64-bit FreeBSD uses
the environment variable `LD_32_LIBRARY_PATH` instead of
`LD_LIBRARY_PATH` to find needed dynamic libraries, running the 32-bit
parts of the dynamic ASan tests will fail with errors similar to:
```
ld-elf32.so.1: Shared object "libclang_rt.asan-i386.so" not found, required by "Asan-i386-inline-Dynamic-Test"
```
This adds support for setting up `LD_32_LIBRARY_PATH` for the unit and
regression tests. It will likely also require a minor change to the
`TestingConfig` class in `llvm/utils/lit/lit`.
Reviewers: emaste, kcc, rnk, arichardson
Reviewed By: arichardson
Subscribers: kubamracek, krytarowski, fedor.sergeev, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65772
------------------------------------------------------------------------
Modified:
compiler-rt/branches/release_90/ (props changed)
compiler-rt/branches/release_90/test/asan/Unit/lit.site.cfg.py.in
compiler-rt/branches/release_90/test/asan/lit.cfg.py
compiler-rt/branches/release_90/test/xray/Unit/lit.site.cfg.py.in
Propchange: compiler-rt/branches/release_90/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 13 05:21:30 2019
@@ -1 +1 @@
-/compiler-rt/trunk:367442,367929
+/compiler-rt/trunk:367442,367929,368516
Modified: compiler-rt/branches/release_90/test/asan/Unit/lit.site.cfg.py.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_90/test/asan/Unit/lit.site.cfg.py.in?rev=368680&r1=368679&r2=368680&view=diff
==============================================================================
--- compiler-rt/branches/release_90/test/asan/Unit/lit.site.cfg.py.in (original)
+++ compiler-rt/branches/release_90/test/asan/Unit/lit.site.cfg.py.in Tue Aug 13 05:21:30 2019
@@ -1,6 +1,7 @@
@LIT_SITE_CFG_IN_HEADER@
import os
+import platform
# Load common config for all compiler-rt unit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
@@ -10,6 +11,11 @@ def push_ld_library_path(config, new_pat
(new_path, config.environment.get('LD_LIBRARY_PATH', '')))
config.environment['LD_LIBRARY_PATH'] = new_ld_library_path
+ if platform.system() == 'FreeBSD':
+ new_ld_32_library_path = os.path.pathsep.join(
+ (new_path, config.environment.get('LD_32_LIBRARY_PATH', '')))
+ config.environment['LD_32_LIBRARY_PATH'] = new_ld_32_library_path
+
# Setup config name.
config.name = 'AddressSanitizer-Unit'
Modified: compiler-rt/branches/release_90/test/asan/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_90/test/asan/lit.cfg.py?rev=368680&r1=368679&r2=368680&view=diff
==============================================================================
--- compiler-rt/branches/release_90/test/asan/lit.cfg.py (original)
+++ compiler-rt/branches/release_90/test/asan/lit.cfg.py Tue Aug 13 05:21:30 2019
@@ -36,6 +36,12 @@ def push_dynamic_library_lookup_path(con
(new_path, config.environment.get(dynamic_library_lookup_var, '')))
config.environment[dynamic_library_lookup_var] = new_ld_library_path
+ if platform.system() == 'FreeBSD':
+ dynamic_library_lookup_var = 'LD_32_LIBRARY_PATH'
+ new_ld_32_library_path = os.path.pathsep.join(
+ (new_path, config.environment.get(dynamic_library_lookup_var, '')))
+ config.environment[dynamic_library_lookup_var] = new_ld_32_library_path
+
# Setup config name.
config.name = 'AddressSanitizer' + config.name_suffix
@@ -111,7 +117,7 @@ config.substitutions.append( ("%clangxx
config.substitutions.append( ("%clang_asan ", build_invocation(clang_asan_cflags)) )
config.substitutions.append( ("%clangxx_asan ", build_invocation(clang_asan_cxxflags)) )
if config.asan_dynamic:
- if config.host_os in ['Linux', 'NetBSD', 'SunOS']:
+ if config.host_os in ['Linux', 'FreeBSD', 'NetBSD', 'SunOS']:
shared_libasan_path = os.path.join(config.compiler_rt_libdir, "libclang_rt.asan{}.so".format(config.target_suffix))
elif config.host_os == 'Darwin':
shared_libasan_path = os.path.join(config.compiler_rt_libdir, 'libclang_rt.asan_{}_dynamic.dylib'.format(config.apple_platform))
Modified: compiler-rt/branches/release_90/test/xray/Unit/lit.site.cfg.py.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_90/test/xray/Unit/lit.site.cfg.py.in?rev=368680&r1=368679&r2=368680&view=diff
==============================================================================
--- compiler-rt/branches/release_90/test/xray/Unit/lit.site.cfg.py.in (original)
+++ compiler-rt/branches/release_90/test/xray/Unit/lit.site.cfg.py.in Tue Aug 13 05:21:30 2019
@@ -1,6 +1,7 @@
@LIT_SITE_CFG_IN_HEADER@
import os
+import platform
# Load common config for all compiler-rt unit tests.
lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/unittests/lit.common.unit.configured")
@@ -22,3 +23,10 @@ if 'LD_LIBRARY_PATH' in os.environ:
config.environment['LD_LIBRARY_PATH'] = libdirs
else:
config.environment['LD_LIBRARY_PATH'] = config.llvm_lib_dir
+
+if platform.system() == 'FreeBSD':
+ if 'LD_32_LIBRARY_PATH' in os.environ:
+ libdirs = os.path.pathsep.join((config.llvm_lib_dir, os.environ['LD_32_LIBRARY_PATH']))
+ config.environment['LD_32_LIBRARY_PATH'] = libdirs
+ else:
+ config.environment['LD_32_LIBRARY_PATH'] = config.llvm_lib_dir
More information about the llvm-branch-commits
mailing list