Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build-proton-tc.sh: Work around ELF type bug in older versions of file
Browse files Browse the repository at this point in the history
file versions 5.35 and older incorrectly report the type of ELF PIE
executables as shared objects and vice versa -- the types appear to have
been swapped. Version 5.32 is even more broken in that it reports both
types as shared objects.

Check for "interpreter" instead in file's output to work around this
issue in our rpath setter.

Tested versions of file:
5.37: ok
5.36: ok
5.35: broken (swapped)
5.32: broken (all shared objects)

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
kdrag0n committed Aug 19, 2019
1 parent ef46739 commit 626fe60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build-proton-tc.sh
Original file line number Diff line number Diff line change
@@ -45,8 +45,8 @@ for f in $(find install -type f -exec file {} \; | grep 'not stripped' | awk '{p
done

# Set executable rpaths so setting LD_LIBRARY_PATH isn't necessary
msg "Setting library paths for porability..."
for bin in $(find install -type f -exec file {} \; | grep 'ELF .* executable' | awk '{print $1}'); do
msg "Setting library load paths for portability..."
for bin in $(find install -type f -exec file {} \; | grep 'ELF .* interpreter' | awk '{print $1}'); do
# Remove last character from file output (':')
bin="${bin: : -1}"

0 comments on commit 626fe60

Please sign in to comment.