exit.c:(.text.exit+0x2c): undefined reference to `_exit

Asked by Ray Zhang

i just test the toochain just build myself with source code, but occured a problem:
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
exit.c:(.text.exit+0x2c): undefined reference to `_exit'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o): In function `_write_r':
writer.c:(.text._write_r+0x20): undefined reference to `_write'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o): In function `_close_r':
closer.c:(.text._close_r+0x18): undefined reference to `_close'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o): In function `_fstat_r':
fstatr.c:(.text._fstat_r+0x1c): undefined reference to `_fstat'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o): In function `_isatty_r':
isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x20): undefined reference to `_lseek'
/Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o): In function `_read_r':
readr.c:(.text._read_r+0x20): undefined reference to `_read'

can someone give me a clue or suggestion to fix it. Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Solved by:
Ray Zhang
Solved:
Last query:
Last reply:
Revision history for this message
Joey Ye (jinyun-ye) said :
#1

Please give linker option -spec=nosys.spec , as described in readme.txt
2014-4-3 下午7:21于 "Ray Zhang" <email address hidden>写道:

> New question #246459 on GCC ARM Embedded:
> https://answers.launchpad.net/gcc-arm-embedded/+question/246459
>
> i just test the toochain just build myself with source code, but occured a
> problem:
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-exit.o):
> In function `exit':
> exit.c:(.text.exit+0x2c): undefined reference to `_exit'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o):
> In function `_sbrk_r':
> sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o):
> In function `_write_r':
> writer.c:(.text._write_r+0x20): undefined reference to `_write'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o):
> In function `_close_r':
> closer.c:(.text._close_r+0x18): undefined reference to `_close'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o):
> In function `_fstat_r':
> fstatr.c:(.text._fstat_r+0x1c): undefined reference to `_fstat'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-isattyr.o):
> In function `_isatty_r':
> isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o):
> In function `_lseek_r':
> lseekr.c:(.text._lseek_r+0x20): undefined reference to `_lseek'
> /Developer/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o):
> In function `_read_r':
> readr.c:(.text._read_r+0x20): undefined reference to `_read'
>
> can someone give me a clue or suggestion to fix it. Thank you.
>
>
> --
> You received this question notification because you are an answer
> contact for GCC ARM Embedded.
>

Revision history for this message
Ray Zhang (zhang-yimin007) said :
#2

It's work, thank you.

Revision history for this message
zinc (zinc) said :
#3

i got the same problem with you ,but i can't understand the best answers above.can you tell me how to solve it?
i use atmel studio 7.0 now.