--- libgfortran/acinclude.m4.orig +++ libgfortran/acinclude.m4 @@ -85,7 +85,7 @@ [Define to 1 if the target supports #pragma weak]) fi case "$host" in - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* | *-*-netbsd* ) AC_DEFINE(GTHREAD_USE_WEAK, 0, [Define to 0 if the target shouldn't use #pragma weak]) ;; --- libgfortran/configure.orig +++ libgfortran/configure @@ -25992,7 +25992,7 @@ fi case "$host" in - *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) + *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* | *-*-netbsd* ) $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h --- gcc/fortran/f95-lang.c.orig +++ gcc/fortran/f95-lang.c @@ -748,10 +748,17 @@ gfc_define_builtin ("__builtin_cabsl", func_clongdouble_longdouble, BUILT_IN_CABSL, "cabsl", ATTR_CONST_NOTHROW_LEAF_LIST); +#if defined(__NetBSD__) + gfc_define_builtin ("__builtin_cabs", func_cdouble_double, + BUILT_IN_CABS, "__c99_cabs", ATTR_CONST_NOTHROW_LEAF_LIST); + gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, + BUILT_IN_CABSF, "__c99_cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); +#else gfc_define_builtin ("__builtin_cabs", func_cdouble_double, BUILT_IN_CABS, "cabs", ATTR_CONST_NOTHROW_LEAF_LIST); gfc_define_builtin ("__builtin_cabsf", func_cfloat_float, BUILT_IN_CABSF, "cabsf", ATTR_CONST_NOTHROW_LEAF_LIST); +#endif gfc_define_builtin ("__builtin_copysignl", mfunc_longdouble[1], BUILT_IN_COPYSIGNL, "copysignl",