Bug 47716 - libgfortran quadmath_weak.h not found on NetBSD 5.1
Summary: libgfortran quadmath_weak.h not found on NetBSD 5.1
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-13 09:10 UTC by Laurent GUERBY
Modified: 2013-12-09 10:03 UTC (History)
1 user (show)

See Also:
Host: x86_64-netbsd5.1
Target: x86_64-netbsd5.1
Build: x86_64-netbsd5.1
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent GUERBY 2011-02-13 09:10:04 UTC
As of 

Sat Feb 12 14:15:11 UTC 2011 (revision 170072)

trunk libgfortran fails to build on gcc70, the NetBSD 5.1 compile farm machine:

gmake[3]: Entering directory `/home/guerby/build/x86_64-unknown-netbsd5.1/libgfortran'
/bin/ksh ./libtool --tag=CC   --mode=compile /home/guerby/build/./gcc/xgcc -B/home/guerby/build/./gcc/ -B/home/guerby/install-46/x86_64-unknown-netbsd5.1/bin/ -B/home/guerby/install-46/x86_64-unknown-netbsd5.1/lib/ -isystem /home/gue\
rby/install-46/x86_64-unknown-netbsd5.1/include -isystem /home/guerby/install-46/x86_64-unknown-netbsd5.1/sys-include    -DHAVE_CONFIG_H -I. -I../../../trunk/libgfortran  -iquote../../../trunk/libgfortran/io -I../../../trunk/libgfort\
ran/../gcc -I../../../trunk/libgfortran/../gcc/config  -I../.././gcc -D_GNU_SOURCE  -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -fcx-fortran-rules -ffunction-sections -fdat\
a-sections  -g -O2 -MT fmain.lo -MD -MP -MF .deps/fmain.Tpo -c -o fmain.lo ../../../trunk/libgfortran/fmain.c
libtool: compile:  /home/guerby/build/./gcc/xgcc -B/home/guerby/build/./gcc/ -B/home/guerby/install-46/x86_64-unknown-netbsd5.1/bin/ -B/home/guerby/install-46/x86_64-unknown-netbsd5.1/lib/ -isystem /home/guerby/install-46/x86_64-unkn\
own-netbsd5.1/include -isystem /home/guerby/install-46/x86_64-unknown-netbsd5.1/sys-include -DHAVE_CONFIG_H -I. -I../../../trunk/libgfortran -iquote../../../trunk/libgfortran/io -I../../../trunk/libgfortran/../gcc -I../../../trunk/li\
bgfortran/../gcc/config -I../.././gcc -D_GNU_SOURCE -std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -fcx-fortran-rules -ffunction-sections -fdata-sections -g -O2 -MT fmain.lo -\
MD -MP -MF .deps/fmain.Tpo -c ../../../trunk/libgfortran/fmain.c  -fPIC -DPIC -o .libs/fmain.o
In file included from ../../../trunk/libgfortran/fmain.c:4:0:
../../../trunk/libgfortran/libgfortran.h:53:29: fatal error: quadmath_weak.h: No such file or directory
gmake[3]: *** [fmain.lo] Error 1
gmake[3]: Leaving directory `/home/guerby/build/x86_64-unknown-netbsd5.1/libgfortran'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory `/home/guerby/build/x86_64-unknown-netbsd5.1/libgfortran'
gmake[1]: *** [all-target-libgfortran] Error 2

c and c++ fo build succesfully:

http://gcc.gnu.org/ml/gcc-testresults/2011-02/msg01405.html
Comment 1 Tobias Burnus 2011-02-13 09:45:40 UTC
See also PR 47648 (same issue for FreeBSD on ia64; contrary to NetBSD/this PR it works on x86-64).

For FreeBSD/ia64 the problem is that _U_Q* are missing, though it is unclear whether NetBSD's libc or GCC's libgcc should provide those.
Cf. also bug 47649 comment 5.
Comment 2 Laurent GUERBY 2011-02-13 21:01:40 UTC
--disable-libquadmath-support was enough to build.

However gfortran test results are pretty poor:

                === gfortran Summary ===

# of expected passes            24669
# of unexpected failures        11625
# of expected failures          41
# of unresolved testcases       40
# of unsupported tests          622


Lots of failures seems to be excess warning for cabsf() and cabs():

Executing on host: /home/guerby/build/gcc/testsuite/gfortran1/../../gfortran -B/home/guerby/build/gcc/testsuite/gfortran1/../../ -B/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/ /home/guerby/trunk/gcc/testsuite/gfortran.dg
/achar_1.f90   -O3 -g   -pedantic-errors  -B/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs -L/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs -L/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/
.libs  -lm   -o ./achar_1.exe    (timeout = 300)
spawn /home/guerby/build/gcc/testsuite/gfortran1/../../gfortran -B/home/guerby/build/gcc/testsuite/gfortran1/../../ -B/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/ /home/guerby/trunk/gcc/testsuite/gfortran.dg/achar_1.f90 
-O3 -g -pedantic-errors -B/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs -L/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs -L/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs -lm -o ./ach
ar_1.exe
/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs/libgfortran.so: warning: warning: reference to compatibility cabsf()
/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs/libgfortran.so: warning: warning: reference to compatibility cabs()
output is:
/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs/libgfortran.so: warning: warning: reference to compatibility cabsf()
/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs/libgfortran.so: warning: warning: reference to compatibility cabs()

FAIL: gfortran.dg/achar_1.f90  -O3 -g  (test for excess errors)
Excess errors:
/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs/libgfortran.so: warning: warning: reference to compatibility cabsf()
/home/guerby/build/x86_64-unknown-netbsd5.1/./libgfortran/.libs/libgfortran.so: warning: warning: reference to compatibility cabs()

-bash-4.1$ grep cabsf\(\) ./gcc/testsuite/gfortran/gfortran.log|wc -l
   38235
Comment 3 Tobias Burnus 2011-02-14 21:02:23 UTC
(In reply to comment #2)
> --disable-libquadmath-support was enough to build.

Could you try whether using the patch in attachment 23341 [details] (from PR 47648) allows you to build GCC without --disable-libquadmath-support? It copies the configure check from libquadmath to libgfortran.


> However gfortran test results are pretty poor:
> warning: warning: reference to compatibility cabsf()

Looks as if complex numbers are not well supported; I do not quite see why the warning is generated - and for which library.

(libgfortran contains at libgfortran/intrinsics/c99_functions.c a fall-back implementation for cabsf, which uses hypotf, which uses (if not present) hypot.)
Comment 4 Laurent GUERBY 2011-02-15 14:17:09 UTC
Tobias, the patch you mentionned did allow bootstrap with c,fortran and without disabling libquadmath for gcc version 4.6.0 20110212 (experimental) [trunk revision 170072] (GCC).

Feel free to ask for a farm account this will be much more efficient than going through me for each test, instructions here:

http://gcc.gnu.org/wiki/CompileFarm

Building GCC on gcc70/NetBSD is simple:

PATH=/opt/cfarm/dejagnu-1.4.4/bin:$PATH
export MAKE=gmake
cd
svn co svn://gcc.gnu.org/svn/gcc/trunk
cd trunk
contrib/gcc_update
cd
mkdir build
cd build
../trunk/configure --prefix=${HOME}/install-4.6-r170072-c --disable-nls --enable-__cxa_atexit --enable-threads=posix --with-gmp=/opt/cfarm/gmp-5.0.1 --with-mpfr=/opt/cfarm/mpfr-3.0.0 --with-mpc=/opt/cfarm/mpc-0.8.2 --enable-languages=c,fortran
gmake -j 2
Comment 5 Tobias Burnus 2011-02-15 21:30:45 UTC
Author: burnus
Date: Tue Feb 15 21:30:43 2011
New Revision: 170200

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170200
Log:
2011-02-15  Tobias Burnus  <burnus@net-b.de>

        PR fortran/47716
        PR fortran/47648
        * acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Use check from
        libquadmath, which uses more features.
        * configure: Regenerate.


Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/acinclude.m4
    trunk/libgfortran/configure
Comment 6 Laurent GUERBY 2011-02-15 22:43:17 UTC
For reference a verbose version of the testsuite warnings that cause FAIL. I will deactivate fortran in my future builds because otherwise the gcc-testresults@ mail is too big and gets rejected.

-bash-4.1$ gfortran -v -v -v /home/guerby/trunk/gcc/testsuite/gfortran.dg/achar_1.f90 
Driving: gfortran -v -v -v /home/guerby/trunk/gcc/testsuite/gfortran.dg/achar_1.f90 -l gfortran -l m -shared-libgcc
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/guerby/install-4.6-r170072-c/libexec/gcc/x86_64-unknown-netbsd5.1/4.6.0/lto-wrapper
Target: x86_64-unknown-netbsd5.1
Configured with: ../trunk/configure --prefix=/home/guerby/install-4.6-r170072-c --disable-nls --enable-__cxa_atexit --enable-threads=posix --with-gmp=/opt/cfarm/gmp-5.0.1 --with-mpfr=/opt/cfarm/mpfr-3.0.0 --with-mpc=/opt/cfarm/mpc-0.8.2 --enable-languages=c,fortran
Thread model: posix
gcc version 4.6.0 20110212 (experimental) [trunk revision 170072] (GCC) 
COLLECT_GCC_OPTIONS='-v' '-v' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/guerby/install-4.6-r170072-c/libexec/gcc/x86_64-unknown-netbsd5.1/4.6.0/f951 /home/guerby/trunk/gcc/testsuite/gfortran.dg/achar_1.f90 -quiet -dumpbase achar_1.f90 -mtune=generic -march=x86-64 -auxbase achar_1 -version -fintrinsic-modules-path /home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/finclude -o /var/tmp//ccZrlOzx.s
GNU Fortran (GCC) version 4.6.0 20110212 (experimental) [trunk revision 170072] (x86_64-unknown-netbsd5.1)
        compiled by GNU C version 4.6.0 20110212 (experimental) [trunk revision 170072], GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Fortran (GCC) version 4.6.0 20110212 (experimental) [trunk revision 170072] (x86_64-unknown-netbsd5.1)
        compiled by GNU C version 4.6.0 20110212 (experimental) [trunk revision 170072], GMP version 5.0.1, MPFR version 3.0.0, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
COLLECT_GCC_OPTIONS='-v' '-v' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -o /var/tmp//cc49hqgX.o /var/tmp//ccZrlOzx.s
Reading specs from /home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/../../../libgfortran.spec
rename spec lib to liborig
COLLECT_GCC_OPTIONS='-v' '-v' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
COMPILER_PATH=/home/guerby/install-4.6-r170072-c/libexec/gcc/x86_64-unknown-netbsd5.1/4.6.0/:/home/guerby/install-4.6-r170072-c/libexec/gcc/x86_64-unknown-netbsd5.1/4.6.0/:/home/guerby/install-4.6-r170072-c/libexec/gcc/x86_64-unknown-netbsd5.1/:/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/:/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/
LIBRARY_PATH=/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/:/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-v' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/guerby/install-4.6-r170072-c/libexec/gcc/x86_64-unknown-netbsd5.1/4.6.0/collect2 -dc -dp -e _start -dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crti.o /home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/crtbegin.o -L/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0 -L/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/../../.. /var/tmp//cc49hqgX.o -lgfortran -lm -lgcc_s -lgcc -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/crtend.o /usr/lib/crtn.o
/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/../../../libgfortran.so: warning: warning: reference to compatibility cabsf()
/home/guerby/install-4.6-r170072-c/lib/gcc/x86_64-unknown-netbsd5.1/4.6.0/../../../libgfortran.so: warning: warning: reference to compatibility cabs()
Comment 7 Tobias Burnus 2011-02-15 23:17:41 UTC
(In reply to comment #6)
> warning: warning: reference to compatibility cabsf()

That seems to be a warning generated by NetBSD's libm, cf.
http://mirror.leaseweb.com/NetBSD/NetBSD-release-5-0/src/lib/libm/compat/compat_cabsf.c

That file contains:

float cabsf __P((struct complex));
__warn_references(cabsf, "warning: reference to compatibility cabsf()");

float
cabsf(struct complex z)
{
  return hypotf(z.x, z.y);
}

Which causes the warning. The __warn_references is defined in <sys/cdefs.h>.

Thus, you could also try to silence the warning. hypot(f) should be give an equivalent result to cabs(f) - thus I do not understand why there is a warning at the first place. (Depending, of course, on the quality of the hypot(f) implementation.)


As the warning is due to NetBSD itself and as the quadmath_weak.h issue is solved, I close this PR.

It would be nice if one could silence the warning - and again build with Fortran support.
Comment 8 Laurent GUERBY 2011-02-16 06:04:55 UTC
Looks like a workaround for a similar problem was discussed here but not commited:

http://www.mailinglistarchive.com/fortran@gcc.gnu.org/msg17593.html
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39570
Comment 9 Francois-Xavier Coudert 2013-12-09 10:03:15 UTC
Fixed as per comment #7.