diff mbox series

[2/2] lldb: don't build rpaths into binaries

Message ID 20250723122448.2250339-2-ross.burton@arm.com
State Accepted, archived
Commit d96e0458b696a7359d310cbe112c5dc2fc60f97d
Headers show
Series [1/2] lldb: remove incorrect comment about llvm vs clang | expand

Commit Message

Ross Burton July 23, 2025, 12:24 p.m. UTC
LLDB defaults to adding rpaths into the binaries which are then stripped
by CMake on install.

However, this rpath removal is implemented by editing the binary instead
of relinking at install time, so the final binary will have an entry in
the dynstr section which is all nulls but is as long as the build path.

Obviously this breaks reproducibility, so disable the use of rpaths in
LLDB to remove this problem.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/recipes-devtools/clang/lldb_git.bb | 1 +
 1 file changed, 1 insertion(+)

Comments

Khem Raj July 23, 2025, 7:14 p.m. UTC | #1
On Wed, Jul 23, 2025 at 5:24 AM Ross Burton via lists.openembedded.org
<ross.burton=arm.com@lists.openembedded.org> wrote:
>
> LLDB defaults to adding rpaths into the binaries which are then stripped
> by CMake on install.
>
> However, this rpath removal is implemented by editing the binary instead
> of relinking at install time, so the final binary will have an entry in
> the dynstr section which is all nulls but is as long as the build path.
>
> Obviously this breaks reproducibility, so disable the use of rpaths in
> LLDB to remove this problem.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  meta/recipes-devtools/clang/lldb_git.bb | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/meta/recipes-devtools/clang/lldb_git.bb b/meta/recipes-devtools/clang/lldb_git.bb
> index 4eec175ff0e..eafc3cb3128 100644
> --- a/meta/recipes-devtools/clang/lldb_git.bb
> +++ b/meta/recipes-devtools/clang/lldb_git.bb
> @@ -24,6 +24,7 @@ EXTRA_OECMAKE = "-DLLDB_INCLUDE_TESTS=OFF \
>                   -DLLVM_DIR=${STAGING_LIBDIR}/cmake/llvm/ \
>                   -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
>                   -DLLDB_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/lldb-tblgen \
> +                 -DLLDB_NO_INSTALL_DEFAULT_RPATH=ON \
>  "

I wonder if using BUILD_WITH_INSTALL_RPATH=OFF might make a good choice here
we do not run lldb from the build tree anyway

>
>  PACKAGECONFIG ??= "libedit libxml2 lzma"
> --
> 2.43.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#220804): https://lists.openembedded.org/g/openembedded-core/message/220804
> Mute This Topic: https://lists.openembedded.org/mt/114302503/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/clang/lldb_git.bb b/meta/recipes-devtools/clang/lldb_git.bb
index 4eec175ff0e..eafc3cb3128 100644
--- a/meta/recipes-devtools/clang/lldb_git.bb
+++ b/meta/recipes-devtools/clang/lldb_git.bb
@@ -24,6 +24,7 @@  EXTRA_OECMAKE = "-DLLDB_INCLUDE_TESTS=OFF \
                  -DLLVM_DIR=${STAGING_LIBDIR}/cmake/llvm/ \
                  -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
                  -DLLDB_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/lldb-tblgen \
+                 -DLLDB_NO_INSTALL_DEFAULT_RPATH=ON \
 "
 
 PACKAGECONFIG ??= "libedit libxml2 lzma"