collect2.c (target_system_root): New variable.
gcc/ * collect2.c (target_system_root): New variable. (main): Handle --sysroot=. (ignore_library): Strip the sysroot from the library path. From-SVN: r148097
This commit is contained in:
parent
dfb636dcd0
commit
781a1758a4
2 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* collect2.c (target_system_root): New variable.
|
||||
(main): Handle --sysroot=.
|
||||
(ignore_library): Strip the sysroot from the library path.
|
||||
|
||||
2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com>
|
||||
|
||||
* Makefile.in (COLLECT2_OBJS): Add collect2-aix.o.
|
||||
|
|
|
@ -217,6 +217,14 @@ static char *response_file; /* Name of any current response file */
|
|||
struct obstack temporary_obstack;
|
||||
char * temporary_firstobj;
|
||||
|
||||
/* A string that must be prepended to a target OS path in order to find
|
||||
it on the host system. */
|
||||
#ifdef TARGET_SYSTEM_ROOT
|
||||
static const char *target_system_root = TARGET_SYSTEM_ROOT;
|
||||
#else
|
||||
static const char *target_system_root = "";
|
||||
#endif
|
||||
|
||||
/* Structure to hold all the directories in which to search for files to
|
||||
execute. */
|
||||
|
||||
|
@ -1224,6 +1232,8 @@ main (int argc, char **argv)
|
|||
ld1--;
|
||||
ld2--;
|
||||
}
|
||||
else if (strncmp (arg, "--sysroot=", 10) == 0)
|
||||
target_system_root = arg + 10;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2454,7 +2464,15 @@ static int
|
|||
ignore_library (const char *name)
|
||||
{
|
||||
const char *const *p;
|
||||
size_t length;
|
||||
|
||||
if (target_system_root[0] != '\0')
|
||||
{
|
||||
length = strlen (target_system_root);
|
||||
if (strncmp (name, target_system_root, length) != 0)
|
||||
return 0;
|
||||
name += length;
|
||||
}
|
||||
for (p = &aix_std_libs[0]; *p != NULL; ++p)
|
||||
if (strcmp (name, *p) == 0)
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Reference in a new issue