Skip to content

Commit

Permalink
Fix linker string comparison for dash
Browse files Browse the repository at this point in the history
Calling out to shell results in /bin/sh, so using a Bash-ism there won't
necesssarily work.  In particular, this breaks on Debian.

Suggested-by: Martin Haaß <[email protected]>
Resolves: #193
Signed-off-by: Robbie Harwood <[email protected]>
  • Loading branch information
frozencemetery committed Jan 11, 2022
1 parent bec837e commit 0c1e011
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/include/workarounds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ LD_FLAVOR := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/ .*//g')
LD_VERSION := $(shell $(LD) --version | grep -E '^(LLD|GNU ld)'|sed 's/.* //')
# I haven't tested 2.36 here; 2.35 is definitely broken and 2.37 seems to work
LD_DASH_T := $(shell \
if [ "x${LD_FLAVOR}" == xLLD ] ; then \
if [ "x${LD_FLAVOR}" = xLLD ] ; then \
echo '-T' ; \
elif [ "x${LD_FLAVOR}" == xGNU ] ; then \
elif [ "x${LD_FLAVOR}" = xGNU ] ; then \
if echo "${LD_VERSION}" | grep -q -E '^2\.3[789]|^2\.[456789]|^[3456789]|^[[:digit:]][[:digit:]]' ; then \
echo '-T' ; \
else \
Expand Down

0 comments on commit 0c1e011

Please sign in to comment.