On Fri, 2014-01-10 at 09:15 -0800, steve kirby wrote:
> (3) then, to trace the error more specifically, I look at config.log
> in ~/gcc-build/arm-android-eabi/libgfortran, which shows:
> /home/skirby/ANDROID19/arm-android-eabi/bin/ld: cannot find crt0.o: No
> such file or directory
> /home/skirby/ANDROID19/arm-android-eabi/bin/ld: cannot find -lg
> collect2: error: ld returned 1 exit status
>
> (4) I can't find crt0.o anywhere. Is there a workaround? As far as
> the -lg issue, where would a libg.a be found?
Rather then find crt0.o and libg I think you need to stop the configure
script from doing the links. If you look at libgfortran/
configure.in
you will see this code:
# Check for library functions.
if test "x${with_newlib}" = "xyes"; then
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
# may not work correctly, because the compiler may not be able to
# link executables.
AC_DEFINE(HAVE_MKSTEMP, 1, [Define if you have mkstemp.])
AC_DEFINE(HAVE_STRTOF, 1, [Define if you have strtof.])
AC_DEFINE(HAVE_SNPRINTF, 1, [Define if you have snprintf.])
AC_DEFINE(HAVE_STRCASESTR, 1, [Define if you have strcasestr.])
AC_DEFINE(HAVE_VSNPRINTF, 1, [Define if you have vsnprintf.])
AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have localtime_r.])
AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have gmtime_r.])
# At some point, we should differentiate between architectures
# like x86, which have long double versions, and alpha/powerpc/etc.,
# which don't. For the time being, punt.
if test x"long_double_math_on_this_cpu" = x"yes"; then
AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.])
fi
else
AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
ftruncate chsize chdir getlogin gethostname kill link symlink sleep ttyname \
alarm access fork execl wait setmode execve pipe dup2 close \
strcasestr getrlimit gettimeofday stat fstat lstat getpwuid vsnprintf dup \
getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
readlink getgid getpid getppid getuid geteuid umask getegid \
secure_getenv __secure_getenv mkostemp)
fi
I think that if you configure with --with-newlib and/or tweak this code so that
the if statement is true even without with_newlib being set then the configure
will set the various HAVE_* variables without doing any links and you may be
able to build. (Obviously, If you change
configure.in you will need to regenerate
and/or make the same change in configure.) Depending on what functions Android
actually supports you may need to change what HAVE_* variables are set in the if
statement.
Steve Ellcey
sel...@mips.com