summary refs log tree commit diff
path: root/pkgs/development/tools/misc/binutils/0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch
blob: f9c6e88d97b45c37a5d607e5b4f4210523e6c9f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
From beca4a2c25ee86e4020f8b8bddc4d8e0ed3430b3 Mon Sep 17 00:00:00 2001
From: Andrew Childs <andrew.childs@bibo.com.ph>
Date: Tue, 22 Feb 2022 11:28:04 +0900
Subject: [PATCH] Revert "libtool.m4: fix nm BSD flag detection"

This reverts commit bef9ef8ca0f941d743c77cc55b5fe7985990b2a7.
---
 ChangeLog  |  9 ------
 libtool.m4 | 88 ++++++++++++++++++++++++++----------------------------
 2 files changed, 43 insertions(+), 54 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 18e8b6835da..c12f07403c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -375,15 +375,6 @@
 
 	* src-release.sh (GDB_SUPPPORT_DIRS): Add libbacktrace.
 
-2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
-
-	PR libctf/27967
-	* libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
-	NM, if there is one.  Run nm on itself, not on /dev/null, to avoid
-	errors from nms that refuse to work on non-regular files.  Remove
-	other workarounds for this problem.  Strip out blank lines from the
-	nm output.
-
 2021-09-27  Nick Alcock  <nick.alcock@oracle.com>
 
 	PR libctf/27967
diff --git a/libtool.m4 b/libtool.m4
index a216bb14e99..7a711249304 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -3200,55 +3200,53 @@ _LT_DECL([], [file_magic_cmd], [1],
 
 # LT_PATH_NM
 # ----------
-# find the pathname to a BSD- or MS-compatible name lister, and any flags
-# needed to make it compatible
+# find the pathname to a BSD- or MS-compatible name lister
 AC_DEFUN([LT_PATH_NM],
 [AC_REQUIRE([AC_PROG_CC])dnl
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
-   # Let the user override the nm to test.
-   lt_nm_to_check="$NM"
- else
-   lt_nm_to_check="${ac_tool_prefix}nm"
-   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-     lt_nm_to_check="$lt_nm_to_check nm"
-   fi
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
-   lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-   for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-     IFS="$lt_save_ifs"
-     test -z "$ac_dir" && ac_dir=.
-     case "$lt_tmp_nm" in
-     */*|*\\*) tmp_nm="$lt_tmp_nm";;
-     *) tmp_nm="$ac_dir/$lt_tmp_nm";;
-     esac
-     if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
-       *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
-	 break
-	 ;;
-       *)
-	 case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
-	 *$tmp_nm*)
-	   lt_cv_path_NM="$tmp_nm -p"
-	   break
-	   ;;
-	 *)
-	   lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-	   continue # so that we can try to find one that supports BSD flags
-	   ;;
-	 esac
-	 ;;
-       esac
-     fi
-   done
-   IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}])
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
 if test "$lt_cv_path_NM" != "no"; then
   NM="$lt_cv_path_NM"
 else
-- 
2.34.1