delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/04/27/07:25:47

From: pavenis AT lanet DOT lv
To: djgpp-workers AT delorie DOT com
Date: Fri, 27 Apr 2001 13:05:31 +0300
MIME-Version: 1.0
Subject: gcc-3.0 related patches for DJGPP CVS version
Message-ID: <3AE96E9B.10268.B1244D@localhost>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

--Message-Boundary-24380
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Built current CVS version with gcc-3.0 20010425 (prerelease). Had to 
patches sources to do that (see attachment):

1) building mkdoc.exe requires either libstdcxx.a or libsupc++.a (I used 
    libstdcxx.a as it's name will perhaps not change)

2) replaced '-m486' with '-march=i386 -mcpu=pentium' as -m486 and 
similar options are deprecated.

3) removed '-traditional' from command line options

4) added '#include <stdlib.h>' and (or) '#include <string.h>' where 
needed (gcc-2.95.2 doesn't detect use of some functions without 
prototypes)

5) for zoneinfo/src/zic.c changed '#ifdef unix' to
'#if def ined(unix) || defined(__DJGPP__)'. At least current CVS version 
of gcc-3.0 doesn't define unix for DJGPP (unless I'm modifying specs)

6) removed #ifdef __GO32__ (it was also not defined)

7) some changes to testsuite 


I also got warning messages for dbgcom.c and some other sources that
multiline string constants are deprecated but I didn't change anything
(it was not so with gcc-3.0 20010314 I tested earlier)

Andris



--Message-Boundary-24380
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  djgpp-gcc30.diff
     Date:  27 Apr 2001, 13:02
     Size:  13770 bytes.
     Type:  Text

--Message-Boundary-24380
Content-type: Application/Octet-stream; name="djgpp-gcc30.diff"; type=Text
Content-disposition: attachment; filename="djgpp-gcc30.diff"

diff -cr3 -X exclude.lst djgpp.old/src/gcc-l.opt djgpp/src/gcc-l.opt
*** djgpp.old/src/gcc-l.opt	Mon Dec 29 18:50:38 1997
--- djgpp/src/gcc-l.opt	Fri Apr 27 09:56:56 2001
***************
*** 1,6 ****
  -MD
  -O2
! -m486
  -malign-loops=2
  -malign-jumps=2
  -malign-functions=2
--- 1,7 ----
  -MD
  -O2
! -march=i386
! -mcpu=pentium
  -malign-loops=2
  -malign-jumps=2
  -malign-functions=2
diff -cr3 -X exclude.lst djgpp.old/src/gcc.opt djgpp/src/gcc.opt
*** djgpp.old/src/gcc.opt	Mon Dec 29 18:50:24 1997
--- djgpp/src/gcc.opt	Fri Apr 27 09:56:56 2001
***************
*** 1,7 ****
  -MD
  -O2
  -fno-strength-reduce
! -m486
  -malign-loops=2
  -malign-jumps=2
  -malign-functions=2
--- 1,8 ----
  -MD
  -O2
  -fno-strength-reduce
! -march=i386
! -mcpu=pentium
  -malign-loops=2
  -malign-jumps=2
  -malign-functions=2
***************
*** 14,20 ****
  -Wpointer-arith
  -Wshadow
  -Wstrict-prototypes
- -Wtraditional
  -Wwrite-strings
  -nostdinc
  
--- 15,20 ----
diff -cr3 -X exclude.lst djgpp.old/src/libc/ansi/stdio/doprnt.c djgpp/src/libc/ansi/stdio/doprnt.c
*** djgpp.old/src/libc/ansi/stdio/doprnt.c	Sun Jul  4 17:18:04 1999
--- djgpp/src/libc/ansi/stdio/doprnt.c	Fri Apr 27 09:56:56 2001
***************
*** 67,75 ****
  static char *roundl(long double fract, int *expv, char *start, char *end,
  		    char ch, char *signp);
  static char *exponentl(char *p, int expv, unsigned char fmtch);
- #ifdef __GO32__
  static int isspeciall(long double d, char *bufp);
- #endif
  
  static char NULL_REP[] = "(null)";
  static char UNNORMAL_REP[] = "Unnormal";
--- 67,73 ----
diff -cr3 -X exclude.lst djgpp.old/src/libc/ansi/stdlib/qsort.c djgpp/src/libc/ansi/stdlib/qsort.c
*** djgpp.old/src/libc/ansi/stdlib/qsort.c	Sun Sep 27 19:31:00 1998
--- djgpp/src/libc/ansi/stdlib/qsort.c	Fri Apr 27 09:56:56 2001
***************
*** 5,10 ****
--- 5,11 ----
  #include <assert.h>
  #include <stdio.h>
  #include <stdlib.h>
+ #include <string.h>
  
  /*
   * This is an implementation of quicksort that partitions the array
diff -cr3 -X exclude.lst djgpp.old/src/libc/compat/stdio/mkstemp.c djgpp/src/libc/compat/stdio/mkstemp.c
*** djgpp.old/src/libc/compat/stdio/mkstemp.c	Tue Aug 29 08:02:18 2000
--- djgpp/src/libc/compat/stdio/mkstemp.c	Fri Apr 27 10:00:20 2001
***************
*** 3,8 ****
--- 3,9 ----
  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  #include <libc/symlink.h>
  #include <stdio.h>
+ #include <string.h>
  #include <fcntl.h>
  #include <errno.h>
  #include <io.h>
diff -cr3 -X exclude.lst djgpp.old/src/libc/compat/stdlib/rand48.c djgpp/src/libc/compat/stdlib/rand48.c
*** djgpp.old/src/libc/compat/stdlib/rand48.c	Mon Jul 17 08:02:14 2000
--- djgpp/src/libc/compat/stdlib/rand48.c	Fri Apr 27 10:01:20 2001
***************
*** 9,14 ****
--- 9,15 ----
   */
  
  #include "stdlib.h"
+ #include <string.h>
  
  #define RAND48_MULT0 (0xe66d)
  #define RAND48_MULT1 (0xdeec)
diff -cr3 -X exclude.lst djgpp.old/src/libc/compat/unistd/symlink.c djgpp/src/libc/compat/unistd/symlink.c
*** djgpp.old/src/libc/compat/unistd/symlink.c	Thu Aug 17 08:01:44 2000
--- djgpp/src/libc/compat/unistd/symlink.c	Fri Apr 27 10:02:16 2001
***************
*** 8,13 ****
--- 8,14 ----
  #include <unistd.h>
  #include <io.h>
  #include <stdio.h>
+ #include <string.h>
  
  #include "xsymlink.h"
  
diff -cr3 -X exclude.lst djgpp.old/src/libc/go32/dpmiexcp.c djgpp/src/libc/go32/dpmiexcp.c
*** djgpp.old/src/libc/go32/dpmiexcp.c	Fri Sep  3 14:58:20 1999
--- djgpp/src/libc/go32/dpmiexcp.c	Fri Apr 27 09:56:56 2001
***************
*** 257,263 ****
    err("\r\nebp="); itox(__djgpp_exception_state->__ebp, 8);
    err(" esp="); itox(__djgpp_exception_state->__esp, 8);
    err(" program=");
!   prog_name = __dos_argv0 ? __dos_argv0 : "<??UNKNOWN??>";
    for (i=0; prog_name[i]; i++);
    write(STDERR_FILENO, prog_name, i);
    err("\r\n");
--- 257,264 ----
    err("\r\nebp="); itox(__djgpp_exception_state->__ebp, 8);
    err(" esp="); itox(__djgpp_exception_state->__esp, 8);
    err(" program=");
!   /* Let's fool gcc-3.0 not to interpret string below as containing trigraphs */
!   prog_name = __dos_argv0 ? __dos_argv0 : "<" "??UNKNOWN??" ">";
    for (i=0; prog_name[i]; i++);
    write(STDERR_FILENO, prog_name, i);
    err("\r\n");
diff -cr3 -X exclude.lst djgpp.old/src/libc/posix/fcntl/fcntl.c djgpp/src/libc/posix/fcntl/fcntl.c
*** djgpp.old/src/libc/posix/fcntl/fcntl.c	Fri Feb  2 07:01:06 2001
--- djgpp/src/libc/posix/fcntl/fcntl.c	Fri Apr 27 09:56:56 2001
***************
*** 20,26 ****
  static unsigned long _get_sft_entry_ptr(int fd)
  {
    __dpmi_regs regs;
!   unsigned char index;
    unsigned long es, di;
  
  
--- 20,27 ----
  static unsigned long _get_sft_entry_ptr(int fd)
  {
    __dpmi_regs regs;
!   /* Previous name 'index' shadows global definition  */
!   unsigned char ind;
    unsigned long es, di;
  
  
***************
*** 40,53 ****
    /* Get the SFT entry number for this handle.  */
    es = regs.x.es;
    di = regs.x.di;
!   index = _farpeekb(_dos_ds, es * 16 + di);
  
  
!   if (index < 0xff)
    {
      /* Now get the address of the entry.  */
      regs.x.ax = 0x1216;
!     regs.x.bx = index;
      __dpmi_int (0x2f, &regs);
    }
    else
--- 41,54 ----
    /* Get the SFT entry number for this handle.  */
    es = regs.x.es;
    di = regs.x.di;
!   ind = _farpeekb(_dos_ds, es * 16 + di);
  
  
!   if (ind < 0xff)
    {
      /* Now get the address of the entry.  */
      regs.x.ax = 0x1216;
!     regs.x.bx = ind;
      __dpmi_int (0x2f, &regs);
    }
    else
diff -cr3 -X exclude.lst djgpp.old/src/libc/posix/unistd/access.c djgpp/src/libc/posix/unistd/access.c
*** djgpp.old/src/libc/posix/unistd/access.c	Wed Aug 23 08:09:40 2000
--- djgpp/src/libc/posix/unistd/access.c	Fri Apr 27 09:56:56 2001
***************
*** 13,18 ****
--- 13,19 ----
  #include <errno.h>
  #include <dirent.h>
  #include <limits.h>
+ #include <string.h>
  
  int access(const char *fn, int flags)
  {
diff -cr3 -X exclude.lst djgpp.old/src/mkdoc/makefile djgpp/src/mkdoc/makefile
*** djgpp.old/src/mkdoc/makefile	Thu Jan  1 22:28:14 1998
--- djgpp/src/mkdoc/makefile	Fri Apr 27 09:56:56 2001
***************
*** 7,13 ****
  all :: $(HOSTBIN)/mkdoc.exe
  
  $(HOSTBIN)/mkdoc.exe : mkdoc.cc
! 	$(GCC) mkdoc.cc -o $@
  
  clean ::
  	@-$(MISC) rm $(HOSTBIN)/mkdoc.exe
--- 7,13 ----
  all :: $(HOSTBIN)/mkdoc.exe
  
  $(HOSTBIN)/mkdoc.exe : mkdoc.cc
! 	$(GCC) mkdoc.cc -lstdcxx -o $@
  
  clean ::
  	@-$(MISC) rm $(HOSTBIN)/mkdoc.exe
diff -cr3 -X exclude.lst djgpp.old/src/utils/bin2h.c djgpp/src/utils/bin2h.c
*** djgpp.old/src/utils/bin2h.c	Thu Jun  3 20:27:40 1999
--- djgpp/src/utils/bin2h.c	Fri Apr 27 09:56:56 2001
***************
*** 3,8 ****
--- 3,9 ----
  /* 1998 -- Modified by Nils van den Heuvel (n DOT heuvel AT wxs DOT nl) */
  
  #include <stdio.h>
+ #include <stdlib.h>
  #include <fcntl.h>
  #include <sys/stat.h>
  #include <unistd.h>
diff -cr3 -X exclude.lst djgpp.old/src/utils/djecho.c djgpp/src/utils/djecho.c
*** djgpp.old/src/utils/djecho.c	Tue Aug 13 02:55:54 1996
--- djgpp/src/utils/djecho.c	Fri Apr 27 09:56:56 2001
***************
*** 1,6 ****
--- 1,7 ----
  /* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  #include <stdio.h>
+ #include <string.h>
  
  int
  main(int argc, char **argv)
diff -cr3 -X exclude.lst djgpp.old/src/utils/djmerge.c djgpp/src/utils/djmerge.c
*** djgpp.old/src/utils/djmerge.c	Sat Feb 24 07:01:20 2001
--- djgpp/src/utils/djmerge.c	Fri Apr 27 09:56:56 2001
***************
*** 3,8 ****
--- 3,10 ----
  /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */
  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
  #include <fcntl.h>
  #include <unistd.h>
  #include <sys/types.h>
diff -cr3 -X exclude.lst djgpp.old/src/utils/djsplit.c djgpp/src/utils/djsplit.c
*** djgpp.old/src/utils/djsplit.c	Sat Feb 24 07:01:20 2001
--- djgpp/src/utils/djsplit.c	Fri Apr 27 09:56:56 2001
***************
*** 3,8 ****
--- 3,9 ----
  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  #include <stdio.h>
  #include <stdlib.h>
+ #include <string.h>
  #include <fcntl.h>
  #include <unistd.h>
  #include <sys/types.h>
diff -cr3 -X exclude.lst djgpp.old/src/utils/texi2ps/word.c djgpp/src/utils/texi2ps/word.c
*** djgpp.old/src/utils/texi2ps/word.c	Sat Feb 20 23:56:06 1999
--- djgpp/src/utils/texi2ps/word.c	Fri Apr 27 09:56:56 2001
***************
*** 20,25 ****
--- 20,26 ----
  
  #include <stdio.h>
  #include <stdlib.h>
+ #include <string.h>
  #include <time.h>
  #include "word.h"
  #include "ps.h"
diff -cr3 -X exclude.lst djgpp.old/src/utils/update.c djgpp/src/utils/update.c
*** djgpp.old/src/utils/update.c	Wed Jul 12 12:27:14 1995
--- djgpp/src/utils/update.c	Fri Apr 27 09:56:56 2001
***************
*** 2,7 ****
--- 2,9 ----
  /* This file is intended to be compiled with Turbo-C */
  
  #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
  #include <fcntl.h>
  #include <unistd.h>
  #include <io.h>
diff -cr3 -X exclude.lst djgpp.old/tests/debug/common/args.c djgpp/tests/debug/common/args.c
*** djgpp.old/tests/debug/common/args.c	Mon Aug 28 02:52:12 1995
--- djgpp/tests/debug/common/args.c	Fri Apr 27 11:28:08 2001
***************
*** 6,12 ****
    _CRT0_FLAG_PRESERVE_UPPER_CASE
    |_CRT0_FLAG_USE_DOS_SLASHES;
  
! void
  main(int argc, char **argv)
  {
    int i;
--- 6,12 ----
    _CRT0_FLAG_PRESERVE_UPPER_CASE
    |_CRT0_FLAG_USE_DOS_SLASHES;
  
! int
  main(int argc, char **argv)
  {
    int i;
diff -cr3 -X exclude.lst djgpp.old/tests/debug/common/v2load.c djgpp/tests/debug/common/v2load.c
*** djgpp.old/tests/debug/common/v2load.c	Mon Aug 28 00:53:38 1995
--- djgpp/tests/debug/common/v2load.c	Fri Apr 27 11:27:36 2001
***************
*** 13,19 ****
  #include <libc/farptrgs.h>
  #include <sys/stat.h>
  
! void main(int argc, char **argv)
  {
    int i;
    char cmdline[128];
--- 13,19 ----
  #include <libc/farptrgs.h>
  #include <sys/stat.h>
  
! int main(int argc, char **argv)
  {
    int i;
    char cmdline[128];
diff -cr3 -X exclude.lst djgpp.old/tests/gcc.opt djgpp/tests/gcc.opt
*** djgpp.old/tests/gcc.opt	Mon Jul 10 05:40:40 1995
--- djgpp/tests/gcc.opt	Fri Apr 27 11:27:08 2001
***************
*** 8,13 ****
  -Wpointer-arith
  -Wshadow
  -Wstrict-prototypes
- -Wtraditional
  -Wwrite-strings
  -nostdinc
--- 8,12 ----
diff -cr3 -X exclude.lst djgpp.old/tests/libc/ansi/stdio/hello.c djgpp/tests/libc/ansi/stdio/hello.c
*** djgpp.old/tests/libc/ansi/stdio/hello.c	Sat Mar 18 20:55:42 1995
--- djgpp/tests/libc/ansi/stdio/hello.c	Fri Apr 27 11:37:02 2001
***************
*** 1,7 ****
  #include <stdio.h>
  
  int
! main(int argc, char *argv)
  {
    printf("hello\n");
    return 0;
--- 1,7 ----
  #include <stdio.h>
  
  int
! main(int argc, char **argv)
  {
    printf("hello\n");
    return 0;
diff -cr3 -X exclude.lst djgpp.old/tests/libc/ansi/stdio/tscanf.c djgpp/tests/libc/ansi/stdio/tscanf.c
*** djgpp.old/tests/libc/ansi/stdio/tscanf.c	Sun Apr 18 17:27:36 1999
--- djgpp/tests/libc/ansi/stdio/tscanf.c	Fri Apr 27 11:37:40 2001
***************
*** 32,38 ****
  
  	  memset (cbuf, 0, sizeof cbuf);
  	  converted = sscanf (buf, fmt, cbuf);
! 	  printf ("`%s' converted %ld characters, result: %s\n",
  		  fmt, strlen (cbuf), cbuf);
  	  return converted;
  	}
--- 32,38 ----
  
  	  memset (cbuf, 0, sizeof cbuf);
  	  converted = sscanf (buf, fmt, cbuf);
! 	  printf ("`%s' converted %lu characters, result: %s\n",
  		  fmt, strlen (cbuf), cbuf);
  	  return converted;
  	}
diff -cr3 -X exclude.lst djgpp.old/tests/libc/ansi/stdlib/shell.c djgpp/tests/libc/ansi/stdlib/shell.c
*** djgpp.old/tests/libc/ansi/stdlib/shell.c	Sun Aug  6 02:19:46 1995
--- djgpp/tests/libc/ansi/stdlib/shell.c	Fri Apr 27 11:39:34 2001
***************
*** 1,5 ****
--- 1,6 ----
  #include <process.h>
  #include <stdio.h>
+ #include <string.h>
  #include <stdlib.h>
  
  int
diff -cr3 -X exclude.lst djgpp.old/tests/libclink/makefile djgpp/tests/libclink/makefile
*** djgpp.old/tests/libclink/makefile	Mon Sep  8 01:55:04 1997
--- djgpp/tests/libclink/makefile	Fri Apr 27 11:30:10 2001
***************
*** 15,21 ****
  	@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
--- 15,21 ----
  	@nm -g ../../lib/crt0.o ../../lib/libc.a | check > check.out
  
  check.exe : check.o slist.o objs.o
! 	gcc -o $@ $^ -lstdcxx
  
  compare.out : compare oldlibc.arm newlibc.arm
  	@compare oldlibc.arm newlibc.arm > compare.out
diff -cr3 -X exclude.lst djgpp.old/zoneinfo/src/zic.c djgpp/zoneinfo/src/zic.c
*** djgpp.old/zoneinfo/src/zic.c	Mon Jan  3 11:57:04 2000
--- djgpp/zoneinfo/src/zic.c	Fri Apr 27 10:15:34 2001
***************
*** 7,13 ****
  #include "private.h"
  #include "locale.h"
  #include "tzfile.h"
! #ifdef unix
  #include "sys/stat.h"			/* for umask manifest constants */
  #include "sys/wait.h"
  #ifndef WEXITSTATUS
--- 7,13 ----
  #include "private.h"
  #include "locale.h"
  #include "tzfile.h"
! #if defined(unix) || defined(__DJGPP__)
  #include "sys/stat.h"			/* for umask manifest constants */
  #include "sys/wait.h"
  #ifndef WEXITSTATUS

--Message-Boundary-24380--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019