yann@1857
|
1 |
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
|
yann@1857
|
2 |
|
yann@1857
|
3 |
On glibc the libc.so carries a copy of the math function copysignl() but
|
yann@1857
|
4 |
on uClibc math functions like copysignl() live in libm. Since libgcc_s
|
yann@1857
|
5 |
contains unresolved symbols, any attempt to link against libgcc_s
|
yann@1857
|
6 |
without explicitely specifying -lm fails, resulting in a broken
|
yann@1857
|
7 |
bootstrap of the compiler.
|
yann@1857
|
8 |
|
yann@1857
|
9 |
|
yann@1857
|
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@1857
|
11 |
--- gcc-4.4.0.old/gcc/config/t-slibgcc-elf-ver 2005-10-31 18:03:08.000000000 +0100
|
yann@1857
|
12 |
+++ gcc-4.4.0/gcc/config/t-slibgcc-elf-ver 2008-10-07 19:28:13.000000000 +0200
|
yann@1857
|
13 |
@@ -9,7 +9,7 @@ SHLIB_MAP = @shlib_map_file@
|
yann@1857
|
14 |
SHLIB_OBJS = @shlib_objs@
|
yann@1857
|
15 |
SHLIB_DIR = @multilib_dir@
|
yann@1857
|
16 |
SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
|
yann@1857
|
17 |
-SHLIB_LC = -lc
|
yann@1857
|
18 |
+SHLIB_LC = @libgcc_libm@ -lc
|
yann@1857
|
19 |
|
yann@1857
|
20 |
SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
|
yann@1857
|
21 |
-Wl,--soname=$(SHLIB_SONAME) \
|
yann@1857
|
22 |
diff -rdup gcc-4.4.0.old/libgcc/configure gcc-4.4.0/libgcc/configure
|
yann@1857
|
23 |
--- gcc-4.4.0.old/libgcc/configure 2008-07-17 10:40:53.000000000 +0200
|
yann@1857
|
24 |
+++ gcc-4.4.0/libgcc/configure 2008-10-07 19:40:48.000000000 +0200
|
yann@1857
|
25 |
@@ -272,7 +272,7 @@ PACKAGE_STRING='GNU C Runtime Library 1.
|
yann@1857
|
26 |
PACKAGE_BUGREPORT=''
|
yann@1857
|
27 |
|
yann@1857
|
28 |
ac_unique_file="static-object.mk"
|
yann@1857
|
29 |
-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@1857
|
30 |
+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@1857
|
31 |
ac_subst_files=''
|
yann@1857
|
32 |
ac_pwd=`pwd`
|
yann@1857
|
33 |
|
yann@1857
|
34 |
@@ -3522,6 +3522,39 @@ if test "$enable_tls $gcc_cv_have_cc_tls
|
yann@1857
|
35 |
fi
|
yann@1857
|
36 |
|
yann@1857
|
37 |
|
yann@1857
|
38 |
+# On powerpc libgcc_s references copysignl which is a libm function but
|
yann@1857
|
39 |
+# glibc apparently also provides it via libc as opposed to uClibc where
|
yann@1857
|
40 |
+# it lives in libm.
|
yann@1857
|
41 |
+echo "$as_me:$LINENO: checking for library containing copysignl" >&5
|
yann@1857
|
42 |
+echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
|
yann@1857
|
43 |
+if test "${libgcc_cv_copysignl_lib+set}" = set; then
|
yann@1857
|
44 |
+ echo $ECHO_N "(cached) $ECHO_C" >&6
|
yann@1857
|
45 |
+else
|
yann@1857
|
46 |
+
|
yann@1857
|
47 |
+ echo '#include <features.h>' > conftest.c
|
yann@1857
|
48 |
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
|
yann@1857
|
49 |
+ libgcc_cv_copysignl_lib="-lc"
|
yann@1857
|
50 |
+ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
|
yann@1857
|
51 |
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
yann@1857
|
52 |
+ (eval $ac_try) 2>&5
|
yann@1857
|
53 |
+ ac_status=$?
|
yann@1857
|
54 |
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
yann@1857
|
55 |
+ (exit $ac_status); }; }
|
yann@1857
|
56 |
+ then
|
yann@1857
|
57 |
+ libgcc_cv_copysignl_lib="-lm"
|
yann@1857
|
58 |
+ fi
|
yann@1857
|
59 |
+ rm -f conftest.*
|
yann@1857
|
60 |
+
|
yann@1857
|
61 |
+fi
|
yann@1857
|
62 |
+echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
|
yann@1857
|
63 |
+echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
|
yann@1857
|
64 |
+
|
yann@1857
|
65 |
+case /${libgcc_cv_copysignl_lib}/ in
|
yann@1857
|
66 |
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
|
yann@1857
|
67 |
+ *) LIBGCC_LIBM= ;;
|
yann@1857
|
68 |
+esac
|
yann@1857
|
69 |
+
|
yann@1857
|
70 |
+
|
yann@1857
|
71 |
# Conditionalize the makefile for this target machine.
|
yann@1857
|
72 |
tmake_file_=
|
yann@1857
|
73 |
for f in ${tmake_file}
|
yann@1857
|
74 |
@@ -4242,6 +4275,7 @@ s,@enable_decimal_float@,$enable_decimal
|
yann@1857
|
75 |
s,@fixed_point@,$fixed_point,;t t
|
yann@1857
|
76 |
s,@vis_hide@,$vis_hide,;t t
|
yann@1857
|
77 |
s,@set_have_cc_tls@,$set_have_cc_tls,;t t
|
yann@1857
|
78 |
+s,@LIBGCC_LIBM@,$LIBGCC_LIBM,;t t
|
yann@1857
|
79 |
s,@tmake_file@,$tmake_file,;t t
|
yann@1857
|
80 |
s,@extra_parts@,$extra_parts,;t t
|
yann@1857
|
81 |
s,@asm_hidden_op@,$asm_hidden_op,;t t
|
yann@1857
|
82 |
diff -rdup gcc-4.4.0.old/libgcc/configure.ac gcc-4.4.0/libgcc/configure.ac
|
yann@1857
|
83 |
--- gcc-4.4.0.old/libgcc/configure.ac 2008-07-17 10:40:53.000000000 +0200
|
yann@1857
|
84 |
+++ gcc-4.4.0/libgcc/configure.ac 2008-10-07 19:34:48.000000000 +0200
|
yann@1857
|
85 |
@@ -203,6 +203,27 @@ if test "$enable_tls $gcc_cv_have_cc_tls
|
yann@1857
|
86 |
fi
|
yann@1857
|
87 |
AC_SUBST(set_have_cc_tls)
|
yann@1857
|
88 |
|
yann@1857
|
89 |
+# On powerpc libgcc_s references copysignl which is a libm function but
|
yann@1857
|
90 |
+# glibc apparently also provides it via libc as opposed to uClibc where
|
yann@1857
|
91 |
+# it lives in libm.
|
yann@1857
|
92 |
+AC_CACHE_CHECK
|
yann@1857
|
93 |
+ libgcc_cv_copysignl_lib,
|
yann@1857
|
94 |
+ echo '#include <features.h>' > conftest.c
|
yann@1857
|
95 |
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
|
yann@1857
|
96 |
+ libgcc_cv_copysignl_lib="-lc"
|
yann@1857
|
97 |
+ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
|
yann@1857
|
98 |
+ then
|
yann@1857
|
99 |
+ libgcc_cv_copysignl_lib="-lm"
|
yann@1857
|
100 |
+ fi
|
yann@1857
|
101 |
+ rm -f conftest.*
|
yann@1857
|
102 |
+ ])
|
yann@1857
|
103 |
+
|
yann@1857
|
104 |
+case /${libgcc_cv_copysignl_lib}/ in
|
yann@1857
|
105 |
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
|
yann@1857
|
106 |
+ *) LIBGCC_LIBM= ;;
|
yann@1857
|
107 |
+esac
|
yann@1857
|
108 |
+AC_SUBST(LIBGCC_LIBM)
|
yann@1857
|
109 |
+
|
yann@1857
|
110 |
# Conditionalize the makefile for this target machine.
|
yann@1857
|
111 |
tmake_file_=
|
yann@1857
|
112 |
for f in ${tmake_file}
|
yann@1857
|
113 |
diff -rdup gcc-4.4.0.old/libgcc/Makefile.in gcc-4.4.0/libgcc/Makefile.in
|
yann@1857
|
114 |
--- gcc-4.4.0.old/libgcc/Makefile.in 2008-07-17 10:40:53.000000000 +0200
|
yann@1857
|
115 |
+++ gcc-4.4.0/libgcc/Makefile.in 2008-10-07 19:28:13.000000000 +0200
|
yann@1857
|
116 |
@@ -40,6 +40,7 @@ enable_shared = @enable_shared@
|
yann@1857
|
117 |
decimal_float = @decimal_float@
|
yann@1857
|
118 |
enable_decimal_float = @enable_decimal_float@
|
yann@1857
|
119 |
fixed_point = @fixed_point@
|
yann@1857
|
120 |
+LIBGCC_LIBM = @LIBGCC_LIBM@
|
yann@1857
|
121 |
|
yann@1857
|
122 |
host_noncanonical = @host_noncanonical@
|
yann@1857
|
123 |
|
yann@1857
|
124 |
@@ -786,9 +787,10 @@ libgcc_s$(SHLIB_EXT): $(libgcc-s-objects
|
yann@1857
|
125 |
@multilib_dir@,$(MULTIDIR),$(subst \
|
yann@1857
|
126 |
@shlib_objs@,$(objects),$(subst \
|
yann@1857
|
127 |
@shlib_base_name@,libgcc_s,$(subst \
|
yann@1857
|
128 |
+ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
|
yann@1857
|
129 |
@shlib_map_file@,$(mapfile),$(subst \
|
yann@1857
|
130 |
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
|
yann@1857
|
131 |
- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
|
yann@1857
|
132 |
+ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
|
yann@1857
|
133 |
|
yann@1857
|
134 |
libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
|
yann@1857
|
135 |
# @multilib_flags@ is still needed because this may use
|