I have a question about the libgfortran configure script.  I am trying to
build the fortran language for the mips-mti-elf target (which is built with
newlib) and as part of the configure script for libgfortran it is trying to
check for localtime_r and other functions.  These functions exist on my target
but the configure script thinks they don't because the GCC compile and link
done in the configure script doesn't include any linker script options.

So I get:

% install-mips-mti-elf/bin/mips-mti-elf-gcc time.c -o x
/local/home/sellcey/nightly/install-mips-mti-elf/lib/gcc/mips-mti-elf/4.9.0/../../../../mips-mti-elf/bin/ld:
 warning: cannot find entry symbol __start; defaulting to 0000000000400098
/tmp/ccnihmPO.o: In function `main':
time.c:(.text+0x10): undefined reference to `localtime_r'
collect2: error: ld returned 1 exit status

If I add '-Tmti32.ld' then it compiles cleanly:

% install-mips-mti-elf/bin/mips-mti-elf-gcc -Tmti32.ld time.c -o x

I don't have any problems like this building the C++ library. I guess
it is because that library doesn't use AC_CHECK_FUNCS_ONCE like libgfortran
does.  The actual error I get when building is caused by
libgfortran/intrinsics/time_1.h defining localtime_r as a static function
(because HAVE_LOCALTIME_R is not set) after seeing a non-static definition
from include/time.h (part of newlib).

As anyone run into this or know how to fix it?

Steve Ellcey
sell...@mips.com

Reply via email to