Skip to contentSkip to conversation

libtraceevent: Fix build with binutils 2.35

PATCH In review Ben Hutchings 4 participants 7 messages Jul 25, 2020 – Jul 30, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtraceevent: Fix build with binutils 2.35

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.

---
 tools/lib/traceevent/plugins/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/plugins/Makefile +1 -1
index 349bb81482ab..680d883efe05 100644
@@ -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                                                            \
Tested-by on v1 1/1
#1 lore raw

Hi,

Quoted 16 lines · Ben Hutchings

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.

---
 tools/lib/traceevent/plugins/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/plugins/Makefile +0 -0
index 349bb81482ab..680d883efe05 100644

tools/lib/traceevent/plugins/Makefile define do_generate_dynamic_list_file · line 203

Quoted 8 lines
tools/lib/traceevent/plugins/Makefile +1 -1
@@ -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                                                            \

FWIW, tested on a system with binutils 2.35 for a 5.7.10 build.

Regards,
Salvatore

Signature · 4 lines
  .-.  Salvatore Bonaccorso --------------- Debian GNU/Linux Developer
  oo|  ----------------------------------------- http://www.debian.org
 /`'\  GPG key ID: 0x789D6F057FD863FE --------------------------------
(\_;/) Fingerprint: 04A4 407C B914 2C23 030C  17AE 789D 6F05 7FD8 63FE
#2 lore raw
In reply to Ben Hutchings

Em Sat, Jul 25, 2020 at 02:06:23AM +0100, Ben Hutchings escreveu:

Quoted 4 lines

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.

Steven, have you seen this one?

- Arnaldo

Quoted 19 lines
---
 tools/lib/traceevent/plugins/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/plugins/Makefile +1 -1
index 349bb81482ab..680d883efe05 100644
@@ -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                                                            \
Signature · 1 line
- Arnaldo
#3 lore raw
Quoted 7 lines · On Tue, 28 Jul 2020 09:19:08 -0300 Arnaldo Carvalho de Melo <[email protected]>…

Em Sat, Jul 25, 2020 at 02:06:23AM +0100, Ben Hutchings escreveu:

Quoted 4 lines

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.

Steven, have you seen this one?

Yeah, I saw it. Just haven't gotten to it yet ;-)

-- Steve

Quoted 25 lines

- Arnaldo

Quoted 19 lines
---
 tools/lib/traceevent/plugins/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/plugins/Makefile +1 -1
index 349bb81482ab..680d883efe05 100644
@@ -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                                                            \  
#4 lore raw

Em Tue, Jul 28, 2020 at 09:08:06AM -0400, Steven Rostedt escreveu:

Quoted 4 lines
Quoted 1 line · On Tue, 28 Jul 2020 09:19:08 -0300 Arnaldo Carvalho de Melo <[email protected]>…

Em Sat, Jul 25, 2020 at 02:06:23AM +0100, Ben Hutchings escreveu:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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.

Steven, have you seen this one?

Yeah, I saw it. Just haven't gotten to it yet ;-)

So, I've stumbled on this on debian:experimental:

LINK /tmp/build/perf/perf
/usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: ignoring invalid character @' in script /usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: ignoring invalid character @' in script /usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: syntax error in dynamic list
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.perf:637: /tmp/build/perf/perf] Error 1

I'll tentatively add this patch to see if it then passes all the tests everywhere...

- Arnaldo

Quoted 28 lines

-- Steve

Quoted 25 lines

- Arnaldo

Quoted 19 lines
---
 tools/lib/traceevent/plugins/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/traceevent/plugins/Makefile +1 -1
index 349bb81482ab..680d883efe05 100644
@@ -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                                                            \  
Signature · 1 line
- Arnaldo
Reviewed-by
#5 lore raw
Quoted 23 lines · On Wed, 29 Jul 2020 17:59:27 -0300 Arnaldo Carvalho de Melo <[email protected]>…

Em Tue, Jul 28, 2020 at 09:08:06AM -0400, Steven Rostedt escreveu:

Quoted 4 lines
Quoted 1 line · On Tue, 28 Jul 2020 09:19:08 -0300 Arnaldo Carvalho de Melo <[email protected]>…

Em Sat, Jul 25, 2020 at 02:06:23AM +0100, Ben Hutchings escreveu:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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.

Steven, have you seen this one?

Yeah, I saw it. Just haven't gotten to it yet ;-)

So, I've stumbled on this on debian:experimental:

LINK /tmp/build/perf/perf
/usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: ignoring invalid character @' in script /usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: ignoring invalid character @' in script /usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: syntax error in dynamic list
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.perf:637: /tmp/build/perf/perf] Error 1

Quoted 4 lines

I'll tentatively add this patch to see if it then passes all the tests everywhere...

-

I'd say go ahead and apply it.

-- Steve

#6 lore raw

Em Wed, Jul 29, 2020 at 08:11:43PM -0400, Steven Rostedt escreveu:

Quoted 26 lines
Quoted 23 lines · On Wed, 29 Jul 2020 17:59:27 -0300 Arnaldo Carvalho de Melo <[email protected]>…

Em Tue, Jul 28, 2020 at 09:08:06AM -0400, Steven Rostedt escreveu:

Quoted 4 lines
Quoted 1 line · On Tue, 28 Jul 2020 09:19:08 -0300 Arnaldo Carvalho de Melo <[email protected]>…

Em Sat, Jul 25, 2020 at 02:06:23AM +0100, Ben Hutchings escreveu:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

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.

Steven, have you seen this one?

Yeah, I saw it. Just haven't gotten to it yet ;-)

So, I've stumbled on this on debian:experimental:

LINK /tmp/build/perf/perf
/usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: ignoring invalid character @' in script /usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: ignoring invalid character @' in script /usr/bin/ld:/tmp/build/perf/libtraceevent-dynamic-list:2: syntax error in dynamic list
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.perf:637: /tmp/build/perf/perf] Error 1

Quoted 8 lines
Quoted 4 lines

I'll tentatively add this patch to see if it then passes all the tests everywhere...

-

I'd say go ahead and apply it.

Done, thanks, testing finished in all containers without build problems.

- Arnaldo