gcccompiler-errorsandroid-ndkcross-compiling

Can binutils Be Built Without libiberty? Or Can report_times Be Disabled?


TLDR: Getting fatal error 'failed to get process times' on cross-native build of gcc. Can I remove report_times code from gcc.c OR use gcc command line option to disable report_times OR build gcc without libiberty (which contains pex_get_times used by report_times

DETAIL After beating my head against various problems I've (finally) successfully used the Android NDK standalone toolchain to build binutils 2.23 and gcc 4.70.

My current problem is getting it to run on my device.

I've written a standard 'hello world' (copied from here) to test gcc on my device. When I run:

arm-linux-eabi-gcc hello.c -o hello or: arm-linux-eabi-gcc hello.c

I get the following error:

arm-linux-eabi-gcc: fatal error: failed to get process times: No such file or directory.

Google did not return much except for links to gcc.c source. Examining the source, I found the error in a function (module? extension?) called report_times. The error is returned by the function (module? extension?) pex_get_times....I'm guessing it does so if it can't get the process times.

The pex_get_times function (module? extension? I'm not sure what it is) is defined in libiberty. I can use --disable-build-libiberty, but it doesn't help for the host (my NookHD) gcc build.

My question(s):

  1. Can this portion of gcc.c be safely (and easily) removed...i.e. the report_times function and everything associated with it? or
  2. Is there a command line option to tell arm-linux-eabi-gcc NOT to use report_times? or
  3. Is there a way to disable build of libiberty for host/target for both gcc and binutils, and would that fix the error?

As always...I'll keep researching while awaiting an answer.


Solution

  • Found this about an hour after posting this question. Maybe two.

    Apparently report_times is part of debugging symbols (?) for GCC. To exclude report_times (which causes the 'failed to get process times' from the original question) you have to build the non-debug...or release...version of gcc.

    To do this, I used info from this link: http://www-gpsg.mit.edu/~simon/gcc_g77_install/build.html

    BUT, I omitted the -g from the LIBCXXFLAGS and LIBCFLAGS and I added LIBCPPFLAGS without -g just in case. Ran make DESTDIR=/staging/install/path install-host, tarballed and transferred to device. No more 'failed to get process times' error.

    I am seeing another error, but it is not related to this question