[Lldb-commits] [lldb] [lldb][test] Support remote run of Shell tests (PR #95986)
dzhidzhoev wrote: Could you please give your opinion @JDevlieghere ? https://github.com/llvm/llvm-project/pull/95986 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/96654 >From c107d5d43ed4f696bb2095b2a7d32ca59696f220 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Wed, 19 Jun 2024 23:50:18 + Subject: [PATCH] [lldb][test] Set target and host OS for API tests in case of remote testing Makefile.rules uses HOST_OS and OS variables for determining host and target OSes for API tests compilation. This commit starts moving the platform detection logic from Makefile to Python lldb test suite. When lldb's target is set to remote-linux, Makefile.rules script should be executed with the target OS variable set to Linux. This is useful for the case of Windows-to-Linux cross-testing. --- .../Python/lldbsuite/test/lldbplatformutil.py | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py index 21f2095db90f8..0c7a6807974b4 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py @@ -56,6 +56,10 @@ def target_is_android(): return configuration.lldb_platform_name == "remote-android" +def target_is_remote_linux(): +return configuration.lldb_platform_name == "remote-linux" + + def android_device_api(): if not hasattr(android_device_api, "result"): assert configuration.lldb_platform_url is not None @@ -92,11 +96,22 @@ def match_android_device(device_arch, valid_archs=None, valid_api_levels=None): def finalize_build_dictionary(dictionary): +if dictionary is None: +dictionary = {} if target_is_android(): -if dictionary is None: -dictionary = {} dictionary["OS"] = "Android" dictionary["PIE"] = 1 +elif platformIsDarwin(): +dictionary["OS"] = "Darwin" +else: +# Provide uname-like platform name +platform_name_to_uname = { "linux": "Linux", +"netbsd": "NetBSD", +"freebsd": "FreeBSD", +"windows": "Windows_NT", +} +dictionary["OS"] = platform_name_to_uname[getPlatform()] +dictionary["HOST_OS"] = platform_name_to_uname[getHostPlatform()] return dictionary ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/96654 >From be1646f4b41c5dced296a279b448624996c592d0 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Wed, 19 Jun 2024 23:50:18 + Subject: [PATCH] [lldb][test] Set target and host OS for API tests in case of remote testing Makefile.rules uses HOST_OS and OS variables for determining host and target OSes for API tests compilation. This commit starts moving the platform detection logic from Makefile to Python lldb test suite. When lldb's target is set to remote-linux, Makefile.rules script should be executed with the target OS variable set to Linux. This is useful for the case of Windows-to-Linux cross-testing. --- .../Python/lldbsuite/test/lldbplatformutil.py | 25 +-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py index 21f2095db90f8..a9cd8772d514f 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py @@ -56,6 +56,10 @@ def target_is_android(): return configuration.lldb_platform_name == "remote-android" +def target_is_remote_linux(): +return configuration.lldb_platform_name == "remote-linux" + + def android_device_api(): if not hasattr(android_device_api, "result"): assert configuration.lldb_platform_url is not None @@ -92,11 +96,28 @@ def match_android_device(device_arch, valid_archs=None, valid_api_levels=None): def finalize_build_dictionary(dictionary): +# Provide uname-like platform name +platform_name_to_uname = { "linux": "Linux", +"netbsd": "NetBSD", +"freebsd": "FreeBSD", +"windows": "Windows_NT", +} + +if dictionary is None: +dictionary = {} if target_is_android(): -if dictionary is None: -dictionary = {} dictionary["OS"] = "Android" dictionary["PIE"] = 1 +elif platformIsDarwin(): +dictionary["OS"] = "Darwin" +else: +dictionary["OS"] = platform_name_to_uname[getPlatform()] + +if platformIsDarwin(): +dictionary["HOST_OS"] = "Darwin" +else: +dictionary["HOST_OS"] = platform_name_to_uname[getHostPlatform()] + return dictionary ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/96654 >From d47f7306c913336529a01a401e41ce688d0c6b46 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Wed, 19 Jun 2024 23:50:18 + Subject: [PATCH] [lldb][test] Set target and host OS for API tests in case of remote testing Makefile.rules uses HOST_OS and OS variables for determining host and target OSes for API tests compilation. This commit starts moving the platform detection logic from Makefile to Python lldb test suite. When lldb's target is set to remote-linux, Makefile.rules script should be executed with the target OS variable set to Linux. This is useful for the case of Windows-to-Linux cross-testing. --- .../Python/lldbsuite/test/lldbplatformutil.py | 29 +-- .../Python/lldbsuite/test/make/Makefile.rules | 5 +++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py index 21f2095db90f8..e4de298fb11ae 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py @@ -56,6 +56,10 @@ def target_is_android(): return configuration.lldb_platform_name == "remote-android" +def target_is_remote_linux(): +return configuration.lldb_platform_name == "remote-linux" + + def android_device_api(): if not hasattr(android_device_api, "result"): assert configuration.lldb_platform_url is not None @@ -92,11 +96,28 @@ def match_android_device(device_arch, valid_archs=None, valid_api_levels=None): def finalize_build_dictionary(dictionary): +# Provide uname-like platform name +platform_name_to_uname = { "linux": "Linux", +"netbsd": "NetBSD", +"freebsd": "FreeBSD", +"windows": "Windows_NT", +} + +if dictionary is None: +dictionary = {} if target_is_android(): -if dictionary is None: -dictionary = {} dictionary["OS"] = "Android" dictionary["PIE"] = 1 +elif platformIsDarwin(): +dictionary["OS"] = "Darwin" +else: +dictionary["OS"] = platform_name_to_uname[getPlatform()] + +if platformIsDarwin(): +dictionary["HOST_OS"] = "Darwin" +else: +dictionary["HOST_OS"] = platform_name_to_uname[getHostPlatform()] + return dictionary @@ -113,6 +134,10 @@ def _get_platform_os(p): platform = "openbsd" return platform +# Triple is not available if we're not connected yet +if p.GetName() == "remote-linux": +return "linux" + return "" diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index bd8eea3d6f5a0..c101d84a9b959 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -55,7 +55,10 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # When running tests from Visual Studio, the environment variable isn't # inherited all the way down to the process spawned for make. #-- -HOST_OS := $(shell uname -s) +ifeq "$(OS)" "" + HOST_OS := $(shell uname -s) +endif + ifneq (,$(findstring windows32,$(HOST_OS))) HOST_OS := Windows_NT endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/96654 >From b6e1aa283d46292556d0edac70eb05d6467497f2 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Wed, 19 Jun 2024 23:50:18 + Subject: [PATCH] [lldb][test] Set target and host OS for API tests in case of remote testing Makefile.rules uses HOST_OS and OS variables for determining host and target OSes for API tests compilation. This commit starts moving the platform detection logic from Makefile to Python lldb test suite. When lldb's target is set to remote-linux, Makefile.rules script should be executed with the target OS variable set to Linux. This is useful for the case of Windows-to-Linux cross-testing. --- .../Python/lldbsuite/test/lldbplatformutil.py | 25 +-- .../Python/lldbsuite/test/make/Makefile.rules | 5 +++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py index 21f2095db90f8..1e076061c6c43 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py @@ -92,11 +92,28 @@ def match_android_device(device_arch, valid_archs=None, valid_api_levels=None): def finalize_build_dictionary(dictionary): +# Provide uname-like platform name +platform_name_to_uname = { +"linux": "Linux", +"netbsd": "NetBSD", +"freebsd": "FreeBSD", +"windows": "Windows_NT", +"macosx": "Darwin", +"darwin": "Darwin", +} + +if dictionary is None: +dictionary = {} if target_is_android(): -if dictionary is None: -dictionary = {} dictionary["OS"] = "Android" dictionary["PIE"] = 1 +elif platformIsDarwin(): +dictionary["OS"] = "Darwin" +else: +dictionary["OS"] = platform_name_to_uname[getPlatform()] + +dictionary["HOST_OS"] = platform_name_to_uname[getHostPlatform()] + return dictionary @@ -113,6 +130,10 @@ def _get_platform_os(p): platform = "openbsd" return platform +# Triple is not available if we're not connected yet +if p.GetName() == "remote-linux": +return "linux" + return "" diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index bd8eea3d6f5a0..3d562285ce9cc 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -55,7 +55,10 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # When running tests from Visual Studio, the environment variable isn't # inherited all the way down to the process spawned for make. #-- -HOST_OS := $(shell uname -s) +ifeq "$(HOST_OS)" "" + HOST_OS := $(shell uname -s) +endif + ifneq (,$(findstring windows32,$(HOST_OS))) HOST_OS := Windows_NT endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
dzhidzhoev wrote: Thank you! Updated it: improved code for Darwin host detection, and removed overriding of HOST_OS in Makefile. https://github.com/llvm/llvm-project/pull/96654 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use correct path separator for C++ library files lookup (PR #98144)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/98144 Use POSIX-style path separators when checking for libcpp library path. This is necessary to run API tests from 'std-module' group compiled on Windows host for Linux target. >From fce5e1e4a59b511a0bd4aa1bb1865528297c5471 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Wed, 22 May 2024 11:19:44 -0700 Subject: [PATCH] [lldb] Use correct path separator for C++ library files lookup Take into account separator style of target platorm. This is necessary to run API tests from 'std-module' group compiled on Windows host for Linux target. --- .../Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp b/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp index f43a04488230f..f3aabc12f92b7 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/CppModuleConfiguration.cpp @@ -71,7 +71,7 @@ bool CppModuleConfiguration::analyzeFile(const FileSpec &f, // If the path is in the libc++ include directory use it as the found libc++ // path. Ignore subdirectories such as /c++/v1/experimental as those don't // need to be specified in the header search. - if (libcpp_regex.match(f.GetPath()) && + if (libcpp_regex.match(convert_to_slash(f.GetPath())) && parent_path(posix_dir, Style::posix).ends_with("c++")) { if (!m_std_inc.TrySet(posix_dir)) return false; ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
@@ -113,6 +130,10 @@ def _get_platform_os(p): platform = "openbsd" return platform +# Triple is not available if we're not connected yet +if p.GetName() == "remote-linux": +return "linux" + dzhidzhoev wrote: That may be relevant if _get_platform_os is called before the connection is established, or, for example, if it has failed to be established. But yeah, currently I'm not aware of such use cases. Should it be removed? https://github.com/llvm/llvm-project/pull/96654 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/96654 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/96654 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb] Use correct path separator for C++ library files lookup (PR #98144)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/98144 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/96654 >From 016ed9ec4ed320709b981f4a5fe228a91d753230 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Wed, 19 Jun 2024 23:50:18 + Subject: [PATCH] [lldb][test] Set target and host OS for API tests in case of remote testing Makefile.rules uses HOST_OS and OS variables for determining host and target OSes for API tests compilation. This commit starts moving the platform detection logic from Makefile to Python lldb test suite. When lldb's target is set to remote-linux, Makefile.rules script should be executed with the target OS variable set to Linux. This is useful for the case of Windows-to-Linux cross-testing. --- .../Python/lldbsuite/test/lldbplatformutil.py | 21 +-- .../Python/lldbsuite/test/make/Makefile.rules | 5 - 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py index 21f2095db90f8..818fdf0e6b5c5 100644 --- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py +++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py @@ -92,11 +92,28 @@ def match_android_device(device_arch, valid_archs=None, valid_api_levels=None): def finalize_build_dictionary(dictionary): +# Provide uname-like platform name +platform_name_to_uname = { +"linux": "Linux", +"netbsd": "NetBSD", +"freebsd": "FreeBSD", +"windows": "Windows_NT", +"macosx": "Darwin", +"darwin": "Darwin", +} + +if dictionary is None: +dictionary = {} if target_is_android(): -if dictionary is None: -dictionary = {} dictionary["OS"] = "Android" dictionary["PIE"] = 1 +elif platformIsDarwin(): +dictionary["OS"] = "Darwin" +else: +dictionary["OS"] = platform_name_to_uname[getPlatform()] + +dictionary["HOST_OS"] = platform_name_to_uname[getHostPlatform()] + return dictionary diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index bd8eea3d6f5a0..3d562285ce9cc 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -55,7 +55,10 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # When running tests from Visual Studio, the environment variable isn't # inherited all the way down to the process spawned for make. #-- -HOST_OS := $(shell uname -s) +ifeq "$(HOST_OS)" "" + HOST_OS := $(shell uname -s) +endif + ifneq (,$(findstring windows32,$(HOST_OS))) HOST_OS := Windows_NT endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
@@ -113,6 +130,10 @@ def _get_platform_os(p): platform = "openbsd" return platform +# Triple is not available if we're not connected yet +if p.GetName() == "remote-linux": +return "linux" + dzhidzhoev wrote: Fixed. https://github.com/llvm/llvm-project/pull/96654 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Set target OS for API tests in case of remote testing (PR #96654)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/96654 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Support remote run of Shell tests (PR #95986)
dzhidzhoev wrote: Created RFC https://discourse.llvm.org/t/rfc-lldb-support-remote-run-of-shell-tests/80072, hope it fosters the discussion. https://github.com/llvm/llvm-project/pull/95986 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix remote executables load and caching (PR #98623)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/98623 Seemingly, #96256 removed the only call to Platform::GetCachedExecutable, which broke the resolution of executable modules in the remote debugging mode (https://github.com/llvm/llvm-project/issues/97410). This commit fixes that. >From 3f8a4164ddc06a3faffe61d95e5023d367d757f0 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 11 Jul 2024 17:53:08 +0200 Subject: [PATCH] [LLDB] Fix remote executables load and caching Seemingly, #96256 removed the only call to Platform::GetCachedExecutable, which broke the resolution of executable modules in the remote debugging mode (https://github.com/llvm/llvm-project/issues/97410). This commit fixes that. --- lldb/source/Target/Platform.cpp| 2 +- lldb/source/Target/RemoteAwarePlatform.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index bb90c377d86b2..1900898db6494 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1446,7 +1446,7 @@ Platform::GetCachedExecutable(ModuleSpec &module_spec, Status error = GetRemoteSharedModule( module_spec, nullptr, module_sp, [&](const ModuleSpec &spec) { -return ResolveExecutable(spec, module_sp, module_search_paths_ptr); +return Platform::ResolveExecutable(spec, module_sp, module_search_paths_ptr); }, nullptr); if (error.Success()) { diff --git a/lldb/source/Target/RemoteAwarePlatform.cpp b/lldb/source/Target/RemoteAwarePlatform.cpp index 5fc2d63876b92..f3aafb87149c8 100644 --- a/lldb/source/Target/RemoteAwarePlatform.cpp +++ b/lldb/source/Target/RemoteAwarePlatform.cpp @@ -46,6 +46,9 @@ Status RemoteAwarePlatform::ResolveExecutable( if (!FileSystem::Instance().Exists(resolved_file_spec)) FileSystem::Instance().ResolveExecutableLocation(resolved_file_spec); + } else if (m_remote_platform_sp) { +return GetCachedExecutable(resolved_module_spec, exe_module_sp, +module_search_paths_ptr); } return Platform::ResolveExecutable(resolved_module_spec, exe_module_sp, ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix Android debugging (PR #98581)
dzhidzhoev wrote: Could you take a peak if this solves your issue? https://github.com/llvm/llvm-project/pull/98623 https://github.com/llvm/llvm-project/pull/98581 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix remote executables load and caching (PR #98623)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/98623 >From b86d6f9ea1b54cbd5ac54b8aae8971862c6536b5 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 11 Jul 2024 17:53:08 +0200 Subject: [PATCH] [LLDB] Fix remote executables load and caching Seemingly, #96256 removed the only call to Platform::GetCachedExecutable, which broke the resolution of executable modules in the remote debugging mode (https://github.com/llvm/llvm-project/issues/97410). This commit fixes that. --- lldb/source/Target/Platform.cpp| 3 ++- lldb/source/Target/RemoteAwarePlatform.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index bb90c377d86b2..ab80fe4c8ba24 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1446,7 +1446,8 @@ Platform::GetCachedExecutable(ModuleSpec &module_spec, Status error = GetRemoteSharedModule( module_spec, nullptr, module_sp, [&](const ModuleSpec &spec) { -return ResolveExecutable(spec, module_sp, module_search_paths_ptr); +return Platform::ResolveExecutable(spec, module_sp, + module_search_paths_ptr); }, nullptr); if (error.Success()) { diff --git a/lldb/source/Target/RemoteAwarePlatform.cpp b/lldb/source/Target/RemoteAwarePlatform.cpp index 5fc2d63876b92..cac738ea67b4c 100644 --- a/lldb/source/Target/RemoteAwarePlatform.cpp +++ b/lldb/source/Target/RemoteAwarePlatform.cpp @@ -46,6 +46,9 @@ Status RemoteAwarePlatform::ResolveExecutable( if (!FileSystem::Instance().Exists(resolved_file_spec)) FileSystem::Instance().ResolveExecutableLocation(resolved_file_spec); + } else if (m_remote_platform_sp) { +return GetCachedExecutable(resolved_module_spec, exe_module_sp, + module_search_paths_ptr); } return Platform::ResolveExecutable(resolved_module_spec, exe_module_sp, ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix remote executables load and caching (PR #98623)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/98623 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/98690 Currently, if we execute 'process load' with remote debugging, it uses the host's path delimiter to look up files on a target machine. If we run remote debugging of Linux target on Windows and execute process load C:\foo\a.so, lldb-server tries to load \foo\a.so instead of /foo/a.so. It affects several API tests. This commit fixes that error. Also, it contains minor fixes for TestLoadUnload.py for testing on Windows host and Linux target. >From 98b75927878e35ca556ecbbecb1125621a63fea9 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Tue, 23 Apr 2024 05:44:49 + Subject: [PATCH] [LLDB] Make 'process load' take remote os path delimiter into account Currently, if we execute 'process load' with remote debugging, it uses host's path delimiter to lookup files on target machine. If we run remote debugging of Linux target on Windows and execute process load C:\foo\a.so, lldb-server tries to load \foo\a.so instead of /foo/a.so. It affects several API tests. This commit fixes that error. Also, it contains minor fixes for TestLoadUnload.py for testing on Windows host and Linux target. --- lldb/source/Commands/CommandObjectProcess.cpp | 3 ++- .../test/API/functionalities/load_unload/TestLoadUnload.py | 7 --- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 3587a8f529e4a..bdcd58c0da785 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -950,11 +950,12 @@ class CommandObjectProcessLoad : public CommandObjectParsed { ExecutionContext *execution_context) override { Status error; const int short_option = m_getopt_table[option_idx].val; + ArchSpec arch = execution_context->GetProcessPtr()->GetSystemArchitecture(); switch (short_option) { case 'i': do_install = true; if (!option_arg.empty()) - install_path.SetFile(option_arg, FileSpec::Style::native); + install_path.SetFile(option_arg, arch.GetTriple()); break; default: llvm_unreachable("Unimplemented option"); diff --git a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py index e52fb8c87377f..cc4060d48cc86 100644 --- a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py +++ b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py @@ -62,7 +62,7 @@ def copy_shlibs_to_remote(self, hidden_dir=False): for f in shlibs: err = lldb.remote_platform.Put( lldb.SBFileSpec(self.getBuildArtifact(f)), -lldb.SBFileSpec(os.path.join(wd, f)), +lldb.SBFileSpec(lldbutil.join_remote_paths(wd, f)), ) if err.Fail(): raise RuntimeError( @@ -71,7 +71,7 @@ def copy_shlibs_to_remote(self, hidden_dir=False): if hidden_dir: shlib = "libloadunload_d." + ext hidden_dir = os.path.join(wd, "hidden") -hidden_file = os.path.join(hidden_dir, shlib) +hidden_file = lldbutil.join_remote_paths(hidden_dir, shlib) err = lldb.remote_platform.MakeDirectory(hidden_dir) if err.Fail(): raise RuntimeError( @@ -405,8 +405,9 @@ def run_step_over_load(self): # We can't find a breakpoint location for d_init before launching because # executable dependencies are resolved relative to the debuggers PWD. Bug? +# The remote lldb server resolves the executable dependencies correctly. @expectedFailureAll( -oslist=["freebsd", "linux", "netbsd"], triple=no_match("aarch64-.*-android") +oslist=["freebsd", "linux", "netbsd"], triple=no_match("aarch64-.*-android"), remote=False ) @expectedFailureAll(oslist=["windows"], archs=["aarch64"]) def test_static_init_during_load(self): ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/98690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/98690 >From aee177b86c61ab8a3ad1b2c4d1fa32239875e10f Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Tue, 23 Apr 2024 05:44:49 + Subject: [PATCH] [LLDB] Make 'process load' take remote os path delimiter into account Currently, if we execute 'process load' with remote debugging, it uses host's path delimiter to lookup files on target machine. If we run remote debugging of Linux target on Windows and execute 'process load C:\foo\a.so', lldb-server tries to load \foo\a.so instead of /foo/a.so. It affects several API tests. This commit fixes that error. Also, it contains minor fixes for TestLoadUnload.py for testing on Windows host and Linux target. --- lldb/source/Commands/CommandObjectProcess.cpp| 4 +++- .../API/functionalities/load_unload/TestLoadUnload.py| 9 ++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 3587a8f529e4a..8685d5761557b 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -950,11 +950,13 @@ class CommandObjectProcessLoad : public CommandObjectParsed { ExecutionContext *execution_context) override { Status error; const int short_option = m_getopt_table[option_idx].val; + ArchSpec arch = + execution_context->GetProcessPtr()->GetSystemArchitecture(); switch (short_option) { case 'i': do_install = true; if (!option_arg.empty()) - install_path.SetFile(option_arg, FileSpec::Style::native); + install_path.SetFile(option_arg, arch.GetTriple()); break; default: llvm_unreachable("Unimplemented option"); diff --git a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py index e52fb8c87377f..d0246f9491d48 100644 --- a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py +++ b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py @@ -62,7 +62,7 @@ def copy_shlibs_to_remote(self, hidden_dir=False): for f in shlibs: err = lldb.remote_platform.Put( lldb.SBFileSpec(self.getBuildArtifact(f)), -lldb.SBFileSpec(os.path.join(wd, f)), +lldb.SBFileSpec(lldbutil.join_remote_paths(wd, f)), ) if err.Fail(): raise RuntimeError( @@ -71,7 +71,7 @@ def copy_shlibs_to_remote(self, hidden_dir=False): if hidden_dir: shlib = "libloadunload_d." + ext hidden_dir = os.path.join(wd, "hidden") -hidden_file = os.path.join(hidden_dir, shlib) +hidden_file = lldbutil.join_remote_paths(hidden_dir, shlib) err = lldb.remote_platform.MakeDirectory(hidden_dir) if err.Fail(): raise RuntimeError( @@ -405,8 +405,11 @@ def run_step_over_load(self): # We can't find a breakpoint location for d_init before launching because # executable dependencies are resolved relative to the debuggers PWD. Bug? +# The remote lldb server resolves the executable dependencies correctly. @expectedFailureAll( -oslist=["freebsd", "linux", "netbsd"], triple=no_match("aarch64-.*-android") +oslist=["freebsd", "linux", "netbsd"], +triple=no_match("aarch64-.*-android"), +remote=False, ) @expectedFailureAll(oslist=["windows"], archs=["aarch64"]) def test_static_init_during_load(self): ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix TestStdCXXDisassembly test for case when tests are linked with libc++ statically (PR #98694)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/98694 The test expects 'libstdc++' or 'libc++' SO module in the module list. In case when static linking with libc++ is on by default, none of them may be present. Thus, USE_SYSTEM_STDLIB is added to ensure the presence of any of them. >From e98b2f73269ba4e8f1a980ffb2b2765d1de5f655 Mon Sep 17 00:00:00 2001 From: Vladimir Vereschaka Date: Thu, 30 May 2024 03:04:58 + Subject: [PATCH] [lldb][test] Fix TestStdCXXDisassembly test when tests are linked with libc++ statically The test expects 'libstdc++' or 'libc++' SO module in the module list. In case when static linking with libc++ is on by default, none of them may be present. Thus, USE_SYSTEM_STDLIB is added to ensure presence of any of them. --- lldb/test/API/lang/cpp/stl/Makefile | 2 ++ lldb/test/API/lang/cpp/stl/TestStdCXXDisassembly.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lldb/test/API/lang/cpp/stl/Makefile b/lldb/test/API/lang/cpp/stl/Makefile index 8b20bcb05..8534fa9b00209 100644 --- a/lldb/test/API/lang/cpp/stl/Makefile +++ b/lldb/test/API/lang/cpp/stl/Makefile @@ -1,3 +1,5 @@ CXX_SOURCES := main.cpp +USE_SYSTEM_STDLIB := 1 + include Makefile.rules diff --git a/lldb/test/API/lang/cpp/stl/TestStdCXXDisassembly.py b/lldb/test/API/lang/cpp/stl/TestStdCXXDisassembly.py index 1e1b0a4d621f0..cc46989f984b2 100644 --- a/lldb/test/API/lang/cpp/stl/TestStdCXXDisassembly.py +++ b/lldb/test/API/lang/cpp/stl/TestStdCXXDisassembly.py @@ -44,7 +44,7 @@ def test_stdcxx_disasm(self): # module is the corresponding SBModule. self.expect( -lib_stdcxx, "Libraray StdC++ is located", exe=False, substrs=["lib"] +lib_stdcxx, "Library StdC++ is located", exe=False, substrs=["lib"] ) self.runCmd("image dump symtab '%s'" % lib_stdcxx) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Fix TestStdCXXDisassembly test for case when tests are linked with libc++ statically (PR #98694)
https://github.com/dzhidzhoev converted_to_draft https://github.com/llvm/llvm-project/pull/98694 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Fix Android debugging (PR #98581)
dzhidzhoev wrote: > @dzhidzhoev Yes, #98623 fixed the ResolveExecutableModule issue, thank you! May I ask you: are there any public builders available for remote Android lldb testing? It will come in handy to know if there are any. https://github.com/llvm/llvm-project/pull/98581 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Enable static linking with libcxx for import-std-module tests (PR #98701)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/98701 --whole-archive and --allow-multiple-definition options has been added to linker flags of these import-std-module tests in order to make them pass with libcxx static linking enabled. Darwin has been excluded since it doesn't seem to build in this configuration. Also, some tests were switched from system stdlib to libcxx since the problem described in https://reviews.llvm.org/D139361 seems to be fixed. >From 47f541c99485e4970c4219044aae5c117e63865c Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Fri, 14 Jun 2024 19:00:39 + Subject: [PATCH] [lldb][test] Enable static linking with libcxx for import-std-module tests --whole-archive and --allow-multiple-definition options has been added to linker flags of these import-std-module tests in order to make them pass with libcxx static linking enabled. Darwin has been excluded since it doesn't seem to build in such configuration. Also, some tests were switched from system stdlib to libcxx since the problem described in https://reviews.llvm.org/D139361 seems to be fixed. --- .../commands/expression/import-std-module/array/Makefile | 5 + .../import-std-module/deque-dbg-info-content/Makefile| 9 ++--- .../import-std-module/list-dbg-info-content/Makefile | 9 ++--- .../import-std-module/vector-dbg-info-content/Makefile | 9 ++--- .../import-std-module/vector-of-vectors/Makefile | 5 + 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/lldb/test/API/commands/expression/import-std-module/array/Makefile b/lldb/test/API/commands/expression/import-std-module/array/Makefile index f938f7428468..b96106a55b85 100644 --- a/lldb/test/API/commands/expression/import-std-module/array/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/array/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LD_EXTRAS := -Xlinker --whole-archive -Xlinker --allow-multiple-definition +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile b/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile index 98638c56f0b9..b96106a55b85 100644 --- a/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/Makefile @@ -1,5 +1,8 @@ -# FIXME: once the expression evaluator can handle std libraries with debug -# info, change this to USE_LIBCPP=1 -USE_SYSTEM_STDLIB := 1 +USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LD_EXTRAS := -Xlinker --whole-archive -Xlinker --allow-multiple-definition +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile b/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile index 98638c56f0b9..b96106a55b85 100644 --- a/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/Makefile @@ -1,5 +1,8 @@ -# FIXME: once the expression evaluator can handle std libraries with debug -# info, change this to USE_LIBCPP=1 -USE_SYSTEM_STDLIB := 1 +USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LD_EXTRAS := -Xlinker --whole-archive -Xlinker --allow-multiple-definition +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile index 98638c56f0b9..b96106a55b85 100644 --- a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/Makefile @@ -1,5 +1,8 @@ -# FIXME: once the expression evaluator can handle std libraries with debug -# info, change this to USE_LIBCPP=1 -USE_SYSTEM_STDLIB := 1 +USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LD_EXTRAS := -Xlinker --whole-archive -Xlinker --allow-multiple-definition +endif + include Makefile.rules diff --git a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile index f938f7428468..b96106a55b85 100644 --- a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile +++ b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/Makefile @@ -1,3 +1,8 @@ USE_LIBCPP := 1 CXX_SOURCES := main.cpp + +ifneq ($(OS),Darwin) + LD_EXTRAS := -Xlinker --whole-archive -Xlinker --allow-multiple-definition +endif + include Makefile.rules ___ lldb-commits mailing list lldb-commits@lists.llvm
[Lldb-commits] [lldb] [lldb][test] Enable static linking with libcxx for import-std-module tests (PR #98701)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/98701 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/98690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/98690 >From 377f4ad5c61846adc7048f31d4b092c3e2a7d905 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Tue, 23 Apr 2024 05:44:49 + Subject: [PATCH] [LLDB] Make 'process load' take remote os path delimiter into account Currently, if we execute 'process load' with remote debugging, it uses host's path delimiter to lookup files on target machine. If we run remote debugging of Linux target on Windows and execute 'process load C:\foo\a.so', lldb-server tries to load \foo\a.so instead of /foo/a.so. It affects several API tests. This commit fixes that error. Also, it contains minor fixes for TestLoadUnload.py for testing on Windows host and Linux target. --- lldb/source/Commands/CommandObjectProcess.cpp | 4 +++- .../API/functionalities/load_unload/TestLoadUnload.py | 8 +--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index 3587a8f529e4a..8685d5761557b 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -950,11 +950,13 @@ class CommandObjectProcessLoad : public CommandObjectParsed { ExecutionContext *execution_context) override { Status error; const int short_option = m_getopt_table[option_idx].val; + ArchSpec arch = + execution_context->GetProcessPtr()->GetSystemArchitecture(); switch (short_option) { case 'i': do_install = true; if (!option_arg.empty()) - install_path.SetFile(option_arg, FileSpec::Style::native); + install_path.SetFile(option_arg, arch.GetTriple()); break; default: llvm_unreachable("Unimplemented option"); diff --git a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py index e52fb8c87377f..cfbfaff10de3c 100644 --- a/lldb/test/API/functionalities/load_unload/TestLoadUnload.py +++ b/lldb/test/API/functionalities/load_unload/TestLoadUnload.py @@ -62,7 +62,7 @@ def copy_shlibs_to_remote(self, hidden_dir=False): for f in shlibs: err = lldb.remote_platform.Put( lldb.SBFileSpec(self.getBuildArtifact(f)), -lldb.SBFileSpec(os.path.join(wd, f)), +lldb.SBFileSpec(lldbutil.join_remote_paths(wd, f)), ) if err.Fail(): raise RuntimeError( @@ -71,7 +71,7 @@ def copy_shlibs_to_remote(self, hidden_dir=False): if hidden_dir: shlib = "libloadunload_d." + ext hidden_dir = os.path.join(wd, "hidden") -hidden_file = os.path.join(hidden_dir, shlib) +hidden_file = lldbutil.join_remote_paths(hidden_dir, shlib) err = lldb.remote_platform.MakeDirectory(hidden_dir) if err.Fail(): raise RuntimeError( @@ -405,8 +405,10 @@ def run_step_over_load(self): # We can't find a breakpoint location for d_init before launching because # executable dependencies are resolved relative to the debuggers PWD. Bug? +# The remote lldb server resolves the executable dependencies correctly. @expectedFailureAll( -oslist=["freebsd", "linux", "netbsd"], triple=no_match("aarch64-.*-android") +oslist=["freebsd", "linux", "netbsd"], +remote=False, ) @expectedFailureAll(oslist=["windows"], archs=["aarch64"]) def test_static_init_during_load(self): ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
@@ -405,8 +405,11 @@ def run_step_over_load(self): # We can't find a breakpoint location for d_init before launching because # executable dependencies are resolved relative to the debuggers PWD. Bug? +# The remote lldb server resolves the executable dependencies correctly. @expectedFailureAll( -oslist=["freebsd", "linux", "netbsd"], triple=no_match("aarch64-.*-android") +oslist=["freebsd", "linux", "netbsd"], +triple=no_match("aarch64-.*-android"), dzhidzhoev wrote: Updated. https://github.com/llvm/llvm-project/pull/98690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Make 'process load' take remote os path delimiter into account (PR #98690)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/98690 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/99266 These changes aim to support cross-compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests pass. Chocolatey make is recommended since it is maintained better than GnuWin32 mentioned here https://lldb.llvm.org/resources/build.html#codesigning (latest GnuWin32 release dated by 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). This commit contains the following changes: 1. Better SHELL detection on Windows host. 2. Paths are turned into POSIX-style since some tests and Unix utilities use them for manipulating files. It helps to avoid compiler/linker errors because of broken paths. 3. Compiler and linker flags are sorted out to enable cross-compilation. >From 7e79d7c7e7946debc8ec3066b6cd54f3d33b7c3d Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). This commit contains following changes: 1. Better SHELL detection for make to use on Windows host. 2. Paths are turned into POSIX-style since some tests and Unix utilities use them for manipulating files. It helps to avoid compiler/linker errors because of broken paths. 3. Compiler and linker flags are cleaned up to enable cross-compilation. --- .../Python/lldbsuite/test/make/Makefile.rules | 124 +++--- .../settings/use_source_cache/Makefile| 2 +- .../breakpoint/comp_dir_symlink/Makefile | 2 +- .../inline-sourcefile/Makefile| 2 +- .../functionalities/multiple-slides/Makefile | 2 +- .../postmortem/netbsd-core/GNUmakefile| 4 +- .../step-avoids-no-debug/Makefile | 2 +- .../functionalities/valobj_errors/Makefile| 2 +- .../API/lang/cpp/operator-overload/Makefile | 2 +- .../API/lang/objcxx/class-name-clash/Makefile | 2 +- lldb/test/API/linux/add-symbols/Makefile | 2 +- lldb/test/API/linux/sepdebugsymlink/Makefile | 2 +- lldb/test/API/macosx/function-starts/Makefile | 2 +- lldb/test/API/macosx/posix_spawn/Makefile | 6 +- lldb/test/API/macosx/universal/Makefile | 8 +- lldb/test/API/macosx/universal64/Makefile | 8 +- lldb/test/API/source-manager/Makefile | 2 +- .../API/tools/lldb-dap/breakpoint/Makefile| 4 +- 18 files changed, 104 insertions(+), 74 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index d1a2de8b2478a..1474714ac4f5c 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -47,7 +47,8 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ .DEFAULT_GOAL := all #-- -# If OS is not defined, use 'uname -s' to determine the OS name. +# If OS or/and HOST_OS are not defined, use 'uname -s' to determine +# the OS name. # # GNUWin32 uname gives "windows32" or "server version windows32" while # some versions of MSYS uname return "MSYS_NT*", but most environments @@ -56,15 +57,12 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # inherited all the way down to the process spawned for make. #-- ifeq "$(HOST_OS)" "" - HOST_OS := $(shell uname -s) -endif - -ifneq (,$(findstring windows32,$(HOST_OS))) - HOST_OS := Windows_NT -endif - -ifneq (,$(findstring MSYS_NT,$(HOST_OS))) - HOST_OS := Windows_NT +HOST_OS := $(shell uname -s) +ifneq (,$(or \ +$(findstring windows32,$(HOST_OS)),\ +$(findstring MSYS_NT,$(HOST_OS +HOST_OS := Windows_NT +endif endif ifeq "$(OS)" "" @@ -80,9 +78,21 @@ endif # Also reset BUILDDIR value because "pwd" returns cygwin or msys path # which needs to be converted to windows path. #-- -ifeq "$(OS)" "Windows_NT" - SHELL = $(WINDIR)\system32\cmd.exe +path_wrapper = $(1) +ifeq "$(HOST_OS)" "Windows_NT" + # Windows 10 and later
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
dzhidzhoev wrote: > What exactly does it help with? Given that you're canonicalizing to a forward > slash, does that mean that some of the tools you use don't accept backslashes > (perhaps because they come from cygwin or the like)? As far as I understand, MinGW make, on which Chocolatey build is based, prefers \ or / slashes. Also, some include/library paths passed to clang seem to be ignored/incorrectly processed, when they have mixed path separators like C:\\..\..\foo/bar I get errors like ``` make.exe 'VPATH=C:\lldb\test\API\commands\expression\call-function' -C 'C:\build-lldb\lldb-test-build.noindex\commands\expression\call-function\TestCallBuiltinFunction.test' -I 'C:\lldb\test\API\commands\expression\call-function' -I 'C:\lldb\packages\Python\lldbsuite\test\make' -f 'C:\lldb\test\API\commands\expression\call-function\Makefile' all ARCH=aarch64 'CC="C:\build-lldb\bin\clang.exe"' SDKROOT=c:/buildslave/fs/jetson-agx-ubuntu 'CLANG_MODULE_CACHE_DIR=C://build-lldb/lldb-test-build.noindex/module-cache-clang\lldb-api' LLDB_OBJ_ROOT=C://build-lldb/tools/lldb OS=Linux HOST_OS=Windows_NT Build Command Output: make-wfix: Entering directory 'C://build-lldb/lldb-test-build.noindex/commands/expression/call-function/TestCallBuiltinFunction.test' "C:\build-lldb\bin\clang.exe" -std=c++11 -g -O0 --sysroot "c:/buildslave/fs/jetson-agx-ubuntu" -IC:\lldb\packages\Python\lldbsuite\test\make/../../../../..//include -IC://build-lldb/tools/lldb/include -IC:\lldb\test\API\commands\expression\call-function -IC:\lldb\packages\Python\lldbsuite\test\make -include C:\lldb\packages\Python\lldbsuite\test\make/test_common.h -MT main.o -MD -MP -MF main.d -c -o main.o C:\lldb\test\API\commands\expression\call-function/main.cpp "C:\build-lldb\bin\clang.exe" main.o -g -O0 --sysroot "c:/buildslave/fs/jetson-agx-ubuntu" -IC:\lldb\packages\Python\lldbsuite\test\make/../../../../..//include -IC://build-lldb/tools/lldb/include -IC:\lldb\test\API\commands\expression\call-function -IC:\lldb\packages\Python\lldbsuite\test\make -include C:\lldb\packages\Python\lldbsuite\test\make/test_common.h -o "a.out" ld.lld: error: undefined symbol: std::__1::basic_string, std::__1::allocator>::~basic_string() >>> referenced by main.cpp:34 >>> (C:\lldb\test\API\commands\expression\call-function\main.cpp:34) >>> main.o:(main) ld.lld: error: undefined symbol: std::__1::basic_string, std::__1::allocator>::__init(char const*, unsigned long) >>> referenced by string:990 (C:\build-lldb\bin\..\include\c++\v1\string:990) >>> main.o:(std::__1::basic_string>> std::__1::char_traits, >>> std::__1::allocator>::basic_string[abi:ne19]<0>(char const*)) clang: error: linker command failed with exit code 1 (use -v to see invocation) make-wfix: *** [Makefile.rules:675: a.out] Error 1 make-wfix: Leaving directory 'C://build-lldb/lldb-test-build.noindex/commands/expression/call-function/TestCallBuiltinFunction.test' ``` https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
dzhidzhoev wrote: > It may be better to split this into smaller patches, given the fragility of > this code. (Basically, one patch for each of your bullet points). I was thinking about that, but for me it looked like path_wrapper thing and cross-compilation/sdkroot fixes should have been sent in the same commit since each of them is insufficient for setting this configuration up on Windows. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -263,9 +280,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) dzhidzhoev wrote: The difference is between "$(ARCHFLAG) $(ARCH)" and "$(ARCHFLAG)$(ARCH)" In the case of Darwin, we should add space between the flag and its argument, which doesn't work on Windows x86_64, for example: ``` "D:\lldb\build-lldb-win\bin\clang.exe" -O0 -m 64 -c D:\lldb\llvm-project-mainline\lldb\test\API\functionalities\step-avoids-no-debug/without-debug.c clang: error: unknown argument: '-m' clang: error: no such file or directory: '64' ``` https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Fix cmd.exe detection on recent Windows versions (PR #99532)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/99532 Since Windows 10 the case of 'windir' env variable was changed. Such error appears without that change: ``` make: \system32\cmd.exe: Command not found Makefile.rules:628: recipe for target 'main.o' failed ``` >From 3ed6eecbb10421ada4b9e8e4355b91b21b31909b Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 18 Jul 2024 19:27:55 +0200 Subject: [PATCH] [LLDB][test] Fix cmd.exe detection on recent Windows versions. Since Windows 10 the case of 'windir' env variable was changed. Such error appears without that change: ``` make: \system32\cmd.exe: Command not found Makefile.rules:628: recipe for target 'main.o' failed ``` --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 3d562285ce9cc..4ade8c16b8e6f 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -80,8 +80,9 @@ endif # Also reset BUILDDIR value because "pwd" returns cygwin or msys path # which needs to be converted to windows path. #-- -ifeq "$(OS)" "Windows_NT" - SHELL = $(WINDIR)\system32\cmd.exe +ifeq "$(HOST_OS)" "Windows_NT" + # Windows 10 and later has the lower-case 'windir' env variable. + SHELL := $(or $(windir),$(WINDIR),C:\WINDOWS)\system32\cmd.exe BUILDDIR := $(shell echo %cd%) endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
dzhidzhoev wrote: Moved SHELL variable change to a separate commit https://github.com/llvm/llvm-project/pull/99532. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Drop OS/HOST_OS detection code from Makefile.rules (PR #99535)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/99535 Remove commands for OS/HOST_OS detection from Makefile.rules to simplify it, since logic for these variables has been implemented in `lldb/packages/Python/lldbsuite/test/lldbplatformutil.py` (https://github.com/llvm/llvm-project/commit/7021e44b2f0e11717c0d82456bad0fed4a0b48f9). >From 3125526d8eb256974ccc92650c8d3e3dfcaeeca9 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 18 Jul 2024 18:28:20 +0200 Subject: [PATCH] [LLDB][test] Drop OS/HOST_OS detection code from Makefile.rules Remove commands for OS/HOST_OS detection from Makefile.rules to simplify it, since logic for these variables has been implemented in lldb/packages/Python/lldbsuite/test/lldbplatformutil.py (https://github.com/llvm/llvm-project/commit/7021e44b2f0e11717c0d82456bad0fed4a0b48f9). --- .../Python/lldbsuite/test/make/Makefile.rules | 25 --- 1 file changed, 25 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 3d562285ce9cc..597aa94566c24 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -46,31 +46,6 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # according to variable values). .DEFAULT_GOAL := all -#-- -# If OS is not defined, use 'uname -s' to determine the OS name. -# -# GNUWin32 uname gives "windows32" or "server version windows32" while -# some versions of MSYS uname return "MSYS_NT*", but most environments -# standardize on "Windows_NT", so we'll make it consistent here. -# When running tests from Visual Studio, the environment variable isn't -# inherited all the way down to the process spawned for make. -#-- -ifeq "$(HOST_OS)" "" - HOST_OS := $(shell uname -s) -endif - -ifneq (,$(findstring windows32,$(HOST_OS))) - HOST_OS := Windows_NT -endif - -ifneq (,$(findstring MSYS_NT,$(HOST_OS))) - HOST_OS := Windows_NT -endif - -ifeq "$(OS)" "" - OS := $(HOST_OS) -endif - #-- # If OS is Windows, force SHELL to be cmd # ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -56,15 +57,12 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # inherited all the way down to the process spawned for make. #-- ifeq "$(HOST_OS)" "" - HOST_OS := $(shell uname -s) -endif - -ifneq (,$(findstring windows32,$(HOST_OS))) - HOST_OS := Windows_NT -endif - -ifneq (,$(findstring MSYS_NT,$(HOST_OS))) - HOST_OS := Windows_NT +HOST_OS := $(shell uname -s) +ifneq (,$(or \ +$(findstring windows32,$(HOST_OS)),\ +$(findstring MSYS_NT,$(HOST_OS +HOST_OS := Windows_NT +endif dzhidzhoev wrote: I think that https://github.com/llvm/llvm-project/commit/7021e44b2f0e11717c0d82456bad0fed4a0b48f9 is sufficient, though I didn't want to remove that from this commit. Created https://github.com/llvm/llvm-project/pull/99535. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Drop OS/HOST_OS detection code from Makefile.rules (PR #99535)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/99535 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Fix cmd.exe detection on recent Windows versions (PR #99532)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99532 >From 17f92b90fff5132960037997b0ace4c17aaf93df Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 18 Jul 2024 19:27:55 +0200 Subject: [PATCH] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules In MinGW make, %windir% variable has a lowercase name $(windir) when launched from cmd.exe, and $(WINDIR) name when launched from MSYS2, since MSYS2 represents standard Windows environment variables in upper case. This commit makes Makefile.rules consider both run variants. --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 597aa94566c24..be3ad684dd736 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -55,8 +55,10 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ # Also reset BUILDDIR value because "pwd" returns cygwin or msys path # which needs to be converted to windows path. #-- -ifeq "$(OS)" "Windows_NT" - SHELL = $(WINDIR)\system32\cmd.exe +ifeq "$(HOST_OS)" "Windows_NT" + # MinGW make gets $(windir) variable if launched from cmd.exe + # and $(WINDIR) if launched from MSYS2. + SHELL := $(or $(windir),$(WINDIR),C:\WINDOWS)\system32\cmd.exe BUILDDIR := $(shell echo %cd%) endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules (PR #99532)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99532 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules (PR #99532)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99532 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules (PR #99532)
dzhidzhoev wrote: Sorry, the initial issue this commit resolves was identified wrongly, fixed the commit description. https://github.com/llvm/llvm-project/pull/99532 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules (PR #99532)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99532 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules (PR #99532)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99532 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Add ABI library to Makefile.rules link flags (PR #99589)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/99589 This commit fixes an undefined reference linking problem with cross-compilation and remote testing on Linux host-Linux target configuration, that occurs when libcxx is linked statically. Many tests fail with errors similar to that: ``` ERROR: test_with_run_command (TestValueObjectRecursion.ValueObjectRecursionTestCase.test_with_run_command) Test that deeply nested ValueObjects still work. -- Error when building test subject. ld.lld: error: undefined symbol: __gxx_personality_v0 >>> referenced by main.cpp >>> main.o:(DW.ref.__gxx_personality_v0) ld.lld: error: undefined symbol: __cxa_allocate_exception >>> referenced by new_helpers.cpp >>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive >>> /home/parallels/llvm-build-release/./lib/aarch64-unknown-linux-gnu/libc++.a ld.lld: error: undefined symbol: std::bad_alloc::bad_alloc() >>> referenced by new_helpers.cpp >>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive >>> /home/parallels/llvm-build-release/./lib/aarch64-unknown-linux-gnu/libc++.a ld.lld: error: undefined symbol: typeinfo for std::bad_alloc >>> referenced by new_helpers.cpp >>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive >>> /home/parallels/llvm-build-release/./lib/aarch64-unknown-linux-gnu/libc++.a >>> referenced by new_helpers.cpp >>> new_helpers.cpp.o:(std::__throw_bad_alloc()) in archive >>> /home/parallels/llvm-build-release/./lib/aarch64-unknown-linux-gnu/libc++.a ... ``` >From 029115b811c149edb316719d7735cc1b4a850c43 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Fri, 19 Jul 2024 02:14:03 +0200 Subject: [PATCH] [lldb][test] Add ABI library to Makefile.rules link flags This commit fixes an undefined reference linking problem with cross-compilation and remote testing on Linux host-Linux target configuration, that occurs when libcxx is linked statically. --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index 597aa94566c24..092632ecc3a07 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -390,7 +390,7 @@ ifeq (1,$(USE_LIBCPP)) ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) endif - LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi else ifeq "$(OS)" "Android" # Nothing to do, this is already handled in @@ -413,7 +413,7 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) $(error "SDKROOT must be set on Darwin to use the system libcxx") endif CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1 -LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ +LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ -lc++abi endif endif @@ -425,7 +425,7 @@ ifeq ($(or $(USE_LIBSTDCPP), $(USE_LIBCPP), $(USE_SYSTEM_STDLIB)),) ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) endif - LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi endif endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -432,18 +468,18 @@ ifeq (1,$(USE_LIBCPP)) ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) endif - LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi else ifeq "$(OS)" "Android" # Nothing to do, this is already handled in # Android.rules. else CXXFLAGS += -stdlib=libc++ - LDFLAGS += -stdlib=libc++ + LDFLAGS += -stdlib=libc++ -lc++abi dzhidzhoev wrote: Yes. Moved to https://github.com/llvm/llvm-project/pull/99589 for clarity. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Improve SHELL detection on Windows in Makefile.rules (PR #99532)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/99532 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From a54680b17e560460b67646622a674b574f2673b6 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). This commit contains following changes: 1. Better SHELL detection for make to use on Windows host. 2. Paths are turned into POSIX-style since some tests and Unix utilities use them for manipulating files. It helps to avoid compiler/linker errors because of broken paths. 3. Compiler and linker flags are cleaned up to enable cross-compilation. --- .../Python/lldbsuite/test/make/Makefile.rules | 72 --- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..0a885451693a2 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TA
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -296,11 +313,13 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +#Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). dzhidzhoev wrote: Fixed https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -296,11 +313,13 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +#Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) - LDFLAGS += -pthread + LDFLAGS += -lpthread dzhidzhoev wrote: Fixed https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
dzhidzhoev wrote: > > > What exactly does it help with? Given that you're canonicalizing to a > > > forward slash, does that mean that some of the tools you use don't accept > > > backslashes (perhaps because they come from cygwin or the like)? > > > > > > As far as I understand, MinGW make, on which Chocolatey build is based, > > prefers \ or / slashes. > > I don't understand this sentence. Are you saying it prefers forward slashes > or backward slashes (or uniform slashes)? > > > Also, some include/library paths passed to clang seem to be > > ignored/incorrectly processed, when they have mixed path separators like > > C:\foo/bar > > This is interesting. I'm surprised that errors are coming from llvm tools, as > the llvm path libraries treat forward and backward slashes (on windows) as > equivalent at a very low level. Could you try to reduce this to to figure out > which specific slash in the command is causing the error? I want to make sure > we're not working around a bug here... When we were setting up cross-platform build and testing config, we had a multi-screen list of errors we had to solve. Also, we were unsure about the environment in which we would run this. Therefore we decided to bulk normalize all paths and some flags. But now I see that reverting this path separator-reverting change doesn't make much difference for us, so I revoked this part of the commit for now. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From 1b2018229eb9d53a4f6cda1fb4f60229afa07367 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). --- .../Python/lldbsuite/test/make/Makefile.rules | 72 --- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..0a885451693a2 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + # Otherwise no C++ library has been specified. Use stdc++ by default. + else +USE_LIBSTDCPP := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,$(CC)))
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From 1d074bad4006134d164e96e21f9105b167212d53 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). --- .../Python/lldbsuite/test/make/Makefile.rules | 72 --- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..8d54fc7f3321e 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + # Otherwise no C++ library has been specified. Use stdc++ by default. + else +USE_SYSTEM_STDLIB := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,$(CC
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -80,9 +78,21 @@ endif # Also reset BUILDDIR value because "pwd" returns cygwin or msys path # which needs to be converted to windows path. #-- -ifeq "$(OS)" "Windows_NT" - SHELL = $(WINDIR)\system32\cmd.exe +path_wrapper = $(1) +ifeq "$(HOST_OS)" "Windows_NT" + # Windows 10 and later has the lower-case 'windir' env variable. + SHELL := $(or $(windir),$(WINDIR),C:\WINDOWS)\system32\cmd.exe BUILDDIR := $(shell echo %cd%) + + ifneq (,$(filter $(OS), Linux Android)) dzhidzhoev wrote: Removed this from the PR, together with path_wrapper thing. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -418,11 +437,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ -lc++abi + # Otherwise no C++ library has been specified. Use stdc++ by default. + else +USE_LIBSTDCPP := 1 dzhidzhoev wrote: Changed it to USE_SYSTEM_STDLIB https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -456,21 +492,15 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1 LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ +else +ifneq (,$(findstring clang,$(CC))) +# Force clang looking for the gcc's headers at specific rootfs folder. +CXXFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS) dzhidzhoev wrote: Agreed https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From 1d074bad4006134d164e96e21f9105b167212d53 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH 1/2] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). --- .../Python/lldbsuite/test/make/Makefile.rules | 72 --- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..8d54fc7f3321e 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + # Otherwise no C++ library has been specified. Use stdc++ by default. + else +USE_SYSTEM_STDLIB := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) dzhidzhoev wrote: It will allow adding extra flags to LDFLAGS via cmake (`-DLLDB_TEST_USER_ARGS="--env;LDFLAGS=-flag"`) without losing things automatically added to CFLAGS https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -456,21 +492,15 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1 LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ +else +ifneq (,$(findstring clang,$(CC))) +# Force clang looking for the gcc's headers at specific rootfs folder. +CXXFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS) dzhidzhoev wrote: > This still forces the usage of libstdc++ on windows, right? Could we just > pass nothing here and let clang use its default? Actually, it's ignored on Windows. We have some problems without that line during cross-compiling, but I think it's due to missing $(GCC_TOOLCHAIN_FLAGS) content, not stdlib selection. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + # Otherwise no C++ library has been specified. Use stdc++ by default. + else +USE_SYSTEM_STDLIB := 1 + endif +endif dzhidzhoev wrote: Thanks! https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -378,11 +387,28 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +# No C++ library has been specifieed. Use libstdc++ by default. +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit request was made, but we have paths to a custom libcxx, use + # them. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + # Otherwise no C++ library has been specified. Use stdc++ by default. + else +USE_SYSTEM_STDLIB := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,$(CC))) - CXXFLAGS += -stdlib=libstdc++ - LDFLAGS += -stdlib=libstdc++ +# Force clang looking for the gcc's headers at specific rootfs folder. dzhidzhoev wrote: Fixed. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From 0e513196fcf3cbcd13b7af941c4afc1ddf8be227 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). Co-authored-by: Pavel Labath --- .../Python/lldbsuite/test/make/Makefile.rules | 70 --- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..8f30e1d292f70 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,26 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit C++ library request was made, but we have paths to a custom libcxx, use + # them. Otherwise, use the system library by default. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + else +USE_SYSTEM_STDLIB := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,$(CC))) - CXXFLAGS += -stdlib=libstdc
[Lldb-commits] [lldb] [lldb][test] Support remote run of Shell tests (PR #95986)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/95986 >From 11cabeefae5c7ecd44543eb8bfbba02430165a93 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Fri, 31 May 2024 21:39:56 + Subject: [PATCH] [lldb][test] Support remote run of Shell tests 1. This commit adds LLDB_TEST_PLATFORM_URL, LLDB_TEST_SYSROOT, LLDB_TEST_PLATFORM_WORKING_DIR, LLDB_SHELL_TESTS_DISABLE_REMOTE cmake flags to pass arguments for cross-compilation and remote running of both Shell&API tests. 2. To run Shell tests remotely, it adds 'platform select' and 'platform connect' commands to %lldb substitution. 3. 'remote-linux' feature added to lit to disable tests failing with remote execution. 4. A separate working directory is assigned to each test to avoid conflicts during parallel test execution. 5. Remote Shell testing is run only when LLDB_TEST_SYSROOT is set for building test sources. Recommended compiler for that is Clang. --- lldb/docs/resources/test.rst | 20 +++--- lldb/test/API/lit.cfg.py | 7 ++ lldb/test/API/lit.site.cfg.py.in | 3 + lldb/test/CMakeLists.txt | 1 + .../test/Shell/Settings/TestEchoCommands.test | 2 + lldb/test/Shell/Target/target-label.test | 20 +++--- lldb/test/Shell/helper/toolchain.py | 67 ++- lldb/test/Shell/lit.cfg.py| 9 ++- lldb/test/Shell/lit.site.cfg.py.in| 7 +- 9 files changed, 112 insertions(+), 24 deletions(-) diff --git a/lldb/docs/resources/test.rst b/lldb/docs/resources/test.rst index 382e42bf22b10..23b6ab03559d4 100644 --- a/lldb/docs/resources/test.rst +++ b/lldb/docs/resources/test.rst @@ -592,15 +592,17 @@ test suite, but there are two things to have in mind: multiple connections. For more information on how to setup remote debugging see the Remote debugging page. 2. You must tell the test-suite how to connect to the remote system. This is - achieved using the ``--platform-name``, ``--platform-url`` and - ``--platform-working-dir`` parameters to ``dotest.py``. These parameters - correspond to the platform select and platform connect LLDB commands. You - will usually also need to specify the compiler and architecture for the - remote system. - -Currently, running the remote test suite is supported only with ``dotest.py`` (or -dosep.py with a single thread), but we expect this issue to be addressed in the -near future. + achieved using the ``LLDB_TEST_PLATFORM_URL``, ``LLDB_TEST_PLATFORM_WORKING_DIR`` + flags to cmake, and ``--platform-name`` parameter to ``dotest.py``. + These parameters correspond to the platform select and platform connect + LLDB commands. You will usually also need to specify the compiler and + architecture for the remote system. +3. Remote Shell tests execution is currently supported only for Linux target + platform. It's triggered when ``LLDB_TEST_SYSROOT`` is provided for building + test sources. It can be disabled by setting ``LLDB_SHELL_TESTS_DISABLE_REMOTE=On``. + Shell tests are not guaranteed to pass against remote target if the compiler + being used is other than Clang. + Running tests in QEMU System Emulation Environment `` diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py index 96520c7c82624..6a0a1b0a76675 100644 --- a/lldb/test/API/lit.cfg.py +++ b/lldb/test/API/lit.cfg.py @@ -303,6 +303,13 @@ def delete_module_cache(path): # In particular, (1) is visited at the top of the file, since the script # derives other information from it. +if is_configured("lldb_platform_url"): +dotest_cmd += ["--platform-url", config.lldb_platform_url] +if is_configured("lldb_platform_working_dir"): +dotest_cmd += ["--platform-working-dir", config.lldb_platform_working_dir] +if is_configured("cmake_sysroot"): +dotest_cmd += ["--sysroot", config.cmake_sysroot] + if is_configured("dotest_user_args_str"): dotest_cmd.extend(config.dotest_user_args_str.split(";")) diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in index 8b2d09ae41cd2..db3cd2971f347 100644 --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -24,6 +24,9 @@ config.lua_executable = "@Lua_EXECUTABLE@" config.lua_test_entry = "TestLuaAPI.py" config.dotest_common_args_str = lit_config.substitute("@LLDB_TEST_COMMON_ARGS@") config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@") +config.lldb_platform_url = lit_config.substitute("@LLDB_TEST_PLATFORM_URL@") +config.lldb_platform_working_dir = lit_config.substitute("@LLDB_TEST_PLATFORM_WORKING_DIR@") +config.cmake_sysroot = lit_config.substitute("@LLDB_TEST_SYSROOT@" or "@DEFAULT_SYSROOT@") config.lldb_enable_python = @LLDB_ENABLE_PYTHON@ config.dotest_lit_args_str = None config.enabled_plugins = [] diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.
[Lldb-commits] [lldb] [lldb][test] Support remote run of Shell tests (PR #95986)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/95986 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Support remote run of Shell tests (PR #95986)
dzhidzhoev wrote: Updated: Added documentation lines. Added TEST_ prefix to cmake variables to indicate they doesn't affect lldb build (as proposed here https://discourse.llvm.org/t/rfc-lldb-support-remote-run-of-shell-tests/80072/5) Shell tests remote execution can now be disabled with `-DLLDB_SHELL_TESTS_DISABLE_REMOTE=On` (they should attempt to execute locally this way). To trigger remote execution, LLDB_TEST_PLATFORM_URL as well as LLDB_TEST_SYSROOT must be set. https://github.com/llvm/llvm-project/pull/95986 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Mark TestAssertMessages.py as passing remotely on Linux target. (PR #100586)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/100586 It has been markad as XFAIL here de2ddc8f3146bd87152ea86b533541039541efe1, but I haven't found the reason for that, and apparently, it passes against the Linux target. >From ea3f6bfd82e71b0c831fa438bb12f11955fc40ab Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 18 Jul 2024 20:30:38 +0200 Subject: [PATCH] [lldb][test] Mark TestAssertMessages.py as passing remotely on Linux target. It has been markad as XFAIL here de2ddc8f3146bd87152ea86b533541039541efe1, but I haven't found an explanation why, and it passes against Linux target. --- lldb/test/API/assert_messages_test/TestAssertMessages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/test/API/assert_messages_test/TestAssertMessages.py b/lldb/test/API/assert_messages_test/TestAssertMessages.py index 3c54b9379d4c1..27d18e5ae99b9 100644 --- a/lldb/test/API/assert_messages_test/TestAssertMessages.py +++ b/lldb/test/API/assert_messages_test/TestAssertMessages.py @@ -23,7 +23,7 @@ def assert_expect_fails_with(self, cmd, expect_args, expected_msg): else: self.fail("Initial expect should have raised AssertionError!") -@expectedFailureAll(remote=True) +@expectedFailureAll(oslist=no_match(["linux"]), remote=True) def test_createTestTarget(self): try: self.createTestTarget("doesnt_exist") ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Mark TestAssertMessages.py as passing remotely on Linux target. (PR #100586)
https://github.com/dzhidzhoev converted_to_draft https://github.com/llvm/llvm-project/pull/100586 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Mark TestAssertMessages.py as passing remotely on Linux target. (PR #100586)
https://github.com/dzhidzhoev ready_for_review https://github.com/llvm/llvm-project/pull/100586 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From 4699a3b956b6684ca811baa50a13c6235f24be3f Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). Co-authored-by: Pavel Labath --- .../Python/lldbsuite/test/make/Makefile.rules | 68 --- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..35dd93942c7d4 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,26 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit C++ library request was made, but we have paths to a custom libcxx, use + # them. Otherwise, use the system library by default. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + else +USE_SYSTEM_STDLIB := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,$(CC))) - CXXFLAGS += -stdlib=libstdc
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -456,21 +492,15 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1 LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ +else +ifneq (,$(findstring clang,$(CC))) +# Force clang looking for the gcc's headers at specific rootfs folder. +CXXFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS) dzhidzhoev wrote: > This still forces the usage of libstdc++ on windows, right? Could we just > pass nothing here and let clang use its default? Sorry, that was too early. We still need this flag. It is ignored for Windows target, but clang tries to pass -lc++ to linker in case of Linux target if -lstdc++ is not specified, and ld.lld fails to find it (since it's not present in my sysroot). https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Mark TestAssertMessages.py as passing remotely on Linux target. (PR #100586)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/100586 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Remove decorator from XPASSes x86/Windows (PR #100628)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/100628 This patch remove XFAIL decorator from tests which are passing on x86 Windows. Corresponding XFAILs for AArch64 were removed here 7daa9a9b40a22. >From 4d606e2b6991d382ee1ee688a86b2154cb70cb66 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Thu, 25 Jul 2024 12:17:25 +0200 Subject: [PATCH] [LLDB] Remove decorator from XPASSes x86/Windows This patch remove XFAIL decorator from tests which are passing on x86 Windows. Corresponding XFAILs for AArch64 were removed here 7daa9a9b40a22. --- .../TestClassTemplateNonTypeParameterPack.py | 3 --- .../TestClassTemplateTypeParameterPack.py | 3 --- 2 files changed, 6 deletions(-) diff --git a/lldb/test/API/lang/cpp/class-template-non-type-parameter-pack/TestClassTemplateNonTypeParameterPack.py b/lldb/test/API/lang/cpp/class-template-non-type-parameter-pack/TestClassTemplateNonTypeParameterPack.py index 9e484e0132c83..730537da2fccf 100644 --- a/lldb/test/API/lang/cpp/class-template-non-type-parameter-pack/TestClassTemplateNonTypeParameterPack.py +++ b/lldb/test/API/lang/cpp/class-template-non-type-parameter-pack/TestClassTemplateNonTypeParameterPack.py @@ -5,9 +5,6 @@ class TestCaseClassTemplateNonTypeParameterPack(TestBase): -@expectedFailureAll( -oslist=["windows"], archs=["i[3-6]86", "x86_64"] -) # Fails to read memory from target. @no_debug_info_test def test(self): self.build() diff --git a/lldb/test/API/lang/cpp/class-template-type-parameter-pack/TestClassTemplateTypeParameterPack.py b/lldb/test/API/lang/cpp/class-template-type-parameter-pack/TestClassTemplateTypeParameterPack.py index 102c00dc603df..1ed643e6dd85c 100644 --- a/lldb/test/API/lang/cpp/class-template-type-parameter-pack/TestClassTemplateTypeParameterPack.py +++ b/lldb/test/API/lang/cpp/class-template-type-parameter-pack/TestClassTemplateTypeParameterPack.py @@ -5,9 +5,6 @@ class TestCaseClassTemplateTypeParameterPack(TestBase): -@expectedFailureAll( -oslist=["windows"], archs=["i[3-6]86", "x86_64"] -) # Fails to read memory from target. @no_debug_info_test def test(self): self.build() ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Remove decorator from XPASSes x86/Windows (PR #100628)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/100628 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] XFAIL already failing Shell tests (PR #100476)
@@ -1,3 +1,4 @@ +# XFAIL: target=x86_64-{{.*}}-windows{{.*}} dzhidzhoev wrote: ``` PASS: lldb-shell :: Settings/TestEchoCommands.test (315 of 543) Exit Code: 0 Command Output (stdout): -- # RUN: at line 1 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet -x -b -o 'settings set interpreter.echo-comment-commands true' -s C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\Settings/Inputs/EchoCommandsAll.out # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' -x -b -o 'settings set interpreter.echo-comment-commands true' -s 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in' # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsAll.out' # note: command had no output on stdout or stderr # RUN: at line 2 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet -x -b -o 'settings set interpreter.echo-comment-commands false' -s C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\Settings/Inputs/EchoCommandsNoComments.out # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' -x -b -o 'settings set interpreter.echo-comment-commands false' -s 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in' # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsNoComments.out' # note: command had no output on stdout or stderr # RUN: at line 3 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet -x -b -o 'settings set interpreter.echo-commands false' -s C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\Settings/Inputs/EchoCommandsNone.out # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' -x -b -o 'settings set interpreter.echo-commands false' -s 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in' # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsNone.out' # note: command had no output on stdout or stderr # RUN: at line 7 echo start >C:\build-lldb-native\tools\lldb\test\Shell\Settings\Output\TestEchoCommands.test.tmp.file # executed command: echo start # note: command had no output on stdout or stderr # RUN: at line 8 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet -x -b --source-quietly -s C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in >>C:\build-lldb-native\tools\lldb\test\Shell\Settings\Output\TestEchoCommands.test.tmp.file # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' -x -b --source-quietly -s 'C:\lldb\test\Shell\Settings/Inputs/EchoCommandsTest.in' # note: command had no output on stdout or stderr # RUN: at line 9 echo done >>C:\build-lldb-native\tools\lldb\test\Shell\Settings\Output\TestEchoCommands.test.tmp.file # executed command: echo done # note: command had no output on stdout or stderr # RUN: at line 10 c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\Settings/Inputs/EchoCommandsQuiet.out https://github.com/llvm/llvm-project/pull/100476 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] XFAIL already failing Shell tests (PR #100476)
@@ -1,5 +1,7 @@ // clang-format off +// XFAIL: target=x86_64-{{.*}}-windows{{.*}} dzhidzhoev wrote: As far as I understand, NativePDB tests only run for Windows host+Windows target, contrary to the tests from the PDB folder which we managed to run on Linux target as part of our effort here https://discourse.llvm.org/t/rfc-lldb-support-remote-run-of-shell-tests/80072/10. It's surprising that they didn't pass with your config ``` PASS: lldb-shell :: SymbolFile/NativePDB/stack_unwinding01.cpp (533 of 543) Exit Code: 0 Command Output (stdout): -- # RUN: at line 4 'C:\Python312\python.exe' C:\lldb\test\Shell\helper\build.py --compiler=any --arch=64 --tools-dir=C:/build-lldb-native/./bin --libs-dir=C:/build-lldb-native/./lib --compiler=clang-cl --nodefaultlib -o C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\NativePDB\Output\stack_unwinding01.cpp.tmp.exe -- C:\lldb\test\Shell\SymbolFile\NativePDB\stack_unwinding01.cpp # executed command: 'C:\Python312\python.exe' 'C:\lldb\test\Shell\helper\build.py' --compiler=any --arch=64 --tools-dir=C:/build-lldb-native/./bin --libs-dir=C:/build-lldb-native/./lib --compiler=clang-cl --nodefaultlib -o 'C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\NativePDB\Output\stack_unwinding01.cpp.tmp.exe' -- 'C:\lldb\test\Shell\SymbolFile\NativePDB\stack_unwinding01.cpp' # .---command stdout # | Cleaning stack_unwinding01.ilk # | Cleaning stack_unwinding01.cpp.tmp.exe-stack_unwinding01.obj # | Cleaning stack_unwinding01.cpp.tmp.pdb # | Cleaning stack_unwinding01.cpp.tmp.exe # | # | # | # | compiling stack_unwinding01.cpp -> stack_unwinding01.cpp.tmp.exe-stack_unwinding01.obj # | STDOUT: # | # | # | # | # | linking stack_unwinding01.cpp.tmp.exe-stack_unwinding01.obj -> stack_unwinding01.cpp.tmp.exe # | STDOUT: # | # `- # RUN: at line 5 env LLDB_USE_NATIVE_PDB_READER=1 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet -f C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\NativePDB\Output\stack_unwinding01.cpp.tmp.exe -s C:\lldb\test\Shell\SymbolFile\NativePDB/Inputs/stack_unwinding01.lldbinit 2>&1 | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\SymbolFile\NativePDB\stack_unwinding01.cpp # executed command: env LLDB_USE_NATIVE_PDB_READER=1 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' -f 'C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\NativePDB\Output\stack_unwinding01.cpp.tmp.exe' -s 'C:\lldb\test\Shell\SymbolFile\NativePDB/Inputs/stack_unwinding01.lldbinit' # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\SymbolFile\NativePDB\stack_unwinding01.cpp' # note: command had no output on stdout or stderr ``` https://github.com/llvm/llvm-project/pull/100476 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] XFAIL already failing Shell tests (PR #100476)
@@ -1,3 +1,4 @@ +# XFAIL: target=x86_64-{{.*}}-windows{{.*}} dzhidzhoev wrote: Interestingly, this test is green on our Windows native CI. It uses cmd.exe. Here's the log: ``` PASS: lldb-shell :: Driver/TestConvenienceVariables.test (88 of 543) Exit Code: 0 Command Output (stdout): -- # RUN: at line 2 mkdir -p C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestConvenienceVariables.test.tmp # executed command: mkdir -p 'C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestConvenienceVariables.test.tmp' # note: command had no output on stdout or stderr # RUN: at line 3 'C:\Python312\python.exe' C:\lldb\test\Shell\helper\build.py --compiler=any --arch=64 --tools-dir=C:/build-lldb-native/./bin --libs-dir=C:/build-lldb-native/./lib C:\lldb\test\Shell\Driver/Inputs/hello.cpp -o C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestConvenienceVariables.test.tmp/target.out # executed command: 'C:\Python312\python.exe' 'C:\lldb\test\Shell\helper\build.py' --compiler=any --arch=64 --tools-dir=C:/build-lldb-native/./bin --libs-dir=C:/build-lldb-native/./lib 'C:\lldb\test\Shell\Driver/Inputs/hello.cpp' -o 'C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestConvenienceVariables.test.tmp/target.out' # .---command stdout # | Cleaning hello.ilk # | Cleaning target.out-hello.obj # | Cleaning target.pdb # | Cleaning target.out # | # | # | # | compiling hello.cpp -> target.out-hello.obj # | STDOUT: # | # | # | # | # | linking target.out-hello.obj -> target.out # | STDOUT: # | # `- # RUN: at line 4 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestConvenienceVariables.test.tmp/target.out -s C:\lldb\test\Shell\Driver/Inputs/convenience.in -o quit | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\Driver\TestConvenienceVariables.test # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' 'C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestConvenienceVariables.test.tmp/target.out' -s 'C:\lldb\test\Shell\Driver/Inputs/convenience.in' -o quit # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\Driver\TestConvenienceVariables.test' # note: command had no output on stdout or stderr -- ``` However, I'm unsure if the quotes are printed in log the same way they are passed to cmd. https://github.com/llvm/llvm-project/pull/100476 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] XFAIL already failing Shell tests (PR #100476)
@@ -1,3 +1,4 @@ +# XFAIL: target=x86_64-{{.*}}-windows{{.*}} # Make sure lldb can handle filenames with single quotes in them. # RUN: %clang_host %p/Inputs/hello.c -g -o "%t-'pat" dzhidzhoev wrote: The same as for TestConvenienceVariables.test: ``` PASS: lldb-shell :: Driver/TestSingleQuote.test (75 of 543) Exit Code: 0 Command Output (stdout): -- # RUN: at line 2 c:\build-lldb-native\bin\clang.exe --target=specify-a-target-or-use-a-_host-substitution --target=x86_64-pc-windows-msvc -fmodules-cache-path=C:/build-lldb-native/lldb-test-build.noindex/module-cache-clang\lldb-shell C:\lldb\test\Shell\Driver/Inputs/hello.c -g -o "C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestSingleQuote.test.tmp-'pat" # executed command: 'c:\build-lldb-native\bin\clang.exe' --target=specify-a-target-or-use-a-_host-substitution --target=x86_64-pc-windows-msvc '-fmodules-cache-path=C:/build-lldb-native/lldb-test-build.noindex/module-cache-clang\lldb-shell' 'C:\lldb\test\Shell\Driver/Inputs/hello.c' -g -o 'C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestSingleQuote.test.tmp-'"'"'pat' # .---command stderr # | clang: warning: argument unused during compilation: '-fmodules-cache-path=C:/build-lldb-native/lldb-test-build.noindex/module-cache-clang\lldb-shell' [-Wunused-command-line-argument] # `- # RUN: at line 3 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet -s C:\lldb\test\Shell\Driver\TestSingleQuote.test "C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestSingleQuote.test.tmp-'pat" | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\Driver\TestSingleQuote.test # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' -s 'C:\lldb\test\Shell\Driver\TestSingleQuote.test' 'C:\build-lldb-native\tools\lldb\test\Shell\Driver\Output\TestSingleQuote.test.tmp-'"'"'pat' # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\Driver\TestSingleQuote.test' # note: command had no output on stdout or stderr -- ``` https://github.com/llvm/llvm-project/pull/100476 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] XFAIL already failing Shell tests (PR #100476)
@@ -1,3 +1,5 @@ +# XFAIL: target=x86_64-{{.*}}-windows{{.*}} dzhidzhoev wrote: We have it green as well ``` PASS: lldb-shell :: SymbolFile/DWARF/x86/dead-code-filtering.yaml (389 of 543) Exit Code: 0 Command Output (stdout): -- # RUN: at line 1 c:\build-lldb-native\bin\yaml2obj.exe C:\lldb\test\Shell\SymbolFile\DWARF\x86\dead-code-filtering.yaml > C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\DWARF\x86\Output\dead-code-filtering.yaml.tmp # executed command: 'c:\build-lldb-native\bin\yaml2obj.exe' 'C:\lldb\test\Shell\SymbolFile\DWARF\x86\dead-code-filtering.yaml' # note: command had no output on stdout or stderr # RUN: at line 2 c:\build-lldb-native\bin\lldb-test.exe symbols C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\DWARF\x86\Output\dead-code-filtering.yaml.tmp | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\SymbolFile\DWARF\x86\dead-code-filtering.yaml --check-prefix=TEST # executed command: 'c:\build-lldb-native\bin\lldb-test.exe' symbols 'C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\DWARF\x86\Output\dead-code-filtering.yaml.tmp' # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\SymbolFile\DWARF\x86\dead-code-filtering.yaml' --check-prefix=TEST # note: command had no output on stdout or stderr # RUN: at line 3 c:\build-lldb-native\bin\lldb.exe --no-lldbinit -S C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\DWARF\x86\Output\dead-code-filtering.yaml.tmp -o "image dump line-table a.c" -o "image lookup -n _start" -o "image lookup -n f" -o exit | c:\build-lldb-native\bin\filecheck.exe C:\lldb\test\Shell\SymbolFile\DWARF\x86\dead-code-filtering.yaml # executed command: 'c:\build-lldb-native\bin\lldb.exe' --no-lldbinit -S 'C:/build-lldb-native/tools/lldb\test\Shell\lit-lldb-init-quiet' 'C:\build-lldb-native\tools\lldb\test\Shell\SymbolFile\DWARF\x86\Output\dead-code-filtering.yaml.tmp' -o 'image dump line-table a.c' -o 'image lookup -n _start' -o 'image lookup -n f' -o exit # note: command had no output on stdout or stderr # executed command: 'c:\build-lldb-native\bin\filecheck.exe' 'C:\lldb\test\Shell\SymbolFile\DWARF\x86\dead-code-filtering.yaml' # note: command had no output on stdout or stderr -- ``` https://github.com/llvm/llvm-project/pull/100476 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB] Remove decorator from XPASSes x86/Windows (PR #100628)
https://github.com/dzhidzhoev closed https://github.com/llvm/llvm-project/pull/100628 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] Fix XFAIL and XPASS on LLDB API tests (PR #100477)
@@ -12,6 +12,7 @@ class MultipleSlidesTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True +@expectedFailureAll(oslist=["windows"], archs=["x86_64"]) dzhidzhoev wrote: Could you provide a failure log for this? It passes on our CI (Windows native x86_64). ``` PASS: lldb-api :: functionalities/multiple-slides/TestMultipleSlides.py (530 of 1191) Script: -- C:/Python312/python.exe C:/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env OBJCOPY=C:/build-lldb-native/./bin/llvm-objcopy.exe --env STRIP=C:/build-lldb-native/./bin/llvm-strip.exe --env LLVM_LIBS_DIR=C:/build-lldb-native/./lib --env LLVM_INCLUDE_DIR=C:/build-lldb-native/include --env LLVM_TOOLS_DIR=C:/build-lldb-native/./bin --arch x86_64 --build-dir C:/build-lldb-native/lldb-test-build.noindex --lldb-module-cache-dir C:/build-lldb-native/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/build-lldb-native/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/build-lldb-native/./bin/lldb.exe --make c:/gl/b1/3rdpaty/bin/make-wfix.exe --compiler C:/build-lldb-native/./bin/clang.exe --dsymutil C:/build-lldb-native/./bin/dsymutil.exe --llvm-tools-dir C:/build-lldb-native/./bin --lldb-obj-root C:/build-lldb-native/tools/lldb --lldb-libs-dir C:/build-lldb-native/./lib --skip-category=watchpoint C:\lldb\test\API\functionalities\multiple-slides -p TestMultipleSlides.py -- Exit Code: 0 Command Output (stdout): -- lldb version 20.0.0git (https://gitlab-ci-token:glcbt-64_rzntyt5_udr5slklb...@gitlab.ninolab.accesssoftek.com/accesssoftek/lldb-test-scripts.git revision cbd39658b6aed4dbb66a2b775096974c9087e93d) clang revision cbd39658b6aed4dbb66a2b775096974c9087e93d llvm revision cbd39658b6aed4dbb66a2b775096974c9087e93d Skipping the following test categories: ['watchpoint', 'libc++', 'libstdcxx', 'dwo', 'dsym', 'gmodules', 'debugserver', 'objc', 'fork', 'pexpect'] -- Command Output (stderr): -- PASS: LLDB (C:\build-lldb-native\bin\clang.exe-x86_64) :: test_mulitple_slides (TestMultipleSlides.MultipleSlidesTestCase.test_mulitple_slides) -- Ran 1 test in 2.447s OK -- ``` https://github.com/llvm/llvm-project/pull/100477 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test][win][x86_64] Fix XFAIL and XPASS on LLDB API tests (PR #100477)
@@ -12,6 +12,7 @@ class MultipleSlidesTestCase(TestBase): NO_DEBUG_INFO_TESTCASE = True +@expectedFailureAll(oslist=["windows"], archs=["x86_64"]) dzhidzhoev wrote: Also, it may be worth cherry-picking this https://github.com/llvm/llvm-project/commit/58d22f1b665ca8810c4de341426247b7b5a69548 to have build commands and outputs in the log without tracing hassle. https://github.com/llvm/llvm-project/pull/100477 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [lldb][test] Add ABI library to Makefile.rules link flags (PR #99589)
dzhidzhoev wrote: > Libc++ supports a [large > number](https://github.com/llvm/llvm-project/blob/6235698f47828747d3b1b0418e547e2e4ff9138f/libcxx/cmake/Modules/HandleLibCXXABI.cmake#L85) > of configurations when in comes to the ABI library. > > I think the most common are: shared-libcxx+shared-libcxxabi (where this > change should be a no-op) and static-libcxx+static-libcxxabi (where this flag > is required to build). > > However, I also found evidence of configurations which embed the abi library > into libcxx (which would break with this flag, as `-lc++abi` will find > nothing, or the wrong library), or link the c++ library to the gnu abi > library (libsupc++, where this flag would cause duplicate definitions or > general weirdness). > > If noone is using these configurations, then I think this patch is fine. If > not, we will have to do something more elaborate. I suspect it's safe, but > lets wait a while before committing to give people a chance to notice this. Do you think it should be pushed now? https://github.com/llvm/llvm-project/pull/99589 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/99266 >From 4e8dec03681b223fa7eec05c8a5a49ef11165b18 Mon Sep 17 00:00:00 2001 From: Vladislav Dzhidzhoev Date: Mon, 15 Jul 2024 22:52:40 +0200 Subject: [PATCH] [LLDB][test] Update Makefile.rules to support Windows host+Linux target These changes are aimed to support cross compilation build on Windows host for Linux target for API tests execution. They're not final: changes will follow for refactoring and adjustments to make all tests passing. Chocolatey make is recommended to use, since it is maintained better than GnuWin32 recommended here https://lldb.llvm.org/resources/build.html#codesigning (it was updated last time in 2010) and helps to avoid problems with building tests (for example, GnuWin32 doesn't support long paths and there are some other failures with building for Linux with it). Co-authored-by: Pavel Labath --- .../Python/lldbsuite/test/make/Makefile.rules | 68 --- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..629ccee32e840 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -112,7 +112,7 @@ $(error "C compiler is not specified. Please run tests through lldb-dotest or li endif #-- -# Handle SDKROOT on Darwin +# Handle SDKROOT for the cross platform builds. #-- ifeq "$(OS)" "Darwin" @@ -120,6 +120,18 @@ ifeq "$(OS)" "Darwin" # We haven't otherwise set the SDKROOT, so set it now to macosx SDKROOT := $(shell xcrun --sdk macosx --show-sdk-path) endif +SYSROOT_FLAGS := -isysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := +else +ifneq "$(SDKROOT)" "" +SYSROOT_FLAGS := --sysroot "$(SDKROOT)" +GCC_TOOLCHAIN_FLAGS := --gcc-toolchain="$(SDKROOT)/usr" +else +# Do not set up these options if SDKROOT was not specified. +# This is a regular build in that case (or Android). +SYSROOT_FLAGS := +GCC_TOOLCHAIN_FLAGS := +endif endif #-- @@ -210,20 +222,15 @@ endif DEBUG_INFO_FLAG ?= -g CFLAGS ?= $(DEBUG_INFO_FLAG) -O0 - -ifeq "$(OS)" "Darwin" - ifneq "$(SDKROOT)" "" - CFLAGS += -isysroot "$(SDKROOT)" - endif -endif +CFLAGS += $(SYSROOT_FLAGS) ifeq "$(OS)" "Darwin" CFLAGS += $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) else CFLAGS += $(ARCHFLAG)$(ARCH) endif -CFLAGS += -I$(LLDB_BASE_DIR)include -I$(LLDB_OBJ_ROOT)/include +CFLAGS += -I$(LLDB_BASE_DIR)/include -I$(LLDB_OBJ_ROOT)/include CFLAGS += -I$(SRCDIR) -I$(THIS_FILE_DIR) ifndef NO_TEST_COMMON_H @@ -234,9 +241,9 @@ CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) # Use this one if you want to build one part of the result without debug information: ifeq "$(OS)" "Darwin" - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) -isysroot "$(SDKROOT)" + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG) $(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) else - CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) + CFLAGS_NO_DEBUG = -O0 $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS) $(SYSROOT_FLAGS) endif ifeq "$(MAKE_DWO)" "YES" @@ -267,7 +274,9 @@ endif CFLAGS += $(CFLAGS_EXTRAS) CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS) LD = $(CC) -LDFLAGS ?= $(CFLAGS) +# Copy common options to the linker flags (dwarf, arch. & etc). +# Note: we get some 'garbage' options for linker here (such as -I, --isystem & etc). +LDFLAGS += $(CFLAGS) LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS) ifeq (,$(filter $(OS), Windows_NT Android Darwin)) ifneq (,$(filter YES,$(ENABLE_THREADS))) @@ -378,11 +387,26 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif endif +ifeq (,$(filter 1, $(USE_LIBSTDCPP) $(USE_LIBCPP) $(USE_SYSTEM_STDLIB))) + # If no explicit C++ library request was made, but we have paths to a custom libcxx, use + # them. Otherwise, use the system library by default. + ifneq ($(and $(LIBCPP_INCLUDE_DIR), $(LIBCPP_LIBRARY_DIR)),) +CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(LIBCPP_INCLUDE_DIR) +ifneq "$(LIBCPP_INCLUDE_TARGET_DIR)" "" + CXXFLAGS += -cxx-isystem $(LIBCPP_INCLUDE_TARGET_DIR) +endif +LDFLAGS += -L$(LIBCPP_LIBRARY_DIR) -Wl,-rpath,$(LIBCPP_LIBRARY_DIR) -lc++ + else +USE_SYSTEM_STDLIB := 1 + endif +endif + ifeq (1,$(USE_LIBSTDCPP)) # Clang requires an extra flag: -stdlib=libstdc++ ifneq (,$(findstring clang,$(CC))) - CXXFLAGS += -stdlib=libstdc
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
@@ -456,21 +492,15 @@ ifeq (1, $(USE_SYSTEM_STDLIB)) endif CXXFLAGS += -nostdlib++ -nostdinc++ -cxx-isystem $(SDKROOT)/usr/include/c++/v1 LDFLAGS += -L$(SDKROOT)/usr/lib -Wl,-rpath,$(SDKROOT)/usr/lib -lc++ +else +ifneq (,$(findstring clang,$(CC))) +# Force clang looking for the gcc's headers at specific rootfs folder. +CXXFLAGS += -stdlib=libstdc++ $(GCC_TOOLCHAIN_FLAGS) dzhidzhoev wrote: Removed `-stdlib=libstdc++`. The problem was, that we were trying to link with in-tree libcxx not linked statically to libcxxabi, but clang driver couldn't use it without the explicit -lc++abi flag (it doesn't distinguish libcxx comilation types according to https://releases.llvm.org/6.0.0/projects/libcxx/docs/BuildingLibcxx.html#using-libcxxrt-on-linux). Adding LIBCXX_ENABLE_STATIC_ABI_LIBRARY helps. https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Update Makefile.rules to support Windows host+Linux target (PR #99266)
https://github.com/dzhidzhoev edited https://github.com/llvm/llvm-project/pull/99266 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] [LLDB][test] Provide a proper path to 'strip' utility for the LLDB API tests. (PR #100836)
https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/100836 Use llvm-strip from llvm tools dir if no path to strip is set. Tests are changed to use cmake-provided strip. This is useful for Windows host-Linux remote testing. >From 23eb3773023c669b6eee43a6242d86c1e706b3ee Mon Sep 17 00:00:00 2001 From: Vladimir Vereschaka Date: Thu, 9 May 2024 03:22:15 + Subject: [PATCH] [LLDB][test] Provide a proper path to 'strip' utility for the LLDB API tests. Use llvm-strip from llvm tools dir if no strip is set. Tests are changed to use cmake-provided strip. This is useful for Windows host-Linux remote testing. --- lldb/packages/Python/lldbsuite/test/make/Makefile.rules | 2 ++ lldb/test/API/CMakeLists.txt | 5 + lldb/test/API/functionalities/json/symbol-file/Makefile | 2 +- lldb/test/API/lang/objc/hidden-ivars/Makefile| 4 ++-- lldb/test/API/lang/objc/objc-ivar-stripped/Makefile | 2 +- lldb/test/API/lang/objc/objc-static-method-stripped/Makefile | 2 +- lldb/test/API/macosx/add-dsym/Makefile | 2 +- lldb/test/API/macosx/dyld-trie-symbols/Makefile | 2 +- lldb/test/API/tools/lldb-dap/module/Makefile | 2 +- lldb/test/API/tools/lldb-dap/terminated-event/Makefile | 2 +- 10 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules index be3ad684dd736..20b76399cbbb8 100644 --- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules +++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules @@ -39,6 +39,8 @@ MAKEFILE_RULES := $(lastword $(MAKEFILE_LIST)) THIS_FILE_DIR := $(shell dirname $(MAKEFILE_RULES)) LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../ +STRIP ?= strip + # The test harness invokes the test Makefiles with an explicit 'all' # target, but its handy to be able to recursively call this Makefile # without specifying a goal. You almost certainly want to build 'all', diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt index 27f285230cafa..42646484a755e 100644 --- a/lldb/test/API/CMakeLists.txt +++ b/lldb/test/API/CMakeLists.txt @@ -89,6 +89,11 @@ else() --env OBJCOPY=${LLVM_TOOLS_BINARY_DIR}/llvm-objcopy${CMAKE_EXECUTABLE_SUFFIX}) endif() +if ("${CMAKE_STRIP}" STREQUAL "") + set(CMAKE_STRIP "${LLVM_TOOLS_BINARY_DIR}/llvm-strip${CMAKE_EXECUTABLE_SUFFIX}" CACHE PATH "llvm-strip tool") +endif() +list(APPEND LLDB_TEST_COMMON_ARGS_VAR --env STRIP=${CMAKE_STRIP}) + if (NOT "${LLDB_LIT_TOOLS_DIR}" STREQUAL "") if (NOT EXISTS "${LLDB_LIT_TOOLS_DIR}") message(WARNING "LLDB_LIT_TOOLS_DIR ${LLDB_LIT_TOOLS_DIR} does not exist.") diff --git a/lldb/test/API/functionalities/json/symbol-file/Makefile b/lldb/test/API/functionalities/json/symbol-file/Makefile index aff841c364299..13bc164582eee 100644 --- a/lldb/test/API/functionalities/json/symbol-file/Makefile +++ b/lldb/test/API/functionalities/json/symbol-file/Makefile @@ -3,6 +3,6 @@ C_SOURCES := main.c all: stripped.out stripped.out : a.out - strip a.out -o stripped.out + $(STRIP) a.out -o stripped.out include Makefile.rules diff --git a/lldb/test/API/lang/objc/hidden-ivars/Makefile b/lldb/test/API/lang/objc/hidden-ivars/Makefile index 283e8a118fb16..c94c0dee1b9ce 100644 --- a/lldb/test/API/lang/objc/hidden-ivars/Makefile +++ b/lldb/test/API/lang/objc/hidden-ivars/Makefile @@ -14,8 +14,8 @@ endif stripped: a.out libInternalDefiner.dylib mkdir stripped - strip -Sx a.out -o stripped/a.out - strip -Sx libInternalDefiner.dylib -o stripped/libInternalDefiner.dylib + $(STRIP) -Sx a.out -o stripped/a.out + $(STRIP) -Sx libInternalDefiner.dylib -o stripped/libInternalDefiner.dylib ifneq "$(CODESIGN)" "" $(CODESIGN) -fs - stripped/a.out endif diff --git a/lldb/test/API/lang/objc/objc-ivar-stripped/Makefile b/lldb/test/API/lang/objc/objc-ivar-stripped/Makefile index 8b63215d6d9da..eed66d2a965d1 100644 --- a/lldb/test/API/lang/objc/objc-ivar-stripped/Makefile +++ b/lldb/test/API/lang/objc/objc-ivar-stripped/Makefile @@ -6,7 +6,7 @@ all:a.out.stripped include Makefile.rules a.out.stripped: a.out.dSYM - strip -o a.out.stripped a.out + $(STRIP) -o a.out.stripped a.out ifneq "$(CODESIGN)" "" $(CODESIGN) -fs - a.out.stripped endif diff --git a/lldb/test/API/lang/objc/objc-static-method-stripped/Makefile b/lldb/test/API/lang/objc/objc-static-method-stripped/Makefile index ed312938c9cd1..4936553c56f7c 100644 --- a/lldb/test/API/lang/objc/objc-static-method-stripped/Makefile +++ b/lldb/test/API/lang/objc/objc-static-method-stripped/Makefile @@ -4,7 +4,7 @@ LD_EXTRAS := -lobjc -framework Foundation default:a.out.stripped a.out.stripped: a.out.dSYM - strip -o a.out.stripped a.out + $(STRIP) -o a.out.stripped a.out ln -sf a.ou