···11+From beca4a2c25ee86e4020f8b8bddc4d8e0ed3430b3 Mon Sep 17 00:00:00 2001
22+From: Andrew Childs <andrew.childs@bibo.com.ph>
33+Date: Tue, 22 Feb 2022 11:28:04 +0900
44+Subject: [PATCH] Revert "libtool.m4: fix nm BSD flag detection"
55+66+This reverts commit bef9ef8ca0f941d743c77cc55b5fe7985990b2a7.
77+---
88+ ChangeLog | 9 ------
99+ libtool.m4 | 88 ++++++++++++++++++++++++++----------------------------
1010+ 2 files changed, 43 insertions(+), 54 deletions(-)
1111+1212+diff --git a/ChangeLog b/ChangeLog
1313+index 18e8b6835da..c12f07403c3 100644
1414+--- a/ChangeLog
1515++++ b/ChangeLog
1616+@@ -375,15 +375,6 @@
1717+1818+ * src-release.sh (GDB_SUPPPORT_DIRS): Add libbacktrace.
1919+2020+-2021-09-27 Nick Alcock <nick.alcock@oracle.com>
2121+-
2222+- PR libctf/27967
2323+- * libtool.m4 (LT_PATH_NM): Try BSDization flags with a user-provided
2424+- NM, if there is one. Run nm on itself, not on /dev/null, to avoid
2525+- errors from nms that refuse to work on non-regular files. Remove
2626+- other workarounds for this problem. Strip out blank lines from the
2727+- nm output.
2828+-
2929+ 2021-09-27 Nick Alcock <nick.alcock@oracle.com>
3030+3131+ PR libctf/27967
3232+diff --git a/libtool.m4 b/libtool.m4
3333+index a216bb14e99..7a711249304 100644
3434+--- a/libtool.m4
3535++++ b/libtool.m4
3636+@@ -3200,55 +3200,53 @@ _LT_DECL([], [file_magic_cmd], [1],
3737+3838+ # LT_PATH_NM
3939+ # ----------
4040+-# find the pathname to a BSD- or MS-compatible name lister, and any flags
4141+-# needed to make it compatible
4242++# find the pathname to a BSD- or MS-compatible name lister
4343+ AC_DEFUN([LT_PATH_NM],
4444+ [AC_REQUIRE([AC_PROG_CC])dnl
4545+ AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
4646+ [if test -n "$NM"; then
4747+- # Let the user override the nm to test.
4848+- lt_nm_to_check="$NM"
4949+- else
5050+- lt_nm_to_check="${ac_tool_prefix}nm"
5151+- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
5252+- lt_nm_to_check="$lt_nm_to_check nm"
5353+- fi
5454+- fi
5555+- for lt_tmp_nm in $lt_nm_to_check; do
5656+- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
5757+- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
5858+- IFS="$lt_save_ifs"
5959+- test -z "$ac_dir" && ac_dir=.
6060+- case "$lt_tmp_nm" in
6161+- */*|*\\*) tmp_nm="$lt_tmp_nm";;
6262+- *) tmp_nm="$ac_dir/$lt_tmp_nm";;
6363+- esac
6464+- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
6565+- # Check to see if the nm accepts a BSD-compat flag.
6666+- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
6767+- # nm: unknown option "B" ignored
6868+- case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
6969+- *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
7070+- break
7171+- ;;
7272+- *)
7373+- case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
7474+- *$tmp_nm*)
7575+- lt_cv_path_NM="$tmp_nm -p"
7676+- break
7777+- ;;
7878+- *)
7979+- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
8080+- continue # so that we can try to find one that supports BSD flags
8181+- ;;
8282+- esac
8383+- ;;
8484+- esac
8585+- fi
8686+- done
8787+- IFS="$lt_save_ifs"
8888+- done
8989+- : ${lt_cv_path_NM=no}])
9090++ # Let the user override the test.
9191++ lt_cv_path_NM="$NM"
9292++else
9393++ lt_nm_to_check="${ac_tool_prefix}nm"
9494++ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
9595++ lt_nm_to_check="$lt_nm_to_check nm"
9696++ fi
9797++ for lt_tmp_nm in $lt_nm_to_check; do
9898++ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
9999++ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
100100++ IFS="$lt_save_ifs"
101101++ test -z "$ac_dir" && ac_dir=.
102102++ tmp_nm="$ac_dir/$lt_tmp_nm"
103103++ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
104104++ # Check to see if the nm accepts a BSD-compat flag.
105105++ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
106106++ # nm: unknown option "B" ignored
107107++ # Tru64's nm complains that /dev/null is an invalid object file
108108++ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
109109++ */dev/null* | *'Invalid file or object type'*)
110110++ lt_cv_path_NM="$tmp_nm -B"
111111++ break
112112++ ;;
113113++ *)
114114++ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
115115++ */dev/null*)
116116++ lt_cv_path_NM="$tmp_nm -p"
117117++ break
118118++ ;;
119119++ *)
120120++ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
121121++ continue # so that we can try to find one that supports BSD flags
122122++ ;;
123123++ esac
124124++ ;;
125125++ esac
126126++ fi
127127++ done
128128++ IFS="$lt_save_ifs"
129129++ done
130130++ : ${lt_cv_path_NM=no}
131131++fi])
132132+ if test "$lt_cv_path_NM" != "no"; then
133133+ NM="$lt_cv_path_NM"
134134+ else
135135+--
136136+2.34.1
137137+
···11+This reverts upstream commit caf606c90d55305967b9253447dda93d2f1835ab
22+until https://sourceware.org/PR29547 is fixed.
33+44+--- a/libtool.m4
55++++ b/libtool.m4
66+@@ -3214,31 +3214,25 @@ AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
77+ lt_nm_to_check="$lt_nm_to_check nm"
88+ fi
99+ fi
1010+- for lt_tmp_nm in "$lt_nm_to_check"; do
1111++ for lt_tmp_nm in $lt_nm_to_check; do
1212+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1313+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
1414+ IFS="$lt_save_ifs"
1515+ test -z "$ac_dir" && ac_dir=.
1616+- # Strip out any user-provided options from the nm to test twice,
1717+- # the first time to test to see if nm (rather than its options) has
1818+- # an explicit path, the second time to yield a file which can be
1919+- # nm'ed itself.
2020+- tmp_nm_path="`$ECHO "$lt_tmp_nm" | sed 's, -.*$,,'`"
2121+- case "$tmp_nm_path" in
2222++ case "$lt_tmp_nm" in
2323+ */*|*\\*) tmp_nm="$lt_tmp_nm";;
2424+ *) tmp_nm="$ac_dir/$lt_tmp_nm";;
2525+ esac
2626+- tmp_nm_to_nm="`$ECHO "$tmp_nm" | sed 's, -.*$,,'`"
2727+- if test -f "$tmp_nm_to_nm" || test -f "$tmp_nm_to_nm$ac_exeext" ; then
2828++ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
2929+ # Check to see if the nm accepts a BSD-compat flag.
3030+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
3131+ # nm: unknown option "B" ignored
3232+- case `"$tmp_nm" -B "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
3333++ case `"$tmp_nm" -B "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
3434+ *$tmp_nm*) lt_cv_path_NM="$tmp_nm -B"
3535+ break
3636+ ;;
3737+ *)
3838+- case `"$tmp_nm" -p "$tmp_nm_to_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
3939++ case `"$tmp_nm" -p "$tmp_nm" 2>&1 | grep -v '^ *$' | sed '1q'` in
4040+ *$tmp_nm*)
4141+ lt_cv_path_NM="$tmp_nm -p"
4242+ break
+6
pkgs/development/tools/misc/binutils/default.nix
···6868 # Make binutils output deterministic by default.
6969 ./deterministic.patch
70707171+7272+ # Breaks nm BSD flag detection, heeds an upstream fix:
7373+ # https://sourceware.org/PR29547
7474+ ./0001-Revert-libtool.m4-fix-the-NM-nm-over-here-B-option-w.patch
7575+ ./0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch
7676+7177 # Required for newer macos versions
7278 ./0001-libtool.m4-update-macos-version-detection-block.patch
7379