From fe7dee47009525e334f1bde385b69753f007085c Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 3 Nov 1994 06:52:42 +0000 Subject: ---------------------------------- GCC-2.6.1 COMES TO FREEBSD-current ---------------------------------- Everybody needs to 'make world'. Oakland, Nov 2nd 1994. In a surprise move this sunny afternoon, the release- engineer for the slightly delayed FreeBSD-2.0, Poul-Henning Kamp (28), decided to pull in the new version 2.6.1 of the GNU C-compiler. The new version of the compiler was release today at noon, and hardly 9 hours later it was committed into the FreeBSD-current source-repository. "It's is simply because we have had too much trouble with the version 2.6.0 of the compiler" Poul-Henning told the FreeBSD-Gazette, "we took a gamble when we decided to use that as our compiler for the 2.0 release, but it seems to pay of in the end now" he concludes. The move has not been discussed on the "core" list at all, and will come as a surprise for most Poul-Hennings peers. "I have only discussed it with Jordan [J. K. Hubbard, the FreeBSD's resident humourist], and we agreed that we needed to do it, so ... I did it!". After a breath he added with a grin: "My email will probably get an all time 'disk-full' now!". This will bring quite a flag-day to the FreeBSD developers, the patch-file is almost 1.4 Megabyte, and they will have to run "make world" to get entirely -current again. "Too bad, but we just had to do this." Was the only comment from Poul-Henning to these problems. When asked how this move would impact the 2.0 release-date, Poul-Hennings face grew dark, he mumbled some very Danish words while he moved his fingers in strange geometrical patterns. Immediately something ecclipsed the Sun, a minor tremor shook the buildings, and the temperature fell significantly. We decided not to pursure the question. ----------- JOB-SECTION ----------- Are you a dedicated GCC-hacker ? We BADLY need somebody to look at the 'freebsd' OS in gcc, sanitize it and carry the patches back to the GNU people. In particular, we need to get out of the "i386-only" spot we are in now. I have the stuff to take a gnu-dist into bmake-form, and will do that part. Please apply to phk@freebsd.org No Novice Need Apply. --- gnu/gnu2bmake/gcc-2.6.1.patch | 178 ++++++++++++++++++++++++++++ gnu/gnu2bmake/gcc-2.6.1.tcl | 261 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 439 insertions(+) create mode 100644 gnu/gnu2bmake/gcc-2.6.1.patch create mode 100755 gnu/gnu2bmake/gcc-2.6.1.tcl (limited to 'gnu/gnu2bmake') diff --git a/gnu/gnu2bmake/gcc-2.6.1.patch b/gnu/gnu2bmake/gcc-2.6.1.patch new file mode 100644 index 000000000000..302b232b5921 --- /dev/null +++ b/gnu/gnu2bmake/gcc-2.6.1.patch @@ -0,0 +1,178 @@ +diff -u -r /freebsd/gcc-2.6.1/cccp.c ./cccp.c +--- /freebsd/gcc-2.6.1/cccp.c Tue Oct 25 15:37:44 1994 ++++ ./cccp.c Wed Nov 2 17:36:25 1994 +@@ -188,7 +188,7 @@ + #ifndef VMS + #ifndef HAVE_STRERROR + extern int sys_nerr; +-#if defined(bsd4_4) || defined(__NetBSD__) ++#if defined(bsd4_4) || defined(__NetBSD__) || defined(__FreeBSD__) + extern const char *const sys_errlist[]; + #else + extern char *sys_errlist[]; +Only in .: cccp.c.orig +Only in .: cccp.o +Only in .: cexp.o +diff -u -r /freebsd/gcc-2.6.1/collect2.c ./collect2.c +--- /freebsd/gcc-2.6.1/collect2.c Thu Oct 20 15:05:46 1994 ++++ ./collect2.c Wed Nov 2 17:36:25 1994 +@@ -41,7 +41,7 @@ + extern int errno; + #endif + +-#if defined(bsd4_4) || defined(__NetBSD__) ++#if defined(bsd4_4) || defined(__NetBSD__) || defined(__FreeBSD__) + extern const char *const sys_errlist[]; + #else + extern char *sys_errlist[]; +Only in .: collect2.c.orig +diff -u -r /freebsd/gcc-2.6.1/config/i386/freebsd.h ./config/i386/freebsd.h +--- /freebsd/gcc-2.6.1/config/i386/freebsd.h Tue Oct 18 17:59:52 1994 ++++ ./config/i386/freebsd.h Wed Nov 2 17:36:37 1994 +@@ -33,11 +33,13 @@ + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-Dunix -Di386 -D__FreeBSD__ -D__386BSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" + ++#if 0 + #define INCLUDE_DEFAULTS { \ + { "/usr/include", 0 }, \ + { "/usr/include/g++", 1 }, \ + { 0, 0} \ + } ++#endif + + /* Like the default, except no -lg. */ + #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" +Only in ./config/i386: freebsd.h.orig +diff -u -r /freebsd/gcc-2.6.1/config/i386/x-freebsd ./config/i386/x-freebsd +--- /freebsd/gcc-2.6.1/config/i386/x-freebsd Mon Oct 31 04:52:41 1994 ++++ ./config/i386/x-freebsd Wed Nov 2 18:45:36 1994 +@@ -1,3 +1,6 @@ + # Don't run fixproto + STMP_FIXPROTO = +-CLIB=-lgnumalloc ++CLIB = -lgnumalloc ++ ++# Find FreeBSD's includes before resorting to GCC's ++LIBGCC2_INCLUDES -I/usr/include +Only in .: config.h +Only in .: config.status +Only in ./cp: Makefile +diff -u -r /freebsd/gcc-2.6.1/cp/g++.c ./cp/g++.c +--- /freebsd/gcc-2.6.1/cp/g++.c Sat Oct 29 04:17:44 1994 ++++ ./cp/g++.c Wed Nov 2 17:36:42 1994 +@@ -84,7 +84,7 @@ + #endif + + extern int sys_nerr; +-#if defined(bsd4_4) || defined(__NetBSD__) ++#if defined(bsd4_4) || defined(__NetBSD__) || defined(__FreeBSD__) + extern const char *const sys_errlist[]; + #else + extern char *sys_errlist[]; +Only in ./cp: g++.c.orig +Only in ./cp: include +Only in ./cp: stage1 +Only in ./cp: stage2 +Only in ./cp: stage3 +Only in ./cp: stage4 +Only in .: cpp +Only in .: float.h-nat +diff -u -r /freebsd/gcc-2.6.1/gcc.c ./gcc.c +--- /freebsd/gcc-2.6.1/gcc.c Thu Oct 27 15:49:58 1994 ++++ ./gcc.c Wed Nov 2 17:36:43 1994 +@@ -166,7 +166,7 @@ + #endif + + extern int sys_nerr; +-#if defined(bsd4_4) || defined(__NetBSD__) ++#if defined(bsd4_4) || defined(__NetBSD__) || defined (__FreeBSD__) + extern const char *const sys_errlist[]; + #else + extern char *sys_errlist[]; +Only in .: gcc.c.orig +Only in .: gfloat.h +diff -u -r /freebsd/gcc-2.6.1/ginclude/stdarg.h ./ginclude/stdarg.h +--- /freebsd/gcc-2.6.1/ginclude/stdarg.h Fri Jul 8 19:04:27 1994 ++++ ./ginclude/stdarg.h Wed Nov 2 17:36:49 1994 +@@ -136,13 +136,13 @@ + But on BSD NET2 we must not test or define or undef it. + (Note that the comments in NET 2's ansi.h + are incorrect for _VA_LIST_--see stdio.h!) */ +-#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__FreeBSD__) ++#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) + /* 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 */ + #ifndef _VA_LIST_T_H + #define _VA_LIST_T_H +-#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__FreeBSD__)) ++#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) + #define _VA_LIST_ + #endif + #define _VA_LIST +Only in ./ginclude: stdarg.h.orig +diff -u -r /freebsd/gcc-2.6.1/ginclude/stddef.h ./ginclude/stddef.h +--- /freebsd/gcc-2.6.1/ginclude/stddef.h Fri Oct 7 16:22:35 1994 ++++ ./ginclude/stddef.h Wed Nov 2 17:36:54 1994 +@@ -22,7 +22,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__) ++#if defined (__BSD_NET2__) || defined (____386BSD____) + #include + #endif + +Only in ./ginclude: stddef.h.orig +diff -u -r /freebsd/gcc-2.6.1/ginclude/varargs.h ./ginclude/varargs.h +--- /freebsd/gcc-2.6.1/ginclude/varargs.h Fri Jul 8 19:04:32 1994 ++++ ./ginclude/varargs.h Wed Nov 2 17:36:59 1994 +@@ -151,13 +151,13 @@ + /* Michael Eriksson at Thu Sep 30 11:00:57 1993: + Sequent defines _VA_LIST_ in to be the type to + use for va_list (``typedef _VA_LIST_ va_list'') */ +-#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) ++#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) + /* 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 */ + #ifndef _VA_LIST_T_H + #define _VA_LIST_T_H +-#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__)) ++#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) + #define _VA_LIST_ + #endif + #define _VA_LIST +Only in ./ginclude: varargs.h.orig +Only in .: hconfig.h +Only in .: include +Only in .: libgcc.a +Only in .: libgcc1.a +Only in .: libgcc2.a +Only in .: libgcc2.ready +Only in .: md +Only in .: multilib.h +Only in .: objc-headers +Only in .: obstack.o +diff -u -r /freebsd/gcc-2.6.1/protoize.c ./protoize.c +--- /freebsd/gcc-2.6.1/protoize.c Tue Oct 4 20:17:40 1994 ++++ ./protoize.c Wed Nov 2 17:37:00 1994 +@@ -79,7 +79,7 @@ + #undef getopt + + extern int errno; +-#if defined(bsd4_4) || defined(__NetBSD__) ++#if defined(bsd4_4) || defined(__NetBSD__) || defined (__FreeBSD__) + extern const char *const sys_errlist[]; + #else + extern char *sys_errlist[]; +Only in .: protoize.c.orig +Only in .: stage1 +Only in .: stmp-fixinc +Only in .: stmp-headers +Only in .: stmp-int-hdrs +Only in .: tconfig.h +Only in .: tm.h +Only in .: version.o +Only in .: xlimits.h diff --git a/gnu/gnu2bmake/gcc-2.6.1.tcl b/gnu/gnu2bmake/gcc-2.6.1.tcl new file mode 100755 index 000000000000..8b1ef7a74e48 --- /dev/null +++ b/gnu/gnu2bmake/gcc-2.6.1.tcl @@ -0,0 +1,261 @@ +#!/usr/local/bin/tclsh +# +# ---------------------------------------------------------------------------- +# "THE BEER-WARE LICENSE" (Revision 42): +# wrote this file. As long as you retain this notice you +# can do whatever you want with this stuff. If we meet some day, and you think +# this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp +# ---------------------------------------------------------------------------- +# +# $FreeBSD$ +# + +source gnu2bmake.tcl + +####################################################################### +# Parameters to tweak +######## +set sdir /freebsd/A/gcc-2.6.1 +set ddir /freebsd/A/cc261 + +####################################################################### +# Do the stunt +######## +sh "cd $sdir ; sh configure i386--freebsd" + +# .h files on their way to ~/include +set l_include {config tm pcp tree input c-lex c-tree flags machmode real + rtl c-parse c-gperf function defaults convert obstack insn-attr + bytecode bc-emit insn-flags expr insn-codes regs hard-reg-set + insn-config loop recog bc-typecd bc-opcode bc-optab typeclass + output basic-block reload integrate conditions bytetypes bi-run + bc-arity multilib stack} + +# other files on their way to ~/include +set l_include_x {tree.def machmode.def rtl.def modemap.def bc-typecd.def} + +# .h files going into ~/include/i386 +set l_include_i386 {perform gstabs gas bsd i386 unix } + +# .c source for cpp +set l_cpp {cccp cexp version} + +# .c source for cc1 +set l_cc1 [zap_suffix [makefile_macro C_OBJS $sdir]] +append l_cc1 " " [zap_suffix [makefile_macro OBJS $sdir]] +append l_cc1 " " [zap_suffix [makefile_macro BC_OBJS $sdir]] + +# .c source for cc +set l_cc {gcc version} +append l_cc " " [zap_suffix [makefile_macro OBSTACK $sdir]] + +# .c source for c++ +set l_cplus [zap_suffix [makefile_macro OBSTACK $sdir]] + +# .c source for c++ from "cp" subdir +set l_cplus_cp {g++} + +# .c source for cc1plus +set l_cc1plus {c-common} +append l_cc1plus " " [zap_suffix [makefile_macro OBJS $sdir]] +append l_cc1plus " " [zap_suffix [makefile_macro BC_OBJS $sdir]] + +# .c source for cc1plus from "cp" subdir +set l_cc1plus_cp {} +append l_cc1plus_cp " " [zap_suffix [makefile_macro CXX_OBJS $sdir/cp]] + +# .h file for cc1plus from "cp" subdir +set l_cc1plus_h {lex parse cp-tree decl class hash} + +# other file for cc1plus from "cp" subdir +set l_cc1plus_x {tree.def input.c} + +# All files used more than once go into the lib. +set l_common [common_set $l_cpp $l_cc1 $l_cc $l_cc1plus $l_cplus] +set l_cpp [reduce_by $l_cpp $l_common] +set l_cc1 [reduce_by $l_cc1 $l_common] +set l_cc [reduce_by $l_cc $l_common] +set l_cplus [reduce_by $l_cplus $l_common] +set l_cc1plus [reduce_by $l_cc1plus $l_common] + +# functions in libgcc1 +set l_libgcc1 [makefile_macro LIB1FUNCS $sdir] +# functions in libgcc2 +set l_libgcc2 [makefile_macro LIB2FUNCS $sdir] +# .c files in libgcc +set l_libgcc {libgcc1.c libgcc2.c} +# .h files in libgcc +set l_libgcc_h {tconfig longlong glimits gbl-ctors} + +set version [makefile_macro version $sdir] +set target [makefile_macro target $sdir] + +# do ~ +sh "rm -rf $ddir" +sh "mkdir $ddir" +set f [open $ddir/Makefile.inc w] +puts $f "#\n# \$FreeBSD\$\n#\n" +puts $f "CFLAGS+=\t-I\${.CURDIR} -I\${.CURDIR}/../include" +puts $f "CFLAGS+=\t-Dbsd4_4" +puts $f "CFLAGS+=\t-DGCC_INCLUDE_DIR=\\\"FOO\\\"" +puts $f "CFLAGS+=\t-DGPLUSPLUS_INCLUDE_DIR=\\\"FOO\\\"" +puts $f "CFLAGS+=\t-DTOOL_INCLUDE_DIR=\\\"FOO\\\"" +puts $f "CFLAGS+=\t-DDEFAULT_TARGET_VERSION=\\\"$version\\\"" +puts $f "CFLAGS+=\t-DDEFAULT_TARGET_MACHINE=\\\"$target\\\"" +puts $f "CFLAGS+=\t-DMD_EXEC_PREFIX=\\\"/usr/libexec/\\\"" +puts $f "CFLAGS+=\t-DSTANDARD_STARTFILE_PREFIX=\\\"/usr/lib\\\"" +close $f + +set f [open $ddir/Makefile w] +puts $f "#\n# \$FreeBSD\$\n#\n" +puts $f "PGMDIR=\tcc_int cpp cc1 cc cc1plus c++ libgcc" +puts $f "SUBDIR=\t\$(PGMDIR)" +puts $f "\n.include " +close $f + +# do ~/legal +sh "mkdir $ddir/legal" +sh "cp $sdir/gen-*.c $sdir/md $ddir/legal" +set f [open $ddir/README w] +puts $f { +$FreeBSD$ + +This directory contains gcc in a form that uses "bmake" makefiles. +This is not the place you want to start, if you want to hack gcc. +we have included everything here which is part of the source-code +of gcc, but still, don't use this as a hacking-base. + +If you suspect a problem with gcc, or just want to hack it in general, +get a complete gcc-X.Y.Z.tar.gz from somewhere, and use that. + +Please look in the directory src/gnu/gnu2bmake to find the tools +to generate these files. + +Thankyou. +} + +# do ~/libgcc +sh "mkdir $ddir/libgcc" +set f [open $ddir/libgcc/Makefile w] +puts $f "#\n# \$FreeBSD\$\n#\n" +puts $f "LIB=\tgcc" +puts $f "INSTALL_PIC_ARCHIVE=\tyes" +puts $f "SHLIB_MAJOR=\t26" +puts $f "SHLIB_MINOR=\t1" +puts $f "" +puts $f "LIB1OBJS=\t[add_suffix $l_libgcc1 .o]" +puts $f "LIB2OBJS=\t[add_suffix $l_libgcc2 .o]" +puts $f { +OBJS= ${LIB1OBJS} ${LIB2OBJS} +LIB1SOBJS=${LIB1OBJS:.o=.so} +LIB2SOBJS=${LIB2OBJS:.o=.so} +P1OBJS=${LIB1OBJS:.o=.po} +P2OBJS=${LIB2OBJS:.o=.po} + +${LIB1OBJS}: libgcc1.c + ${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c + @${LD} -x -r ${.TARGET} + @mv a.out ${.TARGET} + +${LIB2OBJS}: libgcc2.c + ${CC} -c ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c + @${LD} -x -r ${.TARGET} + @mv a.out ${.TARGET} + +.if !defined(NOPIC) +${LIB1SOBJS}: libgcc1.c + ${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c + +${LIB2SOBJS}: libgcc2.c + ${CC} -c -fpic ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c +.endif + +.if !defined(NOPROFILE) +${P1OBJS}: libgcc1.c + ${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc1.c + +${P2OBJS}: libgcc2.c + ${CC} -c -p ${CFLAGS} -DL${.PREFIX} -o ${.TARGET} ${.CURDIR}/libgcc2.c +.endif + +.include +} +close $f +copy_c $sdir $ddir/libgcc $l_libgcc + +# do ~/include +sh "mkdir $ddir/include" +copy_l $sdir $ddir/include [add_suffix $l_include .h] +copy_l $sdir $ddir/include $l_include_x +copy_l $sdir $ddir/include [add_suffix $l_libgcc_h .h] + +# do ~/include/i386 +sh "mkdir $ddir/include/i386" +copy_l $sdir/config/i386 $ddir/include/i386 [add_suffix $l_include_i386 .h] + +# do ~/cc_int +mk_lib $ddir cc_int [add_suffix $l_common .c] { + "NOPROFILE=\t1" + "\ninstall:\n\t@true" +} +copy_c $sdir $ddir/cc_int $l_common + +# do ~/cpp +mk_prog $ddir cpp [add_suffix $l_cpp .c] { + "BINDIR=\t/usr/libexec" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int" + "LDADD+=\t-lcc_int" +} +copy_c $sdir $ddir/cpp $l_cpp +cp $sdir/cpp.1 $ddir/cpp/cpp.1 + +# do ~/c++ +mk_prog $ddir c++ [add_suffix "$l_cplus $l_cplus_cp" .c] { + "BINDIR=\t/usr/bin" + "NOMAN=\t1" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int" + "LDADD+=\t-lcc_int" +} +copy_c $sdir $ddir/c++ $l_cplus +copy_c $sdir/cp $ddir/c++ $l_cplus_cp + +# do ~/cc +mk_prog $ddir cc [add_suffix $l_cc .c] { + "BINDIR=\t/usr/bin" + "MLINKS+=cc.1 gcc.1" + "MLINKS+=cc.1 c++.1" + "MLINKS+=cc.1 g++.1" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int" + "LDADD+=\t-lcc_int" + "\nafterinstall:\n\tcd \$(DESTDIR)\$(BINDIR) ; rm gcc ; ln -s cc gcc" +} +copy_c $sdir $ddir/cc $l_cc +cp $sdir/gcc.1 $ddir/cc/cc.1 + +# do ~/cc1 +mk_prog $ddir cc1 [add_suffix $l_cc1 .c] { + "BINDIR=\t/usr/libexec" + "NOMAN=\t1" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int" + "LDADD+=\t-lcc_int" +} +copy_c $sdir $ddir/cc1 $l_cc1 + +# do ~/cc1plus +mk_prog $ddir cc1plus [add_suffix "$l_cc1plus_cp $l_cc1plus" .c] { + "BINDIR=\t/usr/libexec" + "NOMAN=\t1" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int/obj" + "LDDESTDIR+=\t-L\${.CURDIR}/../cc_int" + "LDADD+=\t-lcc_int" +} +copy_l $sdir/cp $ddir/cc1plus $l_cc1plus_x +copy_c $sdir $ddir/cc1plus $l_cc1plus +copy_c $sdir/cp $ddir/cc1plus $l_cc1plus_cp +copy_l $sdir/cp $ddir/cc1plus [add_suffix $l_cc1plus_h .h] + +exit 0 -- cgit v1.3