https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85451

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)
> ...
> $ ./install/bin/x86_64-pc-linux-gnu-gcc -fopenacc test.c \
>   -B $(pwd
> -P)/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.1
> mkoffload: fatal error: offload compiler
> x86_64-pc-linux-gnu-accel-nvptx-none-gcc not found
> compilation terminated.
> lto-wrapper: fatal error:
> /home/vries/oacc/trunk/install/offload-nvptx-none/libexec/gcc/x86_64-pc-
> linux-gnu/8.0.1//accel/nvptx-none/mkoffload returned 1 exit status
> compilation terminated.
> /usr/bin/ld: error: lto-wrapper failed
> collect2: error: ld returned 1 exit status
> ...

> From the last error message, it's easy to figure out that
> x86_64-pc-linux-gnu-accel-nvptx-none-gcc cannot be found (though it doesn't
> suggest using -B to fix that).

Which is fixed by:
...
diff --git a/gcc/config/nvptx/mkoffload.c b/gcc/config/nvptx/mkoffload.c
index c0093909448..097446c5db6 100644
--- a/gcc/config/nvptx/mkoffload.c
+++ b/gcc/config/nvptx/mkoffload.c
@@ -454,7 +454,7 @@ main (int argc, char **argv)

   if (!found)
     fatal_error (input_location,
-                "offload compiler %s not found", GCC_INSTALL_NAME);
+                "offload compiler %s not found (use -B?)", GCC_INSTALL_NAME);

   /* We may be called with all the arguments stored in some file and
      passed with @file.  Expand them into argv before processing.  */
...

which gives us:
...
$ ./install/bin/x86_64-pc-linux-gnu-gcc -fopenacc test.c -B$(pwd
-P)/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.1 
mkoffload: fatal error: offload compiler
x86_64-pc-linux-gnu-accel-nvptx-none-gcc not found (use -B?)
compilation terminated.
lto-wrapper: fatal error:
/home/vries/oacc/trunk/install/offload-nvptx-none/libexec/gcc/x86_64-pc-linux-gnu/8.0.1//accel/nvptx-none/mkoffload
returned 1 exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
...

Reply via email to