Skip to content

[lldb][test] Skip Test*FromStdModule tests on Linux for now #112530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

slydiman
Copy link
Contributor

@llvmbot
Copy link
Member

llvmbot commented Oct 16, 2024

@llvm/pr-subscribers-lldb

Author: Dmitry Vasilyev (slydiman)

Changes

This is the alternative to #98701.
See for more details:
https://reviews.llvm.org/D139361
https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095


Full diff: https://github.com/llvm/llvm-project/pull/112530.diff

3 Files Affected:

  • (modified) lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py (+1)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py (+1)
  • (modified) lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py (+1)
diff --git a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
index 13ab6b0c9ac1fb..bafc7628296217 100644
--- a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
@@ -10,6 +10,7 @@
 class TestCase(TestBase):
     @add_test_categories(["libc++"])
     @skipIf(compiler=no_match("clang"))
+    @skipIfLinux  # https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095
     def test(self):
         self.build()
 
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
index 1c32222e64f14c..71eaeef20e792d 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
@@ -14,6 +14,7 @@ class TestDbgInfoContentVector(TestBase):
     @skipIf(compiler="clang", compiler_version=["<", "12.0"])
     @skipIf(macos_version=["<", "14.0"])
     @skipIfDarwin  # https://github.com/llvm/llvm-project/issues/106475
+    @skipIfLinux  # https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095
     def test(self):
         self.build()
 
diff --git a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
index a1f33271f39d2f..e9415fd53651f7 100644
--- a/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
+++ b/lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
@@ -10,6 +10,7 @@
 class TestVectorOfVectors(TestBase):
     @add_test_categories(["libc++"])
     @skipIf(compiler=no_match("clang"))
+    @skipIfLinux  # https://discourse.llvm.org/t/lldb-test-failures-on-linux/80095
     def test(self):
         self.build()
 

@slydiman slydiman merged commit 87f1262 into llvm:main Oct 16, 2024
9 checks passed
dzhidzhoev added a commit to dzhidzhoev/llvm-project that referenced this pull request Oct 28, 2024
dzhidzhoev added a commit to dzhidzhoev/llvm-project that referenced this pull request Oct 28, 2024
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470, since libcxx is
set up to be linked statically with the binary on it.

Thus, they were temporarily disabled in llvm#112530. Here, this commit is
reverted.

When libcxx is linked with a program as an archive of static libraries,
functions that aren't used in the program are omitted. Then, jitted
expressions from the tests try calling several functions
that aren't present in the process image, which causes the failure.

LLD (and GNU ld AFAIK) links a binary with libcxx shared library
if libc++.so is present in corresponding library search paths.
Otherwise, it tries static linking. Here, a linker flag is added
to a clang call in libcxx configuration, that ensures that
libc++.so is present and found by linker.

Forcing linker to keep all functions from libcxx archive in this way llvm#98701,
without checking whether libcxx is linked statically looks like a less
clean solution, but I'm not sure about that.
dzhidzhoev added a commit to dzhidzhoev/llvm-project that referenced this pull request Dec 6, 2024
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470, since libcxx is
set up to be linked statically with test binaries on it.

Thus, they were temporarily disabled in llvm#112530. Here, this commit is
reverted.

When libcxx is linked with a program as an archive of static libraries,
functions that aren't used in the program are omitted. Then, jitted
expressions from the tests try calling several functions
that aren't present in the process image, which causes the failure.

Here, --whole-archive linker flags are added to tests' Makefiles to
ensure that the whole libc++ is included during static linking.
It's applied only to -lc++ and -lc++abi (via --push-state/--pop-state),
since for some reason clang Gnu toolchain driver on certain Linux
configurations adds -libclang_rt.builtins twice, so we can't just apply
--whole-archive to all static libraries.

Flags in Makefile.rules and tests' Makefiles are changed to supported
the configuration when libc++, libc++abi and libunwind are linked
separately (this configuration will be enabled on lldb remote buildbots
to be able to control what we link with and avoid duplicate symbols errors).

'-nostdlib++ -nostdinc' are added to LDFLAGS in Makefile.rules to avoid
duplicate symbols error. Applying them only to CXXFLAGS is not enough
since thus they are not passed to the linker call.

'--libcxx-include-dir' flag passing has been fixed on Windows host for
remote platform in lldb/test/API/lit.cfg.py.
dzhidzhoev added a commit to dzhidzhoev/llvm-project that referenced this pull request Jan 9, 2025
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in llvm#112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.
dzhidzhoev added a commit to dzhidzhoev/llvm-project that referenced this pull request Jan 13, 2025
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in llvm#112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.
dzhidzhoev added a commit that referenced this pull request Jan 13, 2025
Some tests from 'import-std-module' used to fail on the builder
https://lab.llvm.org/staging/#/builders/195/builds/4470,
since libcxx is set up to be linked statically with test binaries
on it.

Thus, they were temporarily disabled in #112530. Here, this commit
is reverted.

Jitted expressions from the tests try to call __libcpp_verbose_abort
function that is not present in the process image, which causes
the failure.

Here, this symbol is explicitly referenced from the test source files.
@slydiman slydiman deleted the lldb-skip-tests-FromStdModule branch April 18, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants