libtraceevent: Fix build with binutils 2.35
authorBen Hutchings <ben@decadent.org.uk>
Fri, 24 Jul 2020 21:42:51 +0000 (22:42 +0100)
committerSalvatore Bonaccorso <carnil@debian.org>
Sun, 26 Jul 2020 06:40:40 +0000 (07:40 +0100)
Forwarded: https://lore.kernel.org/linux-trace-devel/20200725010623.GA194964@decadent.org.uk/T/#u

In binutils 2.35, 'nm -D' changed to show symbol versions along with
symbol names, with the usual @@ separator.  When generating
libtraceevent-dynamic-list we need just the names, so strip off the
version suffix if present.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name libtraceevent-fix-build-with-binutils-2.35.patch

tools/lib/traceevent/plugins/Makefile

index 349bb81482abbccf099ae803ba8fe16e0e97b358..680d883efe05b35d531ab48fce4f22a8e16d61d1 100644 (file)
@@ -197,7 +197,7 @@ define do_generate_dynamic_list_file
        xargs echo "U w W" | tr 'w ' 'W\n' | sort -u | xargs echo`;\
        if [ "$$symbol_type" = "U W" ];then                             \
                (echo '{';                                              \
-               $(NM) -u -D $1 | awk 'NF>1 {print "\t"$$2";"}' | sort -u;\
+               $(NM) -u -D $1 | awk 'NF>1 {sub("@.*", "", $$2); print "\t"$$2";"}' | sort -u;\
                echo '};';                                              \
                ) > $2;                                                 \
        else                                                            \