PR driver/91130 Use CL_DRIVER when handling of COLLECT_GCC_OPTIONS in lto-wrapper.c
authorRichard Earnshaw <rearnsha@arm.com>
Wed, 7 Aug 2019 16:15:35 +0000 (16:15 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Wed, 7 Aug 2019 16:15:35 +0000 (16:15 +0000)
Some options are handled differently by the main driver (gcc, g++,
etc) from the back-end compiler programs (cc1, cc1plus, etc) in that
in the driver they do not take an additional argument, while in the
compiler programs they do.  The processing option option CL_DRIVER
controls this alternative interpretation of the options.

The environment variable COLLECT_GCC_OPTIONS is the list of options to
add to a compile if the compiler re-invokes itself at some point.  As
such, the options are driver options, so CL_DRIVER should be used when
processing this list.  Currently lto-wrapper is doing this
incorrectly.

PR driver/91130
* lto-wrapper.c (find_and_merge_options): Use CL_DRIVER when
processing COLLECT_GCC_OPTIONS.
(run_gcc): Likewise.

From-SVN: r274176

gcc/ChangeLog
gcc/lto-wrapper.c

index 8ea14fe7011dedc2417c9b1a80775c00cad61585..d582c5b42ae3790e01965028fdc2740191b6fc5f 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-07  Richard Earnshaw  <rearnsha@arm.com>
+
+       PR driver/91130
+       * lto-wrapper.c (find_and_merge_options): Use CL_DRIVER when
+       processing COLLECT_GCC_OPTIONS.
+       (run_gcc): Likewise.
+
 2019-08-07  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
        PR tree-optimization/91109
index 3414adedd26c469c1face0dda6779540c484e4f8..f93ff504e8897bd5327cd856ce9275d5bfc89f59 100644 (file)
@@ -1010,7 +1010,7 @@ find_and_merge_options (int fd, off_t file_offset, const char *prefix,
       struct cl_decoded_option *f2decoded_options;
       unsigned int f2decoded_options_count;
       get_options_from_collect_gcc_options (collect_gcc,
-                                           fopts, CL_LANG_ALL,
+                                           fopts, CL_DRIVER,
                                            &f2decoded_options,
                                            &f2decoded_options_count);
       if (!fdecoded_options)
@@ -1283,7 +1283,7 @@ run_gcc (unsigned argc, char *argv[])
     fatal_error (input_location,
                 "environment variable %<COLLECT_GCC_OPTIONS%> must be set");
   get_options_from_collect_gcc_options (collect_gcc, collect_gcc_options,
-                                       CL_LANG_ALL,
+                                       CL_DRIVER,
                                        &decoded_options,
                                        &decoded_options_count);