This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] link libgcc_s.so against a lib containing copysignl on powerpc-*-linux-uclibc


Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> writes:

> gcc/ChangeLog:
>
> 2008-10-07  Bernhard Reutner-Fischer  <>
>
> 	* config/t-slibgcc-elf-ver (SHLIB_LC): Also link against
> 	@libgcc_libm@.
>
> libgcc/ChangeLog:
>
> 2008-10-07  Bernhard Reutner-Fischer  <>
>
> 	* configure.ac (libgcc_cv_copysignl_lib, LIBGCC_LIBM): New
> 	variables to denote if we are on powerpc-uclibc where libm
> 	functions live in libm.
> 	* Makefile.in (LIBGCC_LIBM): Set.
> 	(libgcc_s$(SHLIB_EXT)): Substitute @libgcc_libm@ with
> 	$(LIBGCC_LIBM).
> 	* (configure): Regenerate.


> +# 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.
> +dnl save_LIBS="$LIBS"
> +dnl LIBS=
> +dnl AC_SEARCH_LIBS(copysignl, m)
> +dnl LIBGCC_LIBS="$LIBS"
> +dnl LIBS="$save_LIBS"
> +dnl AC_SUBST(LIBGCC_LIBS)

Why don't you run these commands listed as dnl?

> +AC_CACHE_CHECK([for library containing copysignl],
> +  libgcc_cv_copysignl_lib, [
> +    echo '#include <features.h>' > conftest.c
> +    case $target_alias in
> +    *powerpc*)
> +	echo 'int the_libc = __UCLIBC__;' >> conftest.c
> +	;;
> +    *)
> +	echo 'int the_libc; /* dummy */' >> conftest.c
> +	;;
> +    esac
> +    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

AC_TRY_COMMAND is not part of the documented set of autoconf
commands.  And this test seems reversed: shouldn't you add -lm if
AC_TRY_COMMAND fails?

I don't see any reason to write shell code that tests $target_alias
(and shouldn't it be $host_alias anyhow)?  Just write C code that does
"#ifdef PPC"?

The basic idea seems fine, though.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]