🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41807

Re: gcc 2.7.2 collect2 error on AIX 3.2.5

#41807
From: Robert Andrew Ryan
Date: Tue, 13 Feb 1996 00:00
184 lines
6267 bytes
Excerpts from netnews.gnu.gcc.help: 12-Feb-96 gcc 2.7.2 collect2 error
on.. Claude Lefrancois@galaha (708)

> I have the following error message when I try to
> compile emacs-19.30 under AIX 3.2.5 (powerpc) with
> gcc-2.7.2.

> collect2: /: library not found

The patch below worked for me when I got that error.  (building other code.)

-Rob Ryan

Thu Dec 21 23:28:48 1995  David Edelsohn  <edelsohn@mhpcc.edu>

	* collect2.c (scan_libraries): Correct Import File ID interpretation.

*** collect2.c-	Thu Dec 21 16:22:43 1995
--- collect2.c	Thu Dec 21 23:23:28 1995
*************** scan_libraries (prog_name)
*** 2607,2666 ****
        LDHDR ldh;
        char *impbuf;
!       int idx;
        FSEEK (ldptr, ldsh.s_scnptr, BEGINNING);
!       FREAD (&ldh, sizeof ldh, 1, ldptr);
        /* read import library list */
        impbuf = alloca (ldh.l_istlen);
        FSEEK (ldptr, ldh.l_impoff + ldsh.s_scnptr, BEGINNING);
        FREAD (impbuf, ldh.l_istlen, 1, ldptr);
!       idx = strlen (impbuf) + 1;
!       idx += strlen (impbuf+idx) + 1;
        if (debug)
  	fprintf (stderr, "LIBPATH=%s\n", impbuf);
        prefix_from_string (impbuf, &libpath);
!       while (idx < ldh.l_istlen)
  	{
! 	  char *implib = impbuf + idx;
  	  char *impmem = implib + strlen (implib) + 1;
! 	  char *soname = 0;
  	  LDFILE *libptr = NULL;
  	  struct prefix_list *pl;
  	  ARCHDR ah;
! 	  idx += strlen (implib) + 1;
! 	  if (!implib[0])
  	    continue;
! 	  idx += strlen (impmem) + 1;
! 	  if (*implib == '/')
  	    {
! 	      if (access (soname, R_OK) == 0)
! 		soname = implib;
  	    }
  	  else
! 	    {
! 	      char *temp = alloca (libpath.max_len + strlen (implib) + 1);
! 	      for (pl = libpath.plist; pl; pl = pl->next)
! 		{
! 		  strcpy (temp, pl->prefix);
! 		  strcat (temp, implib);
! 		  if (access (temp, R_OK) == 0)
! 		    {
! 		      soname = temp;
! 		      break;
! 		    }
! 		}
! 	    }
! 	  if (!soname)
! 	    {
! 	      fatal ("%s: library not found", implib);
! 	      continue;
! 	    }
  	  if (debug)
! 	    {
! 	      if (impmem[0])
! 		fprintf (stderr, "%s (%s)\n", soname, impmem);
! 	      else
! 		fprintf (stderr, "%s\n", soname);
! 	    }
! 	  ah.ar_name[0] = 0;
  	  do
  	    {
--- 2607,2672 ----
        LDHDR ldh;
        char *impbuf;
!       int entry;
! 
        FSEEK (ldptr, ldsh.s_scnptr, BEGINNING);
!       FREAD (&ldh, sizeof (ldh), 1, ldptr);
        /* read import library list */
        impbuf = alloca (ldh.l_istlen);
        FSEEK (ldptr, ldh.l_impoff + ldsh.s_scnptr, BEGINNING);
        FREAD (impbuf, ldh.l_istlen, 1, ldptr);
! 
        if (debug)
  	fprintf (stderr, "LIBPATH=%s\n", impbuf);
        prefix_from_string (impbuf, &libpath);
! 
!       /* skip LIBPATH and empty base and member fields */
!       impbuf += strlen (impbuf) + 3;
!       for (entry = 1; entry < ldh.l_nimpid; ++entry)
  	{
! 	  char *impath = impbuf;
! 	  char *implib = impath + strlen (impath) + 1;
  	  char *impmem = implib + strlen (implib) + 1;
! 	  char *soname = NULL;
! 	  char *trial;
  	  LDFILE *libptr = NULL;
  	  struct prefix_list *pl;
  	  ARCHDR ah;
! 
! 	  impbuf = impmem + strlen (impmem) + 1;
! 	  if (debug)
! 	    fprintf (stderr, "PATH+BASE=%s%s\n", impath, implib);
! 	  /* Skip AIX kernel exports */
! 	  if (*impath == '/' && *(impath+1) == '\0'
! 	      && strcmp (implib, "unix") == 0)
  	    continue;
!           trial = alloca (MAX (strlen (impath), libpath.max_len)
! 			  + strlen (implib) + 1);
! 	  if (*impath)
  	    {
! 	      strcpy (trial, impath);
! 	      strcat (trial, implib);
! 	      if (access (trial, R_OK) == 0)
! 		soname = trial;
  	    }
  	  else
! 	    for (pl = libpath.plist; pl; pl = pl->next)
! 	      {
! 		strcpy (trial, pl->prefix);
! 		strcat (trial, implib);
! 		if (access (trial, R_OK) == 0)
! 		  {
! 		    soname = trial;
! 		    break;
! 		  }
! 	      }
! 
! 	  if (! soname)
! 	    fatal ("%s: library not found", implib);
  	  if (debug)
! 	    if (*impmem)
! 	      fprintf (stderr, "%s (%s)\n", soname, impmem);
! 	    else
! 	      fprintf (stderr, "%s\n", soname);
! 
  	  do
  	    {
*************** scan_libraries (prog_name)
*** 2672,2676 ****
  		{
  		  LDFILE *memptr;
! 		  if (!impmem[0])
  		    fatal ("%s: no archive member specified", soname);
  		  ldahread (libptr, &ah);
--- 2678,2682 ----
  		{
  		  LDFILE *memptr;
! 		  if (! *impmem)
  		    fatal ("%s: no archive member specified", soname);
  		  ldahread (libptr, &ah);
*************** scan_libraries (prog_name)
*** 2689,2698 ****
  		    fatal ("%s: not an import library", soname);
  		  FSEEK (libptr, soldsh.s_scnptr, BEGINNING);
! 		  if (FREAD (&soldh, sizeof soldh, 1, libptr) != 1)
  		    fatal ("%s: can't read loader section", soname);
  		  /*fprintf (stderr, "\tscanning %s\n", soname);*/
  		  symcnt = soldh.l_nsyms;
! 		  lsyms = (LDSYM*) alloca (symcnt * sizeof *lsyms);
! 		  symcnt = FREAD (lsyms, sizeof *lsyms, symcnt, libptr);
  		  ldstrings = alloca (soldh.l_stlen);
  		  FSEEK (libptr, soldsh.s_scnptr+soldh.l_stoff, BEGINNING);
--- 2695,2704 ----
  		    fatal ("%s: not an import library", soname);
  		  FSEEK (libptr, soldsh.s_scnptr, BEGINNING);
! 		  if (FREAD (&soldh, sizeof (soldh), 1, libptr) != 1)
  		    fatal ("%s: can't read loader section", soname);
  		  /*fprintf (stderr, "\tscanning %s\n", soname);*/
  		  symcnt = soldh.l_nsyms;
! 		  lsyms = (LDSYM*) alloca (symcnt * sizeof (*lsyms));
! 		  symcnt = FREAD (lsyms, sizeof (*lsyms), symcnt, libptr);
  		  ldstrings = alloca (soldh.l_stlen);
  		  FSEEK (libptr, soldsh.s_scnptr+soldh.l_stoff, BEGINNING);
Technical Details
Message-ID: <wl8GMH200gjONLo1wt@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <LEFRANCO.96Feb12182339@galahad.cae.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,772cab74b0208a66
X-Google-Attributes: gid11318c,public
From: Robert Andrew Ryan <robr+@andrew.cmu.edu>
Subject: Re: gcc 2.7.2 collect2 error on AIX 3.2.5
Date: 1996/02/13
Message-ID: <wl8GMH200gjONLo1wt@andrew.cmu.edu>
X-Deja-AN: 139275636
distribution: world
references: <LEFRANCO.96Feb12182339@galahad.cae.ca>
organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA
newsgroups: gnu.gcc.help