* Re: [5/8] Make collect2 honour --sysroot
@ 2009-06-02 13:06 David Edelsohn
0 siblings, 0 replies; 3+ messages in thread
From: David Edelsohn @ 2009-06-02 13:06 UTC (permalink / raw)
To: Richard Sandiford; +Cc: gcc-patches
gcc/
* collect2.c (target_system_root): New variable.
(main): Handle --sysroot=.
(ignore_library): Strip the sysroot from the library path.
Okay.
Thanks, David
^ permalink raw reply [flat|nested] 3+ messages in thread
* [0/8] AIX cross toolchains
@ 2009-06-02 12:03 Richard Sandiford
2009-06-02 12:21 ` [5/8] Make collect2 honour --sysroot Richard Sandiford
0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2009-06-02 12:03 UTC (permalink / raw)
To: gcc-patches
This series of patches adds support for AIX-targetted cross toolchains.
As with other cross toolchains for "hosted" systems, the assumption is
that you have an AIX sysroot available and are using --with-sysroot to
point to it. (This assumption also implicitly requires GNU ld, with its
support for --sysroot.)
Until recently, binutils could not build working AIX shared libraries,
so the patches only work with a CVS copy of binutils. And because of
the binutils problems, current libtool doesn't let you try to use
binutils to build AIX shared libraries; it will always switch to
static libraries instead. The following patches remove this
restriction:
http://lists.gnu.org/archive/html/libtool-patches/2009-03/msg00007.html
http://lists.gnu.org/archive/html/libtool-patches/2009-04/msg00013.html
The patches haven't been accepted, so you'll need to apply them locally
and then regenerate each configure script.
All patches were tested by:
- A native bootstrap on powerpc-ibm-aix6.1 using binutils, with a hack
to disable the stuff in config/mh-ppc-aix. Test flags: {,-pthread}.
(I couldn't test for -maix64 for reasons explained in patch 8.)
- A native boostrap on x86_64-linux-gnu. Test flags: {,-m32}.
- A cross build and cross test from x86_64-linux-gnu to
powerpc-ibm-aix6.1. Test flags: {,-pthread}{,-maix64}.
The patches are covered by the IBM copyright assignment.
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [5/8] Make collect2 honour --sysroot
2009-06-02 12:03 [0/8] AIX cross toolchains Richard Sandiford
@ 2009-06-02 12:21 ` Richard Sandiford
2009-06-02 14:30 ` Ian Lance Taylor
0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2009-06-02 12:21 UTC (permalink / raw)
To: gcc-patches
This patch adds --sysroot support to collect2. Specifically, it makes
sure that ignore_library strips the sysroot directory from the start
of a library path before comparing it against aix_std_libs.
I haven't tried to cope with cases where there are two "/"s after
the sysroot path, or where the sysroot path ends in more "/"s than
the paths themselves. These situations would not occur in the
automatically-generated paths we care about, and I think allowing
slash variations is conceptually a separate change. (Slash variations
would also allow native toolchains to treat "///unix" as "/unix",
for example.)
Tested on powerpc-ibm-aix6.1 and x86_64-linux-gnu. OK to install?
Richard
gcc/
* collect2.c (target_system_root): New variable.
(main): Handle --sysroot=.
(ignore_library): Strip the sysroot from the library path.
Index: gcc/collect2.c
===================================================================
--- gcc/collect2.c 2009-06-02 13:06:05.000000000 +0100
+++ gcc/collect2.c 2009-06-02 13:06:07.000000000 +0100
@@ -217,6 +217,14 @@ static const char *ldd_file_name; /* pat
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. */
@@ -1220,6 +1228,8 @@ main (int argc, char **argv)
ld1--;
ld2--;
}
+ else if (strncmp (arg, "--sysroot=", 10) == 0)
+ target_system_root = arg + 10;
break;
}
}
@@ -2449,6 +2459,15 @@ static int ignore_library (const char *)
ignore_library (const char *name)
{
const char *const *p = &aix_std_libs[0];
+ 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;
+ }
while (*p)
if (! strcmp (name, *p++))
return 1;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-06-02 14:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 13:06 [5/8] Make collect2 honour --sysroot David Edelsohn
-- strict thread matches above, loose matches on Subject: below --
2009-06-02 12:03 [0/8] AIX cross toolchains Richard Sandiford
2009-06-02 12:21 ` [5/8] Make collect2 honour --sysroot Richard Sandiford
2009-06-02 14:30 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).