Further cleanup of GCC's builtin directory list in an attempt to
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Fri, 6 Jan 2006 16:38:55 +0000 (16:38 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Fri, 6 Jan 2006 16:38:55 +0000 (16:38 +0000)
make GCC more cross-build friendly.

gnu/usr.bin/cc34/cc_prep/patches/gcc.c.patch

index 6b34db0..2284d6f 100644 (file)
@@ -1,12 +1,7 @@
-$DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/gcc.c.patch,v 1.4 2005/08/03 03:12:00 joerg Exp $
+$DragonFly: src/gnu/usr.bin/cc34/cc_prep/patches/gcc.c.patch,v 1.5 2006/01/06 16:38:55 joerg Exp $
 
-Index: gcc.c
-===================================================================
-RCS file: /home/joerg/wd/repository/dragonflybsd/src/contrib/gcc-3.4/gcc/gcc.c,v
-retrieving revision 1.3
-diff -u -r1.3 gcc.c
---- gcc.c      24 May 2005 06:29:31 -0000      1.3
-+++ gcc.c      2 Aug 2005 22:25:59 -0000
+--- gcc.c.orig 2005-05-24 06:29:31.000000000 +0000
++++ gcc.c      2005-10-19 07:30:43.000000000 +0000
 @@ -712,6 +712,7 @@
  static const char *asm_spec = ASM_SPEC;
  static const char *asm_final_spec = ASM_FINAL_SPEC;
@@ -15,9 +10,34 @@ diff -u -r1.3 gcc.c
  static const char *lib_spec = LIB_SPEC;
  static const char *libgcc_spec = LIBGCC_SPEC;
  static const char *endfile_spec = ENDFILE_SPEC;
-@@ -1409,8 +1410,7 @@
- static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
- static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
+@@ -1384,33 +1385,12 @@
+ /* Default prefixes to attach to command names.  */
+-#ifdef CROSS_COMPILE  /* Don't use these prefixes for a cross compiler.  */
+-#undef MD_EXEC_PREFIX
+-#undef MD_STARTFILE_PREFIX
+-#undef MD_STARTFILE_PREFIX_1
+-#endif
+-
+-/* If no prefixes defined, use the null string, which will disable them.  */
+-#ifndef MD_EXEC_PREFIX
+-#define MD_EXEC_PREFIX ""
+-#endif
+-#ifndef MD_STARTFILE_PREFIX
+-#define MD_STARTFILE_PREFIX ""
+-#endif
+-#ifndef MD_STARTFILE_PREFIX_1
+-#define MD_STARTFILE_PREFIX_1 ""
+-#endif
+-
+ static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+ static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
+ static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
+-static const char *md_exec_prefix = MD_EXEC_PREFIX;
+-static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+-static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
  static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
 -static const char *const standard_startfile_prefix_1 = "/lib/";
 -static const char *const standard_startfile_prefix_2 = "/usr/lib/";
@@ -25,7 +45,7 @@ diff -u -r1.3 gcc.c
  
  static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
  static const char *tooldir_prefix;
-@@ -1470,6 +1470,7 @@
+@@ -1470,6 +1450,7 @@
    INIT_STATIC_SPEC ("link_gcc_c_sequence",    &link_gcc_c_sequence_spec),
    INIT_STATIC_SPEC ("endfile",                        &endfile_spec),
    INIT_STATIC_SPEC ("link",                   &link_spec),
@@ -33,7 +53,17 @@ diff -u -r1.3 gcc.c
    INIT_STATIC_SPEC ("lib",                    &lib_spec),
    INIT_STATIC_SPEC ("libgcc",                 &libgcc_spec),
    INIT_STATIC_SPEC ("startfile",              &startfile_spec),
-@@ -3219,8 +3220,6 @@
+@@ -1484,9 +1465,6 @@
+   INIT_STATIC_SPEC ("multilib_options",               &multilib_options),
+   INIT_STATIC_SPEC ("linker",                 &linker_name_spec),
+   INIT_STATIC_SPEC ("link_libgcc",            &link_libgcc_spec),
+-  INIT_STATIC_SPEC ("md_exec_prefix",         &md_exec_prefix),
+-  INIT_STATIC_SPEC ("md_startfile_prefix",    &md_startfile_prefix),
+-  INIT_STATIC_SPEC ("md_startfile_prefix_1",  &md_startfile_prefix_1),
+   INIT_STATIC_SPEC ("startfile_prefix_spec",  &startfile_prefix_spec),
+   INIT_STATIC_SPEC ("sysroot_suffix_spec",    &sysroot_suffix_spec),
+   INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec",       &sysroot_hdrs_suffix_spec),
+@@ -3219,8 +3197,6 @@
        set_std_prefix (gcc_exec_prefix, len);
        add_prefix (&exec_prefixes, gcc_libexec_prefix, "GCC",
                  PREFIX_PRIORITY_LAST, 0, NULL, 0);
@@ -42,7 +72,7 @@ diff -u -r1.3 gcc.c
      }
  
    /* COMPILER_PATH and LIBRARY_PATH have values
-@@ -3768,11 +3767,6 @@
+@@ -3768,11 +3744,6 @@
              PREFIX_PRIORITY_LAST, 2, warn_std_ptr, 0);
  #endif
  
@@ -54,7 +84,7 @@ diff -u -r1.3 gcc.c
    tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
                           dir_separator_str, NULL);
  
-@@ -3795,10 +3789,6 @@
+@@ -3795,10 +3766,6 @@
                      concat (gcc_exec_tooldir_prefix, "bin",
                              dir_separator_str, NULL),
                      NULL, PREFIX_PRIORITY_LAST, 0, NULL, 0);
@@ -65,7 +95,7 @@ diff -u -r1.3 gcc.c
        }
  
        tooldir_prefix = concat (standard_exec_prefix, spec_machine,
-@@ -3806,13 +3796,6 @@
+@@ -3806,13 +3773,6 @@
                               dir_separator_str, tooldir_prefix, NULL);
      }
  
@@ -79,7 +109,7 @@ diff -u -r1.3 gcc.c
  #if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS)
    /* If the normal TARGET_SYSTEM_ROOT is inside of $exec_prefix,
       then consider it to relocate with the rest of the GCC installation
-@@ -6037,11 +6020,6 @@
+@@ -6037,11 +5997,6 @@
    n_compilers = n_default_compilers;
  
    /* Read specs from a file if there is one.  */
@@ -91,7 +121,7 @@ diff -u -r1.3 gcc.c
    specs_file = find_a_file (&startfile_prefixes, "specs", R_OK, 0);
    /* Read the specs file unless it is a default one.  */
    if (specs_file != 0 && strcmp (specs_file, "specs"))
-@@ -6051,11 +6029,9 @@
+@@ -6051,11 +6006,9 @@
  
    /* We need to check standard_exec_prefix/just_machine_suffix/specs
       for any override of as, ld and libraries.  */
@@ -104,10 +134,43 @@ diff -u -r1.3 gcc.c
    strcat (specs_file, "specs");
    if (access (specs_file, R_OK) == 0)
      read_specs (specs_file, TRUE);
-@@ -6129,35 +6105,10 @@
-       add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
-                             "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+@@ -6072,17 +6025,6 @@
+   for (i = 0; i < ARRAY_SIZE (driver_self_specs); i++)
+     do_self_spec (driver_self_specs[i]);
  
+-  /* If not cross-compiling, look for executables in the standard
+-     places.  */
+-  if (*cross_compile == '0')
+-    {
+-      if (*md_exec_prefix)
+-      {
+-        add_prefix (&exec_prefixes, md_exec_prefix, "GCC",
+-                    PREFIX_PRIORITY_LAST, 0, NULL, 0);
+-      }
+-    }
+-
+   /* Process sysroot_suffix_spec.  */
+   if (*sysroot_suffix_spec != 0
+       && do_spec_2 (sysroot_suffix_spec) == 0)
+@@ -6115,49 +6057,12 @@
+     }
+   /* We should eventually get rid of all these and stick to
+      startfile_prefix_spec exclusively.  */
+-  else if (*cross_compile == '0' || target_system_root)
++  else
+     {
+-      if (*md_exec_prefix)
+-      add_sysrooted_prefix (&startfile_prefixes, md_exec_prefix, "GCC",
+-                            PREFIX_PRIORITY_LAST, 0, NULL, 1);
+-
+-      if (*md_startfile_prefix)
+-      add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix,
+-                            "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+-
+-      if (*md_startfile_prefix_1)
+-      add_sysrooted_prefix (&startfile_prefixes, md_startfile_prefix_1,
+-                            "GCC", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+-
 -      /* If standard_startfile_prefix is relative, base it on
 -       standard_exec_prefix.  This lets us move the installed tree
 -       as a unit.  If GCC_EXEC_PREFIX is defined, base
@@ -144,7 +207,7 @@ diff -u -r1.3 gcc.c
  #if 0 /* Can cause surprises, and one can use -B./ instead.  */
        add_prefix (&startfile_prefixes, "./", NULL,
                  PREFIX_PRIORITY_LAST, 1, NULL, 0);
-@@ -6197,7 +6148,7 @@
+@@ -6197,7 +6102,7 @@
  
    if (print_search_dirs)
      {