gcc-2.95 on BSD/OS 4.0.1

Steven M. Schultz sms@moe.2bsd.com
Thu Aug 5 22:59:00 GMT 1999


Two files needed to be changed in order to successfully build and run
GCC-2.95 under BSD/OS 4.0.1
on an i386 platform.

The most important file is ./gcc/config/i386/bsd386.h because the
version presently in GCC is for
an old/obsolete version of BSD/OS and is not properly set up for ELF

The other file changed is ./gcc/Makefile.in.  The USE_COLLECT2 define is
(I believe) erroneously
overriden with a superfluous definition.  GCC-2.95 builds and installs
perfectly fine with out
USE_COLLECT2 defined.
*** ./ChangeLog.dist	Wed Jul 28 21:39:36 1999
--- ./ChangeLog	Thu Aug  5 22:40:44 1999
***************
*** 1,3 ****
--- 1,14 ----
+ Thu Aug  5 21:57:03 PDT 1999 Steven Schultz (sms@moe.2bsd.com)
+ 
+ 	* ./gcc/config/i386/bsd386.h: updated for BSD/OS 4.x (the old bsd386.h
+ 	  was for old versions of the OS)
+ 	* ./gcc/Makefile.in.dist: turn off INSTALL_ASSERT_H and USE_COLLECT2
+ 	  because they cause errors with BSD/OS 4.x (this probably should be
+ 	  OS conditional but I didn't know how to do that). The USE_COLLECT2 was
+ 	  superfluous and erroneous because it overrode (unconditionally)
+ 	  the earlier (5 lines before) definition created by 'configure'!  
+ 	  BSD/OS doesn't use/need 'collect2'.
+ 
  Wed Jul 28 21:39:31 PDT 1999 Jeff Law  (law@cygnus.com)
  
  	* gcc-2.95 Released.
*** ./gcc/Makefile.in.dist	Sat Jul 17 18:23:41 1999
--- ./gcc/Makefile.in	Thu Aug  5 22:37:35 1999
***************
*** 162,168 ****
  
  # Target to use whe installing assert.h.  Some systems may
  # want to set this empty.
! INSTALL_ASSERT_H = install-assert-h
  
  # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
  # Usually the one we just built.
--- 162,169 ----
  
  # Target to use whe installing assert.h.  Some systems may
  # want to set this empty.
! # INSTALL_ASSERT_H = install-assert-h
! INSTALL_ASSERT_H =
  
  # The GCC to use for compiling libgcc2.a, enquire, and libgcc1-test.
  # Usually the one we just built.
***************
*** 398,406 ****
  # -DUSE_COLLECT2.  toplev.c, collect2.c and libgcc2.c all need to
  # if we may be using collect2.
  MAYBE_USE_COLLECT2 = @maybe_use_collect2@
- # It is convenient for configure to add the assignment at the beginning,
- # so don't override it here.
- USE_COLLECT2 = collect2$(exeext)
  
  # List of extra C and assembler files to add to libgcc1.a.
  # Assembler files should have names ending in `.asm'.
--- 399,404 ----
*** ./gcc/config/i386/bsd386.h.dist	Wed Dec 16 13:03:09 1998
--- ./gcc/config/i386/bsd386.h	Sat Mar 27 22:20:40 1999
***************
*** 1,33 ****
! /* Configuration for an i386 running BSDI's BSD/OS (formerly known as BSD/386)
!    as the target machine.  */
  
! #include "i386/386bsd.h"
  
! /* We exist mostly to add -Dbsdi and such to the predefines. */
  
  #undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dunix -Di386 -Dbsdi -D__i386__ -D__bsdi__ -D____386BSD____ -D__386BSD__ -DBSD_NET2 -Asystem(unix) -Asystem(bsd) -Acpu(i386) -Amachine(i386)"
  
  #undef WCHAR_TYPE
  #define WCHAR_TYPE "int"
  
- #undef WCHAR_UNSIGNED
  #define WCHAR_UNSIGNED 0
  
! #undef WCHAR_TYPE_SIZE
! #define WCHAR_TYPE_SIZE 32
  
! /* This is suitable for BSD/OS 3.0; we don't know about earlier releases.  */
! #undef ASM_COMMENT_START
! #define ASM_COMMENT_START " #"
  
! /* Until they use ELF or something that handles dwarf2 unwinds
!    and initialization stuff better.  */
! #define DWARF2_UNWIND_INFO 0
! 
! /* BSD/OS still uses old binutils that don't insert nops by default
!    when the .align directive demands to insert extra space in the text
!    segment.  */
! #undef ASM_OUTPUT_ALIGN
! #define ASM_OUTPUT_ALIGN(FILE,LOG) \
!   if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG))
--- 1,66 ----
! /*	BSDI bsdi.h,v 2.5 1998/02/25 21:04:44 donn Exp	*/
  
! /* Configuration for an i386 running BSDI 3.1 as the target machine.  */
  
! /* Don't assume anything about the header files. */
! /* (not actually used on bsdi, but should generally be on anyway) */
! #define	NO_IMPLICIT_EXTERN_C
  
+ /* Emulator does not handle sqrt, sin, cos; default to library */
+ #define	TARGET_CPU_DEFAULT	MASK_NO_FANCY_MATH_387
+ 
+ #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+ 
+ /* Oddly enough, Linux's header seems closer to SVr4 than the SVr4 header.  */
+ #include "i386/linux.h"
+ 
+ /* Sure would like to give up 'i386' and 'bsdi' without underscores,
+    but it seems hopeless.  */
  #undef CPP_PREDEFINES
! #define CPP_PREDEFINES "-Dunix -D__i386__ -Di386 -D__bsdi__ -Dbsdi -D__ELF__ -Asystem(unix) -Asystem(bsd) -Acpu(i386) -Amachine(i386)"
! 
! /* Like the default, except no -lg.  */
! #undef LIB_SPEC
! #define LIB_SPEC "%{!shared: %{pg:-lc_p}%{!pg:%{p:-lc_p}%{!p:-lc}}}"
! 
! #undef LINK_SPEC
! #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
!   %{!shared: \
!     %{!static: \
!       %{rdynamic:-export-dynamic} \
!       %{!dynamic-linker:-dynamic-linker /shlib/ld-bsdi.so}} \
!       %{static:-static}}"
  
  #undef WCHAR_TYPE
  #define WCHAR_TYPE "int"
  
  #define WCHAR_UNSIGNED 0
  
! #undef TARGET_VERSION
! #define	TARGET_VERSION	fprintf(stderr, " (i386 ELF BSD/OS)");
  
! #undef DEFAULT_PCC_STRUCT_RETURN
! #define	DEFAULT_PCC_STRUCT_RETURN	1
  
! /* Restore SVr4-style profile routine name.  */
! #undef FUNCTION_PROFILER
! #define FUNCTION_PROFILER(FILE, LABELNO)  \
! {									\
!   if (flag_pic)								\
!     {									\
!       fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n",		\
! 	       LPREFIX, (LABELNO));					\
!       fprintf (FILE, "\tcall *_mcount@GOT(%%ebx)\n");			\
!     }									\
!   else									\
!     {									\
!       fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO));	\
!       fprintf (FILE, "\tcall _mcount\n");				\
!     }									\
! }
! 
! /* We don't provide "/" as an assembly comment character,
!    because it makes it painful to write assembly code with
!    division operators.  */
! #undef ASM_COMMENT_START
! #define	ASM_COMMENT_START	"#"


More information about the Gcc-patches mailing list