projects/guix·blob python-team · refs

159 lines · 4.2 KiB

1Use 'powerpc64le-linux-gnu-objcopy' rather than 'objcopy' when cross-compiling
2to powerpc64le-linux-gnu: <https://issues.guix.gnu.org/49417>.
3
4Patch submitted:
5 <https://sourceware.org/pipermail/libc-alpha/2021-July/128333.html>
6
7diff --git a/aclocal.m4 b/aclocal.m4
8index 13a791ffde..5b370c07a2 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-OBJCOPY=`$CC -print-prog-name=objcopy`
16-AC_SUBST(OBJCOPY)
17 GPROF=`$CC -print-prog-name=gprof`
18 AC_SUBST(GPROF)
19
20diff --git a/configure b/configure
21index fe0eda1cd5..3a08270734 100755
22--- a/configure
23+++ b/configure
24@@ -654,7 +654,6 @@ MAKE
25 LD
26 AS
27 GPROF
28-OBJCOPY
29 AR
30 LN_S
31 INSTALL_DATA
32@@ -689,6 +688,7 @@ sysheaders
33 ac_ct_CXX
34 CXXFLAGS
35 CXX
36+OBJCOPY
37 OBJDUMP
38 READELF
39 CPP
40@@ -3054,6 +3054,98 @@ else
41 OBJDUMP="$ac_cv_prog_OBJDUMP"
42 fi
43
44+if test -n "$ac_tool_prefix"; then
45+ # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args.
46+set dummy ${ac_tool_prefix}objcopy; 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_OBJCOPY+:} false; then :
50+ $as_echo_n "(cached) " >&6
51+else
52+ if test -n "$OBJCOPY"; then
53+ ac_cv_prog_OBJCOPY="$OBJCOPY" # 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_OBJCOPY="${ac_tool_prefix}objcopy"
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+OBJCOPY=$ac_cv_prog_OBJCOPY
73+if test -n "$OBJCOPY"; then
74+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
75+$as_echo "$OBJCOPY" >&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_OBJCOPY"; then
84+ ac_ct_OBJCOPY=$OBJCOPY
85+ # Extract the first word of "objcopy", so it can be a program name with args.
86+set dummy objcopy; 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_OBJCOPY+:} false; then :
90+ $as_echo_n "(cached) " >&6
91+else
92+ if test -n "$ac_ct_OBJCOPY"; then
93+ ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # 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_OBJCOPY="objcopy"
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_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
113+if test -n "$ac_ct_OBJCOPY"; then
114+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5
115+$as_echo "$ac_ct_OBJCOPY" >&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_OBJCOPY" = x; then
122+ OBJCOPY="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+ OBJCOPY=$ac_ct_OBJCOPY
131+ fi
132+else
133+ OBJCOPY="$ac_cv_prog_OBJCOPY"
134+fi
135+
136
137 # We need the C++ compiler only for testing.
138 ac_ext=cpp
139@@ -4645,8 +4737,6 @@ AS=`$CC -print-prog-name=as`
140 LD=`$CC -print-prog-name=ld`
141 AR=`$CC -print-prog-name=ar`
142
143-OBJCOPY=`$CC -print-prog-name=objcopy`
144-
145 GPROF=`$CC -print-prog-name=gprof`
146
147
148diff --git a/configure.ac b/configure.ac
149index 924af12738..2148cd2ec8 100644
150--- a/configure.ac
151+++ b/configure.ac
152@@ -53,6 +53,7 @@ AC_SUBST(cross_compiling)
153 AC_PROG_CPP
154 AC_CHECK_TOOL(READELF, readelf, false)
155 AC_CHECK_TOOL(OBJDUMP, objdump, false)
156+AC_CHECK_TOOL(OBJCOPY, objcopy, false)
157
158 # We need the C++ compiler only for testing.
159 AC_PROG_CXX