This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc 2.91.66 for VxWorks


Here is a patch to make a gcc 2.91.66 (egcs 1.1.2) for VxWorks.

THIS PATCH WILL BREAK A GCC TREE FOR ANY BUILDS OTHER VxWorks BECAUSE IT

MODIFIES TWO Makefile.in FILES!!!

Any suggestions on how to do this (patch or building of gcc for VxWorks)

better are more than welcome.

It boiled down to some simple changes. First were the swapping of using
'$' for '.' in label names which is repaired in
gcc/config/rs6000/vxppc.h. Also had to undefine the
ASM_OUTPUT_CONSTRUCTOR because VxWorks is a little dense when it comes
to handling the new fangled additions of C++.

vasprintf.o requires a new rule to make it. The va_args give it fits,
but if the $WIND_ROOT/target/h is forced as in include then vasprintf
will compile. However, it keeps parts of libiberty and libio for
building successfully. It may be a problem with the header fixing which
is way out of my league.

Lastly, the Makefile.in for libiberty and libio where modified to not
compile and include the portions of the IO system that do not work
because of vasprintf. Neither libiberty nor libio are required for
VxWorks because it ships with its own IO system. Hence, the hack does
work without crippling IO.

Code compiled with a compiler built using this patch that uses IO
streams, printf, ACE/TAO, corba calls (servants), interrupts, tasks and
other various VxWorks system calls seems to run fine.


Al Niessner



------- Patch:


diff -rc egcs-1.1.2/gcc/config/rs6000/vxppc.h
egcs-1.1.2-vxworks1/gcc/config/rs6000/vxppc.h
*** egcs-1.1.2/gcc/config/rs6000/vxppc.h        Fri Apr 17 07:32:23 1998

--- egcs-1.1.2-vxworks1/gcc/config/rs6000/vxppc.h       Tue Mar  7
09:06:49 2000
***************
*** 32,40 ****
  %{posix: -D_POSIX_SOURCE} \
  %{mrelocatable*: -D_RELOCATABLE} \
  %{!mcpu*: \
!   %{mpowerpc*: -D_ARCH_PPC -DCPU=PPC603} \
    %{!mno-powerpc: -D_ARCH_PPC -DCPU=PPC603}} \
! %{mcpu=powerpc: -D_ARCH_PPC -DCPU=PPC603} \
  %{mcpu=403: -D_ARCH_PPC -DCPU=PPC403} \
  %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR -DCPU=PPC601} \
  %{mcpu=603: -D_ARCH_PPC -DCPU=PPC603} \
--- 32,40 ----
  %{posix: -D_POSIX_SOURCE} \
  %{mrelocatable*: -D_RELOCATABLE} \
  %{!mcpu*: \
!   %{mpowerpc*: -D_ARCH_PPC -DCPU=PPC604} \
    %{!mno-powerpc: -D_ARCH_PPC -DCPU=PPC603}} \
! %{mcpu=powerpc: -D_ARCH_PPC -DCPU=PPC604} \
  %{mcpu=403: -D_ARCH_PPC -DCPU=PPC403} \
  %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR -DCPU=PPC601} \
  %{mcpu=603: -D_ARCH_PPC -DCPU=PPC603} \
***************
*** 67,69 ****
--- 67,82 ----
  /* We use stabs-in-elf for debugging */
  #undef PREFERRED_DEBUGGING_TYPE
  #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
+
+ /* For VxWorks we are not using the AIX assembler and VxWorks loves to
have
+    '$' in its function names.  It really does not like the '.'.
+ */
+ #undef NO_DOLLAR_IN_LABEL
+ #undef NO_DOT_IN_LABEL
+ #define NO_DOT_IN_LABEL
+
+ #undef DOLLARS_IN_IDENTIFIERS
+ #define DOLLARS_IN_IDENTIFIERS 1
+
+ /* VxWorks does not like the ctor sections -- yet. */
+ #undef ASM_OUTPUT_CONSTRUCTOR
diff -rc egcs-1.1.2/libiberty/Makefile.in
egcs-1.1.2-vxworks1/libiberty/Makefile.in
*** egcs-1.1.2/libiberty/Makefile.in    Sat May 23 15:32:53 1998
--- egcs-1.1.2-vxworks1/libiberty/Makefile.in   Fri Feb 25 14:35:21 2000

***************
*** 96,101 ****
--- 96,108 ----

  INCDIR=$(srcdir)/$(MULTISRCTOP)../include

+ COMPILE.vxc = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR)
-I/sol/opt/cots/wind/2.0/target/h $(HDEFINES)
+
+ vasprintf.o:
+       test x"$(enable_shared)" != xyes || \
+         $(COMPILE.vxc) $(PICFLAG)
/home/niessner/Scratch/Unpack/egcs-1.1.2-vxworks1/libiberty/vasprintf.c
-o pic/$@
+       $(COMPILE.vxc)
/home/niessner/Scratch/Unpack/egcs-1.1.2-vxworks1/libiberty/vasprintf.c
+
  COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES)
  .c.o:
        test x"$(enable_shared)" != xyes || \
diff -rc egcs-1.1.2/libio/Makefile.in
egcs-1.1.2-vxworks1/libio/Makefile.in
*** egcs-1.1.2/libio/Makefile.in        Fri Jun 26 22:24:20 1998
--- egcs-1.1.2-vxworks1/libio/Makefile.in       Fri Feb 25 15:59:51 2000

***************
*** 24,34 ****
  INSTALLDIR = $(libdir)

  IO_OBJECTS = filedoalloc.o floatconv.o genops.o fileops.o \
!   iovfprintf.o \
!   iovfscanf.o ioignore.o iopadn.o \
!   iofgetpos.o iofread.o iofscanf.o \
    iofsetpos.o iogetdelim.o iogetline.o \
!   ioprintf.o ioseekoff.o ioseekpos.o \
    outfloat.o strops.o iofclose.o iopopen.o ioungetc.o peekc.o iogetc.o
\
    ioputc.o iofeof.o ioferror.o

--- 24,33 ----
  INSTALLDIR = $(libdir)

  IO_OBJECTS = filedoalloc.o floatconv.o genops.o fileops.o \
!   ioignore.o iopadn.o \
!   iofgetpos.o iofread.o \
    iofsetpos.o iogetdelim.o iogetline.o \
!   ioseekoff.o ioseekpos.o \
    outfloat.o strops.o iofclose.o iopopen.o ioungetc.o peekc.o iogetc.o
\
    ioputc.o iofeof.o ioferror.o

***************
*** 41,55 ****
  # They are needed for iostdio.h.  They are needed under Linux to avoid

  # version incompatibility problems with the C library.
  # iofclose.o is not here, because it is needed for stdio (by pclose).
! STDIO_WRAP_OBJECTS =  iofdopen.o iofflush.o iofgets.o iofopen.o
iofprintf.o iofputs.o iofwrite.o \
!   iogets.o ioperror.o ioputs.o ioscanf.o iosetbuffer.o iosetvbuf.o \
!   iosprintf.o iosscanf.o ioftell.o iovsscanf.o iovsprintf.o

  IOSTREAM_OBJECTS = builtinbuf.o filebuf.o fstream.o \
!   indstream.o ioassign.o ioextend.o iomanip.o iostream.o \
!   isgetline.o isgetsb.o isscan.o \
!   osform.o procbuf.o sbform.o sbgetline.o sbscan.o \
!   stdiostream.o stdstrbufs.o stdstreams.o stream.o streambuf.o
strstream.o \
    PlotFile.o SFile.o parsestream.o pfstream.o editbuf.o

  # These files define _IO_read etc, which are just wrappers for read(2)
etc.
--- 40,54 ----
  # They are needed for iostdio.h.  They are needed under Linux to avoid

  # version incompatibility problems with the C library.
  # iofclose.o is not here, because it is needed for stdio (by pclose).
! STDIO_WRAP_OBJECTS =  iofdopen.o iofflush.o iofgets.o iofopen.o
iofputs.o iofwrite.o \
!   iogets.o ioperror.o ioputs.o iosetbuffer.o iosetvbuf.o \
!   ioftell.o iovsscanf.o iovsprintf.o

  IOSTREAM_OBJECTS = builtinbuf.o filebuf.o fstream.o \
!   indstream.o ioassign.o ioextend.o iomanip.o \
!   isgetline.o isgetsb.o \
!   procbuf.o sbgetline.o  \
!   stdiostream.o stdstrbufs.o stdstreams.o streambuf.o strstream.o \
    PlotFile.o SFile.o parsestream.o pfstream.o editbuf.o

  # These files define _IO_read etc, which are just wrappers for read(2)
etc.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]