This one is strange. On i686-mingw, compiling gfortran fails with: ../../../gcc/libgfortran/generated/exp_c8.c:38: error: conflicting types for 'cabs' /mingw/include/math.h:223: error: previous declaration of 'cabs' was here make[2]: *** [exp_c8.lo] Error 1 make[2]: Leaving directory `/home/coudert/ibin/i686-pc-mingw32/libgfortran' make[1]: *** [all] Error 2 I guess, somewhere in the configure process, the presence of cabs() in math.h was not detected. This is not specific to i686-mingw, since the same thing happens on mips-sgi-irix6.5 (which I reported as comment #7 in PR15266). So, I submit a new PR (hope "component=bootstrap" was the right choice, not sure) so that GNU build utils gurus can get this fixed. I am ready to give any extra information needed, but I don't know what may be useful at that point. PS: configure was a simple ../gcc/configure --prefix=/mingw --enable-languages=c,f95
I will note this definitation of cbas is not compatible with C99.
I worked around this bug, commenting a line in /mingw/include/math.h (I quote it here for reference): //_CRTIMP double __cdecl cabs (struct _complex); The end of the compilation runs smoothly, but when I try to use gfortran, it complains at link-time about missing symbol _ftruncate. Indeed, mingw doesn't have a ftruncate (it has a chsize which has the same prototype and all), but the libgfortran.a needs one (originally in unix.o). This can be worked around (create an object file for ftruncate which call chsize directly and "ar -rv" it into libgortran.a), but it should get fixed nonetheless.
(In reply to comment #2) > I worked around this bug, commenting a line in /mingw/include/math.h (I quote it > here for reference): > //_CRTIMP double __cdecl cabs (struct _complex); > > The end of the compilation runs smoothly, but when I try to use gfortran, it > complains at link-time about missing symbol _ftruncate. Indeed, mingw doesn't > have a ftruncate (it has a chsize which has the same prototype and all), but the The ftruncate problem should be fixed now. Does this work fully or is cabs issue still there?
cabs issue is still here. Will look into it when I have time.
Then, confirmed.
It looks like this issue with cabs declaration is fixed now, with an up-to-date mingw. Closing the PR.
Author: amodra Date: Wed Dec 7 23:16:03 2016 New Revision: 243417 URL: https://gcc.gnu.org/viewcvs?rev=243417&root=gcc&view=rev Log: sync config/* from binutils * elf.m4: Revert 2016-06-21 change. * picflag.m4: Likewise. Revert 2016-04-30 change too. * override.m4 (AC_PROG_LEX): Import 2016-01-18 binutils fix for PR binutils/19481. Modified: trunk/config/ChangeLog trunk/config/elf.m4 trunk/config/override.m4 trunk/config/picflag.m4