[all-commits] [llvm/llvm-project] 50830e: [lldb] Add -Wl, -rpath to make tests run with fresh...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Jan 24 12:22:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50830e50031b5420f09f79e82cf6ec984fb8328d
      https://github.com/llvm/llvm-project/commit/50830e50031b5420f09f79e82cf6ec984fb8328d
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-01-24 (Sun, 24 Jan 2021)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/dotest.py
    M lldb/packages/Python/lldbsuite/test/make/Makefile.rules

  Log Message:
  -----------
  [lldb] Add -Wl,-rpath to make tests run with fresh built libc++

On my Debian machine, system libc++/libc++abi is not installed (`libc++1-9 libc++abi-9`),
21 check-lldb-api tests fail because -stdlib=libc++ linked executables cannot
find runtime libc++.so.1 at runtime.

Use the `-Wl,-rpath,$(LLVM_LIBS_DIR)` mechanism in
`packages/Python/lldbsuite/test/make/Makefile.rules` (D58630 for NetBSD) to
allow such tests compile/link with fresh libc++ built beside lldb.
(A system libc++.so.1 is not guaranteed to match fresh libc++ header files.)

Some tweaks to the existing NetBSD rule when generalizing:

* Drop `-L$(LLVM_LIBS_DIR)` since Clang driver adds it correctly.
* Add `-stdlib=libc++` only for `USE_LIBCPP`.

Also, drop `-isystem /usr/include/c++/v1` introduced in D9426. It is not needed
by Clang driver. GCC using libc++ requires more setup.

I don't find any test needing `-Wl,-rpath` in `test/Shell/helper/{build,toolchain}.py` (D58630 for NetBSD added them).

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D94888




More information about the All-commits mailing list