Article View: gnu.gcc.bug
Article #6384Collect2 bug for AIX 3.2.3 (gcc 2.7.2)
From: Robert Andrew Ryan
Date: Sat, 09 Dec 1995 00:00
Date: Sat, 09 Dec 1995 00:00
89 lines
3238 bytes
3238 bytes
Compiling a program which somehow gets linked against /unix, I found
that the version of collect2 in gcc 2.7.2 reported:
collect2: / : library not found.
It turns out that the scan_libraries function used when XCOFF_SCAN_LIBS
is defined wasn't using the proper format. (At least for AIX 3.2.3.)
The patch below corrects scan_libraries so that it properly deals with
the 3 NUL terminated fields of each entry in the shared library
dependency list.
-Rob Ryan
Andrew Consortium
Thu Dec 07 16:47:38 1995 Rob Ryan <robr@cmu.edu>
* collect2.c: The scan_libraries function used when
XCOFFF_SCAN_LIBS is defined is corrected to deal
with the 3 NUL terminated fields used under AIX 3.2.3
at least.
*** collect2.c.orig Thu Dec 7 16:40:13 1995
--- collect2.c Thu Dec 7 16:40:21 1995
***************
*** 2615,2639 ****
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
{
--- 2615,2652 ----
FREAD (impbuf, ldh.l_istlen, 1, ldptr);
idx = strlen (impbuf) + 1;
idx += strlen (impbuf+idx) + 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 *imppath = impbuf + idx;
! char *implib = imppath + strlen(imppath) + 1;
char *impmem = implib + strlen (implib) + 1;
char *soname = 0;
LDFILE *libptr = NULL;
struct prefix_list *pl;
ARCHDR ah;
+ idx += strlen (imppath) + 1;
idx += strlen (implib) + 1;
idx += strlen (impmem) + 1;
! if (debug)
! {
! fprintf(stderr, "path '%s'\n", imppath);
! fprintf(stderr, "lib '%s'\n", implib);
! fprintf(stderr, "member '%s'\n", impmem);
! }
! if (!implib[0])
! continue;
! if (*imppath)
{
! char *loc=alloca(strlen(imppath)+strlen(implib)+1);
! strcpy(loc, imppath);
! strcat(loc, implib);
! if (access (loc, R_OK) == 0) {
! soname=loc;
! }
}
else
{
Technical Details
Message-ID:
<oklqCaW00gjO5XLFJf@andrew.cmu.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,61e2e6e325a89867,start X-Google-Attributes: gid113d02,public From: robr+@andrew.cmu.edu (Robert Andrew Ryan) Subject: Collect2 bug for AIX 3.2.3 (gcc 2.7.2) Date: 1995/12/09 Message-ID: <oklqCaW00gjO5XLFJf@andrew.cmu.edu> X-Deja-AN: 121389196 distribution: gnu sender: daemon@cis.ohio-state.edu organization: Information Technology Center, Carnegie Mellon, Pittsburgh, PA newsgroups: gnu.gcc.bug