yann@1948
|
1 |
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
|
yann@1948
|
2 |
|
yann@1948
|
3 |
On glibc the libc.so carries a copy of the math function copysignl() but
|
yann@1948
|
4 |
on uClibc math functions like copysignl() live in libm. Since libgcc_s
|
yann@1948
|
5 |
contains unresolved symbols, any attempt to link against libgcc_s
|
yann@1948
|
6 |
without explicitely specifying -lm fails, resulting in a broken
|
yann@1948
|
7 |
bootstrap of the compiler.
|
yann@1948
|
8 |
|
yann@1948
|
9 |
|
yann@1948
|
10 |
diff -rdup gcc-4.4.0.old/gcc/config/t-slibgcc-elf-ver gcc-4.4.0/gcc/config/t-slibgcc-elf-ver
|
yann@1948
|
11 |
|
yann@1948
|
12 |
diff -durN gcc-4.4.4.orig/gcc/config/t-slibgcc-elf-ver gcc-4.4.4/gcc/config/t-slibgcc-elf-ver
|
yann@1948
|
13 |
--- gcc-4.4.4.orig/gcc/config/t-slibgcc-elf-ver 2010-01-04 16:13:08.000000000 +0100
|
yann@1948
|
14 |
+++ gcc-4.4.4/gcc/config/t-slibgcc-elf-ver 2010-05-16 19:38:36.000000000 +0200
|
yann@1948
|
15 |
@@ -9,7 +9,7 @@
|
yann@1948
|
16 |
SHLIB_OBJS = @shlib_objs@
|
yann@1948
|
17 |
SHLIB_DIR = @multilib_dir@
|
yann@1948
|
18 |
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
|
yann@1948
|
19 |
-SHLIB_LC = -lc
|
yann@1948
|
20 |
+SHLIB_LC = @libgcc_libm@ -lc
|
yann@1948
|
21 |
SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
|
yann@1948
|
22 |
SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
|
yann@1948
|
23 |
$$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
|
yann@1948
|
24 |
diff -durN gcc-4.4.4.orig/libgcc/Makefile.in gcc-4.4.4/libgcc/Makefile.in
|
yann@1948
|
25 |
--- gcc-4.4.4.orig/libgcc/Makefile.in 2009-04-10 01:23:07.000000000 +0200
|
yann@1948
|
26 |
+++ gcc-4.4.4/libgcc/Makefile.in 2010-05-16 19:38:36.000000000 +0200
|
yann@1948
|
27 |
@@ -39,6 +39,7 @@
|
yann@1948
|
28 |
decimal_float = @decimal_float@
|
yann@1948
|
29 |
enable_decimal_float = @enable_decimal_float@
|
yann@1948
|
30 |
fixed_point = @fixed_point@
|
yann@1948
|
31 |
+LIBGCC_LIBM = @LIBGCC_LIBM@
|
yann@1948
|
32 |
|
yann@1948
|
33 |
host_noncanonical = @host_noncanonical@
|
yann@1948
|
34 |
|
yann@1948
|
35 |
@@ -787,9 +788,10 @@
|
yann@1948
|
36 |
@multilib_dir@,$(MULTIDIR),$(subst \
|
yann@1948
|
37 |
@shlib_objs@,$(objects),$(subst \
|
yann@1948
|
38 |
@shlib_base_name@,libgcc_s,$(subst \
|
yann@1948
|
39 |
+ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
|
yann@1948
|
40 |
@shlib_map_file@,$(mapfile),$(subst \
|
yann@1948
|
41 |
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
|
yann@1948
|
42 |
- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
|
yann@1948
|
43 |
+ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
|
yann@1948
|
44 |
|
yann@1948
|
45 |
libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
|
yann@1948
|
46 |
# @multilib_flags@ is still needed because this may use
|
yann@1948
|
47 |
diff -durN gcc-4.4.4.orig/libgcc/configure gcc-4.4.4/libgcc/configure
|
yann@1948
|
48 |
--- gcc-4.4.4.orig/libgcc/configure 2008-11-20 18:13:01.000000000 +0100
|
yann@1948
|
49 |
+++ gcc-4.4.4/libgcc/configure 2010-05-16 19:38:36.000000000 +0200
|
yann@1948
|
50 |
@@ -272,7 +272,7 @@
|
yann@1948
|
51 |
PACKAGE_BUGREPORT=''
|
yann@1948
|
52 |
|
yann@1948
|
53 |
ac_unique_file="static-object.mk"
|
yann@1948
|
54 |
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
|
yann@1948
|
55 |
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libgcc_topdir enable_shared slibdir INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK build build_cpu build_vendor build_os host host_cpu host_vendor host_os host_noncanonical build_libsubdir build_subdir host_subdir target_subdir AR ac_ct_AR LIPO ac_ct_LIPO NM ac_ct_NM RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP LN_S CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP decimal_float enable_decimal_float fixed_point vis_hide set_have_cc_tls LIBGCC_LIBM tmake_file extra_parts asm_hidden_op LIBOBJS LTLIBOBJS'
|
yann@1948
|
56 |
ac_subst_files=''
|
yann@1948
|
57 |
ac_pwd=`pwd`
|
yann@1948
|
58 |
|
yann@1948
|
59 |
@@ -3547,6 +3547,39 @@
|
yann@1948
|
60 |
fi
|
yann@1948
|
61 |
|
yann@1948
|
62 |
|
yann@1948
|
63 |
+# On powerpc libgcc_s references copysignl which is a libm function but
|
yann@1948
|
64 |
+# glibc apparently also provides it via libc as opposed to uClibc where
|
yann@1948
|
65 |
+# it lives in libm.
|
yann@1948
|
66 |
+echo "$as_me:$LINENO: checking for library containing copysignl" >&5
|
yann@1948
|
67 |
+echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
|
yann@1948
|
68 |
+if test "${libgcc_cv_copysignl_lib+set}" = set; then
|
yann@1948
|
69 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6
|
yann@1948
|
70 |
+else
|
yann@1948
|
71 |
+
|
yann@1948
|
72 |
+ echo '#include <features.h>' > conftest.c
|
yann@1948
|
73 |
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
|
yann@1948
|
74 |
+ libgcc_cv_copysignl_lib="-lc"
|
yann@1948
|
75 |
+ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
|
yann@1948
|
76 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
yann@1948
|
77 |
+ (eval $ac_try) 2>&5
|
yann@1948
|
78 |
+ ac_status=$?
|
yann@1948
|
79 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
yann@1948
|
80 |
+ (exit $ac_status); }; }
|
yann@1948
|
81 |
+ then
|
yann@1948
|
82 |
+ libgcc_cv_copysignl_lib="-lm"
|
yann@1948
|
83 |
+ fi
|
yann@1948
|
84 |
+ rm -f conftest.*
|
yann@1948
|
85 |
+
|
yann@1948
|
86 |
+fi
|
yann@1948
|
87 |
+echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
|
yann@1948
|
88 |
+echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
|
yann@1948
|
89 |
+
|
yann@1948
|
90 |
+case /${libgcc_cv_copysignl_lib}/ in
|
yann@1948
|
91 |
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
|
yann@1948
|
92 |
+ *) LIBGCC_LIBM= ;;
|
yann@1948
|
93 |
+esac
|
yann@1948
|
94 |
+
|
yann@1948
|
95 |
+
|
yann@1948
|
96 |
# Conditionalize the makefile for this target machine.
|
yann@1948
|
97 |
tmake_file_=
|
yann@1948
|
98 |
for f in ${tmake_file}
|
yann@1948
|
99 |
@@ -4267,6 +4300,7 @@
|
yann@1948
|
100 |
s,@fixed_point@,$fixed_point,;t t
|
yann@1948
|
101 |
s,@vis_hide@,$vis_hide,;t t
|
yann@1948
|
102 |
s,@set_have_cc_tls@,$set_have_cc_tls,;t t
|
yann@1948
|
103 |
+s,@LIBGCC_LIBM@,$LIBGCC_LIBM,;t t
|
yann@1948
|
104 |
s,@tmake_file@,$tmake_file,;t t
|
yann@1948
|
105 |
s,@extra_parts@,$extra_parts,;t t
|
yann@1948
|
106 |
s,@asm_hidden_op@,$asm_hidden_op,;t t
|
yann@1948
|
107 |
diff -durN gcc-4.4.4.orig/libgcc/configure.ac gcc-4.4.4/libgcc/configure.ac
|
yann@1948
|
108 |
--- gcc-4.4.4.orig/libgcc/configure.ac 2008-11-20 18:13:01.000000000 +0100
|
yann@1948
|
109 |
+++ gcc-4.4.4/libgcc/configure.ac 2010-05-16 19:38:36.000000000 +0200
|
yann@1948
|
110 |
@@ -223,6 +223,27 @@
|
yann@1948
|
111 |
fi
|
yann@1948
|
112 |
AC_SUBST(set_have_cc_tls)
|
yann@1948
|
113 |
|
yann@1948
|
114 |
+# On powerpc libgcc_s references copysignl which is a libm function but
|
yann@1948
|
115 |
+# glibc apparently also provides it via libc as opposed to uClibc where
|
yann@1948
|
116 |
+# it lives in libm.
|
yann@1948
|
117 |
+AC_CACHE_CHECK
|
yann@1948
|
118 |
+ libgcc_cv_copysignl_lib,
|
yann@1948
|
119 |
+ echo '#include <features.h>' > conftest.c
|
yann@1948
|
120 |
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
|
yann@1948
|
121 |
+ libgcc_cv_copysignl_lib="-lc"
|
yann@1948
|
122 |
+ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
|
yann@1948
|
123 |
+ then
|
yann@1948
|
124 |
+ libgcc_cv_copysignl_lib="-lm"
|
yann@1948
|
125 |
+ fi
|
yann@1948
|
126 |
+ rm -f conftest.*
|
yann@1948
|
127 |
+ ])
|
yann@1948
|
128 |
+
|
yann@1948
|
129 |
+case /${libgcc_cv_copysignl_lib}/ in
|
yann@1948
|
130 |
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
|
yann@1948
|
131 |
+ *) LIBGCC_LIBM= ;;
|
yann@1948
|
132 |
+esac
|
yann@1948
|
133 |
+AC_SUBST(LIBGCC_LIBM)
|
yann@1948
|
134 |
+
|
yann@1948
|
135 |
# Conditionalize the makefile for this target machine.
|
yann@1948
|
136 |
tmake_file_=
|
yann@1948
|
137 |
for f in ${tmake_file}
|