This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[AArch64] nosys.specs and printf


Hello all

I'm trying to compile following simple program for aarch64 with nosys specs

#include <stdio.h>
int main(void) {
  printf("hello");
  return 0;
}

But I've got:
d:\gcc-6.3-arm64-eabi\bin>aarch64-none-elf-gcc --specs=nosys.specs test.c
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-sbrkr.o):
In function `_sbrk_r':
sbrkr.c:(.text._sbrk_r+0x1c): undefined reference to `_sbrk'
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-writer.o):
In function `_write_r':
writer.c:(.text._write_r+0x24): undefined reference to `_write'
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-closer.o):
In function `_close_r':
closer.c:(.text._close_r+0x1c): undefined reference to `_close'
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-fstatr.o):
In function `_fstat_r':
fstatr.c:(.text._fstat_r+0x20): undefined reference to `_fstat'
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-isattyr.o):
In function `_isatty_r':
isattyr.c:(.text._isatty_r+0x1c): undefined reference to `_isatty'
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-lseekr.o):
In function `_lseek_r':
lseekr.c:(.text._lseek_r+0x24): undefined reference to `_lseek'
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-readr.o):
In function `_read_r':
readr.c:(.text._read_r+0x24): undefined reference to `_read'
collect2.exe: error: ld returned 1 exit status

d:\gcc-6.3-arm64-eabi\bin>aarch64-none-elf-gcc --specs=rdimon.specs test.c

d:\gcc-6.3-arm64-eabi\bin>


I tried to reconfigure libnosys  in the same way as ARM port:

diff -ruN newlib-2.5.0/libgloss/libnosys/configure
newlib-2.5.0/libgloss/libnosys/configure
--- newlib-2.5.0/libgloss/libnosys/configure    2016-12-23
05:33:54.000000000 +0300
+++ newlib-2.5.0/libgloss/libnosys/configure    2017-09-15
13:14:56.412457618 +0300
@@ -2009,6 +2009,8 @@
     ;;
   a29k-amd-udi)
     ;;
+  aarch64*-*-*)
+    ;;
   arc-*-*)
     ;;
   arm*-*-*)
diff -ruN newlib-2.5.0/libgloss/libnosys/configure.in
newlib-2.5.0/libgloss/libnosys/configure.in
--- newlib-2.5.0/libgloss/libnosys/configure.in    2016-12-23
05:33:54.000000000 +0300
+++ newlib-2.5.0/libgloss/libnosys/configure.in    2017-09-14
18:32:27.330466884 +0300
@@ -43,6 +43,8 @@
     ;;
   a29k-amd-udi)
     ;;
+  aarch64*-*-*)
+    ;;
   arc-*-*)
     ;;
   arm*-*-*)

It now compiles so I get final elf, but with warnings:
d:\gcc-6.3-arm64-eabi\bin>aarch64-none-elf-gcc --specs=nosys.specs test.c
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-closer.o):
In function `_close_r':
/home/af/GIT/BG/build_gnu/opt/freescale/Earmv8/obj_newlib/aarch64-none-elf/newlib/libc/reent/../../../../../src_newlib/newlib/libc/reent/closer.c:53:
warning: _close is not impl
emented and will always fail
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-fstatr.o):
In function `_fstat_r':
/home/af/GIT/BG/build_gnu/opt/freescale/Earmv8/obj_newlib/aarch64-none-elf/newlib/libc/reent/../../../../../src_newlib/newlib/libc/reent/fstatr.c:62:
warning: _fstat is not impl
emented and will always fail
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-isattyr.o):
In function `_isatty_r':
/home/af/GIT/BG/build_gnu/opt/freescale/Earmv8/obj_newlib/aarch64-none-elf/newlib/libc/reent/../../../../../src_newlib/newlib/libc/reent/isattyr.c:58:
warning: _isatty is not im
plemented and will always fail
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-lseekr.o):
In function `_lseek_r':
/home/af/GIT/BG/build_gnu/opt/freescale/Earmv8/obj_newlib/aarch64-none-elf/newlib/libc/reent/../../../../../src_newlib/newlib/libc/reent/lseekr.c:58:
warning: _lseek is not impl
emented and will always fail
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-readr.o):
In function `_read_r':
/home/af/GIT/BG/build_gnu/opt/freescale/Earmv8/obj_newlib/aarch64-none-elf/newlib/libc/reent/../../../../../src_newlib/newlib/libc/reent/readr.c:58:
warning: _read is not implem
ented and will always fail
d:/gcc-6.3-arm64-eabi/bin/../lib/gcc/aarch64-none-elf/6.3.1/../../../../aarch64-none-elf/lib\libc.a(lib_a-writer.o):
In function `_write_r':
/home/af/GIT/BG/build_gnu/opt/freescale/Earmv8/obj_newlib/aarch64-none-elf/newlib/libc/reent/../../../../../src_newlib/newlib/libc/reent/writer.c:58:
warning: _write is not impl
emented and will always fail


Hi do I correctly to configure AArch64 nosys ?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]