diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index ff5eb2399de6df2f46babf609d28984b5c205dbc..e8ba657bbc49c69612292536b5dd7b3c25c93069 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -117,8 +117,9 @@ if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*android.*") set(ANDROID_API_LEVEL ${CMAKE_MATCH_2}) endif() -# We define OHOS for ohos targets for now -if (OHOS) +# We define OHOS for ohos targets for now. By default we use devices with hdc connection to test OHOS +# targets. It's also possible to use devices with adb connection which is enabled via ANDROID. +if (OHOS AND NOT ANDROID) set(OHOS_FAMILY 1) endif() diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py index f3f7153e734004be42ecf471a3fce5bf08dccfbf..b30fa67a051509511c5040218b74985f24cf9eff 100644 --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -523,6 +523,8 @@ if config.android: # FIXME: Replace with appropriate version when availible. if android_api_level > 30 or (android_api_level == 30 and android_api_codename == 'S'): config.available_features.add('android-thread-properties-api') + else: + config.environment['OHOS_REMOTE_DYN_LINKER'] = os.environ.get('OHOS_REMOTE_DYN_LINKER') # Prepare the device. android_tmpdir = '/data/local/tmp/Output' diff --git a/compiler-rt/test/sanitizer_common/android_commands/android_common.py b/compiler-rt/test/sanitizer_common/android_commands/android_common.py index 81caae8741c2d3f0310e28f1693337c017d27246..53e364f8e24bd1dce28cb9dae9a5a4d9d66dffe2 100644 --- a/compiler-rt/test/sanitizer_common/android_commands/android_common.py +++ b/compiler-rt/test/sanitizer_common/android_commands/android_common.py @@ -3,6 +3,7 @@ import time ANDROID_TMPDIR = '/data/local/tmp/Output' ADB = os.environ.get('ADB', 'adb') +DYN_LINKER = os.environ.get('OHOS_REMOTE_DYN_LINKER') # OHOS_LOCAL verbose = False if os.environ.get('ANDROID_RUN_VERBOSE') == '1': diff --git a/compiler-rt/test/sanitizer_common/android_commands/android_compile.py b/compiler-rt/test/sanitizer_common/android_commands/android_compile.py index 8f657d32be5621b19395957bfa2676a69eefa833..3b65e0edf2c891acbb610b37f45d4516b1b7a7bc 100755 --- a/compiler-rt/test/sanitizer_common/android_commands/android_compile.py +++ b/compiler-rt/test/sanitizer_common/android_commands/android_compile.py @@ -24,7 +24,12 @@ if output == None: print("No output file name!") sys.exit(1) -ret = subprocess.call(sys.argv[1:]) +# OHOS_LOCAL begin +append_args = [] +if DYN_LINKER: + append_args.append('-Wl,--dynamic-linker=' + DYN_LINKER) +ret = subprocess.call(sys.argv[1:] + append_args) +# OHOS_LOCAL end if ret != 0: sys.exit(ret)