2013-03-23 23:26:29 +01:00
|
|
|
http://gcc.gnu.org/ml/gcc-patches/2008-10/msg00269.html
|
|
|
|
|
|
|
|
On glibc the libc.so carries a copy of the math function copysignl() but
|
|
|
|
on uClibc math functions like copysignl() live in libm. Since libgcc_s
|
|
|
|
contains unresolved symbols, any attempt to link against libgcc_s
|
|
|
|
without explicitely specifying -lm fails, resulting in a broken
|
|
|
|
bootstrap of the compiler.
|
|
|
|
|
|
|
|
Forward port to gcc 4.5.1 by Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
|
|
|
|
|
|
---
|
|
|
|
libgcc/Makefile.in | 4 +++-
|
|
|
|
libgcc/configure | 32 ++++++++++++++++++++++++++++++++
|
|
|
|
libgcc/configure.ac | 21 +++++++++++++++++++++
|
|
|
|
3 files changed, 56 insertions(+), 1 deletion(-)
|
|
|
|
|
2016-08-03 23:48:24 +02:00
|
|
|
Index: b/libgcc/Makefile.in
|
2013-03-23 23:26:29 +01:00
|
|
|
===================================================================
|
2016-08-03 23:48:24 +02:00
|
|
|
--- a/libgcc/Makefile.in
|
|
|
|
+++ b/libgcc/Makefile.in
|
|
|
|
@@ -42,6 +42,7 @@
|
|
|
|
enable_vtable_verify = @enable_vtable_verify@
|
2013-03-23 23:26:29 +01:00
|
|
|
enable_decimal_float = @enable_decimal_float@
|
|
|
|
fixed_point = @fixed_point@
|
|
|
|
+LIBGCC_LIBM = @LIBGCC_LIBM@
|
|
|
|
|
|
|
|
host_noncanonical = @host_noncanonical@
|
|
|
|
target_noncanonical = @target_noncanonical@
|
2016-08-03 23:48:24 +02:00
|
|
|
@@ -943,9 +944,10 @@
|
2013-03-23 23:26:29 +01:00
|
|
|
@multilib_dir@,$(MULTIDIR),$(subst \
|
|
|
|
@shlib_objs@,$(objects) libgcc.a,$(subst \
|
|
|
|
@shlib_base_name@,libgcc_s,$(subst \
|
|
|
|
+ @libgcc_libm@,$(LIBGCC_LIBM),$(subst \
|
|
|
|
@shlib_map_file@,$(mapfile),$(subst \
|
|
|
|
@shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
|
|
|
|
- @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
|
|
|
|
+ @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))))
|
|
|
|
|
|
|
|
libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
|
|
|
|
# @multilib_flags@ is still needed because this may use
|
2016-08-03 23:48:24 +02:00
|
|
|
Index: b/libgcc/configure
|
2013-03-23 23:26:29 +01:00
|
|
|
===================================================================
|
2016-08-03 23:48:24 +02:00
|
|
|
--- a/libgcc/configure
|
|
|
|
+++ b/libgcc/configure
|
2013-03-23 23:26:29 +01:00
|
|
|
@@ -564,6 +564,7 @@
|
|
|
|
tmake_file
|
|
|
|
sfp_machine_header
|
|
|
|
set_use_emutls
|
|
|
|
+LIBGCC_LIBM
|
|
|
|
set_have_cc_tls
|
|
|
|
vis_hide
|
|
|
|
fixed_point
|
2016-08-03 23:48:24 +02:00
|
|
|
@@ -4535,6 +4536,37 @@
|
2013-03-23 23:26:29 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
+# On powerpc libgcc_s references copysignl which is a libm function but
|
|
|
|
+# glibc apparently also provides it via libc as opposed to uClibc where
|
|
|
|
+# it lives in libm.
|
|
|
|
+echo "$as_me:$LINENO: checking for library containing copysignl" >&5
|
|
|
|
+echo $ECHO_N "checking for library containing copysignl... $ECHO_C" >&6
|
|
|
|
+if test "${libgcc_cv_copysignl_lib+set}" = set; then
|
|
|
|
+ echo $ECHO_N "(cached) $ECHO_C" >&6
|
|
|
|
+else
|
|
|
|
+
|
|
|
|
+ echo '#include <features.h>' > conftest.c
|
|
|
|
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
|
|
|
|
+ libgcc_cv_copysignl_lib="-lc"
|
|
|
|
+ if { ac_try='${CC-cc} -S conftest.c -o conftest.s 1>&5'
|
|
|
|
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
|
|
|
+ (eval $ac_try) 2>&5
|
|
|
|
+ ac_status=$?
|
|
|
|
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
|
|
|
+ (exit $ac_status); }; }
|
|
|
|
+ then
|
|
|
|
+ libgcc_cv_copysignl_lib="-lm"
|
|
|
|
+ fi
|
|
|
|
+ rm -f conftest.*
|
|
|
|
+
|
|
|
|
+fi
|
|
|
|
+echo "$as_me:$LINENO: result: $libgcc_cv_copysignl_lib" >&5
|
|
|
|
+echo "${ECHO_T}$libgcc_cv_copysignl_lib" >&6
|
|
|
|
+
|
|
|
|
+case /${libgcc_cv_copysignl_lib}/ in
|
|
|
|
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
|
|
|
|
+ *) LIBGCC_LIBM= ;;
|
|
|
|
+esac
|
|
|
|
|
|
|
|
# Conditionalize the makefile for this target machine.
|
|
|
|
tmake_file_=
|
2016-08-03 23:48:24 +02:00
|
|
|
Index: b/libgcc/configure.ac
|
2013-03-23 23:26:29 +01:00
|
|
|
===================================================================
|
2016-08-03 23:48:24 +02:00
|
|
|
--- a/libgcc/configure.ac
|
|
|
|
+++ b/libgcc/configure.ac
|
|
|
|
@@ -357,6 +357,27 @@
|
2013-03-23 23:26:29 +01:00
|
|
|
fi
|
|
|
|
AC_SUBST(set_have_cc_tls)
|
|
|
|
|
|
|
|
+# On powerpc libgcc_s references copysignl which is a libm function but
|
|
|
|
+# glibc apparently also provides it via libc as opposed to uClibc where
|
|
|
|
+# it lives in libm.
|
|
|
|
+AC_CACHE_CHECK
|
|
|
|
+ libgcc_cv_copysignl_lib,
|
|
|
|
+ echo '#include <features.h>' > conftest.c
|
|
|
|
+ echo 'int the_libc = __UCLIBC__ + __powerpc__;' >> conftest.c
|
|
|
|
+ libgcc_cv_copysignl_lib="-lc"
|
|
|
|
+ if AC_TRY_COMMAND(${CC-cc} -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD)
|
|
|
|
+ then
|
|
|
|
+ libgcc_cv_copysignl_lib="-lm"
|
|
|
|
+ fi
|
|
|
|
+ rm -f conftest.*
|
|
|
|
+ ])
|
|
|
|
+
|
|
|
|
+case /${libgcc_cv_copysignl_lib}/ in
|
|
|
|
+ /-lm/) LIBGCC_LIBM="$LIBGCC_LIBM -lm" ;;
|
|
|
|
+ *) LIBGCC_LIBM= ;;
|
|
|
|
+esac
|
|
|
|
+AC_SUBST(LIBGCC_LIBM)
|
|
|
|
+
|
|
|
|
# See if we have emulated thread-local storage.
|
|
|
|
GCC_CHECK_EMUTLS
|
|
|
|
set_use_emutls=
|