🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52982

Success building gcc 2.1 on Sequent Symmetry

#52982
From: Jason Merrill
Date: Sat, 28 Mar 1992 21:17
87 lines
3155 bytes
After much pain and heartache, I have managed to bring gcc 2.1 up on our
Symmetry.  The important steps:

1) Keep gcc from outputting .stabs entries with n_type = 22.  varasm.c
wants to do this for the global constructor and destructor lists, but the
Sequent as is brain damaged and won't accept any stabs such that n_type &
0xe0 == 0.  I did this by adding these lines to config/seq386.h:

#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)				\
  {									\
    if (flag_gnu_linker)						\
      {									\
	/* Output an N_SETT (0x16, 22.) for the name.  */		\
	fprintf (FILE, "%s \"___CTOR_LIST__\",0x24,0,0,", ASM_STABS_OP);\
	assemble_name (FILE, NAME);					\
	fputc ('\n', FILE);						\
      }									\
  }

/* A C statement (sans semicolon) to output an element in the table of
   global destructors.  */

#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)       				\
  {									\
    if (flag_gnu_linker)						\
      {									\
	/* Output an N_SETT (0x16, 22.) for the name.  */		\
	fprintf (FILE, "%s \"___DTOR_LIST__\",0x24,0,0,", ASM_STABS_OP);\
	assemble_name (FILE, NAME);					\
	fputc ('\n', FILE);						\
      }									\
  }

/* Likewise for entries we want to record for garbage collection.
   Garbage collection is still under development.  */

#define ASM_OUTPUT_GC_ENTRY(FILE,NAME)       				\
  {									\
    if (flag_gnu_linker)						\
      {									\
	/* Output an N_SETT (0x16, 22.) for the name.  */		\
	fprintf (FILE, "%s \"___PTR_LIST__\",0x24,0,0,", ASM_STABS_OP);	\
	assemble_name (FILE, NAME);					\
	fputc ('\n', FILE);						\
      }									\
  }

It now occurs to me that probably using -fno-gnu-linker would have been
easier, but I wasn't aware of the flag at the time.

2) Use collect2, rather than GNU ld.  The problem here is that collect2
uses vfprintf, which isn't standard on the Symmetry.  What you can do is
this:

Turn a function that looks like

static void
fatal_perror (char *string, ...)
{
  va_list vptr;
  int e = errno;

  va_start (vptr, string);
  fprintf (stderr, "collect: ");
  vfprintf (stderr, string, vptr);
  fprintf (stderr, ": %s\n", strerror (e));
  va_end (vptr);
  my_exit (1);
}

into

static void
fatal_perror (string, a1, a2, a3, a4, a5)
	char *string;
{
  fprintf (stderr, "collect: ");
  fprintf (stderr, string, a1, a2, a3, a4, a5);
  fprintf (stderr, ": %s\n", strerror (e));
  my_exit (1);
}

This trick works, though it's extremely inelegant.  Sequent uses it in
their assembler.

Jason Merrill
jason@jarthur.claremont.edu
Technical Details
Message-ID: <1992Mar28.211717.3164@muddcs.claremont.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!news.claremont.edu!jarthur.claremont.edu!jason

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,4f98ea153c842b53,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-03-28 13:17:17 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!elroy.jpl.nasa.gov!news.claremont.edu!jarthur.claremont.edu!jason
From: jason@jarthur.claremont.edu (Jason Merrill)
Subject: Success building gcc 2.1 on Sequent Symmetry
Message-ID: <1992Mar28.211717.3164@muddcs.claremont.edu>
Sender: news@muddcs.claremont.edu (The News System)
Organization: Harvey Mudd College
Date: Sat, 28 Mar 1992 21:17:17 GMT