diff --git a/tools/codesighs/autosummary.unix.bash b/tools/codesighs/autosummary.unix.bash index d3016469d55..7268e6c7c45 100755 --- a/tools/codesighs/autosummary.unix.bash +++ b/tools/codesighs/autosummary.unix.bash @@ -142,8 +142,13 @@ if test "$READELF_PROG"; then else READELF_PROG=`which readelf 2>/dev/null` if test "$READELF_PROG"; then + # Check whether we need -W + if readelf --help | grep "\--wide" >&/dev/null; then + READELF_PROG="readelf -W" + else + READELF_PROG="readelf" + fi USE_READELF=1 - READELF_PROG="readelf -W" else USE_READELF= fi diff --git a/tools/codesighs/basesummary.unix.bash b/tools/codesighs/basesummary.unix.bash index 708c4f0a86a..074af645c0d 100755 --- a/tools/codesighs/basesummary.unix.bash +++ b/tools/codesighs/basesummary.unix.bash @@ -141,7 +141,12 @@ if test "$READELF_PROG"; then else READELF_PROG=`which readelf 2>/dev/null` if test "$READELF_PROG"; then - READELF_PROG="readelf -W" + # Check whether we need -W + if readelf --help | grep "\--wide" >&/dev/null; then + READELF_PROG="readelf -W" + else + READELF_PROG="readelf" + fi USE_READELF=1 else USE_READELF=