nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1From beca4a2c25ee86e4020f8b8bddc4d8e0ed3430b3 Mon Sep 17 00:00:00 2001
2From: Andrew Childs <andrew.childs@bibo.com.ph>
3Date: Tue, 22 Feb 2022 11:28:04 +0900
4Subject: [PATCH] Revert "libtool.m4: fix nm BSD flag detection"
5
6This reverts commit bef9ef8ca0f941d743c77cc55b5fe7985990b2a7.
7---
8 ChangeLog | 9 ------
9 libtool.m4 | 88 ++++++++++++++++++++++++++----------------------------
10 2 files changed, 43 insertions(+), 54 deletions(-)
11
12diff --git a/ChangeLog b/ChangeLog
13index 18e8b6835da..c12f07403c3 100644
14--- a/ChangeLog
15+++ b/ChangeLog
16@@ -375,15 +375,6 @@
17
18 * src-release.sh (GDB_SUPPPORT_DIRS): Add libbacktrace.
19
20-2021-09-27 Nick Alcock <nick.alcock@oracle.com>
21-
22- PR libctf/27967
23- * libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
24- NM, if there is one. Run nm on itself, not on /dev/null, to avoid
25- errors from nms that refuse to work on non-regular files. Remove
26- other workarounds for this problem. Strip out blank lines from the
27- nm output.
28-
29 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
30
31 PR libctf/27967
32diff --git a/libtool.m4 b/libtool.m4
33index a216bb14e99..7a711249304 100644
34--- a/libtool.m4
35+++ b/libtool.m4
36@@ -3200,55 +3200,53 @@ _LT_DECL([], [file_magic_cmd], [1],
37
38 # LT_PATH_NM
39 # ----------
40-# find the pathname to a BSD- or MS-compatible name lister, and any flags
41-# needed to make it compatible
42+# find the pathname to a BSD- or MS-compatible name lister
43 AC_DEFUN([LT_PATH_NM],
44 [AC_REQUIRE([AC_PROG_CC])dnl
45 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
46 [if test -n "$NM"; then
47- # Let the user override the nm to test.
48- lt_nm_to_check="$NM"
49- else
50- lt_nm_to_check="${ac_tool_prefix}nm"
51- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
52- lt_nm_to_check="$lt_nm_to_check nm"
53- fi
54- fi
55- for lt_tmp_nm in $lt_nm_to_check; do
56- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
57- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
58- IFS="$lt_save_ifs"
59- test -z "$ac_dir" && ac_dir=.
60- case "$lt_tmp_nm" in
61- */*|*\\*) tmp_nm="$lt_tmp_nm";;
62- *) tmp_nm="$ac_dir/$lt_tmp_nm";;
63- esac
64- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
65- # Check to see if the nm accepts a BSD-compat flag.
66- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
67- # nm: unknown option "B" ignored
68- case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
69- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
70- break
71- ;;
72- *)
73- case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
74- *$tmp_nm*)
75- lt_cv_path_NM="$tmp_nm -p"
76- break
77- ;;
78- *)
79- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
80- continue # so that we can try to find one that supports BSD flags
81- ;;
82- esac
83- ;;
84- esac
85- fi
86- done
87- IFS="$lt_save_ifs"
88- done
89- : ${lt_cv_path_NM=no}])
90+ # Let the user override the test.
91+ lt_cv_path_NM="$NM"
92+else
93+ lt_nm_to_check="${ac_tool_prefix}nm"
94+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
95+ lt_nm_to_check="$lt_nm_to_check nm"
96+ fi
97+ for lt_tmp_nm in $lt_nm_to_check; do
98+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
99+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
100+ IFS="$lt_save_ifs"
101+ test -z "$ac_dir" && ac_dir=.
102+ tmp_nm="$ac_dir/$lt_tmp_nm"
103+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
104+ # Check to see if the nm accepts a BSD-compat flag.
105+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
106+ # nm: unknown option "B" ignored
107+ # Tru64's nm complains that /dev/null is an invalid object file
108+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
109+ */dev/null* | *'Invalid file or object type'*)
110+ lt_cv_path_NM="$tmp_nm -B"
111+ break
112+ ;;
113+ *)
114+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
115+ */dev/null*)
116+ lt_cv_path_NM="$tmp_nm -p"
117+ break
118+ ;;
119+ *)
120+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
121+ continue # so that we can try to find one that supports BSD flags
122+ ;;
123+ esac
124+ ;;
125+ esac
126+ fi
127+ done
128+ IFS="$lt_save_ifs"
129+ done
130+ : ${lt_cv_path_NM=no}
131+fi])
132 if test "$lt_cv_path_NM" != "no"; then
133 NM="$lt_cv_path_NM"
134 else
135--
1362.34.1
137