diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-01-26 16:30:24 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2005-01-26 16:30:24 +0000 |
commit | 2fd0377e6adee578a4cc8351743bce6332f7e3f8 (patch) | |
tree | b7b1bda0012c2ff0afe9c58d9be3c106d640e60c | |
parent | 8c606138914700275d4abb16d6096b5c970eba70 (diff) |
* gcc.c (SYSROOT_SPEC): New macro.
(sysroot_spec): New variable.
(static_specs): Add sysroot_spec.
(main): Pass --sysroot to the linker.
Revert:
2005-01-16 Mark Mitchell <mark@codesourcery.com>
* gcc.c (init_spec): Handle SYSROOT_SUFFIX_LINK_SPEC.
Revert:
2005-01-24 Mark Mitchell <mark@codesourcery.com>
* config.gcc (arm-wrs-linux-gnu): Use wrs-linux.h and t-wrs-linux.
(i?86-wrs-linux-gnu): Likewise.
(mips-wrs-linux-gnu): Likewise.
(powerpc-wrs-linux-gnu): Likewise.
* config/t-wrs-linux: New file.
* config/wrs-linux.h: Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/csl-3_4_3-linux-branch@94267 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.csl | 20 | ||||
-rw-r--r-- | gcc/config.gcc | 16 | ||||
-rw-r--r-- | gcc/config/t-wrs-linux | 27 | ||||
-rw-r--r-- | gcc/config/wrs-linux.h | 34 | ||||
-rw-r--r-- | gcc/gcc.c | 25 |
5 files changed, 43 insertions, 79 deletions
diff --git a/gcc/ChangeLog.csl b/gcc/ChangeLog.csl index aa869e11cad..2c9747f3cb0 100644 --- a/gcc/ChangeLog.csl +++ b/gcc/ChangeLog.csl @@ -1,3 +1,23 @@ +2005-01-25 Mark Mitchell <mark@codesourcery.com> + + * gcc.c (SYSROOT_SPEC): New macro. + (sysroot_spec): New variable. + (static_specs): Add sysroot_spec. + (main): Pass --sysroot to the linker. + + Revert: + 2005-01-16 Mark Mitchell <mark@codesourcery.com> + * gcc.c (init_spec): Handle SYSROOT_SUFFIX_LINK_SPEC. + + Revert: + 2005-01-24 Mark Mitchell <mark@codesourcery.com> + * config.gcc (arm-wrs-linux-gnu): Use wrs-linux.h and t-wrs-linux. + (i?86-wrs-linux-gnu): Likewise. + (mips-wrs-linux-gnu): Likewise. + (powerpc-wrs-linux-gnu): Likewise. + * config/t-wrs-linux: New file. + * config/wrs-linux.h: Likewise. + 2005-01-24 Mark Mitchell <mark@codesourcery.com> * config.gcc (arm-wrs-linux-gnu): Use wrs-linux.h and t-wrs-linux. diff --git a/gcc/config.gcc b/gcc/config.gcc index 9816dad1d52..a6b5457713f 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -681,8 +681,8 @@ arm*-*-linux*) # ARM GNU/Linux with ELF default_use_cxa_atexit=yes case ${target} in arm-wrs-linux-gnu) - tm_file="$tm_file wrs-linux.h arm/wrs-linux.h" - tmake_file="$tmake_file t-wrs-linux arm/t-wrs-linux" + tm_file="$tm_file arm/wrs-linux.h" + tmake_file="$tmake_file arm/t-wrs-linux" ;; *) ;; esac @@ -1037,12 +1037,6 @@ i[34567]86-*-linux*) # Intel 80386's running GNU/Linux # aka GNU/Linux C library 6 tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h" tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff" - case ${target} in - i?86-wrs-linux-gnu) - tm_file="$tm_file wrs-linux.h" - tmake_file="$tmake_file t-wrs-linux" - ;; - esac ;; x86_64-*-linux*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h \ @@ -1608,8 +1602,8 @@ mips*-*-linux*) # Linux MIPS, either endian. tmake_file="t-slibgcc-elf-ver t-linux" case ${target} in mips-wrs-linux-gnu) - tmake_file="$tmake_file t-wrs-linux mips/t-wrs-linux" - tm_file="$tm_file wrs-linux.h mips/wrs-linux.h" + tmake_file="$tmake_file mips/t-wrs-linux" + tm_file="$tm_file mips/wrs-linux.h" ;; esac ;; @@ -1825,8 +1819,6 @@ powerpc-*-linux*) tmake_file="rs6000/t-fprules rs6000/t-ppcos t-slibgcc-elf-ver t-linux rs6000/t-ppccomm" case ${target} in powerpc-wrs-linux-gnu) - tm_file="$tm_file wrs-linux.h" - tmake_file="$tmake_file t-wrs-linux" target_cpu_default="\\\"603\\\"" ;; esac diff --git a/gcc/config/t-wrs-linux b/gcc/config/t-wrs-linux deleted file mode 100644 index eca48671780..00000000000 --- a/gcc/config/t-wrs-linux +++ /dev/null @@ -1,27 +0,0 @@ -# Wind River GNU/Linux Configuration. -# Copyright (C) 2005 -# Free Software Foundation, Inc. -# -# This file is part of GCC. -# -# GCC is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GCC is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING. If not, write to -# the Free Software Foundation, 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# The GLIBC header files are installed in this subdirectory of the -# installation directory. -NATIVE_SYSTEM_HEADER_DIR = /$(target_subdir)/libc/usr/include -# Define WRS_TARGET_SUBDIR so that the wrs-linux.h configuration files -# can use it. -T_CFLAGS = -DWRS_TARGET_SUBDIR=\"$(target_subdir)\" diff --git a/gcc/config/wrs-linux.h b/gcc/config/wrs-linux.h deleted file mode 100644 index 9f674b6491b..00000000000 --- a/gcc/config/wrs-linux.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Wind River GNU/Linux Configuration. - Copyright (C) 2005 - Free Software Foundation, Inc. - -This file is part of GCC. - -GCC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GCC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* The GLIBC header files are installed in this subdirectory of the - installation root. */ -#undef STANDARD_INCLUDE_DIR -#define STANDARD_INCLUDE_DIR "/" WRS_TARGET_SUBDIR "/libc/usr/include" - -/* The GLIBC library files are installed in this subdirectory of the - installation root. */ -#undef SYSROOT_SUFFIX_SPEC -#define SYSROOT_SUFFIX_SPEC \ - "/" WRS_TARGET_SUBDIR "/libc" -#undef SYSROOT_SUFFIX_LINK_SPEC -#define SYSROOT_SUFFIX_LINK_SPEC \ - "--sysroot-suffix /" WRS_TARGET_SUBDIR "/libc " diff --git a/gcc/gcc.c b/gcc/gcc.c index 35b5110d974..5b10997943e 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -467,6 +467,8 @@ or with constant text in a single argument. %G process LIBGCC_SPEC as a spec. %M output multilib_dir with directory separators replaced with "_"; if multilib_dir is not set or is ".", output "". + %R Output the concatenation of target_system_root and + target_sysroot_suffix. %S process STARTFILE_SPEC as a spec. A capital S is actually used here. %E process ENDFILE_SPEC as a spec. A capital E is actually used here. %C process CPP_SPEC as a spec. @@ -696,6 +698,10 @@ proper position among the other output files. */ # define STARTFILE_PREFIX_SPEC "" #endif +#ifndef SYSROOT_SPEC +# define SYSROOT_SPEC "--sysroot=%R" +#endif + #ifndef SYSROOT_SUFFIX_SPEC # define SYSROOT_SUFFIX_SPEC "" #endif @@ -721,6 +727,7 @@ static const char *linker_name_spec = LINKER_NAME; static const char *link_command_spec = LINK_COMMAND_SPEC; static const char *link_libgcc_spec = LINK_LIBGCC_SPEC; static const char *startfile_prefix_spec = STARTFILE_PREFIX_SPEC; +static const char *sysroot_spec = SYSROOT_SPEC; static const char *sysroot_suffix_spec = SYSROOT_SUFFIX_SPEC; static const char *sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC; @@ -1487,6 +1494,7 @@ static struct spec_list static_specs[] = 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_spec", &sysroot_spec), INIT_STATIC_SPEC ("sysroot_suffix_spec", &sysroot_suffix_spec), INIT_STATIC_SPEC ("sysroot_hdrs_suffix_spec", &sysroot_hdrs_suffix_spec), }; @@ -1701,12 +1709,6 @@ init_spec (void) obstack_grow0 (&obstack, link_spec, strlen (link_spec)); link_spec = obstack_finish (&obstack); #endif -#ifdef SYSROOT_SUFFIX_LINK_SPEC - obstack_grow (&obstack, SYSROOT_SUFFIX_LINK_SPEC, - sizeof (SYSROOT_SUFFIX_LINK_SPEC) - 1); - obstack_grow0 (&obstack, link_spec, strlen (link_spec)); - link_spec = obstack_finish (&obstack); -#endif specs = sl; } @@ -6106,6 +6108,17 @@ main (int argc, const char **argv) target_sysroot_suffix = xstrdup (argbuf[argbuf_index -1]); } + /* Pass the --sysroot option to the linker, which is assumed to be + GNU ld. If there is a sysroot_suffix_spec, it has already been + processed by this point, so target_system_root really is the + system root we should be using. */ + if (target_system_root) + { + obstack_grow (&obstack, "%(sysroot_spec) ", strlen ("%(sysroot_spec) ")); + obstack_grow0 (&obstack, link_spec, strlen (link_spec)); + link_spec = obstack_finish (&obstack); + } + /* Process sysroot_hdrs_suffix_spec. */ if (*sysroot_hdrs_suffix_spec != 0 && do_spec_2 (sysroot_hdrs_suffix_spec) == 0) |