mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
2.1 KiB

  1. Copied from www.linuxfromscratch.org to ROCK Linux.
  2. Submitted by: Ryan Oliver <ryan.oliver@pha.com.au>
  3. Date: 2007-02-14
  4. Initial Package Version: 4.2.0
  5. Origin: Ryan Oliver (issue reported by Erik-Jan Post)
  6. Rediffed against 4.1.0 by Chris Staub
  7. Rediffed against 4.1.2 by Jim Gifford
  8. Rediffed against 4.2.0 by Joe Ciccone
  9. Upstream Status: N/A
  10. Description:
  11. Removes standard_exec_prefix_2 from library search path when cross-compiling.
  12. Removes both standard_exec_prefix_1 and standard_exec_prefix_2 from the gcc
  13. executable search path when cross-compiling.
  14. ie: if cross_compile = 1 in the specs file, do not
  15. - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} to the library search path
  16. - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} or
  17. /usr/libexec/gcc/${TARGET}/${GCC_VER}
  18. to the executable search path
  19. This avoids the possibility of linking in libraries from the host if they
  20. exist under those directories.
  21. diff -Naur gcc-4.2.0.orig/gcc/gcc.c gcc-4.2.0/gcc/gcc.c
  22. --- gcc-4.2.0.orig/gcc/gcc.c 2007-05-16 19:21:26.000000000 -0400
  23. +++ gcc-4.2.0/gcc/gcc.c 2007-05-16 19:22:10.000000000 -0400
  24. @@ -3949,16 +3949,22 @@
  25. PREFIX_PRIORITY_LAST, 2, 0);
  26. add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
  27. PREFIX_PRIORITY_LAST, 2, 0);
  28. - add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
  29. + if (*cross_compile == '0')
  30. + {
  31. + add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
  32. PREFIX_PRIORITY_LAST, 2, 0);
  33. - add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
  34. + add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
  35. PREFIX_PRIORITY_LAST, 2, 0);
  36. + }
  37. #endif
  38. add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
  39. PREFIX_PRIORITY_LAST, 1, 0);
  40. - add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
  41. + if (*cross_compile == '0')
  42. + {
  43. + add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
  44. PREFIX_PRIORITY_LAST, 1, 0);
  45. + }
  46. tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
  47. dir_separator_str, NULL);