Hi Bernd!

One question to you, as the one who has originally written this code
(<https://gcc.gnu.org/ml/gcc-patches/2014-03/msg01079.html>):

On Thu, 2 Oct 2014 19:14:57 +0400, Ilya Verbin <iver...@gmail.com> wrote:
> With this patch lto-wrapper performs invocation of mkoffload tool for each
> offload target.  [...]

(This has been committed long ago.)

> 2014-10-02  Ilya Verbin  <ilya.ver...@intel.com>
>           Bernd Schmidt  <ber...@codesourcery.com>
>           Andrey Turetskiy  <andrey.turets...@intel.com>
>           Michael Zolotukhin  <michael.v.zolotuk...@intel.com>
> 
> gcc/
>       * gcc.c (spec_host_machine, accel_dir_suffix): New variables.
>       (process_command): Tweak path construction for the possibility
>       of being configured as an offload compiler.
>       (main): Likewise.  Look up specs in just_machine_suffix only if not
>       ACCEL_COMPILER.  Construct OFFLOAD_TARGET_NAMES environment variable if
>       we have OFFLOAD_TARGETS.
>       * [...]

> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -157,6 +157,7 @@ static const char *const spec_version = 
> DEFAULT_TARGET_VERSION;
>  /* The target machine.  */
>  
>  static const char *spec_machine = DEFAULT_TARGET_MACHINE;
> +static const char *spec_host_machine = DEFAULT_REAL_TARGET_MACHINE;
>  
>  /* Nonzero if cross-compiling.
>     When -b is used, the value comes from the `specs' file.  */
> @@ -1296,6 +1297,9 @@ static const char *const standard_startfile_prefix_2
>     relative to the driver.  */
>  static const char *const tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
>  
> +/* A prefix to be used when this is an accelerator compiler.  */
> +static const char *const accel_dir_suffix = ACCEL_DIR_SUFFIX;
> +
>  /* Subdirectory to use for locating libraries.  Set by
>     set_multilib_dir based on the compilation options.  */
>  
> @@ -4122,15 +4126,15 @@ process_command (unsigned int decoded_options_count,
>      }
>  
>    gcc_assert (!IS_ABSOLUTE_PATH (tooldir_base_prefix));
> -  tooldir_prefix2 = concat (tooldir_base_prefix, spec_machine,
> +  tooldir_prefix2 = concat (tooldir_base_prefix, spec_host_machine,
>                           dir_separator_str, NULL);

I've noticed that internally we have a change (r447328) to »Use
spec_machine rather than spec_host_machine to build tooldir_prefix2«,
thus you reverted this last change, describing this as a »Driver paths
bugfix«, which »corrects an issue that causes an offload gcc driver to
find the wrong assembler«.

In addition to that change/reversion, one of your more recent patche
submissions, <https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02655.html>,
contained the (unrelated) change to also change back to the original
spec_machine the spec_host_machine usage in the following code:

>  
>    /* Look for tools relative to the location from which the driver is
>       running, or, if that is not available, the configured prefix.  */
>    tooldir_prefix
>      = concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix,
> -           spec_machine, dir_separator_str,
> -           spec_version, dir_separator_str, tooldir_prefix2, NULL);
> +           spec_host_machine, dir_separator_str, spec_version,
> +           accel_dir_suffix, dir_separator_str, tooldir_prefix2, NULL);
>    free (tooldir_prefix2);
>  
>    add_prefix (&exec_prefixes,

Which of the changes should we be making on trunk?  None at all, or just
revert the change for tooldir_prefix2 (patch variant 1), or also for
tooldir_prefix (patch variant 2), or something else?

Patch variant 1:

@@ -4266,7 +4266,7 @@ process_command (unsigned int decoded_op
     }
 
   gcc_assert (!IS_ABSOLUTE_PATH (tooldir_base_prefix));
-  tooldir_prefix2 = concat (tooldir_base_prefix, spec_host_machine,
+  tooldir_prefix2 = concat (tooldir_base_prefix, spec_machine,
                            dir_separator_str, NULL);
 
   /* Look for tools relative to the location from which the driver is

Patch variant 2:

@@ -4238,14 +4238,14 @@ process_command (unsigned int decoded_options_count,
     }
 
   gcc_assert (!IS_ABSOLUTE_PATH (tooldir_base_prefix));
-  tooldir_prefix2 = concat (tooldir_base_prefix, spec_host_machine,
+  tooldir_prefix2 = concat (tooldir_base_prefix, spec_machine,
                            dir_separator_str, NULL);
 
   /* Look for tools relative to the location from which the driver is
      running, or, if that is not available, the configured prefix.  */
   tooldir_prefix
     = concat (gcc_exec_prefix ? gcc_exec_prefix : standard_exec_prefix,
-             spec_host_machine, dir_separator_str, spec_version,
+             spec_machine, dir_separator_str, spec_version,
              accel_dir_suffix, dir_separator_str, tooldir_prefix2, NULL);
   free (tooldir_prefix2);
 


Grüße,
 Thomas

Attachment: signature.asc
Description: PGP signature

Reply via email to