projects/guix·blob java-team · refs

159 lines · 4.3 KiB

1Arrange so that glibc uses 'TRIPLET-objdump -f' rather than 'objdump -f'
2to determine the 'OUTPUT_FORMAT' value in libc.so when cross-compiling.
3
4Patch submitted upstream:
5 <https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html>.
6
7diff --git a/aclocal.m4 b/aclocal.m4
8index c195c4db56..13a791ffde 100644
9--- a/aclocal.m4
10+++ b/aclocal.m4
11@@ -118,8 +118,6 @@ AS=`$CC -print-prog-name=as`
12 LD=`$CC -print-prog-name=ld`
13 AR=`$CC -print-prog-name=ar`
14 AC_SUBST(AR)
15-OBJDUMP=`$CC -print-prog-name=objdump`
16-AC_SUBST(OBJDUMP)
17 OBJCOPY=`$CC -print-prog-name=objcopy`
18 AC_SUBST(OBJCOPY)
19 GPROF=`$CC -print-prog-name=gprof`
20diff --git a/configure b/configure
21index 9619c10991..fe0eda1cd5 100755
22--- a/configure
23+++ b/configure
24@@ -655,7 +655,6 @@ LD
25 AS
26 GPROF
27 OBJCOPY
28-OBJDUMP
29 AR
30 LN_S
31 INSTALL_DATA
32@@ -690,6 +689,7 @@ sysheaders
33 ac_ct_CXX
34 CXXFLAGS
35 CXX
36+OBJDUMP
37 READELF
38 CPP
39 cross_compiling
40@@ -2962,6 +2962,98 @@ else
41 READELF="$ac_cv_prog_READELF"
42 fi
43
44+if test -n "$ac_tool_prefix"; then
45+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
46+set dummy ${ac_tool_prefix}objdump; ac_word=$2
47+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
48+$as_echo_n "checking for $ac_word... " >&6; }
49+if ${ac_cv_prog_OBJDUMP+:} false; then :
50+ $as_echo_n "(cached) " >&6
51+else
52+ if test -n "$OBJDUMP"; then
53+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
54+else
55+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
56+for as_dir in $PATH
57+do
58+ IFS=$as_save_IFS
59+ test -z "$as_dir" && as_dir=.
60+ for ac_exec_ext in '' $ac_executable_extensions; do
61+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
62+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
63+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
64+ break 2
65+ fi
66+done
67+ done
68+IFS=$as_save_IFS
69+
70+fi
71+fi
72+OBJDUMP=$ac_cv_prog_OBJDUMP
73+if test -n "$OBJDUMP"; then
74+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
75+$as_echo "$OBJDUMP" >&6; }
76+else
77+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
78+$as_echo "no" >&6; }
79+fi
80+
81+
82+fi
83+if test -z "$ac_cv_prog_OBJDUMP"; then
84+ ac_ct_OBJDUMP=$OBJDUMP
85+ # Extract the first word of "objdump", so it can be a program name with args.
86+set dummy objdump; ac_word=$2
87+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
88+$as_echo_n "checking for $ac_word... " >&6; }
89+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
90+ $as_echo_n "(cached) " >&6
91+else
92+ if test -n "$ac_ct_OBJDUMP"; then
93+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
94+else
95+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
96+for as_dir in $PATH
97+do
98+ IFS=$as_save_IFS
99+ test -z "$as_dir" && as_dir=.
100+ for ac_exec_ext in '' $ac_executable_extensions; do
101+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
102+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
103+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
104+ break 2
105+ fi
106+done
107+ done
108+IFS=$as_save_IFS
109+
110+fi
111+fi
112+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
113+if test -n "$ac_ct_OBJDUMP"; then
114+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
115+$as_echo "$ac_ct_OBJDUMP" >&6; }
116+else
117+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
118+$as_echo "no" >&6; }
119+fi
120+
121+ if test "x$ac_ct_OBJDUMP" = x; then
122+ OBJDUMP="false"
123+ else
124+ case $cross_compiling:$ac_tool_warned in
125+yes:)
126+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
127+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
128+ac_tool_warned=yes ;;
129+esac
130+ OBJDUMP=$ac_ct_OBJDUMP
131+ fi
132+else
133+ OBJDUMP="$ac_cv_prog_OBJDUMP"
134+fi
135+
136
137 # We need the C++ compiler only for testing.
138 ac_ext=cpp
139@@ -4553,8 +4645,6 @@ AS=`$CC -print-prog-name=as`
140 LD=`$CC -print-prog-name=ld`
141 AR=`$CC -print-prog-name=ar`
142
143-OBJDUMP=`$CC -print-prog-name=objdump`
144-
145 OBJCOPY=`$CC -print-prog-name=objcopy`
146
147 GPROF=`$CC -print-prog-name=gprof`
148diff --git a/configure.ac b/configure.ac
149index 34ecbba540..924af12738 100644
150--- a/configure.ac
151+++ b/configure.ac
152@@ -52,6 +52,7 @@ fi
153 AC_SUBST(cross_compiling)
154 AC_PROG_CPP
155 AC_CHECK_TOOL(READELF, readelf, false)
156+AC_CHECK_TOOL(OBJDUMP, objdump, false)
157
158 # We need the C++ compiler only for testing.
159 AC_PROG_CXX