This is the mail archive of the newlib@sources.redhat.com 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]

Re: undefined sbrk in libnosys


A change was made last April that removed the headers in sbrk.c. These headers are needed to rename the _xxxx syscalls for systems that define the MISSING_SYSCALLS flag. The powerpc-eabi is one of these platforms. I have just checked the following patch in which fixes the problem.

2004-05-26 Jeff Johnston <jjohnstn@redhat.com>

* libnosys/sbrk.c: Add include of <_syslist.h> and "config.h".

-- Jeff J.

Marc Schafer wrote:
i have two cygwin systems.  one is powerpc-eabi-gcc 3.3.1 with newlib 1.11 and the other is powerpc-eabi-gcc
3.4.0 with newlib 1.12

On the 1.11 system, my application compiles fine.  However, on the 1.12 system I get a linker error because
sbrk is undefined.  Both use the same makefile and linker script.

nm shows sbrk in libnosys in the 1.11 version but it shows _sbrk in the 1.12 system.  Is that _ the reason for
the linker error?  Did I do something wrong when I built newlib?

thanks,
marc

Index: sbrk.c
===================================================================
RCS file: /cvs/src/src/libgloss/libnosys/sbrk.c,v
retrieving revision 1.2
retrieving revision 1.4
diff -u -r1.2 -r1.4
--- sbrk.c	24 Apr 2003 12:36:08 -0000	1.2
+++ sbrk.c	26 May 2004 20:38:51 -0000	1.4
@@ -1,5 +1,8 @@
 /* Version of sbrk for no operating system.  */
 
+#include "config.h"
+#include <_syslist.h>
+
 void *
 _sbrk (incr)
      int incr;

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