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 libquadmath]: Fix build of gfortran using libquadmath for pe-coff targets


Ralf,

thanks for review. Patch applied at revision 167259.

2010/11/28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>:
> Hello, and apologies for the delay, I was away,
>
> * Kai Tietz wrote on Wed, Nov 24, 2010 at 08:50:48AM CET:
>> I attached updated patch without the commented line. To fiddle about
>> -no-undefined I let for Dave ;)
>
> Please copy patches inline, or at least ensure that the MIME type is
> text not binary, to make replying easy. ?And please repeat the ChangeLog
> entry when posting an updated patch (it may have changed). ?Thanks.
>
> Patch is OK with nits from others and from below addressed.
> I'm going to review the patch from Tobias that overlaps with this one,
> but that one needs more work, so I think this one should go in first.
>
> Thanks,
> Ralf
>
>> 2010-11-21 ?Kai Tietz
>> ? ? ? ? * configure: Regenerated.
>> ? ? ? ? * Makefile.in: Regenerated.
>> ? ? ? ? * configure.ac (ACX_NONCANONICAL_TARGET): New.
>
> "Call it". ?The macro is not defined here.
>
>> ? ? ? ? (target_alias): Use AC_SUBST for it.
>> ? ? ? ? (GCC_NO_EXECUTABLES): New.
>
> See above.
>
>> ? ? ? ? (AC_PROG_CC): Improve multilib handling.
>> ? ? ? ? Check that gcc is used for compilation.
>> ? ? ? ? Use pattern from libssp for symbol versioning checking.
>> ? ? ? ? * Makefile.am (LTLDFLAGS): Removed.
>> ? ? ? ? (libquadmath_la_LDFLAGS): Add -no-undefined.
>> ? ? ? ? (libquadmath_la_LINK): Commented out.
>> ? ? ? ? (libquadmath_la_DEPENDENCIES): Add ibquadmath_la_LIBADD.
>
> Typo libquadmath_la_LIBADD.

Adjusted in Changelog

>> --- Makefile.am ? ? ? (revision 167107)
>> +++ Makefile.am ? ? ? (working copy)
>> @@ -33,15 +33,13 @@
>> ?version_dep =
>> ?endif
>>
>> -LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) \
>> - ? ? ? ? ? ?-no-undefined
>> +AM_CFLAGS = -Wall
>
> The addition of AM_CFLAGS seems like a good idea, but orthogonal to
> fixing the build. ?Preapproved as separate patch.

Agreed, I removed it from patch and will sent a separate one for it.

>> -
>> ?toolexeclib_LTLIBRARIES = libquadmath.la
>> ?libquadmath_la_LIBADD =
>> -libquadmath_la_LDFLAGS = $(LTLDFLAGS) -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(version_arg) -lm
>> -libquadmath_la_LINK = $(LINK) $(libgfortran_la_LDFLAGS)
>> -libquadmath_la_DEPENDENCIES = $(version_dep)
>> +libquadmath_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` \
>> + ? ? ? ? ? ? ? ? ? ? ?$(version_arg) -no-undefined -bindir "$(bindir)" -lm
>> +libquadmath_la_DEPENDENCIES = $(version_dep) $(libquadmath_la_LIBADD)
>>
>> ?include_HEADERS = quadmath.h quadmath_weak.h
>>
>> @@ -66,4 +64,46 @@
>> ? ?math/nanq.c math/tgammaq.c math/finiteq.c math/nextafterq.c \
>> ? ?math/truncq.c math/floorq.c math/powq.c
>>
>> +# Work around what appears to be a GNU make bug handling MAKEFLAGS
>> +# values defined in terms of make variables, as is the case for CC and
>> +# friends when we are called from the top level Makefile.
>
> Out of curiosity: did you actually need this AM_MAKEFLAGS setting, or
> did you just copy it for consistency?
>
> It is ok.

Well, I inserted it for consistency, I don't assume it is really
necessary (at least not for windows targets).

>> +AM_MAKEFLAGS = \
>> + ? ? "AR_FLAGS=$(AR_FLAGS)" \
>> + ? ? "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
>> + ? ? "CFLAGS=$(CFLAGS)" \
>> + ? ? "CXXFLAGS=$(CXXFLAGS)" \
>> + ? ? "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
>> + ? ? "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
>> + ? ? "INSTALL=$(INSTALL)" \
>> + ? ? "INSTALL_DATA=$(INSTALL_DATA)" \
>> + ? ? "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
>> + ? ? "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
>> + ? ? "JC1FLAGS=$(JC1FLAGS)" \
>> + ? ? "LDFLAGS=$(LDFLAGS)" \
>> + ? ? "LIBCFLAGS=$(LIBCFLAGS)" \
>> + ? ? "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
>> + ? ? "MAKE=$(MAKE)" \
>> + ? ? "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
>> + ? ? "PICFLAG=$(PICFLAG)" \
>> + ? ? "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
>> + ? ? "SHELL=$(SHELL)" \
>> + ? ? "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
>> + ? ? "exec_prefix=$(exec_prefix)" \
>> + ? ? "infodir=$(infodir)" \
>> + ? ? "libdir=$(libdir)" \
>> + ? ? "prefix=$(prefix)" \
>> + ? ? "includedir=$(includedir)" \
>> + ? ? "AR=$(AR)" \
>> + ? ? "AS=$(AS)" \
>> + ? ? "CC=$(CC)" \
>> + ? ? "CXX=$(CXX)" \
>> + ? ? "LD=$(LD)" \
>> + ? ? "LIBCFLAGS=$(LIBCFLAGS)" \
>> + ? ? "NM=$(NM)" \
>> + ? ? "PICFLAG=$(PICFLAG)" \
>> + ? ? "RANLIB=$(RANLIB)" \
>> + ? ? "DESTDIR=$(DESTDIR)"
>> +
>> +MAKEOVERRIDES=
>> +
>> ?endif
>> Index: configure.ac
>> ===================================================================
>> --- configure.ac ? ? ?(revision 167107)
>> +++ configure.ac ? ? ?(working copy)
>> @@ -21,13 +21,13 @@
>> ?# Do not delete or change the following two lines. ?For why, see
>> ?# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
>> ?AC_CANONICAL_SYSTEM
>> +ACX_NONCANONICAL_TARGET
>> +
>> ?target_alias=${target_alias-$host_alias}
>> +AC_SUBST(target_alias)
>>
>> ?AM_INIT_AUTOMAKE([1.9.0 foreign subdir-objects no-dist -Wall -Werror])
>>
>> -AC_PROG_CC
>> -AM_PROG_CC_C_O
>> -
>> ?AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
>> ?AC_ARG_ENABLE(version-specific-runtime-libs,
>> ?[ ?--enable-version-specific-runtime-libs ? ?Specify that runtime libraries should be installed in a compiler-specific directory ],
>> @@ -39,6 +39,7 @@
>> ?[version_specific_libs=no])
>> ?AC_MSG_RESULT($version_specific_libs)
>>
>> +GCC_NO_EXECUTABLES
>>
>> ?# Configure libtool
>> ?AM_PROG_LIBTOOL
>> @@ -48,6 +49,26 @@
>> ?AM_MAINTAINER_MODE
>> ?AM_ENABLE_MULTILIB(, ..)
>>
>> +AC_LANG_C
>> +# The same as in boehm-gc and libstdc++. Have to borrow it from there.
>> +# We must force CC to /not/ be precious variables; otherwise
>> +# the wrong, non-multilib-adjusted value will be used in multilibs.
>> +# As a side effect, we have to subst CFLAGS ourselves.
>> +
>> +m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
>> +m4_define([_AC_ARG_VAR_PRECIOUS],[])
>> +AC_PROG_CC
>> +m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
>> +
>> +AC_SUBST(CFLAGS)
>> +
>> +AM_PROG_CC_C_O
>> +
>> +if test "x$GCC" != "xyes"; then
>> + ?AC_MSG_ERROR([libquadmath must be built with GCC])
>> +fi
>> +AC_PROG_CPP
>> +
>> ?# Calculate toolexeclibdir
>> ?# Also toolexecdir, though it's only used in toolexeclibdir
>> ?case ${version_specific_libs} in
>> @@ -83,30 +104,36 @@
>>
>> ?# Check for symbol versioning (copied from libssp).
>> ?AC_MSG_CHECKING([whether symbol versioning is supported])
>> -save_LDFLAGS="$LDFLAGS"
>> -LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
>> -cat > conftest.map <<EOF
>> +if test x$gcc_no_link = xyes; then
>> + ?# If we cannot link, we cannot build shared libraries, so do not use
>> + ?# symbol versioning.
>> + ?quadmath_use_symver=no
>> +else
>> + ?save_LDFLAGS="$LDFLAGS"
>> + ?LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
>> + ?cat > conftest.map <<EOF
>> ?FOO_1.0 {
>> ? ?global: *foo*; bar; local: *;
>> ?};
>> ?EOF
>> -AC_TRY_LINK([int foo;],[],[quadmath_use_symver=gnu],[quadmath_use_symver=no])
>> -if test x$quadmath_use_symver = xno; then
>> - ?case "$target_os" in
>> - ? ?solaris2*)
>> - ? ? ?LDFLAGS="$save_LDFLAGS"
>> - ? ? ?LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
>> - ? ? ?# Sun ld cannot handle wildcards and treats all entries as undefined.
>> - ? ? ?cat > conftest.map <<EOF
>> + ?AC_TRY_LINK([int foo;],[],[quadmath_use_symver=gnu],[quadmath_use_symver=no])
>> + ?if test x$quadmath_use_symver = xno; then
>> + ? ?case "$target_os" in
>> + ? ? ?solaris2*)
>> + ? ? ? ?LDFLAGS="$save_LDFLAGS"
>> + ? ? ? ?LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
>> + ? ? ? ?# Sun ld cannot handle wildcards and treats all entries as undefined.
>> + ? ? ? ?cat > conftest.map <<EOF
>> ?FOO_1.0 {
>> ? ?global: foo; local: *;
>> ?};
>> ?EOF
>> - ? ? ?AC_TRY_LINK([int foo;],[],[quadmath_use_symver=sun],[quadmath_use_symver=no])
>> - ? ? ?;;
>> - ?esac
>> + ? ? ? ?AC_TRY_LINK([int foo;],[],[quadmath_use_symver=sun],[quadmath_use_symver=no])
>> + ? ? ;;
>
> Let's align ;; with the line above it.
>
>> + ? ?esac
>> + ?fi
>> + ?LDFLAGS="$save_LDFLAGS"
>> ?fi
>> -LDFLAGS="$save_LDFLAGS"
>> ?AC_MSG_RESULT($quadmath_use_symver)
>> ?AM_CONDITIONAL(LIBQUAD_USE_SYMVER, [test "x$quadmath_use_symver" != xno])
>> ?AM_CONDITIONAL(LIBQUAD_USE_SYMVER_GNU, [test "x$quadmath_use_symver" = xgnu])
>

Thanks,
Kai

PS: I will paste for patches you need to review the content. As I am
not able to configure googlemail in a way to use something else then
binary mine-type for attachments, I can do here much about that

-- 
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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