Mail Archives: djgpp-workers/2001/12/01/12:28:52
Hello.
DJ Delorie wrote:
> Over in djgpp/tests/libclink (in djlsr) there's a program to
> test for ansi/posix pollution. Not sure if the lists need updating
> yet, though. Or even if it still works.
It doesn't link (as CVS stands) with gcc 3.0.2. This is the libstdc++
linking thing again. Below is a patch that fixes this in a similar way as
for libc.
When I ran make in tests/libclink, check.out contained this (among other
things):
Impure stub pipe.o(close) -> stub0002.o
Impure stub pipe.o(open) -> stub0011.o
Impure stub unsetenv.o(putenv) -> stub0012.o
Impure stub malldbg.o(sbrk) -> stub0037.o
The patch below fixes these impure stubs by including libc/stubs.h.
The patch also:
* stubs statfs(), tell(), uclock();
* adds snprintf() & vsnprintf() to the list of ANSI functions.
OK to commit?
Thanks, bye, Rich =]
--
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/
Index: tests/makefile.def
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/makefile.def,v
retrieving revision 1.1
diff -p -c -3 -r1.1 makefile.def
*** tests/makefile.def 2001/02/01 19:36:44 1.1
--- tests/makefile.def 2001/12/01 17:19:58
*************** AR = ar
*** 36,41 ****
--- 36,42 ----
LD = ld
STRIP = strip
BISON = bison
+ LIBSTDCXX = -lstdcxx
else
*************** AR = ar
*** 58,63 ****
--- 59,65 ----
LD = ld
STRIP = strip
BISON = bison
+ LIBSTDCXX = -lstdc++
# You may need to replace coff-go32 with coff-i386 in lib/djgpp.djl or
# edit your cross_ld to replace coff-i386 with coff-go32 (as I did)
Index: tests/libclink/makefile
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libclink/makefile,v
retrieving revision 1.2
diff -p -c -3 -r1.2 makefile
*** tests/libclink/makefile 1997/09/07 22:55:04 1.2
--- tests/libclink/makefile 2001/12/01 17:20:01
***************
*** 1,3 ****
--- 1,5 ----
+ include ../makefile.def
+
%.o : %.cc
gcc -O2 -g -c $<
*************** check.out : check.exe ../../lib/crt0.o .
*** 15,27 ****
@nm -g ../../lib/crt0.o ../../lib/libc.a | check > check.out
check.exe : check.o slist.o objs.o
! gcc -o $@ $^
compare.out : compare oldlibc.arm newlibc.arm
@compare oldlibc.arm newlibc.arm > compare.out
compare : compare.o slist.o
! gcc -o $@ $^
coff2exe $@
oldlibc.arm : /v1/lib/libc.a /v1/lib/libpc.a /v1/lib/libm.a
--- 17,29 ----
@nm -g ../../lib/crt0.o ../../lib/libc.a | check > check.out
check.exe : check.o slist.o objs.o
! gcc -o $@ $^ $(LIBSTDCXX)
compare.out : compare oldlibc.arm newlibc.arm
@compare oldlibc.arm newlibc.arm > compare.out
compare : compare.o slist.o
! gcc -o $@ $^ $(LIBSTDCXX)
coff2exe $@
oldlibc.arm : /v1/lib/libc.a /v1/lib/libpc.a /v1/lib/libm.a
Index: tests/libclink/check.cc
===================================================================
RCS file: /cvs/djgpp/djgpp/tests/libclink/check.cc,v
retrieving revision 1.4
diff -p -c -3 -r1.4 check.cc
*** tests/libclink/check.cc 1999/03/20 23:09:38 1.4
--- tests/libclink/check.cc 2001/12/01 17:20:05
*************** char *ansi_fns[] = { "abort", "abs", "ac
*** 35,47 ****
"memmove", "memset", "mktime", "modf", "perror", "pow", "printf",
"putc", "putchar", "puts", "qsort", "raise", "rand", "realloc",
"remove", "rename", "rewind", "scanf", "setbuf", "setjmp",
! "setlocale", "setvbuf", "signal", "sin", "sinh", "sprintf", "sqrt",
"srand", "sscanf", "strcat", "strchr", "strcmp", "strcoll", "strcpy",
"strcspn", "strerror", "strftime", "strlen", "strncat", "strncmp",
"strncpy", "strpbrk", "strrchr", "strspn", "strstr", "strtod",
"strtok", "strtol", "strtoul", "strxfrm", "system", "tan", "tanh",
"time", "tmpfile", "tmpnam", "tolower", "toupper", "tzname", "ungetc",
! "vfprintf", "vprintf", "vsprintf", "wcstombs", "wctomb", 0
};
char *posix_fns[] = { "_exit", "access", "alarm", "cfgetispeed",
--- 35,47 ----
"memmove", "memset", "mktime", "modf", "perror", "pow", "printf",
"putc", "putchar", "puts", "qsort", "raise", "rand", "realloc",
"remove", "rename", "rewind", "scanf", "setbuf", "setjmp",
! "setlocale", "setvbuf", "signal", "sin", "sinh", "snprintf", "sprintf",
"sqrt",
"srand", "sscanf", "strcat", "strchr", "strcmp", "strcoll", "strcpy",
"strcspn", "strerror", "strftime", "strlen", "strncat", "strncmp",
"strncpy", "strpbrk", "strrchr", "strspn", "strstr", "strtod",
"strtok", "strtol", "strtoul", "strxfrm", "system", "tan", "tanh",
"time", "tmpfile", "tmpnam", "tolower", "toupper", "tzname", "ungetc",
! "vfprintf", "vprintf", "vsnprintf", "vsprintf", "wcstombs", "wctomb", 0
};
char *posix_fns[] = { "_exit", "access", "alarm", "cfgetispeed",
Index: include/libc/stubs.h
===================================================================
RCS file: /cvs/djgpp/djgpp/include/libc/stubs.h,v
retrieving revision 1.9
diff -p -c -3 -r1.9 stubs.h
*** include/libc/stubs.h 2001/06/19 19:10:15 1.9
--- include/libc/stubs.h 2001/12/01 17:20:08
*************** extern "C" {
*** 60,67 ****
--- 60,70 ----
#define setmode __setmode
#define spawnve __spawnve
#define spawnvpe __spawnvpe
+ #define statfs __statfs
#define stricmp __stricmp
#define sync __sync
+ #define tell __tell
+ #define uclock __uclock
#endif /* !_POSIX_SOURCE */
#endif /* !__STRICT_ANSI__ */
Index: src/libc/posix/unistd/pipe.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/unistd/pipe.c,v
retrieving revision 1.3
diff -p -c -3 -r1.3 pipe.c
*** src/libc/posix/unistd/pipe.c 2001/06/19 23:52:21 1.3
--- src/libc/posix/unistd/pipe.c 2001/12/01 17:20:11
***************
*** 1,5 ****
--- 1,6 ----
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+ #include <libc/stubs.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
Index: src/libc/posix/stdlib/unsetenv.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/posix/stdlib/unsetenv.c,v
retrieving revision 1.2
diff -p -c -3 -r1.2 unsetenv.c
*** src/libc/posix/stdlib/unsetenv.c 2001/06/27 23:05:59 1.2
--- src/libc/posix/stdlib/unsetenv.c 2001/12/01 17:20:14
***************
*** 1,5 ****
--- 1,6 ----
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
+ #include <libc/stubs.h>
#include <libc/unconst.h>
#include <errno.h>
#include <stdlib.h>
Index: src/libc/ansi/stdlib/malldbg.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/ansi/stdlib/malldbg.c,v
retrieving revision 1.1
diff -p -c -3 -r1.1 malldbg.c
*** src/libc/ansi/stdlib/malldbg.c 2001/06/08 10:01:01 1.1
--- src/libc/ansi/stdlib/malldbg.c 2001/12/01 17:20:17
***************
*** 1,5 ****
--- 1,6 ----
/* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
+ #include <libc/stubs.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Index: src/libc/pc_hw/timer/uclock.c
===================================================================
RCS file: /cvs/djgpp/djgpp/src/libc/pc_hw/timer/uclock.c,v
retrieving revision 1.3
diff -p -c -3 -r1.3 uclock.c
*** src/libc/pc_hw/timer/uclock.c 1999/06/03 17:27:37 1.3
--- src/libc/pc_hw/timer/uclock.c 2001/12/01 17:20:20
***************
*** 1,6 ****
--- 1,8 ----
+ /* Copyright (C) 2001 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1999 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
+ #include <libc/stubs.h>
#include <time.h>
#include <errno.h>
#include <pc.h>
- Raw text -