Bug 55225 - Fail to build lgammaq.c from trunk with mingw-w64
Summary: Fail to build lgammaq.c from trunk with mingw-w64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libquadmath (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-07 07:36 UTC by Alexey Pavlov
Modified: 2012-11-21 13:48 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-11-21 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Pavlov 2012-11-07 07:36:20 UTC
Mingw-w64 doesn't have declared signgam in <math.h> that leads to an error:

depbase=`echo math/lgammaq.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool --tag=CC   --mode=compile /temp/x64-trunk-snapshot-posix-seh-rev0/build/gcc-trunk/./gcc/xgcc -B/temp/x64-trunk-snapshot-posix-seh-rev0/build/gcc-trunk/./gcc/ -L/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/lib -L/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/mingw/lib -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/include -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/mingw/include -B/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/bin/ -B/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/lib/ -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/include -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/sys-include    -DHAVE_CONFIG_H -I. -I../../../../../mingw-sources/gcc-trunk/libquadmath     -g -O2 -pipe -fomit-frame-pointer -I/temp/x64-trunk-snapshot-posix-seh-rev0/libs/include -I/temp/mingw-prereq/x86_64-w64-mingw32-static/include -MT math/lgammaq.lo -MD -MP -MF $depbase.Tpo -c -o math/lgammaq.lo ../../../../../mingw-sources/gcc-trunk/libquadmath/math/lgammaq.c &&\
	mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /temp/x64-trunk-snapshot-posix-seh-rev0/build/gcc-trunk/./gcc/xgcc -B/temp/x64-trunk-snapshot-posix-seh-rev0/build/gcc-trunk/./gcc/ -L/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/lib -L/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/mingw/lib -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/include -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/mingw/include -B/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/bin/ -B/temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/lib/ -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/include -isystem /temp/x64-trunk-snapshot-posix-seh-rev0/prefix/x86_64-w64-mingw32/sys-include -DHAVE_CONFIG_H -I. -I../../../../../mingw-sources/gcc-trunk/libquadmath -g -O2 -pipe -fomit-frame-pointer -I/temp/x64-trunk-snapshot-posix-seh-rev0/libs/include -I/temp/mingw-prereq/x86_64-w64-mingw32-static/include -MT math/lgammaq.lo -MD -MP -MF math/.deps/lgammaq.Tpo -c ../../../../../mingw-sources/gcc-trunk/libquadmath/math/lgammaq.c  -DDLL_EXPORT -DPIC -o math/.libs/lgammaq.o
../../../../../mingw-sources/gcc-trunk/libquadmath/math/lgammaq.c: In function 'lgammaq':
../../../../../mingw-sources/gcc-trunk/libquadmath/math/lgammaq.c:763:3: error: 'signgam' undeclared (first use in this function)
   signgam = 1;
   ^
../../../../../mingw-sources/gcc-trunk/libquadmath/math/lgammaq.c:763:3: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [math/lgammaq.lo] Error 1
make[3]: Leaving directory `/temp/x64-trunk-snapshot-posix-seh-rev0/build/gcc-trunk/x86_64-w64-mingw32/libquadmath'
Comment 1 Alexey Pavlov 2012-11-21 08:02:29 UTC
Fixed in mingw-w64 trunk
Comment 2 niXman 2012-11-21 08:09:40 UTC
(In reply to comment #1)
> Fixed in mingw-w64 trunk

Strange that the mingw-w64 developers didn't report that the bug is fixed.
Comment 3 Kai Tietz 2012-11-21 11:53:53 UTC
(In reply to comment #2)
> Strange that the mingw-w64 developers didn't report that the bug is fixed.

It isn't fixed.  We added to mingw-w64's trunk the POSIX feature of signgam.  By this reason things are working again, if you are using recent mingw-w64's trunk version.
I re-open bug as there is actual a fix pending
Comment 4 Tobias Burnus 2012-11-21 13:46:41 UTC
Author: burnus
Date: Wed Nov 21 13:46:34 2012
New Revision: 193695

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193695
Log:
2012-11-21  Tobias Burnus  <burnus@net-b.de>

        PR libquadmath/55225
        * math/lgammaq.c (lgammaq): Use local variable if
        math.h does not provide signgam.
        * acinclude.m4 (LIBQUAD_CHECK_MATH_H_SIGNGAM): New check.
        * configure.ac: Use it.
        * configure: Regenerate.
        * config.h.in: Regenerate.


Modified:
    trunk/libquadmath/ChangeLog
    trunk/libquadmath/acinclude.m4
    trunk/libquadmath/config.h.in
    trunk/libquadmath/configure
    trunk/libquadmath/configure.ac
    trunk/libquadmath/math/lgammaq.c
Comment 5 Tobias Burnus 2012-11-21 13:48:48 UTC
FIXED on the trunk (4.8), which was only affected.

While POSIX requires that signgam is used for lgamma and, hence, math.h includes it. C99 doesn't have signgam.

Thus, even if MinGW-w64 now supports it, a configure check makes sense as other systems might not (yet?) support it.