1 # --- SDE-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # Filename: package/.../gcc/gcc-4.1.2-cross_search_paths-1.patch
5 # Copyright (C) 2008 The OpenSDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- SDE-COPYRIGHT-NOTE-END ---
17 Submitted by: Ryan Oliver <ryan.oliver@pha.com.au>
19 Initial Package Version: 4.1.2
20 Origin: Ryan Oliver (issue reported by Erik-Jan Post)
21 Rediffed against 4.1.0 by Chris Staub
22 Rediffed against 4.1.2 by Jim Gifford
25 Removes standard_exec_prefix_2 from library search path when cross-compiling.
26 Removes both standard_exec_prefix_1 and standard_exec_prefix_2 from the gcc
27 executable search path when cross-compiling.
29 ie: if cross_compile = 1 in the specs file, do not
30 - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} to the library search path
31 - do not add /usr/lib/gcc/${TARGET}/${GCC_VER} or
32 /usr/libexec/gcc/${TARGET}/${GCC_VER}
33 to the executable search path
35 This avoids the possibility of linking in libraries from the host if they
36 exist under those directories.
38 diff -Naur gcc-4.1.2.orig/gcc/gcc.c gcc-4.1.2/gcc/gcc.c
39 --- gcc-4.1.2.orig/gcc/gcc.c 2006-11-07 06:26:21.000000000 -0800
40 +++ gcc-4.1.2/gcc/gcc.c 2007-02-14 07:48:55.000000000 -0800
41 @@ -3821,16 +3821,22 @@
42 PREFIX_PRIORITY_LAST, 2, 0);
43 add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
44 PREFIX_PRIORITY_LAST, 2, 0);
45 - add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
46 + if (*cross_compile == '0')
48 + add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
49 PREFIX_PRIORITY_LAST, 2, 0);
50 - add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
51 + add_prefix (&exec_prefixes, standard_exec_prefix_2, "BINUTILS",
52 PREFIX_PRIORITY_LAST, 2, 0);
56 add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
57 PREFIX_PRIORITY_LAST, 1, 0);
58 - add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
59 + if (*cross_compile == '0')
61 + add_prefix (&startfile_prefixes, standard_exec_prefix_2, "BINUTILS",
62 PREFIX_PRIORITY_LAST, 1, 0);
65 tooldir_prefix = concat (tooldir_base_prefix, spec_machine,
66 dir_separator_str, NULL);