diff mbox series

[meta-darwin,1/2] gcc: rely on loader_path instead of rpath

Message ID 20250527132415.2160472-1-ecordonnier@snap.com
State New
Headers show
Series [meta-darwin,1/2] gcc: rely on loader_path instead of rpath | expand

Commit Message

Etienne Cordonnier May 27, 2025, 1:24 p.m. UTC
From: Dominik Schnitzer <dominik@snap.com>

"--disable-darwin-at-rpath" causes the "loader_path" to be used instead of the "rpath" for finding libraries.
This allows to use the SDK without calling the relocate script which is changing the rpath values (LC_RPATH on MacOS).

Also add "Signed-off-by" line to aarch64-Darwin patch.

Before:
```
$ llvm-objdump -p ./sysroots/x86_64-pokysdk-darwin21/usr/bin/clang-18 | grep -A2 -i libstdc++
         name @loader_path/../lib/libstdc++.6.dylib (offset 24)
```

After:
```
$ llvm-objdump -p ./sysroots/x86_64-pokysdk-darwin21/usr/bin/clang-18 | grep -A2 libstdc++
         name @rpath/libstdc++.6.dylib (offset 24)
```

Signed-off-by: Dominik Schnitzer <dominik@snap.com>
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
---
 .../gcc/files/0101-aarch64-Darwin-support-gcc-13-3-darwin.patch  | 1 +
 recipes-devtools/gcc/gcc-runtime_%.bbappend                      | 1 +
 2 files changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/recipes-devtools/gcc/files/0101-aarch64-Darwin-support-gcc-13-3-darwin.patch b/recipes-devtools/gcc/files/0101-aarch64-Darwin-support-gcc-13-3-darwin.patch
index 4599f52..23d36b3 100644
--- a/recipes-devtools/gcc/files/0101-aarch64-Darwin-support-gcc-13-3-darwin.patch
+++ b/recipes-devtools/gcc/files/0101-aarch64-Darwin-support-gcc-13-3-darwin.patch
@@ -6,6 +6,7 @@  Upstream-Status: Pending
 aarch64 Darwin support for GCC 13.3 from:
 https://github.com/iains/gcc-13-branch/
 
+Signed-off-by: Iain Sandoe <iains@gcc.gnu.org>
 Signed-off-by: Dominik Schnitzer <dominik@snap.com>
 ---
 
diff --git a/recipes-devtools/gcc/gcc-runtime_%.bbappend b/recipes-devtools/gcc/gcc-runtime_%.bbappend
index 7f61e92..ce9dd1f 100644
--- a/recipes-devtools/gcc/gcc-runtime_%.bbappend
+++ b/recipes-devtools/gcc/gcc-runtime_%.bbappend
@@ -1,5 +1,6 @@ 
 EXTRA_OECONF:remove:darwin21 = "--enable-clocale=gnu"
 EXTRA_OECONF:remove:darwin21 = "--enable-clocale=generic"
+EXTRA_OECONF:append:darwin21 = " --disable-darwin-at-rpath"
 
 RUNTIMETARGET:remove:darwin21 = "libmpx"