<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -14,6 +14,20 @@ class Gcc (cross.AutoBuild):
         return ['cross/binutils']
     def patch (self):
         cross.AutoBuild.patch (self)
+        # GUB cross compilers must NOT look in /usr.
+        # Fixes librestrict=stat:open and resulting ugliness.
+        for i in ['%(srcdir)s/configure', '%(srcdir)s/gcc/configure']:
+            self.file_sub ([('( *gcc_cv_tool_dirs=.*PATH_SEPARATOR/usr)', r'#\1'), # gcc-4.1.1 gcc/configure
+                            ('( *gcc_cv_tool_dirs=.*gcc_cv_tool_dirs/usr)', r'#\1')], # gcc-4.3.2 ./configure
+                           i)
+        # This seems to have been fixed in gcc-4.3.2, but only if
+        # *not* cross-compiling---a hardcoded lookup in /usr, without
+        # asking configure, still makes no sense to me.  Redirecting
+        # lookups survives gcc-4.1.1--4.3.2, which is more robust than
+        # patching them out.
+        self.file_sub ([('( standard_exec_prefix_.*= &quot;)/usr', r'\1%(system_prefix)s')],
+                       '%(srcdir)s/gcc/gcc.c')
+
         if False and self.settings.build_architecture == self.settings.target_architecture:
             # This makes the target build *not* use /lib* at all, but
             # it produces executables that will only run within the</diff>
      <filename>gub/specs/cross/gcc.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>674684f451aea62275c5afc11a21c60e5dd7cbab</id>
    </parent>
  </parents>
  <author>
    <name>Jan Nieuwenhuizen</name>
    <email>janneke@gnu.org</email>
  </author>
  <url>http://github.com/janneke/gub/commit/df4d4f7f3dbcac707dd195490576bfa18197e348</url>
  <id>df4d4f7f3dbcac707dd195490576bfa18197e348</id>
  <committed-date>2009-02-18T05:40:51-08:00</committed-date>
  <authored-date>2009-02-18T05:40:51-08:00</authored-date>
  <message>gcc: do not look in /usr.

Allows removal of /usr/lib/gcc, /usr/libexec/gcc from
LIBRESTRICT_ALLOW in strict mode.</message>
  <tree>452bf972d623c68119e25ec47ba3c8f2852cf760</tree>
  <committer>
    <name>Jan Nieuwenhuizen</name>
    <email>janneke@gnu.org</email>
  </committer>
</commit>
