diff options
author | Michael Matz <matz@suse.de> | 2010-11-21 07:56:12 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-11-21 08:56:12 +0100 |
commit | b8c73637a42f0f686fbc4e392d2718151dd2bd9e (patch) | |
tree | 84bb95306f015ba30218e3f37350445b695b56ef | |
parent | 8812e4d5dd6f5ff0cac16c22bfe41986d92cb959 (diff) | |
download | gcc-b8c73637a42f0f686fbc4e392d2718151dd2bd9e.zip gcc-b8c73637a42f0f686fbc4e392d2718151dd2bd9e.tar.gz gcc-b8c73637a42f0f686fbc4e392d2718151dd2bd9e.tar.bz2 |
re PR driver/46516 (Non-multilib search problem in gcc.c / gfortran error: libgfortran.spec: No such file or directory)
2010-11-21 Michael Matz <matz@suse.de>
Tobias Burnus <burnus@net-b.de>
PR driver/46516
* gfortranspec.c (lang_specific_driver,
lang_specific_pre_link): Load libgfortran.spec in
lang_specific_pre_link unless found in the -L path.
Co-Authored-By: Tobias Burnus <burnus@net-b.de>
From-SVN: r166998
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/gfortranspec.c | 20 |
2 files changed, 21 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 69312db..db4380f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2010-11-21 Michael Matz <matz@suse.de> + Tobias Burnus <burnus@net-b.de> + + PR driver/46516 + * gfortranspec.c (lang_specific_driver, + lang_specific_pre_link): Load libgfortran.spec in + lang_specific_pre_link unless found in the -L path. + 2010-11-20 Janne Blomqvist <jb@gcc.gnu.org> * f95-lang.c (gfc_init_decl_processing): Set size_type_node as diff --git a/gcc/fortran/gfortranspec.c b/gcc/fortran/gfortranspec.c index 24c9093..d8d9fc2 100644 --- a/gcc/fortran/gfortranspec.c +++ b/gcc/fortran/gfortranspec.c @@ -75,6 +75,9 @@ static void append_arg (const struct cl_decoded_option *); static unsigned int g77_newargc; static struct cl_decoded_option *g77_new_decoded_options; +/* The path to the spec file. */ +char *spec_file = NULL; + /* Return full path name of spec file if it is in DIR, or NULL if not. */ @@ -223,9 +226,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* Whether we should link a static libgfortran. */ int static_lib = 0; - /* The path to the spec file. */ - char *spec_file = NULL; - /* Whether we need to link statically. */ int static_linking = 0; @@ -447,9 +447,10 @@ For more information about these matters, see the file named COPYING\n\n")); #endif /* Read the specs file corresponding to libgfortran. - If we didn't find the spec file on the -L path, then we hope it - is somewhere in the standard install areas. */ - append_option (OPT_specs_, spec_file == NULL ? SPEC_FILE : spec_file, 1); + If we didn't find the spec file on the -L path, we load it + via lang_specific_pre_link. */ + if (spec_file) + append_option (OPT_specs_, spec_file, 1); if (verbose && g77_new_decoded_options != g77_x_decoded_options) { @@ -467,8 +468,13 @@ For more information about these matters, see the file named COPYING\n\n")); /* Called before linking. Returns 0 on success and -1 on failure. */ int -lang_specific_pre_link (void) /* Not used for F77. */ +lang_specific_pre_link (void) { + if (spec_file) + free (spec_file); + else + do_spec ("%:include(libgfortran.spec)"); + return 0; } |