Bug 46483 - [patch] Fix gcc295 on current/i386
Summary: [patch] Fix gcc295 on current/i386
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Trevor Johnson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-23 00:40 UTC by Stefan Farfeleder
Modified: 2004-08-17 14:32 UTC (History)
1 user (show)

See Also:


Attachments
gcc295.patch (9.43 KB, patch)
2002-12-23 00:40 UTC, Stefan Farfeleder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Farfeleder 2002-12-23 00:40:00 UTC
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.
Comment 1 Ying-Chieh Liao freebsd_committer 2002-12-23 08:20:01 UTC
Responsible Changed
From-To: freebsd-ports->trevor

over to maintainer
Comment 2 Tilman Keskinoz freebsd_committer 2003-01-01 12:07:07 UTC
State Changed
From-To: open->patched

I committed this patch, thanks. 

Since obrien likes patch-ar to be solved different, I'll leave this PR in state "patched"
Comment 3 Stefan Farfeleder freebsd_committer 2004-08-17 14:31:27 UTC
State Changed
From-To: patched->closed

As nobody came up with a better patch till now, close this PR.