You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The best way to fix this while also preserving both $ORIGIN in the DT_RPATH of the output and the changes in #1545 is to also pass -Wl,-rpath-link with the full path to the subdirectories (without $ORIGIN).
I checked and this does work as we want it to. But I am not sure why this wasn't caught on the CI. A lot of tests are failing on my machine (Fedora 25, binutils 2.26.1).
Will submit a PR with a test for this.
The text was updated successfully, but these errors were encountered:
meson.git/test cases/common/46 library chain $ ninja -C build
ninja: Entering directory `build'
[11/11] Linking target prog.
FAILED: prog
ccache cc -o prog 'prog@exe/main.c.o' -Wl,--no-undefined -Wl,--as-needed subdir/liblib1.so '-Wl,-rpath,$ORIGIN/subdir:$ORIGIN/subdir/subdir2:$ORIGIN/subdir/subdir3'
/usr/bin/ld: warning: liblib2.so, needed by subdir/liblib1.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: liblib3.so, needed by subdir/liblib1.so, not found (try using -rpath or -rpath-link)
subdir/liblib1.so: undefined reference to `lib3fun'
subdir/liblib1.so: undefined reference to `lib2fun'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
This works:
ccache cc -o prog 'prog@exe/main.c.o' -Wl,--no-undefined -Wl,--as-needed subdir/liblib1.so '-Wl,-rpath,$ORIGIN/subdir:$ORIGIN/subdir/subdir2:$ORIGIN/subdir/subdir3' "-Wl,-rpath-link,$PWD/subdir:$PWD/subdir/subdir2:$PWD/subdir/subdir3"
Use -rpath-link with the absolute paths to the respective build dirs
to work around a binutils bug that causes $ORIGIN to not be used while
linking.
Includes a unit test that manually checks the RPATH value written out
to ensure that it uses $ORIGIN.
See: https://sourceware.org/bugzilla/show_bug.cgi?id=16936Closesmesonbuild#1897
https://sourceware.org/bugzilla/show_bug.cgi?id=16936
The best way to fix this while also preserving both
$ORIGIN
in theDT_RPATH
of the output and the changes in #1545 is to also pass-Wl,-rpath-link
with the full path to the subdirectories (without$ORIGIN
).I checked and this does work as we want it to. But I am not sure why this wasn't caught on the CI. A lot of tests are failing on my machine (Fedora 25, binutils 2.26.1).
Will submit a PR with a test for this.
The text was updated successfully, but these errors were encountered: