From: Aaron W. LaFramboise Date: Thu, 1 Jul 2004 23:55:22 +0000 (+0000) Subject: gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=656c7a3a1a533d467f9564259cb0d76ed62f029b;p=gcc.git gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. 2004-07-02 Aaron W. LaFramboise * gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. (STANDARD_STARTFILE_PREFIX_2): Define. (standard_startfile_prefix_1): Initialize to STANDARD_STARTFILE_PREFIX_1. (standard_startfile_prefix_2): Initialize to STANDARD_STARTFILE_PREFIX_2. * config/i386/mingw32.h (MD_STARTFILE_PREFIX): Remove. (STANDARD_STARTFILE_PREFIX_1): Define. (STANDARD_STARTFILE_PREFIX_2): Define. * doc/tm.texi (STANDARD_STARTFILE_PREFIX_1): Document. (STANDARD_STARTFILE_PREFIX_2): Document. From-SVN: r84002 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2512885a47..1628676a557 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +2004-07-02 Aaron W. LaFramboise + + * gcc.c (STANDARD_STARTFILE_PREFIX_1): Define. + (STANDARD_STARTFILE_PREFIX_2): Define. + (standard_startfile_prefix_1): Initialize to + STANDARD_STARTFILE_PREFIX_1. + (standard_startfile_prefix_2): Initialize to + STANDARD_STARTFILE_PREFIX_2. + * config/i386/mingw32.h (MD_STARTFILE_PREFIX): Remove. + (STANDARD_STARTFILE_PREFIX_1): Define. + (STANDARD_STARTFILE_PREFIX_2): Define. + * doc/tm.texi (STANDARD_STARTFILE_PREFIX_1): Document. + (STANDARD_STARTFILE_PREFIX_2): Document. + 2004-07-01 Richard Henderson * tree-sra.c (sra_walk_expr): Don't maybe_lookup_element_for_expr diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h index 4bf0dda1d98..bdd8da2b3dd 100644 --- a/gcc/config/i386/mingw32.h +++ b/gcc/config/i386/mingw32.h @@ -69,9 +69,13 @@ Boston, MA 02111-1307, USA. */ #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}" -/* An additional prefix to try after the standard prefixes. */ -#undef MD_STARTFILE_PREFIX -#define MD_STARTFILE_PREFIX "/mingw/lib/" +/* Override startfile prefix defaults. */ +#ifndef STANDARD_STARTFILE_PREFIX_1 +#define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/" +#endif +#ifndef STANDARD_STARTFILE_PREFIX_2 +#define STANDARD_STARTFILE_PREFIX_2 "" +#endif /* Output STRING, a string representing a filename, to FILE. We canonicalize it to be in Unix format (backslashes are replaced diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index b196ac4d854..1b5de1b71cb 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -469,6 +469,22 @@ try when searching for startup files such as @file{crt0.o}. is built as a cross compiler. @end defmac +@defmac STANDARD_STARTFILE_PREFIX_1 +Define this macro as a C string constant if you wish to override the +standard choice of @code{/lib} as a prefix to try after the default prefix +when searching for startup files such as @file{crt0.o}. +@code{STANDARD_STARTFILE_PREFIX_1} is not searched when the compiler +is built as a cross compiler. +@end defmac + +@defmac STANDARD_STARTFILE_PREFIX_2 +Define this macro as a C string constant if you wish to override the +standard choice of @code{/lib} as yet another prefix to try after the +default prefix when searching for startup files such as @file{crt0.o}. +@code{STANDARD_STARTFILE_PREFIX_2} is not searched when the compiler +is built as a cross compiler. +@end defmac + @defmac MD_STARTFILE_PREFIX If defined, this macro supplies an additional prefix to try after the standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the diff --git a/gcc/gcc.c b/gcc/gcc.c index 677d9e74c37..74d043fea74 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -1429,6 +1429,13 @@ static const char *gcc_libexec_prefix; /* Default prefixes to attach to command names. */ +#ifndef STANDARD_STARTFILE_PREFIX_1 +#define STANDARD_STARTFILE_PREFIX_1 "/lib/" +#endif +#ifndef STANDARD_STARTFILE_PREFIX_2 +#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" +#endif + #ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */ #undef MD_EXEC_PREFIX #undef MD_STARTFILE_PREFIX @@ -1454,8 +1461,10 @@ 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/"; +static const char *const standard_startfile_prefix_1 + = STANDARD_STARTFILE_PREFIX_1; +static const char *const standard_startfile_prefix_2 + = STANDARD_STARTFILE_PREFIX_2; static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX; static const char *tooldir_prefix; @@ -6231,10 +6240,14 @@ main (int argc, const char **argv) NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1); } - add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1, - "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1); - add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2, - "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1); + if (*standard_startfile_prefix_1) + add_sysrooted_prefix (&startfile_prefixes, + standard_startfile_prefix_1, "BINUTILS", + PREFIX_PRIORITY_LAST, 0, NULL, 1); + if (*standard_startfile_prefix_2) + add_sysrooted_prefix (&startfile_prefixes, + standard_startfile_prefix_2, "BINUTILS", + PREFIX_PRIORITY_LAST, 0, NULL, 1); #if 0 /* Can cause surprises, and one can use -B./ instead. */ add_prefix (&startfile_prefixes, "./", NULL, PREFIX_PRIORITY_LAST, 1, NULL, 0);