configuring reentrant syscalls to compile ARM processor programs

Paul Gelencser via gcc-help gcc-help@gcc.gnu.org
Thu Feb 22 15:55:00 GMT 2018


Hello,

Thank you for offering help through this mailing list.  

I'm having some trouble compiling, and was hoping for some guidance.  I'm aware of two paths I could take (maybe there are more), but am not sure what path makes sense.  Help is appreciated.

My application is to compile ARM program files into .elf files to run in a test environment, if that helps.

 The errors are of the type: 
     
  /lib\libc.a(lib_a-exit.o): In function `exit':
      exit.c:(.text.exit+0x2c):  undefined reference to `_exit'
 
  /lib/crt0.o: In function  `_start':
    (.text+0xec): undefined  reference to `main'

  /lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
  sbrkr.c:(.text._sbrk_r+0x18): undefined reference to  `_sbrk'
     
  /lib\libc.a(lib_a-isattyr.o): In function `_isatty_r':
  isattyr.c:(.text._isatty_r+0x18): undefined reference to  `_isatty'

>From the error message, one solution I could pursue would be to define two macros, 

    REENTRANT_SYSCALLS_PROVIDED
    MISSING_SYSCALL_NAMES, 

which are used in file,

     ..."7 2017-q4-major\arm-none-eabi\include\reent.h".

There are proper instructions in file "reent.h" for enabling syscalls, but they refer to a file I can't find, "configure.host".  Also, I'm not sure if defining these macros would lead to hitting other errors.

The other path which someone suggested was to assert  "-nostdlib -nostartfiles -ffreestanding", but then I believe I'm on the hook for finding all of the mandatory dependencies of the compiler, which could be a long list of things to find - kind of an Easter egg hunt.

Help is greatly appreciated.

Thanks,
Paul





More information about the Gcc-help mailing list