Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: llvm/llvm-project
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: llvm/llvm-project
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: users/atrosinenko/bolt-unit-tests-llvm-dylib
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Aug 2, 2025

  1. [BOLT] Fix unit test failures when libLLVM is linked dynamically

    When LLVM_LINK_LLVM_DYLIB is ON, `check-bolt` target reports unit test
    failures:
    
        BOLT-Unit :: Core/./CoreTests/failed_to_discover_tests_from_gtest
        BOLT-Unit :: Profile/./ProfileTests/failed_to_discover_tests_from_gtest
    
    The reason is that when llvm-lit runs a unit-test executable:
    
        /path/to/CoreTests --gtest_list_tests '--gtest_filter=-*DISABLED_*'
    
    an assertion is triggered with the following message:
    
        LLVM ERROR: Option 'default' already exists!
    
    This assertion triggers when the initializer of defaultListDAGScheduler
    defined at SelectionDAGISel.cpp:219 is called as a statically-linked
    function after already being called during the initialization of libLLVM.
    
    The issue can be traced down to LLVMTestingSupport library which depends
    on libLLVM as neither COMPONENT_LIB nor DISABLE_LLVM_LINK_LLVM_DYLIB is
    specified in a call to `add_llvm_library(LLVMTestingSupport ...)`.
    
    Specifying DISABLE_LLVM_LINK_LLVM_DYLIB for LLVMTestingSupport makes
    Clang unit test fail and COMPONENT_LIB is probably inappropriate for a
    testing-specific library, thus as a workaround, added Error.cpp source
    from LLVMTestingSupport directly to the list of source files of CoreTests
    target (as it depends on `llvm::detail::TakeError(llvm::Error)`) and
    removed LLVMTestingSupport from the list of dependencies of ProfileTests.
    atrosinenko committed Aug 2, 2025
    Configuration menu
    Copy the full SHA
    d9fac9f View commit details
    Browse the repository at this point in the history
Loading