Skip to content

Commit

Permalink
Filter libtool warning about table of contents (#15448)
Browse files Browse the repository at this point in the history
The warning is unlikely to indicate a real issue, and Bazel already silences parallel warnings with `-no_warning_for_no_symbols`.

For more context, see #4057

Fixes #4057

Closes #15325.

PiperOrigin-RevId: 446659148

Co-authored-by: Christopher Sauer <cpsauer@users.noreply.github.com>
  • Loading branch information
2 people authored and meteorcloudy committed May 10, 2022
1 parent 2649c7c commit 027e9b2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/objc/libtool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ if [ -z ${MY_LOCATION+x} ]; then
fi
fi

WRAPPER="${MY_LOCATION}/xcrunwrapper.sh"
function invoke_libtool() {
# Just invoke libtool via xcrunwrapper
"${MY_LOCATION}/xcrunwrapper.sh" libtool "$@" \
2> >(grep -v "the table of contents is empty (no object file members in the"`
`" library define global symbols)$" >&2)
# ^ Filtering a warning that's unlikely to indicate a real issue
# ...and not silencable via a flag.
}

if [ ! -f "${MY_LOCATION}"/libtool_check_unique ] ; then
echo "libtool_check_unique not found. Please file an issue at github.com/bazelbuild/bazel"
exit 1
elif "${MY_LOCATION}"/libtool_check_unique "$@"; then
# If there are no duplicate .o basenames,
# libtool can be invoked with the original arguments.
"${WRAPPER}" libtool "$@"
invoke_libtool "$@"
exit
fi

Expand Down Expand Up @@ -131,4 +138,4 @@ for arg in "$@"; do
done

printf '%s\n' "${ARGS[@]}" > "$TEMPDIR/processed.params"
"${WRAPPER}" libtool "@$TEMPDIR/processed.params"
invoke_libtool "@$TEMPDIR/processed.params"

0 comments on commit 027e9b2

Please sign in to comment.