Skip to content

BugPoint tests are failing when compiled with LTO #50574

@petrhosek

Description

@petrhosek
Bugzilla Link 51230
Version unspecified
OS All
CC @gkmhub,@MaskRay,@int3,@thevinster,@nico,@smeenai,@oontvoo

Extended Description

I tried enabling the use of ld64.lld in our toolchain build that uses (regular) LTO but I see a number of BugPoint tests failure which all looks the same:

Error opening '/opt/s/w/ir/x/w/staging/llvm_build/tools/clang/stage2-bins/lib/BugpointPasses.dylib': dlopen(/opt/s/w/ir/x/w/staging/llvm_build/tools/clang/stage2-bins/lib/BugpointPasses.dylib, 9): Symbol not found: __ZNK4llvm4Pass11getPassNameEv
  Referenced from: /opt/s/w/ir/x/w/staging/llvm_build/tools/clang/stage2-bins/lib/BugpointPasses.dylib
  Expected in: flat namespace
 in /opt/s/w/ir/x/w/staging/llvm_build/tools/clang/stage2-bins/lib/BugpointPasses.dylib
  -load request ignored.
bugpoint: Unknown command line argument '-bugpoint-crashcalls'.  Try: '/opt/s/w/ir/x/w/staging/llvm_build/tools/clang/stage2-bins/bin/bugpoint --help'
bugpoint: Did you mean '--print-after-all'?

I suspect it's related to the use of -flat_namespace, see

set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
, which should be supported under LTO according to
config->namespaceKind == NamespaceKind::flat ||
but perhaps it doesn't behave the same way as ld64?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions