Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Dec 2002 01:31:40 +0100 (CET)
From:      Stefan Farfeleder <stefan@fafoe.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        stefan@fafoe.dyndns.org
Subject:   ports/46483: [patch] Fix gcc295 on current/i386
Message-ID:  <20021223003140.982B288D@frog.fafoe>

next in thread | raw e-mail | index | archive | help

>Number:         46483
>Category:       ports
>Synopsis:       [patch] Fix gcc295 on current/i386
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 22 16:40:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Farfeleder
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD frog.fafoe 5.0-CURRENT FreeBSD 5.0-CURRENT #8: Fri Dec 20 01:53:06 CET 2002 freebsd@frog.fafoe:/freebsd/current/obj/freebsd/current/src/sys/FROG i386


	
>Description:
The following problems were fixed:

* Lack of <machine/ansi.h> on -current

	This is the error also noticed by the bento cluster
	(http://bento.freebsd.org/errorlogs/i386-5-latest/gcc-2.95.3.log).
	patch-ap is updated to include <machine/_types>, the successor to
	<machine/ansi.h> if __FreeBSD_version is >= 500039.  Also the new
	nomenclature of _XXX_DECLARED is added to avoid having everything
	declared twice (_SIZE_T_DECLARED and _WCHAR_T_DECLARED in patch-ap,
	_VA_LIST_DECLARED in patch-aq).

* Fix LINK_SPEC to say elf_i386_fbsd instead of elf_i386

	At this point ld complains about the elf_i386:

stage1/xgcc -Bstage1/ -B/usr/local/i386-portbld-freebsd5.0/bin/  -DIN_GCC     -O2 -O -pipe -mcpu=pentiumpro  -DHAVE_CONFIG_H  -o gencheck \
 gencheck.o ` case "obstack.o" in ?*) echo obstack.o ;; esac ` ` case "" in ?*) echo  ;; esac ` ` case "" in ?*) echo  ;; esac `  ` case "" in ?*) echo  ;; esac ` ` case "" in ?*) echo  ;; esac ` 
/usr/bin/ld: unrecognised emulation mode: elf_i386
Supported emulations: elf_i386_fbsd
collect2: ld returned 1 exit status
gmake[2]: *** [gencheck] Error 1

	The name was changed in revision 1.18 of
	src/gnu/usr.bin/binutils/ld/Makefile.i386.  patch-af is enhanced to
	declare LINK_SPEC depending on __FreeBSD_version.  Other
	architectures will probably need similar fixes but due to my lack of
	access to such machines with FreeBSD installations only i386 is
	fixed.

* Syntax error due to #define __size_t

	gcc/ginclude/stddef.h defines __size_t to be nothing which leads to
	this error:

/usr/home/stefan/ports/lang/gcc295.test/work/gcc-2.95.3/gcc/xgcc -B/usr/home/stefan/ports/lang/gcc295.test/work/gcc-2.95.3/gcc/ -B/usr/local/i386-portbld-freebsd5.0/bin/ -c -DHAVE_CONFIG_H -O -pipe -mcpu=pentiumpro -I. -I./../../include  getruntime.c
In file included from /usr/include/sys/param.h:101,
                 from getruntime.c:38:
/usr/include/sys/signal.h:277: parse error before `ss_size'
/usr/include/sys/signal.h:277: warning: no semicolon at end of struct or union
/usr/include/sys/signal.h:279: parse error before `}'
/usr/include/sys/signal.h:279: warning: data definition has no type or storage class
gmake[2]: *** [getruntime.o] Error 1

	because of __size_t ss_size; in <sys/signal.h>.  The offending line
	is deleted in patch-ap.

* _G_config.h needs __sigset_t

/usr/home/stefan/ports/lang/gcc295.test/work/gcc-2.95.3/gcc/xgcc -B/usr/home/stefan/ports/lang/gcc295.test/work/gcc-2.95.3/gcc/ -B/usr/local/i386-portbld-freebsd5.0/bin/ -c -O -pipe -mcpu=pentiumpro -I. -I.  filedoalloc.c
In file included from libio.h:30,
                 from iolibio.h:1,
                 from libioP.h:47,
                 from filedoalloc.c:45:
_G_config.h:43: parse error before `_G_sigset_t'
_G_config.h:43: warning: data definition has no type or storage class
gmake[2]: *** [filedoalloc.o] Error 1

	_G_config.h contains the line
typedef __sigset_t _G_sigset_t;
	without including a header that declares __sigset_t.  Since
	_G_sigset_t is never used anyway, gen-params is tweaked to omit that
	line (patch-as).

* G++ 2.95.3 dislikes <sys/_types.h>

/usr/home/stefan/ports/lang/gcc295.test/work/gcc-2.95.3/gcc/xgcc -B/usr/home/stefan/ports/lang/gcc295.test/work/gcc-2.95.3/gcc/ -B/usr/local/i386-portbld-freebsd5.0/bin/ -c -O -pipe -mcpu=pentiumpro -fno-implicit-templates -I. -I. -nostdinc++  filebuf.cc
In file included from /usr/include/machine/endian.h:41,
                 from /usr/include/sys/types.h:48,
                 from filebuf.cc:28:
/usr/include/sys/_types.h:75: declaration does not declare anything
gmake[2]: *** [filebuf.o] Error 1

	The offending line is
typedef __ct_rune_t     __wchar_t;

	In fact, I do not know the cause of this.  I've "worked around" by
	completely disabling the error in the compiler (patch-ar), since the
	produced g++ would not be of much use.  -fpermissive would work, but
	the option treats /all/ errors as warnings.

* objc directory removed from pkg-plist

	This directory is never created.

>How-To-Repeat:

Try to install gcc295 on -current.
	
>Fix:

	

--- gcc295.patch begins here ---
Index: pkg-plist
===================================================================
RCS file: /usr/home/ncvs/ports/lang/gcc295/pkg-plist,v
retrieving revision 1.32
diff -c -r1.32 pkg-plist
*** pkg-plist	6 May 2002 23:38:17 -0000	1.32
--- pkg-plist	22 Dec 2002 22:41:19 -0000
***************
*** 18,24 ****
  @exec install-info %D/info/gcc.info %D/info/dir
  @dirrm %%GNU_HOST%%/include
  @dirrm %%GNU_HOST%%
- @dirrm lib/gcc-lib/%%GNU_HOST%%/%%EGCS_REV%%/include/objc
  @dirrm lib/gcc-lib/%%GNU_HOST%%/%%EGCS_REV%%/include/g++/std
  @dirrm lib/gcc-lib/%%GNU_HOST%%/%%EGCS_REV%%/include/g++
  @dirrm lib/gcc-lib/%%GNU_HOST%%/%%EGCS_REV%%/include
--- 18,23 ----
Index: files/patch-af
===================================================================
RCS file: /usr/home/ncvs/ports/lang/gcc295/files/patch-af,v
retrieving revision 1.13
diff -c -r1.13 patch-af
*** files/patch-af	17 Apr 2001 09:26:26 -0000	1.13
--- files/patch-af	22 Dec 2002 22:10:05 -0000
***************
*** 1,5 ****
! --- gcc/config/i386/freebsd.h.orig	Mon Dec 18 06:05:58 2000
! +++ gcc/config/i386/freebsd.h	Tue Apr 17 02:24:05 2001
  @@ -35,9 +35,9 @@
      libraries compiled with the native cc, so undef it. */
   #undef NO_DOLLAR_IN_LABEL
--- 1,5 ----
! --- gcc/config/i386/freebsd.h.orig	Mon Dec 18 15:05:58 2000
! +++ gcc/config/i386/freebsd.h	Sun Dec 22 23:08:15 2002
  @@ -35,9 +35,9 @@
      libraries compiled with the native cc, so undef it. */
   #undef NO_DOLLAR_IN_LABEL
***************
*** 93,95 ****
--- 93,124 ----
   
   /* Provide a LIB_SPEC appropriate for FreeBSD.  Just select the appropriate
      libc, depending on whether we're doing profiling or need threads support.
+ @@ -230,6 +242,20 @@
+     done.  */
+  
+  #undef	LINK_SPEC
+ +#include <osreldate.h>
+ +#if __FreeBSD_version >= 500042
+ +#define LINK_SPEC "-m elf_i386_fbsd \
+ +  %{Wl,*:%*} \
+ +  %{v:-V} \
+ +  %{assert*} %{R*} %{rpath*} %{defsym*} \
+ +  %{shared:-Bshareable %{h*} %{soname*}} \
+ +    %{!shared: \
+ +      %{!static: \
+ +        %{rdynamic:-export-dynamic} \
+ +	%{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
+ +    %{static:-Bstatic}} \
+ +  %{symbolic:-Bsymbolic}"
+ +#else
+  #define LINK_SPEC "-m elf_i386 \
+    %{Wl,*:%*} \
+    %{v:-V} \
+ @@ -241,6 +267,7 @@
+  	%{!dynamic-linker:-dynamic-linker /usr/libexec/ld-elf.so.1}} \
+      %{static:-Bstatic}} \
+    %{symbolic:-Bsymbolic}"
+ +#endif
+  
+  /* A C statement to output to the stdio stream FILE an assembler
+     command to advance the location counter to a multiple of 1<<LOG
Index: files/patch-ap
===================================================================
RCS file: /usr/home/ncvs/ports/lang/gcc295/files/patch-ap,v
retrieving revision 1.3
diff -c -r1.3 patch-ap
*** files/patch-ap	24 Mar 2002 17:03:20 -0000	1.3
--- files/patch-ap	22 Dec 2002 17:19:38 -0000
***************
*** 1,14 ****
! --- gcc/ginclude/stddef.h.orig.orig	Sun Mar 24 03:12:41 2002
! +++ gcc/ginclude/stddef.h	Sun Mar 24 03:12:47 2002
! @@ -25,6 +25,7 @@
   /* On 4.3bsd-net2, make sure ansi.h is included, so we have
      one less case to deal with in the following.  */
   #if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__)
! +#define __NO_GNUC_VA_LIST	/* <machine/ansi.h> defines __gnuc_va_list */
   #include <machine/ansi.h>
   #endif
   
! @@ -109,7 +110,6 @@
   #define _T_PTRDIFF
   #define __PTRDIFF_T
   #define _PTRDIFF_T_
--- 1,22 ----
! --- gcc/ginclude/stddef.h.orig	Wed Dec 16 22:19:25 1998
! +++ gcc/ginclude/stddef.h	Sun Dec 22 18:18:47 2002
! @@ -25,8 +25,15 @@
   /* On 4.3bsd-net2, make sure ansi.h is included, so we have
      one less case to deal with in the following.  */
   #if defined (__BSD_NET2__) || defined (____386BSD____) || defined (__FreeBSD__) || defined(__NetBSD__)
! +/* <machine/ansi.h> and <machine/_types.h> define __gnuc_va_list */
! +#define __NO_GNUC_VA_LIST
! +#include <osreldate.h>
! +#if __FreeBSD_version >= 500039
! +#include <machine/_types.h>
! +#else
   #include <machine/ansi.h>
   #endif
+ +#endif
   
!  /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
!     defined if the corresponding type is *not* defined.
! @@ -109,7 +116,6 @@
   #define _T_PTRDIFF
   #define __PTRDIFF_T
   #define _PTRDIFF_T_
***************
*** 16,34 ****
   #define ___int_ptrdiff_t_h
   #define _GCC_PTRDIFF_T
   #ifndef __PTRDIFF_TYPE__
! @@ -156,7 +156,6 @@
   #define _T_SIZE
   #define __SIZE_T
   #define _SIZE_T_
  -#define _BSD_SIZE_T_
   #define _SIZE_T_DEFINED_
   #define _SIZE_T_DEFINED
   #define ___int_size_t_h
! @@ -217,7 +216,6 @@
   #define _T_WCHAR
   #define __WCHAR_T
   #define _WCHAR_T_
  -#define _BSD_WCHAR_T_
   #define _WCHAR_T_DEFINED_
   #define _WCHAR_T_DEFINED
   #define _WCHAR_T_H
--- 24,84 ----
   #define ___int_ptrdiff_t_h
   #define _GCC_PTRDIFF_T
   #ifndef __PTRDIFF_TYPE__
! @@ -145,6 +151,7 @@
!  #ifndef _BSD_SIZE_T_
!  #ifndef _SIZE_T_DEFINED_
!  #ifndef _SIZE_T_DEFINED
! +#ifndef _SIZE_T_DECLARED
!  #ifndef ___int_size_t_h
!  #ifndef _GCC_SIZE_T
!  #ifndef _SIZET_
! @@ -156,13 +163,12 @@
   #define _T_SIZE
   #define __SIZE_T
   #define _SIZE_T_
  -#define _BSD_SIZE_T_
   #define _SIZE_T_DEFINED_
   #define _SIZE_T_DEFINED
+ +#define _SIZE_T_DECLARED
   #define ___int_size_t_h
!  #define _GCC_SIZE_T
!  #define _SIZET_
! -#define __size_t
!  #ifndef __SIZE_TYPE__
!  #define __SIZE_TYPE__ long unsigned int
!  #endif
! @@ -176,6 +182,7 @@
!  #endif /* _SIZET_ */
!  #endif /* _GCC_SIZE_T */
!  #endif /* ___int_size_t_h */
! +#endif /* _SIZE_T_DECLARED */
!  #endif /* _SIZE_T_DEFINED */
!  #endif /* _SIZE_T_DEFINED_ */
!  #endif /* _BSD_SIZE_T_ */
! @@ -207,6 +214,7 @@
!  #ifndef _BSD_WCHAR_T_
!  #ifndef _WCHAR_T_DEFINED_
!  #ifndef _WCHAR_T_DEFINED
! +#ifndef _WCHAR_T_DECLARED
!  #ifndef _WCHAR_T_H
!  #ifndef ___int_wchar_t_h
!  #ifndef __INT_WCHAR_T_H
! @@ -217,9 +225,9 @@
   #define _T_WCHAR
   #define __WCHAR_T
   #define _WCHAR_T_
  -#define _BSD_WCHAR_T_
   #define _WCHAR_T_DEFINED_
   #define _WCHAR_T_DEFINED
+ +#define _WCHAR_T_DECLARED
   #define _WCHAR_T_H
+  #define ___int_wchar_t_h
+  #define __INT_WCHAR_T_H
+ @@ -253,6 +261,7 @@
+  #endif
+  #ifndef __cplusplus
+  typedef __WCHAR_TYPE__ wchar_t;
+ +#endif
+  #endif
+  #endif
+  #endif
Index: files/patch-aq
===================================================================
RCS file: /usr/home/ncvs/ports/lang/gcc295/files/patch-aq,v
retrieving revision 1.1
diff -c -r1.1 patch-aq
*** files/patch-aq	5 Aug 1999 16:06:03 -0000	1.1
--- files/patch-aq	22 Dec 2002 15:21:23 -0000
***************
*** 1,5 ****
! --- gcc/ginclude/stdarg.h.orig	Fri May  7 18:52:35 1999
! +++ gcc/ginclude/stdarg.h	Wed Jun 23 16:38:00 1999
  @@ -67,7 +67,7 @@
   
   #ifndef __GNUC_VA_LIST
--- 1,5 ----
! --- gcc/ginclude/stdarg.h.orig	Sat May  8 03:52:35 1999
! +++ gcc/ginclude/stdarg.h	Sun Dec 22 16:21:14 2002
  @@ -67,7 +67,7 @@
   
   #ifndef __GNUC_VA_LIST
***************
*** 9,11 ****
--- 9,38 ----
   typedef char *__gnuc_va_list;
   #else
   typedef void *__gnuc_va_list;
+ @@ -181,6 +181,8 @@
+  #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
+  /* The macro _VA_LIST_DEFINED is used in Windows NT 3.5  */
+  #ifndef _VA_LIST_DEFINED
+ +/* The macro _VA_LIST_DECLARED is used in FreeBSD 5.x */
+ +#ifndef _VA_LIST_DECLARED
+  /* The macro _VA_LIST is used in SCO Unix 3.2.  */
+  #ifndef _VA_LIST
+  /* The macro _VA_LIST_T_H is used in the Bull dpx2  */
+ @@ -188,6 +190,7 @@
+  typedef __gnuc_va_list va_list;
+  #endif /* not _VA_LIST_T_H */
+  #endif /* not _VA_LIST */
+ +#endif /* not _VA_LIST_DECLARED */
+  #endif /* not _VA_LIST_DEFINED */
+  #if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
+  #define _VA_LIST_
+ @@ -197,6 +200,9 @@
+  #endif
+  #ifndef _VA_LIST_DEFINED
+  #define _VA_LIST_DEFINED
+ +#endif
+ +#ifndef _VA_LIST_DECLARED
+ +#define _VA_LIST_DECLARED
+  #endif
+  #ifndef _VA_LIST_T_H
+  #define _VA_LIST_T_H
Index: files/patch-ar
===================================================================
RCS file: files/patch-ar
diff -N files/patch-ar
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- files/patch-ar	22 Dec 2002 18:38:54 -0000
***************
*** 0 ****
--- 1,15 ----
+ --- gcc/cp/decl.c.orig	Sat Jun 10 02:06:42 2000
+ +++ gcc/cp/decl.c	Sun Dec 22 19:37:47 2002
+ @@ -7119,10 +7119,12 @@
+    if (found_type > 1)
+      error ("multiple types in one declaration");
+  
+ +#if 0
+    /* Inside a class, we might be in a friend or access declaration.
+       Until we have a good way of detecting the latter, don't warn.  */
+    if (t == NULL_TREE && ! current_class_type)
+      pedwarn ("declaration does not declare anything");
+ +#endif
+  
+    /* Check for an anonymous union.  We're careful
+       accessing TYPE_IDENTIFIER because some built-in types, like
Index: files/patch-as
===================================================================
RCS file: files/patch-as
diff -N files/patch-as
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- files/patch-as	22 Dec 2002 20:46:32 -0000
***************
*** 0 ****
--- 1,10 ----
+ --- libio/gen-params.orig     Sun Dec 22 20:02:50 2002
+ +++ libio/gen-params  Sun Dec 22 20:04:15 2002
+ @@ -411,7 +411,6 @@
+  #define __PTRDIFF_TYPE__ ${ptrdiff_t-long int /* default */}
+  #endif
+  typedef __PTRDIFF_TYPE__ ${macro_prefix}ptrdiff_t;
+ -typedef ${sigset_t-int /* default */} ${macro_prefix}sigset_t;
+  #ifndef __SIZE_TYPE__
+  #define __SIZE_TYPE__ ${size_t-unsigned long /* default */}
+  #endif
--- gcc295.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021223003140.982B288D>