Skip to content

Commit fd565e8

Browse files
committed
Canonicalize ld path
Signed-off-by: Blake Batson <[email protected]>
1 parent 6086a4c commit fd565e8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/meson.build

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ message('Setting rpath:', rpath)
7575

7676
# objcopy only writes to files, but /proc/self/fd/1 is stdout so take that
7777
objcopy = find_program('objcopy')
78-
ldpath = run_command(
78+
79+
ld_path = run_command(
7980
objcopy,
8081
'-O', 'binary',
8182
'--only-section=.interp',
@@ -86,7 +87,11 @@ ldpath = run_command(
8687
)
8788

8889
# .interp ends in a null char, so make sure to strip it
89-
dynamic_linker = '/run/host' + ldpath.stdout().strip('\0')
90+
ld_path_str = ld_path.stdout().strip('\0')
91+
92+
ld_canon = run_command(readlink, '--canonicalize', ld_path_str, capture: true, check: true).stdout().strip()
93+
94+
dynamic_linker = '/run/host' + ld_canon
9095

9196
message('Setting dynamic linker:', dynamic_linker)
9297

0 commit comments

Comments
 (0)