[Lldb-commits] [clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)

2024-05-31 Thread Vladimir Vereschaka via lldb-commits

vvereschaka wrote:

Hi @Endilll ,

these changes break MSVC build of the projects including LLDB. The `cl` 
compiler gets unsupported gcc/clang options, such as 
`-Wno-deprecated-declarations`, `-Wno-unknown-pragmas` and 
`-Wno-strict-aliasing`, and gets failed because of it.

Here is the command line:
```
 [267/5832] Building CXX object 
tools\lldb\utils\TableGen\CMakeFiles\lldb-tblgen.dir\LLDBOptionDefEmitter.cpp.obj
FAILED: 
tools/lldb/utils/TableGen/CMakeFiles/lldb-tblgen.dir/LLDBOptionDefEmitter.cpp.obj
 
ccache 
C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1439~1.335\bin\Hostx64\x64\cl.exe
  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 
-D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-IC:\path-to-build-dir\build-lldb\tools\lldb\utils\TableGen 
-IC:\path-to-build-dir\lldb\utils\TableGen -IC:\path-to-build-dir\lldb\include 
-IC:\path-to-build-dir\build-lldb\tools\lldb\include 
-IC:\path-to-build-dir\build-lldb\include -IC:\path-to-build-dir\llvm\include 
-IC:\Python312\include -IC:\path-to-build-dir\llvm\..\clang\include 
-IC:\path-to-build-dir\build-lldb\tools\lldb\..\clang\include -D__OPTIMIZE__ 
/Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 
-wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 
-wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 
-wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 
-wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -w14062 -we4238 /Gw 
-Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing /O2 /Ob2 
 -MD   -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530 -wd4589  /EHs-c- 
/GR- -UNDEBUG -std:c++17 /showIncludes 
/Fotools\lldb\utils\TableGen\CMakeFiles\lldb-tblgen.dir\LLDBOptionDefEmitter.cpp.obj
 /Fdtools\lldb\utils\TableGen\CMakeFiles\lldb-tblgen.dir\ /FS -c 
C:\path-to-build-dir\lldb\utils\TableGen\LLDBOptionDefEmitter.cpp
```

This is the cl error:
```
cl : Command line error D8021 : invalid numeric argument 
'/Wno-deprecated-declarations'
```

https://github.com/llvm/llvm-project/pull/92953
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][tests] Fix TestStdCXXDisassembly test when running on the remote Linux targets. (PR #93649)

2024-05-28 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka edited 
https://github.com/llvm/llvm-project/pull/93649
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][tests] Fix TestStdCXXDisassembly test when running on the remote Linux targets. (PR #93649)

2024-05-28 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93649

The test expects 'libstdc++' SO module in the module list. Force using StdC++ 
by specifying USE_LIBSTDCPP := 1 in the test's Makefile.

>From 741f69159b88c208ec0848b9c6d97be78f64383f Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Tue, 28 May 2024 21:45:10 -0700
Subject: [PATCH] [lldb][tests] Fix TestStdCXXDisassembly test when running on
 the remote Linux targets.

The test expects 'libstdc++' SO module in the module list. Force using StdC++ by
specifying USE_LIBSTDCPP := 1 in the test's Makefile.
---
 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..bf8e6b8703f36 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_LIBSTDCPP := 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][tests] Fix passing pthread library to a linker for some API tests. (PR #93648)

2024-05-28 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93648

Specify ENABLE_THREADS := YES within test's Makefile instead passing -lpthread 
throuhg the compiler's CFLAGS options.

Updated the following tests:

* 
lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
* 
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/Makefile
* lldb/test/API/functionalities/process_save_core_minidump/Makefile
* lldb/test/API/tools/lldb-dap/threads/Makefile

Fixes the following compiler/linker messages and error:

```
clang: warning: -lpthread: 'linker' input unused 
[-Wunused-command-line-argument]
...
ld.lld: error: undefined symbol: pthread_create
...
```

Depends on #93639

>From dc5913d7c2e65ea6afaa752c4dacb588cc545b8d Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Tue, 28 May 2024 21:40:10 -0700
Subject: [PATCH] [lldb][tests] Fix passing pthread library to a linker for
 some API tests.

Specify ENABLE_THREADS := YES within test's Makefile instead passing -lpthread
throuhg the compiler's CFLAGS options.

Updated the following tests:

* 
lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
* 
lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/Makefile
* lldb/test/API/functionalities/process_save_core_minidump/Makefile
* lldb/test/API/tools/lldb-dap/threads/Makefile
---
 .../aarch64_sme_z_registers/za_dynamic_resize/Makefile | 3 ++-
 .../aarch64_sve_registers/rw_access_dynamic_resize/Makefile| 3 ++-
 .../API/functionalities/process_save_core_minidump/Makefile| 2 +-
 lldb/test/API/tools/lldb-dap/threads/Makefile  | 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
 
b/lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
index 57d926b37d45c..bee03ac62a60f 100644
--- 
a/lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
+++ 
b/lldb/test/API/commands/register/register/aarch64_sme_z_registers/za_dynamic_resize/Makefile
@@ -1,5 +1,6 @@
 C_SOURCES := main.c
 
-CFLAGS_EXTRAS := -march=armv8-a+sve+sme -lpthread
+CFLAGS_EXTRAS := -march=armv8-a+sve+sme
+ENABLE_THREADS := YES
 
 include Makefile.rules
diff --git 
a/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/Makefile
 
b/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/Makefile
index efa5ca913f6e2..1c65300b73738 100644
--- 
a/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/Makefile
+++ 
b/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/Makefile
@@ -1,5 +1,6 @@
 C_SOURCES := main.c
 
-CFLAGS_EXTRAS := -march=armv8-a+sve -lpthread
+CFLAGS_EXTRAS := -march=armv8-a+sve
+ENABLE_THREADS := YES
 
 include Makefile.rules
diff --git a/lldb/test/API/functionalities/process_save_core_minidump/Makefile 
b/lldb/test/API/functionalities/process_save_core_minidump/Makefile
index 2d177981fdde1..e9a26189f5dad 100644
--- a/lldb/test/API/functionalities/process_save_core_minidump/Makefile
+++ b/lldb/test/API/functionalities/process_save_core_minidump/Makefile
@@ -1,6 +1,6 @@
 CXX_SOURCES := main.cpp
 
-CFLAGS_EXTRAS := -lpthread
+ENABLE_THREADS := YES
 
 include Makefile.rules
 
diff --git a/lldb/test/API/tools/lldb-dap/threads/Makefile 
b/lldb/test/API/tools/lldb-dap/threads/Makefile
index 121868fa8ec33..aa6b054685d61 100644
--- a/lldb/test/API/tools/lldb-dap/threads/Makefile
+++ b/lldb/test/API/tools/lldb-dap/threads/Makefile
@@ -1,4 +1,5 @@
 C_SOURCES := main.c
-CFLAGS_EXTRAS := -lpthread
+
+ENABLE_THREADS := YES
 
 include Makefile.rules

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Allow using a custom 'strip' tool for the API tests. (PR #93645)

2024-05-28 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93645

Allow passing any custom 'strip' tool, such as 'llvm-strip', to use with the 
LLDB API tests.

The tool can be provided via LLDB_TEST_COMMON_ARGS_VAR CMake variable: 
`..;--env STRIP=${CMAKE_STRIP};...`.

Depends on #93639

>From eb1827cd5c052d7c194e2d60faf5a81edccc27a5 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Tue, 28 May 2024 21:25:50 -0700
Subject: [PATCH] [lldb] Allow using a custom 'strip' tool for the API tests.

Allow passing any custom 'strip' tool, such as 'llvm-strip',
to use with the LLDB API tests.

The tool can be provided via LLDB_TEST_COMMON_ARGS_VAR CMake
variable: `..;--env STRIP=${CMAKE_STRIP};...`.
---
 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 +-
 8 files changed, 9 insertions(+), 9 deletions(-)

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.out.dSYM a.out.stripped.dSYM
 
 include Makefile.rules
diff --git a/lldb/test/API/macosx/add-dsym/Makefile 
b/lldb/test/API/macosx/add-dsym/Makefile
index 4e1ec2202d0b0..b949b308d3acc 100644
--- a/lldb/test/API/macosx/add-dsym/Makefile
+++ b/lldb/test/API/macosx/add-dsym/Makefile
@@ -8,7 +8,7 @@ hide.app/Contents/a.out.dSYM:
mkdir hide.app
mkdir hide.app/Contents
mv a.out.dSYM hide.app/Contents
-   strip -x a.out
+   $(STRIP) -x a.out
 ifneq "$(CODESIGN)" ""
$(CODESIGN) -fs - a.out
 endif
diff --git a/lldb/test/API/macosx/dyld-trie-symbols/Makefile 
b/lldb/test/API/macosx/dyld-trie-symbols/Makefile
index a0f3424d676cc..50938bb111483 100644
--- a/lldb/test/API/macosx/dyld-trie-symbols/Makefile
+++ b/lldb/test/API/macosx/dyld-trie-symbols/Makefile
@@ -10,4 +10,4 @@ all: a.out a.out-stripped
 
 a.out-stripped:
cp a.out a.out-stripped
-   strip -N a.out-stripped
+   $(STRIP) -N a.out-stripped
diff --git a/lldb/test/API/tools/lldb-dap/module/Makefile 
b/lldb/test/API/tools/lldb-dap/module/Makefile
index b30baf48b972e..c7d626a1a7e4c 100644
--- a/lldb/test/API/tools/lldb-dap/module/Makefile
+++ b/lldb/test/API/tools/lldb-dap/module/Makefile
@@ -10,7 +10,7 @@ include Makefile.rules
 all: a.out.stripped
 
 a.out.stripped:
-   strip -o a.out.stripped a.out
+   $(STRIP) -o a.out.stripped a.out
 
 ifneq "$(CODESIGN)" ""
$(CODESIGN) -fs - a.out.stripped
diff --git 

[Lldb-commits] [lldb] [lldb] Wrap Unix-style path inside appropriate API test Makefiles. (PR #93643)

2024-05-28 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93643

Some of the API tests use Makefiles with the custom rules to manipulate the 
source code files. This patch normalizes their file pathes to Unix-style on the 
Windows build host and avoids compiler/linker error because of the broken pathes

Depends on #93639

>From 3f05232a4307acd71fee16ca67819f544c8ac450 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Tue, 28 May 2024 21:18:36 -0700
Subject: [PATCH] [lldb] Wrap Unix-style path inside appropriate API test
 Makefiles.

Some of the API tests use Makefiles with the custom rules to manipulate
the source code files. This patch normalizes their file pathes to Unix-style
on the Windows build host and avoids compiler/linker error because of
the broken pathes
---
 lldb/test/API/commands/settings/use_source_cache/Makefile | 2 +-
 .../functionalities/breakpoint/comp_dir_symlink/Makefile  | 2 +-
 lldb/test/API/functionalities/inline-sourcefile/Makefile  | 2 +-
 lldb/test/API/functionalities/multiple-slides/Makefile| 2 +-
 .../functionalities/postmortem/netbsd-core/GNUmakefile| 4 ++--
 .../API/functionalities/step-avoids-no-debug/Makefile | 2 +-
 lldb/test/API/functionalities/valobj_errors/Makefile  | 2 +-
 lldb/test/API/lang/cpp/operator-overload/Makefile | 2 +-
 lldb/test/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 +-
 lldb/test/API/tools/lldb-dap/breakpoint/Makefile  | 4 ++--
 17 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/lldb/test/API/commands/settings/use_source_cache/Makefile 
b/lldb/test/API/commands/settings/use_source_cache/Makefile
index 791cb7d868d87..2fc18665303cb 100644
--- a/lldb/test/API/commands/settings/use_source_cache/Makefile
+++ b/lldb/test/API/commands/settings/use_source_cache/Makefile
@@ -5,4 +5,4 @@ include Makefile.rules
 
 # Copy file into the build folder to enable the test to modify it.
 main-copy.cpp: main.cpp
-   cp -f $< $@
+   cp -f $(call path_wrapper,$<) $@
diff --git a/lldb/test/API/functionalities/breakpoint/comp_dir_symlink/Makefile 
b/lldb/test/API/functionalities/breakpoint/comp_dir_symlink/Makefile
index 1c42301c7b587..ff090a7fd0ea2 100644
--- a/lldb/test/API/functionalities/breakpoint/comp_dir_symlink/Makefile
+++ b/lldb/test/API/functionalities/breakpoint/comp_dir_symlink/Makefile
@@ -6,4 +6,4 @@ include Makefile.rules
 
 # Force relative filenames by copying it into the build directory.
 relative.cpp: main.cpp
-   cp -f $< $@
+   cp -f $(call path_wrapper,$<) $@
diff --git a/lldb/test/API/functionalities/inline-sourcefile/Makefile 
b/lldb/test/API/functionalities/inline-sourcefile/Makefile
index adb29d3a88e26..76a41fa4ec4b4 100644
--- a/lldb/test/API/functionalities/inline-sourcefile/Makefile
+++ b/lldb/test/API/functionalities/inline-sourcefile/Makefile
@@ -8,4 +8,4 @@ OBJECTS += inline.o
 $(EXE): main.c inline.o
 
 %.o: %.ll
-   $(CC) $< -c -o $@
+   $(CC) $(call path_wrapper,$<) -c -o $@
diff --git a/lldb/test/API/functionalities/multiple-slides/Makefile 
b/lldb/test/API/functionalities/multiple-slides/Makefile
index 5f83deaa24d77..822af701e7794 100644
--- a/lldb/test/API/functionalities/multiple-slides/Makefile
+++ b/lldb/test/API/functionalities/multiple-slides/Makefile
@@ -8,5 +8,5 @@ include Makefile.rules
 # sliding the binary, the address of `first` and
 # `second` are not slid for some reason on Darwin.
 main.o: main.c
-   $(CC) $(CFLAGS_NO_DEBUG) -c $< -o $@
+   $(CC) $(CFLAGS_NO_DEBUG) -c $(call path_wrapper,$<) -o $@
 
diff --git a/lldb/test/API/functionalities/postmortem/netbsd-core/GNUmakefile 
b/lldb/test/API/functionalities/postmortem/netbsd-core/GNUmakefile
index 62c719d3d2ff0..f72ddf4234828 100644
--- a/lldb/test/API/functionalities/postmortem/netbsd-core/GNUmakefile
+++ b/lldb/test/API/functionalities/postmortem/netbsd-core/GNUmakefile
@@ -8,8 +8,8 @@ clean:
rm -f $(CORES) $(EXECS)
 
 %.core: %
-   sysctl -w proc..corename=$@; ulimit -s 16; ! ./$<
+   sysctl -w proc..corename=$@; ulimit -s 16; ! ./$(call 
path_wrapper,$<)
 %.$(ARCH): %.c
-   $(CC) -o $@ -g $<
+   $(CC) -o $@ -g $(call path_wrapper,$<)
 
 .PHONY: all clean
diff --git a/lldb/test/API/functionalities/step-avoids-no-debug/Makefile 
b/lldb/test/API/functionalities/step-avoids-no-debug/Makefile
index 374e58b89a81c..1ea6acec8960c 100644
--- a/lldb/test/API/functionalities/step-avoids-no-debug/Makefile
+++ 

[Lldb-commits] [lldb] [lldb] Update LLDB testsuite's Makefile.rules in order to support the cross builds on Windows host. (PR #93639)

2024-05-28 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93639

These changes do the following:

* avoids usage of $(findstring) within $(CC) to detect a type of specified C 
compiler. Also they change a way to get a counterpart C++ compiler instead of 
modifying the original $(CC) variable. Both of those fixes a problem when a 
compiler name is a part of some word (or itself) used in the path to the 
compiler. Here is an example where the `cc` compiler is getting detected 
instead of `clang` compiler inside of $(CC) with the following path:

> `".../accesssoftek/.../bin/clang.exe"`

and replaces the 'cc' sequence of 'accesssoftek' word with 'c++' sequence to 
get the C++ compiler name:

> `".../ac++esssoftek/.../bin/clang.exe"`

The change parses the source $(CC) and put every part into a separate variable 
instead and uses these parts to build the required tool's references 
subsequently.

Also these parts are used within the conditions to direct comparison instead of 
using $(findstring) where it is necessary or possible.

* avoids the compiler comparison with $(findstring) within the conditions.
* fixes SHELL initialization on the Windows build hosts.
* moves LLVM_AR initialization from the test's Makefile into Makefile.rules.
* adds `USE_LLVM_TOOLS` variable to force using of llvm-ar/llvm-objcopy tool 
instead of the system default. Passing this variable as `USE_LLVM_TOOLS=1` will 
configure the build to use `llvm-ar`, `llvm-objcopy` and `llvm-strip` tools for 
the tests. This variable could be passed via 
`LLDB_TEST_USER_ARGS="...;--env;USE_LLVM_TOOL=1;..."`.
* fix of LDFLAGS guiding through Makefile.rules.


>From 663964e45e65b94a4ec8e0b044e971b0195ff574 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Tue, 28 May 2024 21:01:24 -0700
Subject: [PATCH] [lldb] Update LLDB testsuite's Makefile.rules in order to
 support the cross builds on Windows host.

These changes do the following:

* avoids usage of $(findstring) within $(CC) to detect a type of specified C 
compiler.
  Also they change a way to get a counterpart C++ compiler instead of modifying
  the original $(CC) variable.
* avoids the compiler comparison with $(findstring) within the conditions.
* fixes SHELL initialization on the Windows build hosts.
* moves LLVM_AR initialization from the test's Makefile into Makefile.rules.
* adds USE_LLVM_TOOLS variable to force using of llvm-ar/llvm-objcopy tool
  instead of the system default.
* Passing this variable as USE_LLVM_TOOLS=1 will configure the build
  to use llvm-ar, llvm-objcopy and llvm-strip tools for the tests.
  This variable could be passed via 
LLDB_TEST_USER_ARGS="...;--env;USE_LLVM_TOOL=1;...".
* fix of LDFLAGS guiding through Makefile.rules.
---
 .../Python/lldbsuite/test/make/Makefile.rules | 260 --
 1 file changed, 176 insertions(+), 84 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules 
b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index bd8eea3d6f5a0..8cf67068af34d 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -26,6 +26,9 @@
 # SPLIT_DEBUG_SYMBOLS := YES
 # CROSS_COMPILE :=
 # USE_PRIVATE_MODULE_CACHE := YES
+#
+# Specifying USE_LLVM_TOOLS=1 will force usage of the LLVM tools, such as 
llvm-ar/llvm-objcopy/llvm-strip,
+# instead of the system defaults (ar/objcopy/strip accordingly).
 
 # Uncomment line below for debugging shell commands
 # SHELL = /bin/sh -x
@@ -39,6 +42,11 @@ MAKEFILE_RULES := $(lastword $(MAKEFILE_LIST))
 THIS_FILE_DIR := $(shell dirname $(MAKEFILE_RULES))
 LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
 
+STRIP ?= strip
+
+# Empty if not specified.
+LDFLAGS ?=
+
 # 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',
@@ -51,23 +59,25 @@ LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
 #
 # 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. 
+# 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.
 #--
 HOST_OS := $(shell uname -s)
-ifneq (,$(findstring windows32,$(HOST_OS)))
-   HOST_OS := Windows_NT
-endif
-
-ifneq (,$(findstring MSYS_NT,$(HOST_OS)))
-   HOST_OS := Windows_NT
+ifneq (,$(or \
+$(findstring windows32,$(HOST_OS)),\
+$(findstring MSYS_NT,$(HOST_OS
+HOST_OS := Windows_NT
 endif
 
 ifeq "$(OS)" ""
OS := $(HOST_OS)
 endif
 
+# Retrieve the host arch. We are going to use $HOST_OS/$HOST_ARCH to
+# detect the 

[Lldb-commits] [lldb] [lldb] Allow specific 'make' tool for LLDB testsuite. (PR #93367)

2024-05-24 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93367

Because the 'make' tool is required to run the lldb testsuite a detection of 
this program was added to the CMake script. If 'make' tool is missed on the 
host CMake raises a fatal error now.

It is possible to provide a full path to the 'make' tool via 'Make_EXECUTABLE' 
CMake variable through the command line:

```
  cmake -DMake_EXECUTABLE=c:\path\to\make.exe ...
```

The found tool gets passed into the lldb testsuite scripts using a newly added 
argument --make. This option also can be used directly via LLDB_TEST_USER_ARGS 
CMake configuraion parameter:

```
  cmake ...
-DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..."
...
```

These options are useful on the Windows build hosts.

>From 427d6d5a7ce14204ea09ba12934e93b9cefc9d63 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Fri, 24 May 2024 21:01:45 -0700
Subject: [PATCH] [lldb] Allow specific 'make' tool for LLDB testsuite.

Because the 'make' tool is required to run the lldb testsuite a detection of 
this
program was added to the CMake script. If 'make' tool is missed on the host
CMake raises a fatal error now.

It is possible to provide a full path to the 'make' tool via 'Make_EXECUTABLE'
CMake variable through the command line:

```
  cmake -DMake_EXECUTABLE=c:\path\to\make.exe ...
```

The found tool gets passed into the lldb testsuite scripts using a newly added
argument --make. This option also can be used directly via LLDB_TEST_USER_ARGS
CMake configuraion parameter:

```
  cmake ...
-DLLDB_TEST_USER_ARGS="...;--make;C:\\Path\\to\\make.exe;..."
...
```

These options are useful on the Windows build hosts.
---
 .../packages/Python/lldbsuite/test/builders/builder.py |  4 +++-
 lldb/packages/Python/lldbsuite/test/configuration.py   |  1 +
 lldb/packages/Python/lldbsuite/test/dotest.py  |  2 ++
 lldb/packages/Python/lldbsuite/test/dotest_args.py |  6 ++
 lldb/test/API/lit.cfg.py   |  3 +++
 lldb/test/API/lit.site.cfg.py.in   |  1 +
 lldb/test/CMakeLists.txt   | 10 ++
 lldb/test/Shell/lit.site.cfg.py.in |  1 +
 lldb/test/Unit/lit.site.cfg.py.in  |  1 +
 lldb/test/lit.site.cfg.py.in   |  1 +
 lldb/utils/lldb-dotest/lldb-dotest.in  |  3 +++
 11 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py 
b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 21ea3530e24fc..178ce8bc3c490 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -40,7 +40,9 @@ def getMake(self, test_subdir, test_name):
 """Returns the invocation for GNU make.
 The first argument is a tuple of the relative path to the testcase
 and its filename stem."""
-if platform.system() == "FreeBSD" or platform.system() == "NetBSD":
+if configuration.make_path is not None:
+make = configuration.make_path
+elif platform.system() == "FreeBSD" or platform.system() == "NetBSD":
 make = "gmake"
 else:
 make = "make"
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py 
b/lldb/packages/Python/lldbsuite/test/configuration.py
index dbd4a2d72a15d..27eef040497d1 100644
--- a/lldb/packages/Python/lldbsuite/test/configuration.py
+++ b/lldb/packages/Python/lldbsuite/test/configuration.py
@@ -43,6 +43,7 @@
 compiler = None
 dsymutil = None
 sdkroot = None
+make_path = None
 
 # The overriden dwarf verison.
 dwarf_version = 0
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py 
b/lldb/packages/Python/lldbsuite/test/dotest.py
index 2e537e3fd3ce0..42b39bc6e2f7b 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -266,6 +266,8 @@ def parseOptionsAndInitTestdirs():
 configuration.compiler = candidate
 break
 
+if args.make:
+configuration.make_path = args.make
 if args.dsymutil:
 configuration.dsymutil = args.dsymutil
 elif platform_system == "Darwin":
diff --git a/lldb/packages/Python/lldbsuite/test/dotest_args.py 
b/lldb/packages/Python/lldbsuite/test/dotest_args.py
index 8b00c7a4d56e7..a0a840416c567 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest_args.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest_args.py
@@ -87,6 +87,12 @@ def create_parser():
 ),
 )
 
+group.add_argument(
+"--make",
+metavar="make",
+dest="make",
+help=textwrap.dedent("Specify which make to use."),
+)
 group.add_argument(
 "--dsymutil",
 metavar="dsymutil",
diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index d934349fe3ca3..ce8ae0c3b2341 100644
--- 

[Lldb-commits] [lldb] [lldb][tests] Transfer some environment variables into API tests on Windows platform. (PR #93366)

2024-05-24 Thread Vladimir Vereschaka via lldb-commits

https://github.com/vvereschaka created 
https://github.com/llvm/llvm-project/pull/93366

These environment variables avoid some side effects during execution of the 
remote API tests on Windows platform.

One of the side effect is a creating of weird folders, such as 
`\%SystemDrive%\...`, within the test directory.

>From 5f79f5fbf6679da020266d655ced91389215d851 Mon Sep 17 00:00:00 2001
From: Vladimir Vereschaka 
Date: Fri, 24 May 2024 20:19:54 -0700
Subject: [PATCH] [lldb][tests] Transfer some environment variables into API
 tests on Windows platform.

These environment variables avoid some side effects during execution of the 
remote API tests
on Windows platform.

One of the side effect is a creating of weird folders, such as 
\%SystemDrive%\...,
within the test directory.
---
 lldb/test/API/lit.cfg.py | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/lldb/test/API/lit.cfg.py b/lldb/test/API/lit.cfg.py
index d934349fe3ca3..7d38ee0ec098c 100644
--- a/lldb/test/API/lit.cfg.py
+++ b/lldb/test/API/lit.cfg.py
@@ -313,3 +313,22 @@ def delete_module_cache(path):
 # Propagate XDG_CACHE_HOME
 if "XDG_CACHE_HOME" in os.environ:
 config.environment["XDG_CACHE_HOME"] = os.environ["XDG_CACHE_HOME"]
+
+# Transfer some environment variables into the tests on Windows build host.
+if platform.system() == "Windows":
+for v in [
+"SystemDrive",
+"SystemRoot",
+"ALLUSERSPROFILE",
+"APPDATA",
+"LOCALAPPDATA",
+"USERDNSDOMAIN",
+"USERDOMAIN",
+"USERNAME",
+"USERPROFILE",
+"USERDOMAIN_ROAMINGPROFILE",
+"COMPUTERNAME",
+"ProgramData",
+]:
+if v in os.environ:
+config.environment[v] = os.environ[v]

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Have lldb-server assign ports to children in platform mode (PR #88845)

2024-05-24 Thread Vladimir Vereschaka via lldb-commits

vvereschaka wrote:

Hi @Awfa,

we start getting failures for some LLDB API tests after these changes. The 
tests are running on Jetson AGX/Cortex a78 (aarch64) board with Ubuntu Linux 
22.04 on it. The failed tests get failed with the following error message:
```
AssertionError: No value is not true : Could not create a valid process for 
a.out: unable to launch a GDB server on 'jetson-agx-2198'
```
We run these tests in 8 threads. The `lldb-server` is executing on the target 
board with the following arguments:
```
./lldb-server p --log-channels 'lldb all' --listen '*:1234' --server 
--min-gdbserver-port 1236 --max-gdbserver-port 1246
```

The build host is Windows, the remote target host is Ubuntu Linux.

Affected tests:

* lldb-api :: commands/process/handle/TestProcessHandle.py
* lldb-api :: commands/target/basic/TestTargetCommand.py
* lldb-api :: 
functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
* lldb-api :: 
functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
* lldb-api :: 
functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
* lldb-api :: 
functionalities/breakpoint/breakpoint_reset_upon_run/TestBreakpointResetUponRun.py
* lldb-api :: functionalities/rerun/TestRerun.py
* lldb-api :: functionalities/rerun_and_expr/TestRerunAndExpr.py
* lldb-api :: functionalities/signal/raise/TestRaise.py
* lldb-api :: source-manager/TestSourceManager.py

Reverting of these changes fixes the problem.

Thanks.
Vlad.

https://github.com/llvm/llvm-project/pull/88845
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [clang-tools-extra] [flang] [mlir] [lld] [openmp] [compiler-rt] [lldb] [llvm] [libunwind] [BranchFolding] Fix missing predecessors of landing-pad (PR #77608)

2024-01-11 Thread Vladimir Vereschaka via lldb-commits

vvereschaka wrote:

also, you can try to start a `Force Build` with cleaning of the source/build 
directories for these builders. It should clean up the current source folder 
and reload it.

https://github.com/llvm/llvm-project/pull/77608
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [compiler-rt] [lld] [clang-tools-extra] [mlir] [libunwind] [flang] [llvm] [lldb] [openmp] [clang] [BranchFolding] Fix missing predecessors of landing-pad (PR #77608)

2024-01-11 Thread Vladimir Vereschaka via lldb-commits

vvereschaka wrote:

@HaohaiWen 
>We may need to manually delete LLVM::windows-seh-EHa-PreserveCFG.s on those 
>machines.
ok, got it. I'll do it for those builders.

>Do you know who can help us to delete it?
if you see some other failed builders because of this problem you can find 
their owners on the `Workers` tab, `Admin` column
https://lab.llvm.org/buildbot/#/workers


https://github.com/llvm/llvm-project/pull/77608
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [flang] [clang] [lld] [compiler-rt] [libunwind] [mlir] [clang-tools-extra] [lldb] [llvm] [openmp] [BranchFolding] Fix missing predecessors of landing-pad (PR #77608)

2024-01-11 Thread Vladimir Vereschaka via lldb-commits

vvereschaka wrote:

@HaohaiWen ,
looks like these changes break some builders with the failed test
`UNRESOLVED: LLVM::windows-seh-EHa-PreserveCFG.s`

https://lab.llvm.org/buildbot/#/builders/234
https://lab.llvm.org/buildbot/#/builders/58
https://lab.llvm.org/buildbot/#/builders/104
https://lab.llvm.org/buildbot/#/builders/235

>Oh, sorry. I fixed it in https://github.com/llvm/llvm-project/pull/77784.
it didn't fix the problem.

https://github.com/llvm/llvm-project/pull/77608
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits